perl-carton / carton

Bundler or pip freeze for Perl
http://search.cpan.org/dist/carton
Other
494 stars 96 forks source link

Upgrading Params::Classify fails #244

Open dracos opened 5 years ago

dracos commented 5 years ago

We have a working installation, as part of which is Params::Classify 0.013 as a dependency of another module. For compatibility with perl 5.26, we wanted to upgrade this to 0.015. So in our cpanfile we added the line requires 'Params::Classify', '0.015'; but running carton install fails saying it upgrades but then can't find it.

Minimal reproducing below:

$ rmdir local
$ # Set up a local directory with 0.013 in it
$ ./cpanm -l local ZEFRAM/Params-Classify-0.013.tar.gz
--> Working on ZEFRAM/Params-Classify-0.013.tar.gz
Fetching http://www.cpan.org/authors/id/Z/ZE/ZEFRAM/Params-Classify-0.013.tar.gz ... OK
Configuring Params-Classify-0.013 ... OK
Building and testing Params-Classify-0.013 ... OK
Successfully installed Params-Classify-0.013
1 distribution installed
$ more cpanfile
requires 'Params::Classify';
$ ./carton install
Installing modules using /home/matthew/minimumPCissue/cpanfile
Complete! Modules were installed into /home/matthew/minimumPCissueLatest/local
$ ./carton install --deployment
Installing modules using /home/matthew/minimumPCissue/cpanfile (deployment mode)
Complete! Modules were installed into /home/matthew/minimumPCissue/local
$ vim cpanfile
$ more cpanfile
requires 'Params::Classify', '0.015';
$ ./carton install
Installing modules using /home/matthew/minimumPCissue/cpanfile
Successfully installed Params-Classify-0.015 (upgraded from 0.013)
! Installing the dependencies failed: Installed version (0.013) of Params::Classify is not in range '0.015'
! Bailing out the installation for /home/matthew/minimumPCissue/.
1 distribution installed
Installing modules failed

Looking at the contents of local it looks like it now has two versions of Params::Classify installed -

I don't know for sure if the issue is with Carton, Params::Classify, or us, but it seems that Params::Classify has changed between 0.013 and 0.015 so that on our server it no longer wishes to install an XS version, installs a pure Perl version, but leaves the XS version around to then confuse as to what's installed. I'm not sure how best to deal with this issue, I can presumably manually remove the old XS version but would prefer an automated way of dealing with it.

Grinnz commented 5 years ago

This is a general problem with Perl INC paths when different versions of a distribution get installed into the regular lib and the archlib subdirectory, as archlib takes precedence. Params::Classify appears to attempt to install XS code by default though, so maybe it's a bug that it's not still installing in archlib.

dracos commented 5 years ago

Params::Classify will now only install the XS version if ExtUtils::ParseXS >= 3.30 is installed, so as long as that is, it works okay (though depending on installation order by carton, it might take two runs of carton install to work iyswim).