zopsicle / raku-nix

Build Raku modules with Nix! Also includes Nix derivations for community modules from CPAN and GitHub.
9 stars 3 forks source link

Does not generate correct dependencies when module, not distribution name, is used #10

Open ugexe opened 4 years ago

ugexe commented 4 years ago

https://github.com/chloekek/raku-nix/blob/811cc574fa0e75580a80bf4e307c8eb0a59a68f5/ecosystem/Ddt.nix#L7

Note this shows a dependency on e.g. Zef::Distribution which is provided by a distribution calledzef (with a lower case Z). Zef (with an uppercase Z), Zef-Distribution, Zef-Identity, etc should all resolve to the same thing... whatever the zef distribution contains. I suspect in your case you only want the .nix file to depend on rakuPackages.zef.


For brevity:

https://design.raku.org/S22.html#depends

Optional. A list of run-time dependencies, specified as use strings.

The above explains why dependencies can use module names, and indeed it makes sense when you consider things like S22s emulates ( NYI, but a naive implementation exists https://github.com/rakudo/rakudo/pull/2732 ). The fact we accept distribution names in depends is because that is what was done from before zef (which had to inherit this allowance to not break the world). So you need to look at both the provides section of all modules (theoretically the emulates section as well) as well as the distribution name.

zopsicle commented 4 years ago

That’s interesting. CRAI does not yet collect provides, but this is something I want to add (https://github.com/chloekek/crai/issues/15), so once that’s in place this issue can be fixed.

zopsicle commented 4 years ago

provides entries are now collected into the meta_provides table.