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

Fix to build on Perl 5.37.9 #5

Closed
wants to merge 3 commits into from

Conversation

demerphq
Copy link

@demerphq demerphq commented Feb 28, 2023

Fixes the test failure, silences "not imported" warnings during test, and bumps version to v0.14.

This also includes changes to Makefile.PL so that it depends on EUMM 7.66 (the latest), and removes the META.yml which was resulting in bogus warnings about an unknown license and bizarre MYMETA.yml contents even when run against a modern EUMM. It also simplifies the Makefile.PL to just depend on a modern EUMM instead of doing different stuff for older ones. AFAIK, EUMM is backwards compatible to perl 5.8.0 so there is no reason not to expect it to be up to date.

The test failure is related to: Perl/perl5#20357

Fixes: Perl/perl5#20864

…rors

In Perl/perl5#20357 the Perl dev team fixed some
inconsistencies in how eval behaved with regard to compile errors. Prior
that PR the exact outcome of a compile error varied with the type and
number of errors that were encountered, sometimes calling $SIG{__DIE__},
sometimes not, sometimes outputing "Execution ... aborted" messages,
sometimes not. With the merge of that PR the behavior is now consistent,
and in particular for this module the "Execution ... aborted" message is
now always output when there is a compile error.

This patch strips this message off the error before rethrowing the
exception with _croak().

This patch also includes some minor changes to the code to make it
easier to debug the code being eval()ed which I left commented out. I
figured if it was useful to debug this issue then it might useful again
in the future.
…stinct var names

Using "$FILE" in multiple tests causes the "not imported" warnings.
Simply replacing them with distinct names causes the warnings to go away.
@@ -28,15 +16,11 @@ WriteMakefile(
'Slay::Maker' => 0.04,
'File::Path' => 0,
'File::Copy::Recursive' => 0,
'ExtUtils::MakeMaker' => 7.66,
Copy link

Choose a reason for hiding this comment

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

Why require such a recent MakeMaker?

Copy link
Author

Choose a reason for hiding this comment

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

Because the makfile does a bunch of contortions to deal with older makefiles, a simpler solution is to just require a modern one.

Copy link

Choose a reason for hiding this comment

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

That doesn't explain why it would need more than the 6.54 that was previously suggested

@Leont
Copy link

Leont commented Mar 1, 2023

I'm puzzled by it removing the META.yml file; I can't imagine that being the solution to any problem.

@demerphq
Copy link
Author

demerphq commented Mar 1, 2023

Removing it stopped the complaint about the license.

@demerphq
Copy link
Author

demerphq commented Mar 1, 2023

I'm puzzled by it removing the META.yml file; I can't imagine that being the solution to any problem.

Shrug. Your imagination is faulty I guess. [ What an arrogant comment. Sheesh. ]

All of the below is assuming that I have removed the commit which alters the Makefile.PL and the META.yml in this PR, that is: 5dd2c2f

  1. With the patch for EUMM from Fix strange warning from existing META.yml license info conflicting with Makefile.PL Perl-Toolchain-Gang/ExtUtils-MakeMaker#436 and with the META.yaml I get this:
$ perl Makefile.PL 
Generating a Unix-style Makefile
Writing Makefile for Slay::Makefile
Your META.yml has a different license (unknown) than your Makefile.PL (perl_5)
Writing MYMETA.yml and MYMETA.json
  1. With the latest version of EUMM in the repo, and with the META.yml:
$ perl Makefile.PL 
Generating a Unix-style Makefile
Writing Makefile for Slay::Makefile
Invalid LICENSE value 'perl_5' ignored
Writing MYMETA.yml and MYMETA.json
  1. Removing the META.yml:
$ rm META.yml
$ perl Makefile.PL 
Generating a Unix-style Makefile
Writing Makefile for Slay::Makefile
Writing MYMETA.yml and MYMETA.json
  1. Difference in the MYMETA.yml and the META.yml from the last step:
$ mv MYMETA.yml META.yml
$ git diff
diff --git a/META.yml b/META.yml
index a7834b5..f7e7b58 100644
--- a/META.yml
+++ b/META.yml
@@ -1,16 +1,29 @@
---- #YAML:1.0
-name:                Slay-Makefile
-version:             0.12
-abstract:            Wrapper to Slay::Maker that reads the rules from a file
-license:             ~
-author:              
-    - Mark Nodine <[email protected]>
-generated_by:        ExtUtils::MakeMaker version 6.44
-distribution_type:   module
-requires:     
-    File::Copy::Recursive:         0
-    File::Path:                    0
-    Slay::Maker:                   0.04
+---
+abstract: 'Wrapper to Slay::Maker that reads the rules from a file'
+author:
+  - 'Slaven Rezic <[email protected]>'
+  - 'Mark Nodine <[email protected]>'
+  - 'Mark Nodine <[email protected]>'
+build_requires:
+  ExtUtils::MakeMaker: '0'
+configure_requires:
+  ExtUtils::MakeMaker: '0'
+dynamic_config: 0
+generated_by: 'ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter version 2.150010'
+license: perl
 meta-spec:
-    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
-    version: 1.3
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: '1.4'
+name: Slay-Makefile
+no_index:
+  directory:
+    - t
+    - inc
+requires:
+  File::Copy::Recursive: '0'
+  File::Path: '0'
+  Slay::Maker: '0.04'
+resources:
+  repository: git://github.com/eserte/Slay-Makefile.git
+version: '0.13'
+x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
  1. Observable differences seem to be,
    a) the license is more correct. I do not know why perl_5 turned into perl, but surely that is more correct than ~.
    b) Mark Nodine <[email protected]> is mentioned twice instead of once. Presumably because of this:
