cpm icon indicating copy to clipboard operation
cpm copied to clipboard

install by url fails when same dist required with different version

Open abraxxa opened this issue 6 years ago • 3 comments

To support our private Perl dist repo we use the url feature or cpanfile, e.g.

requires 'Our::Dist' => '1.23',
    url => 'http://fqdn/Our-Dist-1.23.tar.gz';

When a private dependency has the same dependency but with a different version installation fails. For example

cpanfile of Our-Dist-A:

requires 'Our::Dist::B' => '1.0',
    url => 'http://fqdn/Our-Dist-B-1.0.tar.gz';
requires 'Our::Dist::C' => '1.23',
    url => 'http://fqdn/Our-Dist-C-1.23.tar.gz';

cpanfile of Our-Dist-B:

requires 'Our::Dist::C' => '1.24',
    url => 'http://fqdn/Our-Dist-C-1.24.tar.gz';

output of cpm install -g in Our-Dist-A directory:

WARN http://fqdn/Our-Dist-C-1.23.tar.gz provides Our::Dist::C (1.23), but needs 1.24
FAIL install http://fqdn/Our-Dist-B-1.0.tar.gz

abraxxa avatar Jun 21 '19 09:06 abraxxa

At the moment, If you have multiple private distributions, I suggest you prepare DarkPAN. Then use cpm with --resolver 02packages,http://your-darkpan (and optionally with --resolver metadb too).

skaji avatar Jun 21 '19 10:06 skaji

We use CPANPLUS custom sources feature because it's easy to use and only requires a single text file containing all filenames. Setting up a DarkPAN server is much more work.

abraxxa avatar Jun 21 '19 10:06 abraxxa

Something similar happens when DarkPAN dist A requires DarkPAN dist B and lists its URL in the cpanfile. The cpanfile of DarkPAN dist B in turn also lists DarkPAN dist C with its URL which can't be resolved.

abraxxa avatar Apr 27 '20 10:04 abraxxa