How to specify a github repo as the source of dependency of a module in Raku?
Asked Answered
G

1

10

My module depends on the Fcntl module (https://github.com/manchicken/perl6-Fcntl), which hasn't been updated in a long time and is broken. However, there's a fork (https://github.com/jonathanstowe/perl6-Fcntl) that works for me if I zef install it manually. Is it possible to specify the dependency in my module's META-6.json such that the correct github repo will be used for installing the module?

Gallipot answered 13/8, 2020 at 0:49 Comment(0)
T
9

No, you cannot list a uri as a dependency. The spec actually states that dependency names in META6.json should match what you would use.

If you insist on not integrating the namespace into one of the many cooperative ecosystems then you are still free to list the urls in your installation instructions:

zef install MyModule https://github.com/foo/dependency.git

When a user provides a uri to zef it is essentially treated as a stand-alone ecosystem and thus is able to fulfill dependencies for MyModule. This is ok -- the user is explicitly requesting that source to be used. What is not ok is for module authors to dictate where dependencies are downloaded from (only what dependencies are needed).

All that said you can solve your problem a different way -- fork the module, change the auth field to something else, list (and use) Fcntl:auth<mynewauth> as the dependency name, and then add your fork to an ecosystem. Alternative you could just bump the version so-to-speak.

Thalassic answered 13/8, 2020 at 1:50 Comment(1)
The idea of avoiding URIs is a good one for another reason: if everything is done by module name, author name, and version, then dependencies can be maintained long term by ecosystem repositories like CPAN, etc. If URIs are allowed, then link rottage could set in rather fast and break modules with potentially little recourse.Tridentine

© 2022 - 2024 — McMap. All rights reserved.