Skip to content

crate_universe: build.rs script causes erroneous alias record #4053

@matx-patrick

Description

@matx-patrick

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThe ticket needs maintainer attention.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions