Replies: 1 comment
-
Answering my own question: Putting the following into the WORKSPACE file worked: load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
load("@rules_rust//rust:repositories.bzl", "rust_register_toolchains")
rust_register_toolchains(
edition = "2021",
versions = [
"nightly/2024-02-08",
],
)
crates_repository(
name = "crate_tools",
annotations = {
"diesel_cli": [crate.annotation(
gen_binaries = ["diesel"],
)],
},
cargo_lockfile = "//tools:Cargo.lock",
lockfile = "//tools:cargo-bazel-lock.json",
packages = {
"diesel_cli": crate.spec(
artifact = "bin",
default_features = False,
features = ["sqlite"],
version = "2.1",
),
},
rust_version = "nightly/2024-02-08",
)
load("@crate_tools//:defs.bzl", "crate_repositories")
crate_repositories() --> Allows to run |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What would be the equivalent of
cargo install diesel_cli
in Bazel? I am able to install 'normal' dependencies viacrate.from_cargo
just fine, but this does not seem to work with binary-only crates likediesel_cli
. What's the correct way to install these?Beta Was this translation helpful? Give feedback.
All reactions