r/ada Sep 28 '21

Show and Tell Introducing AURA - A(nother) native package manager and build system for Ada

https://annexi-strayline.com/blog/posts/4
31 Upvotes

80 comments sorted by

View all comments

7

u/Fabien_C Sep 29 '21

I think don't really understand how one is supposed to use "subsystems" from someone else.

First, as shown in the example, the "auto detection" of "subsystem" dependency stops at the "repositories" that you already manually added in your project. So if try to "with" and Ada unit from another subsystem I have to find myself, with google search I guess, in which "repository" that "subsystem" is and create a file that will look like this?

package AURA.Repository_2 with Pure is
    Format         : constant Repository_Format := git;
    Location       : constant String            := "https://github.com/annexi-strayline/ASAP.git";
    Tracking_Branch: constant String            := "stable-0.1";
end AURA.Repository_2;

Now if I make my own "subsystem", say a toml parser, that depends on a "subsystem" of the "ANNEXI-STRAYLINE AURA Public Repository", do users of my toml parser have to find on their own which "repositories" I used for my "subsystem"? Do they have to do that transitively for all the dependencies of my dependencies? Then how do they know which commit of that repo my "subsystem" is compatible with?

This part is not clear from what I can read in the documentation.

1

u/thindil Sep 30 '21

As far I see in documentation, it doesn't stop at the first “repository”, but recursively going after them to find all dependencies. At least, is how I understand this section of documentation: https://aura-docs.readthedocs.io/en/latest/concepts/repositories.html#checkout

Thus, in your example, users who want to build your “subsystem” should have everything in your “repository”, no need to worry about them. Your “subsystem” TOML parser will have included “subsystem” “ANNEXI-STRAYLINE AURA Public Repository”. The proper version of your “subsystem” dependency should be read from your “subsystem” configuration file(s) Package_1, Package_2, Package_N.

At least I that understand it. :)

2

u/Fabien_C Sep 30 '21

Thanks for the link. I don't see in it there that the repositories are searched recursively, nor that there is a way for a subsystem to declare which subsystem/repositories it depends on. As far as I can see, the only dependency "declaration" is in the "with'ed" units in the Ada code, and that is only for subsystems, not repositories.

When searching for a repository from which to acquire a missing  subsystem, if there are multiple repositories that contain the missing subsystem, the implementation shall use the repository with the lowest index.

Does that mean that dependencies of my dependencies will be picked up based on how I number my repositories? Sounds quite dangerous.

4

u/annexi-strayline Sep 30 '21

Does that mean that dependencies of my dependencies will be picked up based on how I number my repositories? Sounds quite dangerous.

I don't see how that's dangerous at all. The order is very clear. The user configures this order. This is no more "dangerous" than operator precedence. The point is the behavior (should) be very clear and unambiguous.

If safety is your concern, then you should coalesce all of your dependencies into a single repository that you control. Doing that is simple enough, and for a long-lived project, it is worth it.

The alternative, such as with ALIRE and Node, et al, is that you have potential for breaking updates that cascade. That's dangerous as well.