($eumm_recent_enough
     ? (META_MERGE => { resources  => { repository => 'git://github.com/eserte/Slay-Makefile.git' },
                        author     => ['Mark Nodine <[email protected]>'],
                      },
       )
     : ()
    ),
  1. Checking out the code at yves/fix_for_perl_5_37_9 (that is restoring 5dd2c2f) and applying a fixup on top (i shouldnt have removed the author line from the META_MERGE):
perl Makefile.PL
Generating a Unix-style Makefile
Writing Makefile for Slay::Makefile
Writing MYMETA.yml and MYMETA.json

Notice there is complaint about an invalid license.

  1. And reviewing the final MYMETA.yml:
$ cat MYMETA.yml 
---
abstract: 'Wrapper to Slay::Maker that reads the rules from a file'
author:
  - 'Slaven Rezic <[email protected]>'
  - 'Mark Nodine <[email protected]>'
  - 'Mark Nodine <[email protected]>'
build_requires:
  ExtUtils::MakeMaker: '0'
configure_requires:
  ExtUtils::MakeMaker: '0'
dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 7.66, CPAN::Meta::Converter version 2.150010'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Slay-Makefile
no_index:
  directory:
    - t
    - inc
requires:
  ExtUtils::MakeMaker: '7.66'
  File::Copy::Recursive: '0'
  File::Path: '0'
  Slay::Maker: '0.04'
resources:
  repository: git://github.com/eserte/Slay-Makefile.git
version: '0.14'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'

Conclusion, META_MERGE is buggy (why is Mark added twice?), and keeping the current META.yml isn't helpful particularly. IMO @eserte would be better off removing it, regenerating a MYMETA.yml and then copying that in place.

@demerphq
Copy link
Author

Note this was reported again as Perl/perl5#21026 which I have closed as we still have Perl/perl5#20864

The failed AppVeyor tests seem to be due to a misconfiguration and are irrelevant to this PR.

@Leont
Copy link

Leont commented Apr 16, 2023

Removing it stopped the complaint about the license.

But when you «make dist», it will recreate the META.yml in the actual tarball, so any issue would reappear.

The META.yml just does the wrong thing so remove it. Remove the logic
to handle older ExtUtls::MakeMaker and instead just require a modern
EUMM to proceed.
@demerphq
Copy link
Author

@Leont My primary intention of this PR was to fix the issue caused by my changes to Perl 5.37.9 so we could clear the related BBC ticket. The change to the Makefile.PL is a secondary feature because I wanted to stop it from reporting "Invalid LICENSE value 'perl_5' ignored", but since you keep complaining about it I have created #6 without that commit and I will close this PR. Feel free to post your own patch to fix the "invalid license" issue if you want.

@demerphq demerphq closed this Apr 16, 2023
@demerphq
Copy link
Author

Removing it stopped the complaint about the license.

But when you «make dist», it will recreate the META.yml in the actual tarball, so any issue would reappear.

Well, I just tried it, and no, the issue does not reappear in the tarball. I have not dug into why, but I think it is because in the current META.yaml contains:

-license:             ~, but the new one contains

but the new one (recreated as you stated above) contains:

license: perl

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