In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/134b625d9892c96a2e9718d6dba0692b40391bc7?hp=e6132dc079934a742aa3f346fceb6cb20e5dd8c2>

- Log -----------------------------------------------------------------
commit 134b625d9892c96a2e9718d6dba0692b40391bc7
Author: Tony Cook <[email protected]>
Date:   Thu Aug 8 11:58:23 2019 +1000

    bump $Storable::VERSION and update ChangeLog

commit d8d4e2e101f7b3f67be2e11ec8e867885de0c46c
Author: Tony Cook <[email protected]>
Date:   Tue Aug 6 10:54:25 2019 +1000

    minimally document the stacksize tool

commit 95173f94fe0c1b2b943af60e1f6c6e4c47b8a975
Author: Graham Knop <[email protected]>
Date:   Sat Apr 20 12:53:06 2019 +0200

    move Storable CAN_FLOCK computation into XS
    
    At build time, Storable would check if it could use flock based on some
    Config values, and generate the final Storable.pm file using tha value.
    This was done to avoid needing to load Config at runtime.  This adds
    complexity to the build process.
    
    A simpler option is to build the constant in the XS code.  This means
    the build process can be entirely standard for XS.
    
    Some slight adjustments to the code are needed to load the XS module at
    BEGIN time, so that the contant is available in the rest of the file.

commit 2473bad063d0c1124df00d40e840a2fb91bb8fc4
Author: Graham Knop <[email protected]>
Date:   Sat Apr 20 12:44:52 2019 +0200

    remove remains of Storable stack size detection
    
    At build time, Storable used to detect the stack limits and store them.
    This was removed in 2a0bbd31bbcc94c7c511f9575df619c5fdf3164c.  That
    removed the Limit module and the setup for building it, but left behind
    the script used to detect the limits.
    
    Clean up the script and some related bits in the Makefile.PL.
    
    TonyC: retain stacksize, so end users can use it to choose limits

-----------------------------------------------------------------------

Summary of changes:
 MANIFEST                                       |  3 +--
 Porting/corelist.pl                            |  1 -
 dist/Storable/.gitignore                       |  2 --
 dist/Storable/ChangeLog                        |  7 +++++
 dist/Storable/MANIFEST                         |  3 +--
 dist/Storable/Makefile.PL                      | 37 ++++----------------------
 dist/Storable/{__Storable__.pm => Storable.pm} | 17 +++++++-----
 dist/Storable/Storable.pm.PL                   | 35 ------------------------
 dist/Storable/Storable.xs                      |  8 ++++++
 9 files changed, 32 insertions(+), 81 deletions(-)
 delete mode 100644 dist/Storable/.gitignore
 rename dist/Storable/{__Storable__.pm => Storable.pm} (99%)
 delete mode 100644 dist/Storable/Storable.pm.PL

diff --git a/MANIFEST b/MANIFEST
index 9b7798e379..e3785eedd6 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -3630,7 +3630,6 @@ dist/SelfLoader/lib/SelfLoader.pm Load functions only on 
demand
 dist/SelfLoader/t/01SelfLoader.t       See if SelfLoader works
 dist/SelfLoader/t/02SelfLoader-buggy.t See if SelfLoader works
 dist/SelfLoader/t/03taint.t            See if SelfLoader works under taint
-dist/Storable/__Storable__.pm  Template to generate Storable.pm
 dist/Storable/ChangeLog                        Storable extension
 dist/Storable/hints/gnukfreebsd.pl     Hint for Storable for named architecture
 dist/Storable/hints/gnuknetbsd.pl      Hint for Storable for named architecture
@@ -3640,8 +3639,8 @@ dist/Storable/Makefile.PL         Storable extension
 dist/Storable/MANIFEST                 Storable MANIFEST file
 dist/Storable/README                   Storable extension
 dist/Storable/stacksize                        compute stack sizes
+dist/Storable/Storable.pm              Storable perl module
 dist/Storable/Storable.xs              Storable extension
-dist/Storable/Storable.pm.PL   perl script to generate Storable.pm from 
template
 dist/Storable/t/attach.t               Check STORABLE_attach doesn't create 
objects unnecessarily
 dist/Storable/t/attach_errors.t                Trigger and test 
STORABLE_attach errors
 dist/Storable/t/attach_singleton.t     Test STORABLE_attach for the Singleton 
