Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the 5 (implement PPC0025) #22857

Draft
wants to merge 16 commits into
base: blead
Choose a base branch
from
Draft

Drop the 5 (implement PPC0025) #22857

wants to merge 16 commits into from

Conversation

book
Copy link
Contributor

@book book commented Dec 11, 2024

This is a draft MR, to test how things would actually work.

Many of the remaining failing tests are dual-life modules (which perform a string comparison againsg $]), or misplaced expectations (use v6 should now work, and enable the :5.41 feature and builtin bundles).

  • This set of changes requires a perldelta entry, and I need help writing it.

@book book marked this pull request as draft December 11, 2024 22:36
@book book requested review from ap, haarg, rjbs, leonerd and tonycoz December 11, 2024 22:36
@tonycoz
Copy link
Contributor

tonycoz commented Dec 11, 2024

Debugger needs an update too:

$ ./perl -Ilib -de0
Feature bundle "41.7" is not supported by Perl 41.7.0 at lib/perl5db.pl line 527.
BEGIN failed--compilation aborted at lib/perl5db.pl line 529.
Compilation failed in require.
BEGIN failed--compilation aborted.

which looks like a simple fix.

(trying to track down the rogue \xb6 the regen tests are complaining about)

@tonycoz
Copy link
Contributor

tonycoz commented Dec 11, 2024

The \xb6 complaint was:

diff --git a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
index 242a4eb117..fdac90151e 100644
--- a/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
+++ b/cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm
@@ -35,7 +35,7 @@ sub my_qr ($$) {
     my ($input_re, $should_match) = @_;
     # XXX could have a third parameter $shouldnt_match for extra safety
 
-    my $use_utf8 = ($] le 5.006002) ? 'use utf8;' : "";
+    my $use_utf8 = ("$]" < 5.006002) ? 'use utf8;' : "";
 
     my $re = eval "no warnings; $use_utf8 qr/$input_re/";
     #print STDERR  __LINE__, ": $input_re: $@\n" if $@;

@book
Copy link
Contributor Author

book commented Dec 11, 2024

-    my $use_utf8 = ($] le 5.006002) ? 'use utf8;' : "";
+    my $use_utf8 = ("$]" < 5.006002) ? 'use utf8;' : "";

I definitely need to fix all those comparisons.

@tonycoz
Copy link
Contributor

tonycoz commented Dec 12, 2024

I definitely need to fix all those comparisons.

I wonder how many more are on CPAN.

@book
Copy link
Contributor Author

book commented Dec 12, 2024

I definitely need to fix all those comparisons.

I wonder how many more are on CPAN.

Over 300 distributions contain files that match /\$\] *[gl][et]/.
This might be the straw of backwards compatibility that breaks this proposal's back.

Once we get the branch to pass the test suite, it would be great to test a bunch of CPAN modules against it.

@book book requested a review from neilb December 12, 2024 08:02
@@ -1645,7 +1645,7 @@ CORE::evalbytes '';
####
# feature features when feature has been disabled by use VERSION
# CONTEXT no warnings 'deprecated';
use feature (sprintf(":%vd", $^V));
use feature (sprintf(":%s", $^V =~ /^v(5\.\d+|\d+)/g));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed. feature.pm is meant to accept the full version as a bundle, and will shorten it as needed. If it isn't doing that correctly, it should be fixed.

@@ -86,7 +86,7 @@ print "# $@\nnot " if $@;
print "ok ",$i++," - require v5 ignores sub named v5\n";

eval { require 10.0.2; };
print "# $@\nnot " unless $@ =~ /^\QPerl v10.0.2 required\E/;
print "# $@\nnot " if $@;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't seem correct. This is meant to check the error from requiring a version number that is too high.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You meant this changed the intended meaning of the test? I agree.

I'm not sure if the best solution is to simply delete those tests (there are other tests that do that), or come up with bigger numbers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The easier answer is to massively increase the number to one we'll never hit. Otherwise, calculate a future version and use a string eval to run the require statement.

book added 6 commits December 15, 2024 14:14
This commit drop PERL_REVISION from $] and $^V.

Since $^V expects 3 components, we add a .0 at the end.
The FEATURE_BUNDLE_xxx constants in feature.h must be ordered by
version. The 'as_bundles' sort function ensures that all bundles will
be sorted correctly (except for 5.9.5, which ends up between 5.41 and 41).
The fix follows Zefram's suggestion from
https://www.nntp.perl.org/group/perl.perl5.porters/2012/05/msg186846.html

> On older perls, however, $] had a numeric value that was built up using
> floating-point arithmetic, such as 5+0.006+0.000002.  This would not
> necessarily match the conversion of the complete value from string form
> [perl #72210].  You can work around that by explicitly stringifying
> $] (which produces a correct string) and having *that* numify (to a
> correctly-converted floating point value) for comparison.  I cultivate
> the habit of always stringifying $] to work around this, regardless of
> the threshold where the bug was fixed.  So I'd write
>
>     use if "$]" >= 5.014, warnings => "non_unicode";
@book book force-pushed the psc/ppc0025 branch 2 times, most recently from 4849b36 to 6061f4f Compare December 15, 2024 16:29
@jkeenan
Copy link
Contributor

jkeenan commented Dec 16, 2024

I built the psc/ppc0025 branch, unthreaded, on linux at 6061f4f and observed the following build-time warnings.

$ parse-build-warnings 6061f4f766.linux.unthreaded.psc-ppc0025.maketp.output.txt.gz 
File:  6061f4f766.linux.unthreaded.psc-ppc0025.maketp.output.txt.gz

[
  {
    char   => 24,
    group  => "Wunused-variable",
    line   => 4415,
    source => "pp_ctl.c",
    text   => "unused variable \xE2\x80\x98pv\xE2\x80\x99",
  },
  {
    char   => 17,
    group  => "Wunused-but-set-variable",
    line   => 4413,
    source => "pp_ctl.c",
    text   => "variable \xE2\x80\x98lav\xE2\x80\x99 set but not used",
  },
  {
    char   => 17,
    group  => "Wunused-variable",
    line   => 4412,
    source => "pp_ctl.c",
    text   => "unused variable \xE2\x80\x98first\xE2\x80\x99",
  },
  {
    char   => 39,
    group  => "Wmaybe-uninitialized",
    line   => 2153,
    source => "utf8.c",
    text   => "\xE2\x80\x98uv\xE2\x80\x99 may be used uninitialized",
  },
]

