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

Cannot change DISTNAME in configure step to create trial release #455

Closed XSven closed 3 months ago

XSven commented 3 months ago

I have a module with the NAME Foo::Bar. To create a trial release I wanted to change the DISTNAME from Foo-Bar to Foo-Bar-TRIAL at configure time

perl Makefile.PL DISTNAME=Foo-Bar-TRIAL
WARNING: Setting ABSTRACT via file 'lib/Foo/Bar.pod' failed
...

The reason is that ExtUtils::MM_Unix::parse_abstract() uses DISTNAME (Why not NAME?) to create $package (Foo::Bar::TRIAL) which it searches in the .pod. Of course this does no exist. What is the proper way to create a trial release using the EU::MM installer?

Grinnz commented 3 months ago

There are two ways to create a trial release with EUMM:

  1. Set a module and distribution version that contains an underscore (the most automatic way with EUMM as your authoring tool, unfortunately)
  2. Set the https://metacpan.org/pod/CPAN::Meta::Spec#release_status to unstable or testing, and then add -TRIAL (with optional following digit) to the tarball name before the file extension.

-TRIAL should not be added to the version or distname.

haarg commented 3 months ago

You can add -TRIAL to the tarball name using DISTVNAME.

perl Makefile.PL DISTVNAME=Foo-Bar-0.01-TRIAL
make dist
XSven commented 3 months ago

Thanks for the hints and sorry that I have used the wrong EU:MM attribute (DISTNAME instead of DISTVNAME). I will follow the @haarg approach because this avoids touching any files but simply refers to a specific configure call. Don't know if your suggestions should be added to the EU:MM documentation.

Observation: Changing DISTVNAME does not change the release_status. The release status is "stable".

Grinnz commented 3 months ago

The only automatic way to set release_status is with an underscore in the version. Otherwise it can be set in META_ADD/META_MERGE. EUMM does not know anything about the significance of -TRIAL in the archive name, even if DISTVNAME is used to achieve this.

XSven commented 3 months ago

Ok then I will refrain from using DISTVNAME in a dedicated configure call.