Skip to content

Configure tests for 5.005 or later, but its getverlist uses a pack feature from 5.9.4 #23289

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

Open
gsteemso opened this issue May 15, 2025 · 8 comments

Comments

@gsteemso
Copy link

Description
Configure briefly stumbles over itself when running the getverlist script it constructs, because my ancient (version 5.8.6 or 5.8.8, depending on OS release) system Perls do not understand the ‘>’ endianness modifier in a pack template. I believe this causes no significant problems, but if it's completely ignoreable why would Configure bother running that code in the first place?

Steps to Reproduce
Run Configure alongside a pre-5.9-series Perl. I base this statement on the perlfunc documentation from version 5.12.5, which states that is when endianness modifiers were added to pack.

Expected behavior
Configure does not complain about invalid characters in a pack template.

Configuration: system Perl is 5.8.6 under Mac OS 10.4.11 and 5.8.8 under Mac OS 10.5.8. I could go into more detail but since I have to copy all this by hand into my iPhone browser and the issue is purely version dependent, I'm disinclined to go to all that effort unless someone has a really compelling reason.

@Tux
Copy link
Contributor

Tux commented May 15, 2025

This is a non-issue, as Configure is bound to the perl core distribution and not available as update or upgrade from CPAN

As current Configure is not supposed to work with any perl version older than the version it is shipped with, I think this can be closed as "wontfix"

@haarg
Copy link
Contributor

haarg commented May 15, 2025

This bit of Configure checks for an existing installed perl greater than version 5.005. It seems like that version check should be increased to the version that is actually needed.

@gsteemso
Copy link
Author

gsteemso commented May 15, 2025

“As current Configure is not supposed to work with any perl version older than the version it is shipped with”

...What? Configure is used for BUILDING the version of Perl it is shipped with, which by definition is not available yet.

@Tux
Copy link
Contributor

Tux commented May 16, 2025

mea culpa @gsteemso . I misinterpreted the situation. The code at hand in Configure is by me even.

": Determine list of previous versions to include in @inc"

would have helped in the problem description.

I agree with @haarg - 5.005 in @inc does not make sense at all

@Tux
Copy link
Contributor

Tux commented May 16, 2025

@@ -7685,6 +7685,9 @@ EOPL
 # of three digit per group separate by '.'s or '_'s. Names are extended
 # with ".0.0" to ensure at least three elements for the pack.
 #                                   -- H.Merijn Brand (m)'06 23-10-2006
+# pack "s>" was introduced in perl-5.10, so I had to rewrite this to an
+# sprintf approach to support bases systems with 5.6.x and 5.8.x
+#                                   -- H.Merijn Brand (m)'25 16-05-2025

 my @inc_version_list;
 my @candidates;
@@ -7692,7 +7695,7 @@ my @candidates;
 if (-d $stem) {
     chdir($stem);
     ;@candidates = map {
-       [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
+       [ $_, sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] ] } glob("5.*");
     ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
 }
 else {
@@ -7700,7 +7703,7 @@ else {
 }

 my ($pversion, $aversion, $vsn5005) = map {
-    pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
+    sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] } $version, $api_versionstring, "5.005";
 foreach my $d (@candidates) {
     if ($d->[1] lt $pversion) {
        if ($d->[1] ge $aversion) {

Would that work for you?

@gsteemso
Copy link
Author

Looks OK to me, but as I am sick in bed today, I am not in a position to test it.

@Tux
Copy link
Contributor

Tux commented May 20, 2025

@haarg Shall I merge that change? Does it conflict with the code freeze?

@haarg
Copy link
Contributor

haarg commented May 20, 2025

The change looks good to me, and I think it's fine to merge. The version of perl it checks for should still be updated. The addition of use warnings means it isn't compatible with perl 5.005 anymore.

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

No branches or pull requests

4 participants