Skip to content

chore: update rules_rust - #10919

Merged
nmattia merged 2 commits into
masterfrom
nm-drop-rules-rust-strip-patch
Jul 27, 2026
Merged

chore: update rules_rust#10919
nmattia merged 2 commits into
masterfrom
nm-drop-rules-rust-strip-patch

Conversation

@nmattia

@nmattia nmattia commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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

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
@github-actions github-actions Bot added the chore label Jul 27, 2026
Comment thread bazel/rust.MODULE.bazel Outdated
@nmattia
nmattia marked this pull request as ready for review July 27, 2026 13:40
@nmattia
nmattia requested a review from a team as a code owner July 27, 2026 13:40
@github-actions github-actions Bot added the @idx label Jul 27, 2026
Comment thread bazel/rust.MODULE.bazel Outdated
@nmattia
nmattia added this pull request to the merge queue Jul 27, 2026
Merged via the queue into master with commit db7f145 Jul 27, 2026
37 checks passed
@nmattia
nmattia deleted the nm-drop-rules-rust-strip-patch branch July 27, 2026 14:33
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants