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

Added standalone targets for rust_toolchain components. #792

Merged
merged 3 commits into from
Jul 15, 2021

Conversation

UebelAndre
Copy link
Collaborator

@UebelAndre UebelAndre commented Jun 25, 2021

I'm not sure if there's a better way to do this but I certainly feel it's better than:

alias(
name = "rustfmt_bin",
actual = select({
"@rules_rust//rust/platform:aarch64-apple-darwin": "@rust_darwin_aarch64//:rustfmt_bin",
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": "@rust_linux_aarch64//:rustfmt_bin",
"@rules_rust//rust/platform:x86_64-apple-darwin": "@rust_darwin_x86_64//:rustfmt_bin",
"@rules_rust//rust/platform:x86_64-pc-windows-msvc": "@rust_windows_x86_64//:rustfmt_bin",
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": "@rust_linux_x86_64//:rustfmt_bin",
}),
)

This PR adds targets for parsing specific components of a rust_toolchain:

  • @rules_rust//rust/toolchain:current_exec_rustfmt_files
  • @rules_rust//rust/toolchain:current_exec_rustdoc_files
  • @rules_rust//rust/toolchain:current_exec_rustc_srcs_files
  • @rules_rust//rust/toolchain:current_exec_rustc_lib_files
  • @rules_rust//rust/toolchain:current_exec_rustc_files
  • @rules_rust//rust/toolchain:current_exec_rust_stdlib_files
  • @rules_rust//rust/toolchain:current_exec_clippy_files
  • @rules_rust//rust/toolchain:current_exec_cargo_files

These targets give users the ability to consume these files at runtime (cargo-raze is also doing this and would benefit from these targets).

test/toolchain/BUILD.bazel Outdated Show resolved Hide resolved
rust/toolchain.bzl Outdated Show resolved Hide resolved
rust/toolchain.bzl Outdated Show resolved Hide resolved
rust/toolchain.bzl Outdated Show resolved Hide resolved
test/toolchain/BUILD.bazel Outdated Show resolved Hide resolved
@UebelAndre UebelAndre requested a review from hlopko June 29, 2021 03:32
@UebelAndre UebelAndre changed the title Added a toolchain_tool rule for fetching rust tools from a toolchain Added standalone targets for rust_toolchain components. Jun 29, 2021
@UebelAndre UebelAndre force-pushed the tool branch 10 times, most recently from ad4abc8 to 2b5a314 Compare June 29, 2021 06:27
@UebelAndre
Copy link
Collaborator Author

Windows is very unfun... but this PR is ready for review again

Copy link
Member

@hlopko hlopko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

test/current_toolchain_tools/BUILD.bazel Outdated Show resolved Hide resolved
test/current_toolchain_tools/current_exec_files_test.sh Outdated Show resolved Hide resolved
@UebelAndre UebelAndre merged commit 8cca226 into bazelbuild:main Jul 15, 2021
@UebelAndre UebelAndre deleted the tool branch July 15, 2021 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants