Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up Bazel rust_repositories with a default edition that is not usable #1035

Merged
merged 1 commit into from Apr 11, 2022

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Apr 11, 2022

Closes #1031. Closes #1032.

Requires bazelbuild/rules_rust#1254, since some targets from the rules_rust repo otherwise end up using the default edition set by cxx's WORKSPACE. (This behavior is silly, but a consequence of bazelbuild/rules_rust#1251.)

Using rules_rust's current main branch this change would fail as follows:

$ bazel build ...
INFO: Analyzed 48 targets (5 packages loaded, 382 targets configured).
INFO: Found 48 targets...
ERROR: /home/david/.cache/bazel/_bazel_david/ebce1d0721fb68dda9c70c0dd1405803/external/rules_rust/util/process_wrapper/BUILD.bazel:6:36: Compiling Rust (without process_wrapper) bin process_wrapper (4 files) [for host] failed: (Exit 1): rustc failed: error executing command bazel-out/host/bin/external/rust_linux_x86_64/toolchain_for_x86_64-unknown-linux-gnu_impl/bin/rustc external/rules_rust/util/process_wrapper/main.rs '--crate-name=process_wrapper' '--crate-type=bin' ... (remaining 15 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
error: argument for `--edition` must be one of: 2015|2018|2021. (instead was `required`)

INFO: Elapsed time: 15.072s, Critical Path: 0.14s
INFO: 3 processes: 3 internal.
FAILED: Build did NOT complete successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel: build fails if importing project's workspace sets default rust edition of "2021"
1 participant