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:

  1. move to stable Rust (1.88.0) for CI/developer consistency,
  2. 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.toml switched to channel = "1.88.0".
  • GitLab CI image centralized via variable:
    • CI_UNIFIED_IMAGE=paritytech/ci-unified:bullseye-1.88.0.
  • Add toolchain_sync_check job in dependencies stage.
  • Add script:
    • scripts/check_toolchain_sync.sh
  • Check enforces:
    • rust-toolchain.toml version == CI image suffix version,
    • CI runtime rustc version == 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.toml aliases
  • xtask client build paths (build_deb, build_rpm, build_raw_specs)
  • docker/Dockerfile
  • docker/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-sdk in a dependencies stage before quality,
  • 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.lock uses same SDK branch as Cargo.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 dependencies stage.
  • Pipelines should be more reproducible and easier to operate on stable Rust.
Edited by Éloïs