The Wmaybe-uninitialized warning in utf8.c is also present in blead (see #22858), hence will be ignored in this ticket. In context, the other 3 warnings are:

  30 cc -c -DPERL_CORE -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_L     ARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c99 -O2 -Wall -Werror=pointer-arith -Werror=vla -Wextra -Wn     o-long-long -Wno-declaration-after-statement -Wc++-compat -Wwrite-strings -Wno-use-after-free pp_ctl.c
  31 pp_ctl.c: In function ‘S_require_version’:
  32 pp_ctl.c:4415:24: warning: unused variable ‘pv’ [-Wunused-variable]
  33  4415 |             SV * const pv = *hv_fetchs(MUTABLE_HV(req), "original", FALSE);
  34       |                        ^~             
  35 pp_ctl.c:4413:17: warning: variable ‘lav’ set but not used [-Wunused-but-set-variable]
  36  4413 |             AV *lav;
  37       |                 ^~~
  38 pp_ctl.c:4412:17: warning: unused variable ‘first’ [-Wunused-variable]
  39  4412 |             I32 first = 0;
  40       |                 ^~~~~

@book
Copy link
Contributor Author

book commented Dec 16, 2024

I built the psc/ppc0025 branch, unthreaded, on linux at 6061f4f and observed the following build-time warnings.

Thanks! I'll rework the patch to remove those variables.

book added 3 commits December 16, 2024 23:17
use-ing these versions will load the :5.41 bundle, since that's
the highest one before them.

This also means that we don't need to give hints about why
'use 5.6' or 'use 5.10' fail, because they won't anymore.
@sisyphus
Copy link
Contributor

sisyphus commented Dec 17, 2024

I've built the psc/ppc0025 branch on Windows 11, using a mingw-w64 port of gcc-14.2.0:

Test Summary Report
-------------------
porting/corelist.t                             (Wstat: 0 Tests: 5 Failed: 3)
  Failed tests:  3-5
run/todo.t                                     (Wstat: 0 Tests: 6 Failed: 0)
  TODO passed:   3-4
../dist/Module-CoreList/t/maintainer.t         (Wstat: 512 (exited 2) Tests: 5 Failed: 2)
  Failed tests:  4-5
  Non-zero exit status: 2
../ext/IPC-Open3/t/IPC-Open3.t                 (Wstat: 0 Tests: 53 Failed: 0)
  TODO passed:   33
Files=2903, Tests=1200821, 1458 wallclock secs (10.14 usr +  0.30 sys = 10.44 CPU)
Result: FAIL
Finished test run at Tue Dec 17 00:26:27 2024.
make: *** [GNUmakefile:1831: test] Error 1

My main issue is that make install fails:

>make install
[snip]
copy ..\README.win32    ..\pod\perlwin32.pod
        1 file(s) copied.
copy ..\pod\perldelta.pod ..\pod\perl5417delta.pod
        1 file(s) copied.
..\miniperl.exe -I..\lib bin\pl2bat.pl ..\utils\h2ph ..\utils\splain ..\utils\perlbug ..\utils\pl2pm ..\utils\h2xs ..\utils\perldoc ..\utils\perlivp ..\utils\libnetcfg ..\utils\enc2xs ..\utils\encguess ..\utils\piconv ..\utils\corelist ..\utils\cpan ..\utils\xsubpp ..\utils\pod2html ..\utils\prove ..\utils\ptar ..\utils\ptardiff ..\utils\ptargrep ..\utils\zipdetails ..\utils\shasum ..\utils\instmodsh ..\utils\json_pp bin\exetype.pl bin\runperl.pl bin\pl2bat.pl bin\perlglob.pl bin\search.pl
..\miniperl.exe -I..\lib ..\autodoc.pl -c "win32\full\config.h" ..
..\miniperl.exe -I..\lib ..\pod\perlmodlib.PL -q ..
..\perl.exe -f ..\pod\buildtoc -q
..\perl.exe ..\installperl
Patchlevel of perl (00)and patchlevel of config.sh (41) don't match
make: *** [GNUmakefile:1779: installbare] Error 2

For context, here's the relevant portion of win32/GNUmakefile, beginning at line 1778:

installbare : utils ..\pod\perltoc.pod
	$(PERLEXE) ..\installperl
	if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\$(NULL)
	if exist $(PERLEXESTATIC) $(XCOPY) $(PERLEXESTATIC) $(INST_BIN)\$(NULL)
	$(XCOPY) $(GLOBEXE) $(INST_BIN)\$(NULL)
	if exist ..\perl*.pdb $(XCOPY) ..\perl*.pdb $(INST_BIN)\$(NULL)
	$(XCOPY) "bin\*.bat" $(INST_SCRIPT)\$(NULL)

I don't really know what's going on here, but there's a lot of hard-coded configuration specs in win32/config.gc, win32/config_H.gc and win32/config_sh.PL - and I wonder whether there's some stuff in one (or more) of those files that requires editing.
Or perhaps it's the win32/GNUmakefile itself that needs some repair.

$] seems to be set correctly:

>..\perl -I..\lib -le "print $];"
41.007000

but I don't know about the correctness of this (which is hard coded into win32/config_sh.PL) :

UPDATE: I've just done a build on Ubuntu-24.04 for reference, and I can see that ..\perl -I..\lib -V:version should output '41.7'.
So I'll fix that in config_sh.PL, do a fresh build, and see how that fares.

UPDATE 2: Amending config_sh.PL corrects the output of ..\perl -I..\lib -V:version to '41.7'. but both make test and make install still fail exactly the same as before.
I need to think of something else to try.

>..\perl -I..\lib -V:version
version='5.41.7';

Here is full perl -V output:

