-
Notifications
You must be signed in to change notification settings - Fork 9
Description
I'm having some troubles with a Cargo workspace that uses Cargo.toml
files as the source of truth. Gazelle will generate third-party dependencies fine. But, I can't seem to get Gazelle to automatically generate the deps
attributes properly for other workspace members.
Let's say I have a some Cargo.toml
s like this:
# Cargo.toml
[workspace]
members = ["foo", "bar"]
resolver = "2"
# foo/Cargo.toml
[package]
name = "foo"
version = "0.1.0"
edition = "2021"
[dependencies]
bar = { version = "0.1.0", path = "../bar" }
# bar/Cargo.toml
[package]
name = "bar"
version = "0.1.0"
edition = "2021"
[dependencies]
And I import bar
in foo
:
// foo/src/lib.rs
use bar::*;
Whenever I run Gazelle, it does not find the dependency for bar
:
$ bazel run //:gazelle
<snip>
gazelle: @test_workspace//foo/src:lib: no match for bar
I'm not 100% sure I've got the workspace setup properly. As mentioned, Gazelle can find third-party dependencies alright (I use things like clap
and tracing
in the actual workspace). But, that might be handled differently from first-party dependencies.
Looking at the examples/tests, nothing seems to use Cargo.toml
files as the source of truth with gazelle_rust
. Is it that this use case hasn't been fleshed out yet? If not, any thoughts on what the issue could be?