Skip to content

chore: update repo to use ic-agent 0.45 and resolve conflicts from cargo update#8816

Draft
shilingwang wants to merge 17 commits intomasterfrom
shiling/new-update
Draft

chore: update repo to use ic-agent 0.45 and resolve conflicts from cargo update#8816
shilingwang wants to merge 17 commits intomasterfrom
shiling/new-update

Conversation

@shilingwang
Copy link

Summary

This PR fixes all compilation errors introduced by running cargo update, which updated several dependencies to newer versions with breaking API changes.

Changes

1. proptest (pinned to =1.6.0)

  • Issue: proptest 1.10.0 uses rand 0.9.x, incompatible with our rand_chacha 0.3.1 (which uses rand 0.8.x)
  • Fix: Pinned proptest to exactly version 1.6.0 in workspace Cargo.toml

2. slog (deprecated macro)

  • Issue: slog_o! macro deprecated in favor of slog::o!()
  • Fixed in: 2 files (state_tool/commands.rs, embedders/bin/instrument_wasm.rs)

3. assert_cmd (deprecated API)

  • Issue: Command::cargo_bin() deprecated in favor of cargo_bin_cmd! macro
  • Fixed in: 2 files (fstrim_tool tests, replica tests)

4. ic-agent (v0.40.1 → v0.45.0)

  • BasicIdentity::from_pem() now requires bytes directly, not file handles or cursors (4 files)
  • AgentError::TransportError now wraps TransportError::Reqwest(e) (1 file)
  • HttpService trait signature changed: added size_limit parameter and changed types to http::Request<Bytes> (1 file)

5. wirm (v2.1.0 → v2.2.0)

  • Instructions::new() now requires 3 parameters: vec with offset tuples, locals_start, save_offsets (2 files, 4 occurrences)
  • Module::parse() now requires 3 parameters, added with_offsets: bool (6 files, 9 occurrences)

6. nix (v0.29.0)

  • Issue: Pid and kill now require feature flags
  • Fix: Added features = ["process", "signal"] to pocket_ic_server/Cargo.toml

7. ic-utils (v0.40.1 → v0.45.0)

  • InstallMode deprecated → use CanisterInstallMode (2 files)
  • CanisterStatus deprecated → use CanisterStatusType (1 file)
  • take_canister_snapshot() signature changed, requires public crate types (1 file)

8. Missing dependencies

  • Added bytes and http to boundary_nodes tests Cargo.toml
  • Added ic-management-canister-types to consensus upgrade tests

9. Version conflicts

  • Fixed: nns-system-tests had ic-utils = "0.40.1" pinned → changed to { workspace = true }

Test Plan

All changes fix compilation errors. The code should build successfully after these changes.

Files Changed

Total: 28 files modified

  • 3 Cargo.toml files (dependencies)
  • 1 Cargo.lock (updated)
  • 24 source files (API adaptations)

This commit fixes all compilation errors introduced by running cargo update,
which updated several dependencies to newer versions with breaking API changes.

Key fixes:
- Pin proptest to =1.6.0 to avoid rand version conflicts
- Update slog_o! macro to slog::o!() (deprecated)
- Update assert_cmd Command::cargo_bin() to cargo_bin_cmd! macro
- Fix ic-agent API changes (BasicIdentity::from_pem, AgentError::TransportError, HttpService trait)
- Update wirm Instructions::new() and Module::parse() signatures
- Add nix feature flags for process and signal
- Update ic-utils deprecated types (InstallMode, CanisterStatus, take_canister_snapshot)
- Add missing dependencies (bytes, http, ic-management-canister-types)
- Fix version conflicts (ic-utils pinned version in nns-system-tests)

Total files modified: 28 files across 9 different dependency updates
@shilingwang shilingwang requested review from a team as code owners February 12, 2026 13:16
@github-actions github-actions bot added the chore label Feb 12, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@shilingwang shilingwang marked this pull request as draft February 12, 2026 13:20
shilingwang and others added 16 commits February 12, 2026 13:21
The cargo update brought in wirm 2.2.0 in Cargo.lock, but Cargo.toml
still specified 2.1.0. This caused Bazel to use the old version while
our code was fixed for the new API. Update Cargo.toml to match.
Per discussion, we don't want to update wirm at this time. This commit:
- Reverts Cargo.toml wirm version back to 2.1.0
- Reverts all wirm API changes (Instructions::new and Module::parse)
- Downgrades Cargo.lock to wirm 2.1.0

Files reverted:
- rs/embedders/src/wasm_utils/instrumentation.rs (3 changes)
- rs/embedders/src/wasm_utils/system_api_replacements.rs
- rs/embedders/src/wasm_utils/validation.rs
- rs/embedders/benches/embedders_bench/src/lib.rs
- rs/embedders/tests/instrumentation.rs (6 changes)
- rs/embedders/tests/misc_tests.rs (2 changes)
- rs/embedders/tests/spec_tests.rs
- rs/embedders/tests/wirm_round_trip.rs
Update rust.MODULE.bazel to match the dependency versions in Cargo.toml:
- ic-agent: ^0.40.1 → ^0.45.0
- ic-utils: ^0.40.1 → ^0.45.0
- ic-identity-hsm: ^0.40.1 → ^0.45.0
- ic-transport-types: ^0.40.1 → ^0.45.0
- dfx-core: ^0.1.4 → ^0.3.0
- ic-bn-lib: 0.1.7 → 0.1.14
- ic-gateway: rev → tag v0.4.0
- ic-http-gateway: rev c17ad1b... → rev 895d573...
- proptest: ^1.5.0 → =1.6.0

This ensures Bazel uses the same dependency versions as Cargo.
Regenerated Cargo.Bazel.json.lock and Cargo.Bazel.toml.lock to reflect
the updated dependency versions in rust.MODULE.bazel.
Updated Cargo.toml and rust.MODULE.bazel to use tag=v0.4.2 instead of
rev to match Cargo.lock. This eliminates the duplicate ic-http-gateway
entry that was causing the GitHub dependency submission job to fail.
Updated fqdn from 0.3.11 to 0.5.2 in pocket_ic_server to resolve
version conflict with ic-bn-lib 0.1.14, which requires fqdn 0.5.x.
This ensures all fqdn dependencies use version 0.5 or higher.
It's annoying for external contributors that CI is automatically kicked
off on pushes to master on the forked repos and then fail. This adds
another condition to prevent them from being triggered.

---------

Co-authored-by: Bas van Dijk <bas@dfinity.org>
…8790)

This makes it much easier to locate code that mutates a `CanisterState`
(simply grep for the 4 methods that return a `CanisterState` or a
mutable reference to one). Which comes in very handy when
`CanisterStates` are wrapped in `Arcs`, as mutating (too many of) said
`Arcs` may turn out to be very expensive.
- Updated ic-bn-lib-common version spec in bazel/rust.MODULE.bazel from 0.1 to 0.1.4
- Regenerated Bazel lock files to resolve fqdn version conflicts
- Updated test data file with latest Cargo.Bazel.toml.lock snapshot
- This ensures all fqdn dependencies use version 0.5.x as required by ic-bn-lib 0.1.14
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.

4 participants