thaljef / Pinto

Curate your own repository of Perl modules
https://metacpan.org/module/Pinto::Manual
66 stars 49 forks source link

If cpanm tries to install B when installing A, then shouldn't Pinto pull B when pulling A? #147

Open akarelas opened 10 years ago

akarelas commented 10 years ago

The module that made me ask this question is: https://metacpan.org/pod/Package::Stash

When I pull it, it doesn't pull Package::Stash::XS.

When I pinto install it, it tries to install Package::Stash::XS, however, and fails.

Package::Stash::XS is mentioned in the META.json file: https://metacpan.org/source/DOY/Package-Stash-0.36/META.json , so it's not missing.

akarelas commented 10 years ago

Maybe it's the module's maintainer's fault. If that's the case, please tell me and I'll notify him to fix it.

thaljef commented 10 years ago

In this particular case, Package::Stash::XS is listed only as a "recommended" prereq. Pinto only fetches the "required" prereqs (for configure, build, test, and run phases). As you have probably already figured out, the workaround is to pull Package::Stash::XS directly.

Perhaps Pinto should fetch recommended (or suggested) modules too. But Package::Stash::XS only makes sense iff you have C compiler, which Pinto doesn't know. So there's no way to get this right all the time, since authors can compute dependencies dynamically.

But you could also argue that it doesn't matter than much. If Pinto has certain distributions but cpanm never installs them (because you don't have the necessary tools) then it's not the end of the world. It just clutters up your repo.

What do you think would be the best approach?

thaljef commented 10 years ago

Maybe it's the module's maintainer's fault

No, not their fault.

hartzell commented 10 years ago

I'd be happy to see pinto err on the side of pulling in recommended stuff, even if it never gets used. Having them hanging around unused shouldn't be a problem but having them not at hand when cpanm reaches for them leads to sadness.

akarelas commented 10 years ago

Behaviour towards recommended modules could be an option in pinto pull, I guess.

perlpunk commented 10 years ago

I would also like to see an option to pull recommended modules automatically. It can be a lot of work to find out which modules to pull manually (try installing Dist::Zilla for example ;-)