Skip to content

cargo_toml_env_vars requires extra Bazel repository dependencies when building generated targets #3335

@jayzhuang

Description

@jayzhuang

Version: 0.59.0
Relevant PR: #2772

I'm using WORKSPACE with rules_rust_dependencies only, and I'm getting the following errors:

ERROR: no such package '@@rules_rust_ctve__cargo-util-schemas-0.3.1//': The repository '@@rules_rust_ctve__cargo-util-schemas-0.3.1' could not be resolved: Repository '@@rules_rust_ctve__cargo-util-schemas-0.3.1' is not defined

I think this is because ctve_crate_reposotires is not in rules_rust_dependencies. For my use case I have locally vendored third-party crates and I check in generated BUILD.bazel files. When building with Bazel later, it doesn't need to know about crate_universe since it's simply consuming generated targets. However, with the addition of cargo_toml_env_vars, it looks like I need to make sure crate_universe_dependencies is called in WORKSPACE as well, which in turn pulls in way too many dependencies than we want to vendor.

@illicitonion I guess a simple workaround for my use case would be a knob to disable generation of cargo_toml_env_vars targets. Is that a reasonable thing to do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions