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

Honor cpanfile requirements when recursing sub dependencies #446

Merged
merged 6 commits into from Apr 18, 2015

Conversation

miyagawa
Copy link
Owner

This will save the parsed cpanfile requirements during the install session, and when extracting sub dependencies, cpanm will merge the prereqs of the root cpanfile, so that requirements in cpanfile will still effect there.

This will address #363 and lots of issues with Carton such as perl-carton/carton#68

This will occasionally pass and fail, because of hash randomization in newer perl.
@miyagawa
Copy link
Owner Author

Most tests failures on Travis seem like due to errors on metacpan side randomly. Tests are all passing locally.

miyagawa added a commit that referenced this pull request Apr 18, 2015
Honor cpanfile requirements when recursing sub dependencies
@miyagawa miyagawa merged commit bae9572 into devel Apr 18, 2015
@skaji
Copy link
Sponsor Contributor

skaji commented Apr 19, 2015

I'm not sure this shoud be fixed or not, but comment here.

If cpanfile is:

requires 'Module::Refresh', '== 0.17';
requires 'Path::Class::File', '== 0.25';

then,

$ cpanm -n -Llocal --installdeps .
--> Working on .
Configuring /Users/skaji/work/2015-04-12 ... OK
==> Found dependencies: Module::Refresh, Path::Class::File
--> Working on Module::Refresh
Fetching http://www.cpan.org/authors/id/A/AL/ALEXMV/Module-Refresh-0.17.tar.gz ... OK
Configuring Module-Refresh-0.17 ... OK
==> Found dependencies: Path::Class
--> Working on Path::Class
Fetching http://www.cpan.org/authors/id/K/KW/KWILLIAMS/Path-Class-0.35.tar.gz ... OK
==> Found dependencies: Module::Build
--> Working on Module::Build
Fetching http://www.cpan.org/authors/id/L/LE/LEONT/Module-Build-0.4211.tar.gz ... OK
==> Found dependencies: CPAN::Meta
--> Working on CPAN::Meta
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/CPAN-Meta-2.150001.tar.gz ... OK
Configuring CPAN-Meta-2.150001 ... OK
Building CPAN-Meta-2.150001 ... OK
Successfully installed CPAN-Meta-2.150001 (upgraded from 2.140640)
Configuring Module-Build-0.4211 ... OK
Building Module-Build-0.4211 ... OK
Successfully installed Module-Build-0.4211 (upgraded from 0.4205)
Configuring Path-Class-0.35 ... OK
Building Path-Class-0.35 ... OK
Successfully installed Path-Class-0.35
Building Module-Refresh-0.17 ... OK
Successfully installed Module-Refresh-0.17
--> Working on Path::Class::File
Fetching http://www.cpan.org/authors/id/K/KW/KWILLIAMS/Path-Class-0.25.tar.gz ... OK
Configuring Path-Class-0.25 ... OK
Building Path-Class-0.25 ... OK
Successfully installed Path-Class-0.25 (downgraded from 0.35)
<== Installed dependencies for .. Finishing.
5 distributions installed

=> install Path-Class distribution twice

@miyagawa
Copy link
Owner Author

that is definitely a corner case, but also a correct behavior, because Module::Refresh wants Path::Class whatever version, so cpanm will get the latest from CPAN, then found that you want Path::Class::File == 0.25, so it tries to downgrade later.

It's absolutely a correct behavior. It would be nicer if the actual installation happens later, after building the whole dep tree, but that's a very big change required for the cpanm installation process.

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

Successfully merging this pull request may close these issues.

None yet

2 participants