Add support for --compile_one_dependency#2598
Merged
illicitonion merged 3 commits intobazelbuild:mainfrom Apr 3, 2024
Merged
Conversation
Collaborator
|
This looks reasonable - do you think there's a reasonable way to add a test for this behaviour? |
Contributor
Author
|
I added a test, which I think should work. I'm not 100% sure since I haven't worked with the bazel CI system before. |
rrbutani
referenced
this pull request
in bazel-contrib/toolchains_llvm
Apr 10, 2024
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rules_rust](https://togithub.com/bazelbuild/rules_rust) | http_archive | minor | `0.41.1` -> `0.42.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_rust (rules_rust)</summary> ### [`v0.42.0`](https://togithub.com/bazelbuild/rules_rust/releases/tag/0.42.0) [Compare Source](https://togithub.com/bazelbuild/rules_rust/compare/0.41.1...0.42.0) ### 0.42.0 ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_rust", integrity = "sha256-XT1YVJ6FHJTXBr1v3px2fV37/OCS3dQk3ul+XvfIIf8=", urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.42.0/rules_rust-v0.42.0.tar.gz"], ) ``` Additional documentation can be found at: https://bazelbuild.github.io/rules_rust/#setup #### What's Changed - Fix crates.io URL by [@​ericmcbride](https://togithub.com/ericmcbride) in [https://github.com/bazelbuild/rules_rust/pull/2597](https://togithub.com/bazelbuild/rules_rust/pull/2597) - Add support for `--compile_one_dependency` by [@​william-smith-skydio](https://togithub.com/william-smith-skydio) in [https://github.com/bazelbuild/rules_rust/pull/2598](https://togithub.com/bazelbuild/rules_rust/pull/2598) - Update rules_apple by [@​sgowroji](https://togithub.com/sgowroji) in [https://github.com/bazelbuild/rules_rust/pull/2602](https://togithub.com/bazelbuild/rules_rust/pull/2602) - Support building more things with bzlmod by [@​matts1](https://togithub.com/matts1) in [https://github.com/bazelbuild/rules_rust/pull/2601](https://togithub.com/bazelbuild/rules_rust/pull/2601) - Make bazel lock file cross-platform by [@​cameron-martin](https://togithub.com/cameron-martin) in [https://github.com/bazelbuild/rules_rust/pull/2453](https://togithub.com/bazelbuild/rules_rust/pull/2453) - Added Rust 1.77.1 by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2591](https://togithub.com/bazelbuild/rules_rust/pull/2591) - Fix (+) In vendored crates semver metadata by [@​ericmcbride](https://togithub.com/ericmcbride) in [https://github.com/bazelbuild/rules_rust/pull/2579](https://togithub.com/bazelbuild/rules_rust/pull/2579) - Keep default_features parity from bzlmod to workspace by [@​Lev1ty](https://togithub.com/Lev1ty) in [https://github.com/bazelbuild/rules_rust/pull/2606](https://togithub.com/bazelbuild/rules_rust/pull/2606) - clippy: use --cap-lints=warn; apply clippy_flags when capture_output=True by [@​goffrie](https://togithub.com/goffrie) in [https://github.com/bazelbuild/rules_rust/pull/2451](https://togithub.com/bazelbuild/rules_rust/pull/2451) - Added Rust 1.77.2 by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2608](https://togithub.com/bazelbuild/rules_rust/pull/2608) - Re-vendor crate_universe outputs by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2609](https://togithub.com/bazelbuild/rules_rust/pull/2609) - Release 0.42.0 by [@​UebelAndre](https://togithub.com/UebelAndre) in [https://github.com/bazelbuild/rules_rust/pull/2610](https://togithub.com/bazelbuild/rules_rust/pull/2610) #### New Contributors - [@​Lev1ty](https://togithub.com/Lev1ty) made their first contribution in [https://github.com/bazelbuild/rules_rust/pull/2606](https://togithub.com/bazelbuild/rules_rust/pull/2606) **Full Changelog**: bazelbuild/rules_rust@0.41.1...0.42.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/toolchains_llvm). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--compile_one_dependencyflag (docs) changesbazel buildetc. to accept a file path and build the target corresponding to that file. This is useful for check-on-save with rust-analyzer in combination with the newly-added$saved_filecommand substitution (rust-lang/rust-analyzer#15476).Officially
--compile_one_dependencyonly supports the builtin C++ and Java rules, but an undocumented flag can be added to attributes to turn them into sources supporting--compile_one_dependency. I'm not sure what the status of this support is, but it appears to work for all bazel versions up to at least 7.1.1, and if support is removed the flag is pretty harmless.Before this change:
After: