Replies: 3 comments 1 reply
-
I see the same error with bazel_dep(name = "rules_rust", version = "0.57.1", dev_dependency = True)
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate")
crate.spec(package = "diesel_cli", version = "2.2.7")
crate.annotation(crate = "diesel_cli", gen_binaries = ["diesel"])
crate.from_specs(name = "crates_diesel_cli")
use_repo(crate, "crates_diesel_cli") Note.- My project also has a |
Beta Was this translation helpful? Give feedback.
-
I had similar issues with another binary called
So for diesel_cli, it would be: crate.spec(artifact = "bin", package = "diesel_cli", version = "2.2.7")
crate.annotation(crate = "diesel_cli", gen_binaries = ["diesel"])
crate.from_specs(
name = "crates_diesel_cli",
generate_binaries = True,
host_tools_repo = "rust_host_tools_nightly"
)
use_repo(crate, "crates_diesel_cli") It is because they are binary crates rather than library crates. You can read more here: https://bazelbuild.github.io/rules_rust/crate_universe_bzlmod.html#binary-dependencies |
Beta Was this translation helpful? Give feedback.
-
Not working here 🤷 I also wrote in #3110 as it's kind of related. I get the following error:
|
Beta Was this translation helpful? Give feedback.
-
I need to use the
wit-bindgen
executable fromwit-bindgen-cli
but I can't figure out why it won't work.Here's an example in a single
MODULE.bazel
file:Uncommenting the annotation for
wit-bindgen-cli
causes the error:Error: Unused annotations were provided. Please remove them
. So,rules_rust
seems to thinkwit-bindgen-cli
is not a dependency (verified withbazel query
). Everything is fine for the first two. You can see all the generated targets withbazel query '@crates//...' --output build
.What is it about
wit-bindgen-cli
that makes it seemingly invisible torules_rust
?Beta Was this translation helpful? Give feedback.
All reactions