Perl-Toolchain-Gang / ExtUtils-MakeMaker

Perl module to make Makefiles and build modules (what backs Makefile.PL)
https://metacpan.org/release/ExtUtils-MakeMaker
64 stars 77 forks source link

Fix strange warning from existing META.yml license info conflicting with Makefile.PL #436

Open demerphq opened 1 year ago

demerphq commented 1 year ago

See https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/434 for details of an example of this.

This patch keeps track of the generated metadata from the WriteMakefile() command, and then later when we load the data from META.yml we notice if the license data differs between the two.

This avoids the incorrect warning about an invalid license, and allows us to point out when there is a discrepancy so developers can fix it.

Leont commented 1 year ago

This branch really needs a tests that shows what the problem really is. I have a strong feeling it's really the dist that's the problem.

And even if it wasn't the solution sits wrong with me, if anything the code should be simpler not more complex.

demerphq commented 1 year ago

This branch really needs a tests that shows what the problem really is.

Agreed. GIven the noises i was hearing from you about this on p5p I didnt want to put much more effort into it beyond proving that we could do better than we are doing. With this patch in place the Slay::Makefile outputs the following.

$ 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

if anything the code should be simpler not more complex.

Everthing should be as simple as possible, but not simpler. - Einstein.

It looks like we have set up a complex process that does the wrong thing in a bunch of different ways, it doesn't surprise me that requires some complexity to deal with. The complexity of a solution mirrors the complexity of the problem domain it solves. This problem domain seems complex.