-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input: add support for package aliases #609
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #609 +/- ##
==========================================
- Coverage 88.87% 88.86% -0.01%
==========================================
Files 48 48
Lines 15551 15629 +78
==========================================
+ Hits 13821 13889 +68
- Misses 1730 1740 +10 ☔ View full report in Codecov by Sentry. |
@sixtyfourktec @rhubert It would be nice to get you feedback here. Given the "virtual" packages in basement-gnu-linux, I figured some native support should be provided. Especially since it's not possible to virtualize tools at all at the moment. This PR is the bare minimum feature set that I could think of. Is this enough from your POV or do we need something more for proper virtual packages..? |
👍 Look good + sufficient to me. Only a quick idea: What about virtual classes? I'm thinking of the the integration |
Thanks for looking into it. I'm currently leaning to name this
As for classes I'm not sure if this will work. The aliases are created after all classes have been resolved already. But I have to think about this too... |
8d2cea5
to
ffd10e2
Compare
Ok, so I renamed everything consistently to "alias". There are now global aliases that are configured in the @daxcore you might want to try out the local aliases. Any feedback if this fits your needs is highly appreciated. :) More tests and the documentation are still missing, though... |
So far, Bob supports string substitution of dependency names. This lets recipes decide the actual dependency at recipe parsing time. That is a local decision of the recipe, though. Sometimes, a common indirection for many dependencies is required. Global recipe aliases provide such an indirection. They are configured in the newly recognized "aliases" directory. The alias name is derived from the YAML file name, just like for recipes and classes. If it is just a single alias, the file only contains the target recipe name. Optionally, several aliases can be defined by using a "multiPackage" in the file. The alias target is subject to string substitution.
With the advent of aliases, the package name may no longer resemble the underlying recipe. This will be confusing to the user when trying to find the workspaces for a particular recipe. Hence we should always use the original package name based on the recipe instead of the possibly aliased package name.
ffd10e2
to
30523c8
Compare
Each dependency of a recipe has to have a unique name. This is a problem if two distinct variants of the same dependency need to be used, though. To enable that feature, every dependency can optionally get an alias name. Multiple references to the same dependency can be created, given that each gets its own unique alias. If the dependency is provided via 'provideDeps', the alias name will be used for matching and in the downstream package dependencies. On the other hand, the alias is ignored for recipe cycle analysis. This means that aliases cannot be used to break cyclic recipe dependencies. Fixes BobBuildTool#314.
30523c8
to
dc7f3ad
Compare
Virtual packages transparently create an alias for a recipe. They are configured by yaml files in the newly defined
virtual
directory. For example, the filevirtual/libs/libegl.yaml
would create packages
libs::libegl
,libs::libegl-dev
andlibs::libegl-tgt
whose underlying recipe is selected byCONFIG_SELECT_LIBEGL
.If there is only one package, the yaml file can be a simple string containing just the target name.