Skip to content
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

Common dependency namespace #7

Open
mainrs opened this issue Sep 15, 2020 · 1 comment
Open

Common dependency namespace #7

mainrs opened this issue Sep 15, 2020 · 1 comment

Comments

@mainrs
Copy link

mainrs commented Sep 15, 2020

Currently, each crate has its own namespace defined. Although the prefix can be set, the crate name has to be appended to it.

Would it be possible to somehow make it that all crates have the same namespace? E.g.:

@blackjack_cargo_lock//:cargo_lock
@blackjack_cargo_metadata//:cargo_metadata

# becomes...
@blackjack//:cargo_lock
@blackjack//:cargo_lock

Not sure if there is a technical reason for the separate namespaces. But I think that the second one is easier to understand and feels overall a little bit cleaner.

@wildarch
Copy link
Owner

The technical reason behind this is that for every crate in the dependency graph, we generate an http_archive rule and the corresponding BUILD file to build the crate. I don't think there is an easy way around that.

What we could do however is make the names of these http_archives an implementation detail, and expose the crates via a dedicated workspace (in your example it would be called blackjack) that contains aliases to the actual crates, exposing them under convenient names such as @blackjack//:cargo_lock.

I'm not sure how we would set up a workspace like that, maybe with a repository rule?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants