Move to stable rust while preserving git dependency network optimization
Context
We historically relied on nightly Rust mainly for -Zgit=shallow-deps to reduce network/disk usage when resolving git dependencies (especially duniter-polkadot-sdk).
We want to:
- move to stable Rust (
1.88.0) for CI/developer consistency, - keep equivalent practical network optimization for our large git dependency workflow.
Goal
Replace nightly-only git fetch optimization with a stable-compatible approach that keeps CI bandwidth usage low and reproducibility high.
How
1) Stable Rust alignment across toolchain/CI/srtool
-
rust-toolchain.tomlswitched tochannel = "1.88.0". - GitLab CI image centralized via variable:
-
CI_UNIFIED_IMAGE=paritytech/ci-unified:bullseye-1.88.0.
-
- Add
toolchain_sync_checkjob independenciesstage. - Add script:
scripts/check_toolchain_sync.sh
- Check enforces:
-
rust-toolchain.tomlversion == CI image suffix version, - CI runtime
rustcversion == same version, - srtool image version in release xtask files == same version.
-
2) Remove nightly-only -Zgit=shallow-deps
Remove from:
.gitlab-ci.yml-
.cargo/config.tomlaliases -
xtaskclient build paths (build_deb,build_rpm,build_raw_specs) docker/Dockerfiledocker/build-deb.Dockerfile- related docs references
3) Replace vendor-package strategy with local SDK mirror strategy
Instead of publishing vendor packages per fingerprint, we should:
- prepare a local bare mirror of
duniter-polkadot-sdkin adependenciesstage beforequality, - pass mirror as pipeline artifact,
- run cargo with git URL rewrite to local mirror in downstream jobs.
4) Branch source-of-truth and shallow policy
- SDK branch is read from root
Cargo.toml - A script fetches SDK branch with
--depth 1. - Script validates:
-
Cargo.lockuses same SDK branch asCargo.toml(if lock has branch query), - locked SDK commit equals current branch tip commit.
-
- This enforces “project must always track latest commit of maintained SDK branch”.
5) Apply same optimization pattern to Docker builds
Docker builds should prepare local SDK mirror + route cargo through wrapper (same pattern as CI).
Why this approach
- Keeps stable Rust as default everywhere.
- Removes nightly-only feature dependency.
- Maintains practical low-bandwidth git dependency resolution for our largest git source.
- Keeps branch/version consistency explicit and enforced.
Expected impact
- CI/builds should continue to be network-efficient for
duniter-polkadot-sdk. - Toolchain drift should fail fast in
dependenciesstage. - Pipelines should be more reproducible and easier to operate on stable Rust.
Edited by Éloïs