Replies: 1 comment 7 replies
-
I've run into what I think is a rather nasty footgun using approach (2) above. I've written a minimal demonstration: I'm using the nightly feature In my main binary crate, I have a type When I build the program, the library's instance of serde is distinct from the binary's instance of serde and the program fails to build. If I change the binary's bazel dependency on the library to use |
Beta Was this translation helpful? Give feedback.
-
I'd like to use crate_universe with some non-registry crates and I'm not quite clear on how to go about it. I'm currently using
cargo-raze
in my repository and I'm able to accomplish this by also using cargo-raze in my non-registry dependencies and having my main repo load the raze-generated deps of my non-registry dependencies.I'm migrating my project (opentitan) to crate_universe and I'm not sure what is the best approach.
git
references. This works, but is not a viable solution for me because I need to support airgapped builds andgit
references in the Cargo.toml file get converted tonew_git_repository
imports. AFAIK, bazel doesn't support git repositories for airgapped mode.crates_vendor
rules and duplicate the structure I currently have with cargo-raze.crates_repository
rules in each of my non-registry deps and export starlark functions that load and configure the deps of my non-registry repos and then load those from my root workspace.I'd really like to do (1), but I need to download my deps as http_archives. It would be convenient if either cargo or a
crate.annotation
provided a url override so I could specify an archive to download.I think (2) is probably the next-best approach. I had hoped to avoid committing the generated BUILD files into my repo. I'm already committing the BUILD files with cargo-raze and I feel that it would be an improvement to not have to do it.
I think (3) is too complex.
Are there other possibilities that would allow crate_universe to unify dependency management between registry-deps and non-registry deps (and perhaps cargo-free deps)?
Beta Was this translation helpful? Give feedback.
All reactions