Repository navigation
chore(deps): move the in-repo proc macros to syn 3 and darling 0.24, drop educe and secp256k1 - #12222
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The libfuzzer-sys initialization change needs confirmation that Bazel’s Run Fuzzers CI job passes, as the 11 AFL targets lack successful local linking and reported CI build/run results.
No open issues 🎉
What changed in this PR
Updates the IC’s in-repository procedural macros to syn 3 and darling 0.24, following the dependency refresh in #12177. It also removes unused direct dependencies and aligns Bazel’s libfuzzer-sys version with Cargo.
Changes:
- Upgrade macro dependencies and adapt function destructuring to syn 3.
- Replace educe with an equivalent manual
Debugimplementation and remove unused direct secp256k1 dependencies. - Update Bazel to libfuzzer-sys 0.4.13 and adjust the sandbox callback’s safety signature.
| File | Description |
|---|---|
rs/tla_instrumentation/tla_instrumentation_proc_macros/src/lib.rs |
Adapt three function patterns to syn 3. |
rs/test_utilities/privileges/macros/src/lib.rs |
Adapt function destructuring to syn 3. |
rs/execution_environment/fuzz/src/lib.rs |
Accept the updated unsafe libfuzzer callback. |
rs/crypto/internal/crypto_service_provider/src/vault/remote_csp_vault/codec.rs |
Replace educe with a bound-free manual Debug implementation. |
rs/crypto/internal/crypto_service_provider/Cargo.toml |
Remove the direct educe dependency. |
rs/crypto/internal/crypto_service_provider/BUILD.bazel |
Remove educe from library and test dependencies. |
rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/Cargo.toml |
Remove the unused direct secp256k1 dependency. |
rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/test_utils/BUILD.bazel |
Remove the corresponding Bazel dependency. |
packages/ic-secp256k1/Cargo.toml |
Remove the unused secp256k1 dev-dependency. |
Cargo.toml |
Update workspace requirements and remove direct secp256k1. |
Cargo.lock |
Update macro dependency edges and remove unused direct edges. |
Cargo.Bazel.toml.lock |
Update dependency edges and lock libfuzzer-sys 0.4.13. |
Cargo.Bazel.json.lock |
Regenerate Bazel dependency metadata and feature selections. |
bazel/rust.MODULE.bazel |
Align dependency specifications and remove unused direct entries. |
Review effort: Balanced
|
✅ No security or compliance issues detected. Reviewed 1 of 6 changed files (5 skipped) up to 8f190fd. Security Overview
Detected Code Changes
|
pierugo-dfinity
left a comment
There was a problem hiding this comment.
Not easy to parse the PR description, but looks good I guess
…0.24
The workspace syn requirement moves from 2.0.110 to 3.0.10 and darling
from 0.20.11 to 0.24.1, in Cargo.toml and in the Bazel crate specs. Both
versions were already locked for third-party proc macros, so no package
version changes; only the in-repo crates' dependency edges move.
syn 3 adds a non-exhaustive `modifiers` field to `ItemFn`, so the four
`let ItemFn { .. }` patterns in the privileges and TLA macros end in `..`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…duce `educe` was used once, to derive `Debug` for the remote CSP vault's `Bincode` codec with both fields ignored. The hand-written impl prints the same `Bincode` and, like educe's, puts no `Debug` bounds on the type parameters. It sits at the end of the module, after the other impls, as educe's macro-generated impl did, so the other impls keep their symbol names. The crate-local `educe = "0.5"` dependency, its Bazel crate spec and the two `proc_macro_deps` entries go. educe 0.5.11 stays locked as a dependency of tokio-serde. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ic-secp256k1's dev-dependencies and the tSchnorr test utilities declared secp256k1 0.29 directly, but their code only uses the bitcoin crate's re-export, `bitcoin::secp256k1`. The direct dependency, its workspace entry and its Bazel crate spec go. secp256k1 0.29.100 stays locked as a dependency of the bitcoin-dogecoin fork. Bazel unifies features across the workspace, so its build of secp256k1 0.29.100 loses the `default` and `global-context` features that came from the dropped spec. `default` only enables `std`, which the fork still enables, and nothing uses the global context. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cargo already locks libfuzzer-sys 0.4.13, while Bazel was held at 0.4.7. Since 0.4.8, `libfuzzer_sys::test_input_wrap` is an `unsafe fn`, so the execution-environment fuzzer sandbox now declares `LLVMFuzzerRunDriver`'s callback as `unsafe fn`. The call already sits inside an `unsafe` block. The requirement floor moves to 0.4.13 in both manifests, so a plain repin releases the hold without moving unrelated dependency edges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`codec` is a private module and nothing formats a `Bincode` codec, so the `Debug` impl that replaced educe's derive is not needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3f01afb to
8f190fd
Compare
There was a problem hiding this comment.
🔵 Needs a closer look
The syn/darling migration spans 12 proc-macro crates, including production code generation, and needs owner confirmation of generated-code and binary parity plus Cargo/Bazel validation that could not be independently reproduced here.
No open issues 🎉
Review effort: Balanced
Moves the IC's own proc-macro crates to syn 3 and darling 0.24, which #12177 allowed. It also drops the direct
educeandsecp256k1dependencies, and updates Bazel's libfuzzer-sys to Cargo's 0.4.13.Changes
modifiersfield toItemFn, so the fourlet ItemFn { attrs, vis, sig, block } = ...patterns in the privileges and TLA macros now end in...educedependency. Its only use derivedDebugfor the remote CSP vault'sBincodecodec, which nothing formats (codecis a private module), so that impl goes too. educe 0.5.11 stays locked throughtokio-serde.secp256k10.29 dependency ofic-secp256k1(a dev-dependency) and of the canister threshold-sig test utilities (canister_threshold_sig/test_utils). Both only use thebitcoin::secp256k1re-export. secp256k1 0.29.100 stays locked through the bitcoin fork, and Bazel now builds it without the unuseddefaultandglobal-contextfeatures.test_input_wrapis anunsafe fn, so//rs/execution_environment/fuzz:fuzzer_sandboxnow declares itsLLVMFuzzerRunDrivercallback asunsafe fn(...). Both manifests raise the floor to 0.4.13.Behaviour changes
debug!calls now record source line numbers 5 lower, becausecodec.rslost five educe lines above them. The client's two calls are in the binaries that create aCryptoComponent, for examplereplicaandorchestrator. The server's two are inic-crypto-csp. Inreplicaandic-crypto-csp, nothing else in the machine code differs.ic-btc-adapterandpocket-ic-server: 40 fewer bytes of exception-handling tables, because secp256k1 loses those features. All functions are otherwise the same.ic-adminare byte-identical.The in-repo source of the published
canlog_derivenow builds with syn 3 and darling 0.24 and generates the same code. Nothing has to be released now. A release needs a newcanlog_deriveversion and acanlogrelease that raises its=0.1.0pin.FYI @dfinity/defi (
ic-btc-adapter,canlog) and @dfinity/core-protocol (replica,orchestrator,ic-crypto-csp,pocket-ic-server).🤖 Generated with Claude Code