pattern
diff --git a/Porting/corelist.pl b/Porting/corelist.pl
index ad5a4ad06d..ce74ed42c8 100755
--- a/Porting/corelist.pl
+++ b/Porting/corelist.pl
@@ -98,7 +98,6 @@ find(
     sub {
         /(\.pm|_pm\.PL)$/ or return;
         /PPPort\.pm$/ and return;
-        /__Storable__\.pm$/ and return;
         my $module = $File::Find::name;
         $module =~ /\b(demo|t|private|corpus)\b/ and return;    # demo or test 
modules
         my $version = MM->parse_version($_);
diff --git a/dist/Storable/.gitignore b/dist/Storable/.gitignore
deleted file mode 100644
index de731b9d98..0000000000
--- a/dist/Storable/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/Storable.pm
-/lib
diff --git a/dist/Storable/ChangeLog b/dist/Storable/ChangeLog
index 4745c74b85..68159a9b65 100644
--- a/dist/Storable/ChangeLog
+++ b/dist/Storable/ChangeLog
@@ -1,3 +1,10 @@
+2019-08-08 11:48:00 TonyC
+    version 3.17
+        * correct a data type to ensure the check for too large results from
+         STORABLE_freeze() are detected correctly (detected by Coverity)
+       * removed remains of stack size detection from the build process.
+       * moved CAN_FLOCK detection into XS to simplify the build process.
+
 2019-06-11 10:43:00 TonyC
     version 3.16
         * (perl #134179) fix self-referencing structures that include regexps
diff --git a/dist/Storable/MANIFEST b/dist/Storable/MANIFEST
index d30b94e133..5e382d9524 100644
--- a/dist/Storable/MANIFEST
+++ b/dist/Storable/MANIFEST
@@ -1,4 +1,3 @@
-__Storable__.pm
 ChangeLog
 hints/gnukfreebsd.pl
 hints/gnuknetbsd.pl
@@ -11,7 +10,7 @@ META.yml                      Module meta-data (added by 
MakeMaker)
 ppport.h
 README
 stacksize
-Storable.pm.PL
+Storable.pm
 Storable.xs
 t/attach.t
 t/attach_errors.t
diff --git a/dist/Storable/Makefile.PL b/dist/Storable/Makefile.PL
index 4a39125562..cdcc3e0087 100644
--- a/dist/Storable/Makefile.PL
+++ b/dist/Storable/Makefile.PL
@@ -10,10 +10,6 @@ use strict;
 use warnings;
 use ExtUtils::MakeMaker 6.31;
 use Config;
-use File::Copy qw(move copy);
-use File::Spec;
-
-my $pm = { 'Storable.pm' => '$(INST_ARCHLIB)/Storable.pm' };
 
 WriteMakefile(
     NAME                => 'Storable',
@@ -22,31 +18,26 @@ WriteMakefile(
     DISTNAME            => "Storable",
 # We now ship this in t/
 #    PREREQ_PM           => { 'Test::More' => '0.41' },
-    PL_FILES        => { }, # prevent default behaviour
-    PM              => $pm,
     PREREQ_PM           => { XSLoader => 0 },
     INSTALLDIRS => ($] >= 5.007 && $] < 5.012) ? 'perl' : 'site',
-    VERSION_FROM    => '__Storable__.pm',
-    ABSTRACT_FROM   => '__Storable__.pm',
+    VERSION_FROM    => 'Storable.pm',
+    ABSTRACT_FROM   => 'Storable.pm',
     ($ExtUtils::MakeMaker::VERSION > 6.45 ?
      (META_MERGE        => { resources =>
                                { bugtracker => 'http://rt.perl.org/perlbug/' },
                             provides    => {
                                 'Storable'  => {
-                                    file        => '__Storable__.pm',
-                                    version     => 
MM->parse_version('__Storable__.pm'),
+                                    file        => 'Storable.pm',
+                                    version     => 
MM->parse_version('Storable.pm'),
                                 },
                             },
 
                            },
     ) : ()),
     dist                => { SUFFIX => 'gz', COMPRESS => 'gzip -f' },
-    clean               => { FILES => 'Storable-* Storable.pm lib' },
+    clean               => { FILES => 'Storable-*' },
 );
 
-# Unlink the .pm file included with the distribution
-1 while unlink "Storable.pm";
-
 my $ivtype = $Config{ivtype};
 
 # I don't know if the VMS folks ever supported long long on 5.6.x
@@ -67,16 +58,8 @@ in the Storable documentation for instructions on how to 
read your data.
 EOM
 }
 
-# compute the maximum stacksize, before and after linking
 package MY;
 
-# FORCE finish of INST_DYNAMIC, avoid loading the old Storable (failed 
XS_VERSION check)
-sub xlinkext {
-    my $s = shift->SUPER::linkext(@_);
-    $s =~ s|( :: .*)| $1 FORCE stacksize|;
-    $s
-}
-
 sub depend {
     "
 
@@ -87,13 +70,3 @@ release : dist
        git push --tags
 "
 }
-
-sub postamble {
-'
-all :: Storable.pm
-       $(NOECHO) $(NOOP)
-
-Storable.pm :: Storable.pm.PL __Storable__.pm
-       $(PERLRUN) Storable.pm.PL
-'
-}
diff --git a/dist/Storable/__Storable__.pm b/dist/Storable/Storable.pm
similarity index 99%
rename from dist/Storable/__Storable__.pm
rename to dist/Storable/Storable.pm
index 8ed247f96f..cd35e637ca 100644
--- a/dist/Storable/__Storable__.pm
+++ b/dist/Storable/Storable.pm
@@ -8,7 +8,7 @@
 #  in the README file that comes with the distribution.
 #
 
-require XSLoader;
+BEGIN { require XSLoader }
 require Exporter;
 package Storable;
 
@@ -27,7 +27,9 @@ our @EXPORT_OK = qw(
 
 our ($canonical, $forgive_me);
 
-our $VERSION = '3.16';
+BEGIN {
+  our $VERSION = '3.17';
+}
 
 our $recursion_limit;
 our $recursion_limit_hash;
@@ -104,14 +106,12 @@ $Storable::flags = FLAGS_COMPAT;
 $Storable::downgrade_restricted = 1;
 $Storable::accept_future_minor = 1;
 
-XSLoader::load('Storable');
+BEGIN { XSLoader::load('Storable') };
 
 #
 # Determine whether locking is possible, but only when needed.
 #
 
-sub CAN_FLOCK; # TEMPLATE - replaced by Storable.pm.PL
-
 sub show_file_magic {
     print <<EOM;
 #
@@ -266,7 +266,7 @@ sub _store {
     local *FILE;
     if ($use_locking) {
         open(FILE, ">>", $file) || logcroak "can't write into $file: $!";
-        unless (&CAN_FLOCK) {
+        unless (CAN_FLOCK) {
             logcarp
               "Storable::lock_store: fcntl/flock emulation broken on $^O";
             return undef;
@@ -410,7 +410,7 @@ sub _retrieve {
     my $self;
     my $da = $@;                       # Could be from exception handler
     if ($use_locking) {
-        unless (&CAN_FLOCK) {
+        unless (CAN_FLOCK) {
             logcarp
               "Storable::lock_store: fcntl/flock emulation broken on $^O";
             return undef;
@@ -986,6 +986,9 @@ modifying C<$Storable::recursion_limit> and
 C<$Storable::recursion_limit_hash> respectively.  Either can be set to
 C<-1> to prevent any depth checks, though this isn't recommended.
 
+If you want to test what the limits are, the F<stacksize> tool is
+included in the C<Storable> distribution.
+
 =item *
 
 You can create endless loops if the things you serialize via freeze()
diff --git a/dist/Storable/Storable.pm.PL b/dist/Storable/Storable.pm.PL
deleted file mode 100644
index df979c09a9..0000000000
--- a/dist/Storable/Storable.pm.PL
+++ /dev/null
@@ -1,35 +0,0 @@
-use strict;
-use warnings;
-
-use Config;
-
-my $template;
-{      # keep all the code in an external template to keep it easy to update
-       local $/;
-       open my $FROM, '<', '__Storable__.pm' or die $!;
-       $template = <$FROM>;
-       close $FROM or die $!;
-}
-
-sub CAN_FLOCK {
-       return
-               $Config{'d_flock'} ||
-               $Config{'d_fcntl_can_lock'} ||
-               $Config{'d_lockf'}
-               ? 1 : 0;
-}
-
-my $CAN_FLOCK = CAN_FLOCK();
-
-# populate the sub and preserve it if used outside
-$template =~ s{^sub CAN_FLOCK;.*$}{sub CAN_FLOCK { ${CAN_FLOCK} } # computed 
by Storable.pm.PL}m;
-# alternatively we could remove the sub
-#$template =~ s{^sub CAN_FLOCK;.*$}{}m;
-# replace local function calls to hardcoded value
-$template =~ s{&CAN_FLOCK}{${CAN_FLOCK}}g;
-
-{
-       open my $OUT, '>', 'Storable.pm' or die $!;
-       print {$OUT} $template or die $!;
-       close $OUT or die $!;
-}
diff --git a/dist/Storable/Storable.xs b/dist/Storable/Storable.xs
index d75125b839..c2335680ab 100644
--- a/dist/Storable/Storable.xs
+++ b/dist/Storable/Storable.xs
@@ -104,6 +104,12 @@
 #  define strEQc(s,c) memEQ(s, ("" c ""), sizeof(c))
 #endif
 
+#if defined(HAS_FLOCK) || defined(FCNTL_CAN_LOCK) && defined(HAS_LOCKF)
+#define CAN_FLOCK &PL_sv_yes
+#else
+#define CAN_FLOCK &PL_sv_no
+#endif
+
 #ifdef DEBUGME
 
 #ifndef DASSERT
@@ -7794,6 +7800,8 @@ BOOT:
     newCONSTSUB(stash, "BIN_MINOR", newSViv(STORABLE_BIN_MINOR));
     newCONSTSUB(stash, "BIN_WRITE_MINOR", newSViv(STORABLE_BIN_WRITE_MINOR));
 
+    newCONSTSUB(stash, "CAN_FLOCK", CAN_FLOCK);
+
     init_perinterp(aTHX);
     gv_fetchpv("Storable::drop_utf8",   GV_ADDMULTI, SVt_PV);
 #ifdef DEBUGME

-- 
Perl5 Master Repository

Reply via email to