Skip to content

Commit

Permalink
[bazel] Load import_deps for rules_rust
Browse files Browse the repository at this point in the history
Even though we're not using these, Bazel 7 hits errors if we try to run
`bazel query deps($something)` on a Rust dependency.

Fixed in `rules_rust>=0.38.0`.

bazelbuild/rules_rust#1166 (comment)

Signed-off-by: James Wainwright <[email protected]>
  • Loading branch information
jwnrt committed Aug 26, 2024
1 parent 447d83e commit 77509d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions third_party/rust/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_dependencies")
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set")
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")
load("@rules_rust//util/import:deps.bzl", "import_deps")

def rust_deps():
rules_rust_dependencies()
Expand All @@ -25,3 +26,9 @@ def rust_deps():
)

rust_analyzer_dependencies()

# We're not using this feature, but have to load the deps in Bazel 7 due to
# https://github.com/bazelbuild/rules_rust/issues/1166#issuecomment-1060888166
#
# This is no longer needed for `rules_rust>=0.38.0`.
import_deps()

0 comments on commit 77509d1

Please sign in to comment.