chore: update rules_rust - #10919
Merged
Merged
Conversation
This drops our local rules_rust patch which we used to hardcode strip values, and instead use the new `strip_level_select` tag: bazelbuild/rules_rust#4167
nmattia
commented
Jul 27, 2026
basvandijk
approved these changes
Jul 27, 2026
nmattia
commented
Jul 27, 2026
pull Bot
pushed a commit
to mikeyhodl/ic
that referenced
this pull request
Aug 7, 2026
…nity#11074) Since the rules_rust update in dfinity#10919, `rust_library`/`rust_binary`/`rust_test` print a deprecation warning for every `cc_library` found in their `deps` — e.g. [this run](https://github.com/dfinity/ic/actions/runs/31178310153/job/92865651208): ``` WARNING: Target @@+new_local_repository+libsystemd//:libsystemd in 'deps' of @@rules_rust++crate+crate_index__libsystemd-sys-0.9.3//:libsystemd_sys is a C++ library. Only Rust targets are allowed in 'deps'. Please use 'link_deps' for manual FFI linkage. Support for C++ libraries in 'deps' is deprecated and will be removed in a future release. ``` Support is slated for removal, so this is a build break waiting on the next rules_rust bump, not just log noise. ## Changes - Switch the `devicemapper-sys`, `libcryptsetup-rs-sys` and `libsystemd-sys` crate annotations from `deps` to `link_deps`. Behaviour-preserving: for a target that only provides `CcInfo`, `transform_link_deps` builds exactly the same `DepVariantInfo` that `transform_deps` does. - `guest_vm_runner` hit the same warning by listing `@libvirt` directly in the `deps` of its two `rust_binary`s and one `rust_test`. Rather than repeat the attribute move three times, attach the library to the `virt-sys` crate instead — it is a pkg-config `-sys` crate (`links = "virt"`) just like the three above, so this is the pattern `bazel/pkg-config.patch` already documents: *"The `-l` libs resolve against cc_import dependencies that link the host library by explicit path"*. This needs a new `//third_party:libvirt` alias, since apparent repo names don't resolve from inside the generated crate repositories. - Repin `Cargo.Bazel.json.lock` (checksum + the four `extra_deps` → `extra_link_deps` entries; `Cargo.Bazel.toml.lock` is untouched). ## Verification `bazel query` confirms `//rs/ic_os/os_tools/guest_vm_runner`, `//rs/ic_os/os_tools/guest_disk` and `//rs/ic_os/device` are the only in-repo consumers of these four crates. Rebuilding all three with the analysis cache discarded: **6 warnings before, 0 after**, and the `NEEDED` entries of the resulting `guest_vm_runner` and `guest_disk` binaries are byte-identical (`libvirt.so.0`, `libsystemd.so.0`, `libcryptsetup.so.12` all still linked). `bazel build //... --nobuild` is clean and `//rs/ic_os/os_tools/guest_vm_runner:guest_vm_runner_test` passes. The two remaining tests over these targets (`guest_disk_test`, `upgrade_device_mapper_test`) are `manual` because they need root; they build, and are exercised via `//rs/tests/node:root_tests`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.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.
This drops our local rules_rust patch which we used to hardcode strip values, and instead use the new
strip_level_selecttag:bazelbuild/rules_rust#4167