>..\perl -I..\lib -V
Summary of my perl5 (version 41 subversion 7) configuration:
  Derived from:
  Platform:
    osname=MSWin32
    osvers=10.0.22631.4602
    archname=MSWin32-x64-multi-thread
    uname=''
    config_args='undef'
    hint=recommended
    useposix=true
    d_sigaction=undef
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=undef
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='gcc'
    ccflags ='-std=c99 -DWIN32 -DWIN64 -fdiagnostics-color=never -DPERL_TEXTMODE_SCRIPTS -DMULTIPLICITY -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-strict-aliasing -mms-bitfields'
    optimize='-Os -falign-functions -falign-jumps -falign-labels -falign-loops -freorder-blocks -freorder-blocks-algorithm=stc -freorder-blocks-and-partition'
    cppflags='-DWIN32'
    ccversion=''
    gccversion='14.2.0'
    gccosandvers=''
    intsize=4
    longsize=4
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='long long'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags ='-s -L"D:\perl-5.41.62-1420-ucrt-mcf\lib\MSWin32-x64-multi-thread\CORE" -L"C:\winlibs-ucrt-1420\mingw64\lib" -L"C:\winlibs-ucrt-1420\mingw64\x86_64-w64-mingw32\lib" -L"C:\winlibs-ucrt-1420\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0"'
    libpth=C:\winlibs-ucrt-1420\mingw64\lib C:\winlibs-ucrt-1420\mingw64\x86_64-w64-mingw32\lib C:\winlibs-ucrt-1420\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0 D:\_64\msys_1420\1.0\local\lib
    libs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    perllibs= -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32 -lcomctl32
    libc=-lucrt
    so=dll
    useshrplib=true
    libperl=libperl541.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_win32.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags='-shared -s -L"D:\perl-5.41.62-1420-ucrt-mcf\lib\MSWin32-x64-multi-thread\CORE" -L"C:\winlibs-ucrt-1420\mingw64\lib" -L"C:\winlibs-ucrt-1420\mingw64\x86_64-w64-mingw32\lib" -L"C:\winlibs-ucrt-1420\mingw64\lib\gcc\x86_64-w64-mingw32\14.2.0"'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_LONG_DOUBLE
    HAS_TIMES
    HAVE_INTERP_INTERN
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_HASH_FUNC_SIPHASH13
    PERL_HASH_USE_SBOX32
    PERL_IMPLICIT_SYS
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_THREAD_SAFE_LOCALE
  Locally applied patches:
    uncommitted-changes
  Built under MSWin32
  Compiled at Dec 16 2024 23:59:27
  @INC:
    ..\lib
    D:/comp-1420-ucrt/perl-5.41.62/lib

@book
Copy link
Contributor Author

book commented Dec 17, 2024

I've built the psc/ppc0025 branch on Windows 11, using a mingw-w64 port of gcc-14.2.0:

Thank you!

UPDATE 2: Amending config_sh.PL corrects the output of ..\perl -I..\lib -V:version to '41.7'. but both make test and make install still fail exactly the same as before. I need to think of something else to try.

I'm currently working on getting the last failing tests to pass for me. Module-CoreList does need some patching.

@sisyphus
Copy link
Contributor

sisyphus commented Dec 17, 2024

My main issue is that make install fails

Same thing happens on Ubuntu (with the same error as on Windows).
Both Ubuntu and Windows are reporting that $Config{patchlevel} is 41, but I think they should be reporting it to be the empty string ''.

On Windows, I've hacked win32/config.gc such that $Config{patchlevel} is now being reported as being the empty string.
But the same error persists with make install.

I'm wondering whether patchlevel.h (which is referenced by config.sh) requires some amendment ??

UPDATE:
Looks like the issue lies in the (top-level source file) installperl, which contains:

my $ver = $Config{version};
my $release = substr($],0,3);   # Not used currently.
my $patchlevel = substr($],3,2);
die "Patchlevel of perl ($patchlevel)",
    "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
	if $patchlevel != $Config{'PERL_VERSION'};

I think the assignment to $patchlevel is no longer correct.
I'll check tomorrow (as it's now late), and post the patches I've used.

@sisyphus
Copy link
Contributor

A couple of observations/questions:

  1. $] is reporting as 41.007000 on both Windows and Ubuntu. Do we really want the 3 trailing zeroes ?
  2. The windows dll is currently perl541.dll. Are we going to keep the "5" ?

The patches that I used in order to be able to install perl:

--- installperl_orig	2024-12-16 23:57:30.022629300 +1100
+++ installperl	2024-12-18 11:02:42.855434600 +1100
@@ -176,10 +176,9 @@
 
 my $ver = $Config{version};
 my $release = substr($],0,3);   # Not used currently.
-my $patchlevel = substr($],3,2);
-die "Patchlevel of perl ($patchlevel)",
-    "and patchlevel of config.sh ($Config{'PERL_VERSION'}) don't match\n"
-	if $patchlevel != $Config{'PERL_VERSION'};
+my $patchlevel = '';
+die "Wrong patchlevel"
+	if $patchlevel ne $Config{'patchlevel'};
 
 # Fetch some frequently-used items from %Config
 my $installbin = "$opts{destdir}$Config{installbin}";
@@ -246,7 +245,7 @@
     if ($Is_Cygwin) {
 	$perldll = $libperl;
     } else {
-	$perldll = 'perl5'.$Config{patchlevel}.'.'.$so;
+	$perldll = 'perl5'.$Config{PERL_VERSION}.'.'.$so;
     }
 
     if ($dlsrc ne "dl_none.xs") {
--- win32/config.gc_orig	2024-12-16 23:57:31.741556400 +1100
+++ win32/config.gc_mod	2024-12-18 13:42:52.416461500 +1100
@@ -963,7 +963,7 @@
 package='perl5'
 pager='more /e'
 passcat=''
-patchlevel='~PERL_VERSION~'
+patchlevel=''
 path_sep=';'
 perl5=''
 perl='perl'
--- win32/config_SH.PL_orig	2024-12-16 23:57:31.741556400 +1100
+++ win32/config_sh.PL	2024-12-17 16:02:34.103728200 +1100
@@ -140,7 +140,7 @@
     close $fh;
 }
 
-$opt{version} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
+$opt{version} = "$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}";
 $opt{version_patchlevel_string} = "version $opt{PERL_VERSION} subversion $opt{PERL_SUBVERSION}";
 $opt{version_patchlevel_string} .= " patch $opt{PERL_PATCHLEVEL}" if exists $opt{PERL_PATCHLEVEL};
 

@book
Copy link
Contributor Author

book commented Dec 18, 2024

A couple of observations/questions:

1. $] is reporting as 41.007000 on both Windows and Ubuntu. Do we really want the 3 trailing zeroes ?

It's annoying, but I think it's coming from version, which defaults to 3-parts version numbers.

2. The windows dll is currently perl541.dll. Are we going to keep the "5" ?

I suppose we would drop the 5 there too, and have perl41.dll.

@sisyphus
Copy link
Contributor

It's annoying, but I think it's coming from version, which defaults to 3-parts version numbers.

Yes, presumably that third bit is something like sprintf "%.3d", $Config{patchlevel} - which is always going to be 000 under this new arrangement.
I suspect this new setting of version to 41.7 might also be problematic when the March 2025 devel release sets it to 41.10 which, in both string and numeric context, is less than the version value for the previous eight 41.x releases had they all been built under the new arrangement.

I suppose we would drop the 5 there too, and have perl41.dll.

It would be a whole lot easier to leave the "5" in there.
The win32/GNUmakefile, along with Strawberry Perl build scripts and my own build scripts, assume that the name of the .dll (and the .lib) will always match /^libperl5/.
And then there's all the other places that I haven't even thought of.
Not to mention what we do re the naming of the per5*delta.pod files.

Another concern is the number of cpan modules (especially the unmaintained ones) that rely on $] being formatted as per the current perl-5.40.0 setting.
Turns out that a test file in one of my own modules relies on that very thing.
Not a problem - the module is maintained and the offending test can be fixed.
But what happens if such a thing occurs in unmaintained modules ?

I'm not trying to be negative, and I'll deal with whatever gets thrown at me, but I really don't want to witness another removal of ' package separator fiasco.

@book
Copy link
Contributor Author

book commented Dec 19, 2024

I suspect this new setting of version to 41.7 might also be problematic when the March 2025 devel release sets it to 41.10 which, in both string and numeric context, is less than the version value for the previous eight 41.x releases had they all been built under the new arrangement.

It's only less than the version in string comparisons. 41.7 is definitely larger than 5.041006 and v5.41.6.

I suppose we would drop the 5 there too, and have perl41.dll.
It would be a whole lot easier to leave the "5" in there.

As documented in PPC0025, we have basically three options:

  • do nothing, and continue as we've been doing ("Perl 5 forever"): this is the easiest;
  • move to Perl 7 (#define PERL_REVISION 7): this is much harder, and maybe impossible if we don't want to break backwards compatibility;
  • move to Perl 42 ("drop the 5 from $] and $^V"): this is not very hard (I was able to produce a branch for testing, after all), but there are still some difficulties with running old Perl code unmodified.

If we can't "drop the 5", for the reasons you've stated above, we're effectively stuck with 5 forever.

The win32/GNUmakefile, along with Strawberry Perl build scripts and my own build scripts, assume that the name of the .dll (and the .lib) will always match /^libperl5/.

This is maintained software, so we can hopefully expect that when they build Strawberry Perl 42 for Windows, they will make the necessary adaptations.

And then there's all the other places that I haven't even thought of.

This is the reason for this branch. Have some actual code we can experiment with, hopefully finding out if the plan is workable or if there is such a roadblock that force us to remain Perl 5 forever.

Not to mention what we do re the naming of the per5*delta.pod files.

Surely we can come up with a naming scheme for those. Don't forget that the perldeltas for dev releases are eventually deleted and merged in the perldelta for the stable release. These would be perl420delta.pod, perl421delta.pod, perl440delta.pod, etc. The naming of perldeltas already sucks somewhat, this is not making it much worse.

Another concern is the number of cpan modules (especially the unmaintained ones) that rely on $] being formatted as per the current perl-5.40.0 setting. Turns out that a test file in one of my own modules relies on that very thing. Not a problem - the module is maintained and the offending test can be fixed. But what happens if such a thing occurs in unmaintained modules ?

This is indeed the goal of this branch: assess the size of the problem, and decide if this is going to block the proposal.

I'm not trying to be negative, and I'll deal with whatever gets thrown at me, but I really don't want to witness another removal of ' package separator fiasco.

"Fiasco" might be a strong word for "we changed our mind in the middle of the development track".

@bulk88
Copy link
Contributor

bulk88 commented Dec 19, 2024

What happens to path #4 of a version object, the 4.4.3_001 syntax.

@book
Copy link
Contributor Author

book commented Dec 19, 2024

What happens to path #‍4 of a version object, the 4.4.3_001 syntax.

$ perl -E '
say join "\t", $_, version->parse($_)->numify, version->parse($_)->normal
  for @ARGV
' 4.4.3_001 4.4.003_001 4.4.003.001
4.4.3_001       4.0043001       v4.4.3001
4.4.003_001     4.0043001       v4.4.3001
4.4.003.001     4.004003001     v4.4.3.1

@Grinnz
Copy link
Contributor

Grinnz commented Dec 19, 2024

What happens to path #4 of a version object, the 4.4.3_001 syntax.

This proposal does not change how version objects work - and underscores do not create an additional segment (in recent versions of version), but may have an arbitrary number of segments, which must each be under 999 to convert properly to a decimal form.

@sisyphus
Copy link
Contributor

It's only less than the version in string comparisons. 41.7 is definitely larger than 5.041006 and v5.41.6.

I mean that, as I keep building this branch of blead over the coming months, the version will progress from 41.7 to 41.8 to 41.9 and then to 41.10.
But 41.10 is less than 41.9, and less than 41.8, etc.
I'm thinking that the current version should be 41.07 (or 41.007), rather than 41.7.

This is indeed the goal of this branch: assess the size of the problem, and decide if this is going to block the proposal.

I agree that this is the way to proceed.

@Grinnz
Copy link
Contributor

Grinnz commented Dec 19, 2024

It's only less than the version in string comparisons. 41.7 is definitely larger than 5.041006 and v5.41.6.

I mean that, as I keep building this branch of blead over the coming months, the version will progress from 41.7 to 41.8 to 41.9 and then to 41.10. But 41.10 is less than 41.9, and less than 41.8, etc. I'm thinking that the current version should be 41.07 (or 41.007), rather than 41.7.

As a number, the version is 41.010, which is numerically greater than 41.009. As a dotted decimal, 41.10.0 is greater than 41.7.0. It is a risk that people will specify the version incorrectly in code if we suggest using only two segments, but I'm not sure if that's what you're referring to.

@sisyphus
Copy link
Contributor

As a number, the version is 41.010, which is numerically greater than 41.009.

I'm talking about $Config{version}, and it's my fault that I took it for granted that others understood that.

Under the current system it's "5.41.7", which is clearly not a valid number.
People can see that it's not meant to be treated as a number, and treat it accordingly. (Perl will warn you if you use it in numeric context.)

This new approach alters $Config{version} to "41.7" which looks like a number, but if one expects "41.10" to be greater than than "41.7", one will probably be disappointed. (And perl won't warn about the folly.)

There's a trap there that's easily avoided by having $Config{version} instead set to (eg) "41.007".

book added 3 commits December 20, 2024 10:25
Important fixes include:
* sorting numerical versions using <=>
* properly computing the family for versions larger than 5
@@ -3255,7 +3255,10 @@ PPD_PERLVERS
# archname did not change from 5.6 to 5.8, but those versions may
# not be not binary compatible so now we append the part of the
# version that changes when binary compatibility may change
if ("$]" >= 5.008) {
if ("$]" >= 41) {
$archname .= "-$Config{api_version}";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to @haarg, this should be $Config{api_versionstring}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the test should be:

if ("$]" >= 5.041) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants