Description
In a repository using cargo_bazel for vendored crates.io dependencies, a workspace-internal crate with a build.rs script causes the :crates_vendor utility to emit an alias for it, breaking the build due to bad dependency information. Because the crate is a workspace member, and not an external dependency, no alias record should be written.
Reproduction steps
Include a workspace crate with a build.rs script, and run :crates_vendor. Inspect the generated BUILD.bazel and observe the alias records for that crate.
Reproducer repository: https://github.com/matx-patrick/cargo-bazel-repro
Impact
We have worked around this with the patch shown in the reproducer repo.
Bazel and rules_rust version
rules_rust: 0.70.0
Bazel: 9.1.0
Description
In a repository using
cargo_bazelfor vendored crates.io dependencies, a workspace-internal crate with abuild.rsscript causes the:crates_vendorutility to emit an alias for it, breaking the build due to bad dependency information. Because the crate is a workspace member, and not an external dependency, no alias record should be written.Reproduction steps
Include a workspace crate with a
build.rsscript, and run:crates_vendor. Inspect the generatedBUILD.bazeland observe thealiasrecords for that crate.Reproducer repository: https://github.com/matx-patrick/cargo-bazel-repro
Impact
We have worked around this with the patch shown in the reproducer repo.
Bazel and rules_rust version
rules_rust: 0.70.0Bazel: 9.1.0