bazelbuild / bazelbuild/rules_rust

crate_universe: build.rs script causes erroneous alias record

Open
#4,053 2 comments 1 reaction 0 assignees View on GitHub
crate-universe
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

**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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.