metacpan-web icon indicating copy to clipboard operation
metacpan-web copied to clipboard

What does "and possibly others" mean under "dependencies"?

Open szabgab opened this issue 3 years ago • 6 comments

I could not find it in the FAQ

szabgab avatar Oct 26 '20 20:10 szabgab

It means that https://metacpan.org/pod/CPAN::Meta::Spec#dynamic_config is enabled in metadata, which is the default - Makefile.PL or Build.PL may alter the dependencies needed for the build/test/runtime phases based on the system's needs at install time.

Grinnz avatar Oct 26 '20 20:10 Grinnz

If I understand correctly META.json that comes in the zip file can include a list of immediate dependencies, but sometimes it is not the full list (e.g. when there is a platform-specific dependency) and thus one needs to run the Makefile.PL or Build.PL in order to get the full list.

Because MetaCPAN relies on the META.json file to display the the list of dependencies this "and possibly others" suggests that there might be others.

And this is the default. If someone really wants to tell the users that the full list of immediate dependencies is in META.json (and thus on MetaCPAN) they need to somehow turn off the dynamic_config.

In the whole I wrote "immediate dependencies" as, if I understand correctly, META.json will not include any secondary dependency and thus MetaCPAN will not display them either, right?

szabgab avatar Oct 26 '20 20:10 szabgab

Correct. The dynamic dependency list is produced by EUMM or MB in the MYMETA.json file it generates on the user's system; metacpan has access only to the static dependency list provided with the release and has no way to know what dependencies might be requested dynamically on a particular system.

Grinnz avatar Oct 26 '20 20:10 Grinnz

I'll also add that there is no requirement that the resulting dynamic dependency list resembles the static dependency list in any way, for the build/test/runtime phases; but it's a good enough assumption that metacpan can show it to give a good idea for most cases.

Grinnz avatar Oct 26 '20 20:10 Grinnz

Thanks. It might be a good idea to add something about this to the FAQ of MetaCPAN.

szabgab avatar Oct 26 '20 20:10 szabgab

See also https://metacpan.org/pod/Acme::Working::Out::Dependencies::From::META::files::Will::Be::Wrong::At::Some::Point::Like::This::Module::For::Instance for an extreme example of this case.

Grinnz avatar Oct 26 '20 20:10 Grinnz