File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Supply-chain cooldown for dependency resolution (unstable min-publish-age,
2+ # tracking issue rust-lang/cargo#17009): crate versions published less than
3+ # 14 days ago are excluded when the resolver runs on a nightly cargo.
4+ # Stable cargo ignores these tables silently, so builds from the committed
5+ # Cargo.lock are unaffected; run `just update` to resolve under the policy.
6+ # When the feature stabilizes, drop the [unstable] table and the nightly
7+ # resolver pin in the justfile: the policy then binds all resolution.
8+ # The fmt nightly (older than the feature) prints an unused-key warning
9+ # for these tables; harmless.
10+ [unstable ]
11+ min-publish-age = true
12+
13+ [registry ]
14+ global-min-publish-age = " 14 days"
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ jobs:
2424 key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2525
2626 - name : Install Rust toolchain
27- uses : dtolnay/rust-toolchain@master
27+ uses : dtolnay/rust-toolchain@6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 # v1
2828 with :
2929 toolchain : nightly-2026-01-01
30- components : clippy, rustfmt
30+ components : rustfmt
3131
3232 - name : Install protoc
3333 run : sudo provisioning/protoc.sh
4141 run : echo "$HOME/.cargo/bin" >> $GITHUB_PATH
4242
4343 - name : Check compilation
44- run : cargo check
44+ run : cargo check --locked
4545
4646 - name : Check formatting
4747 run : just fmt-check
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ jobs:
207207 ${{ runner.os }}-cargo-build-
208208
209209 - name : Build binary (Darwin)
210- run : cargo build --release --target ${{ matrix.target }} --bin ${{ matrix.name }}
210+ run : cargo build --locked -- release --target ${{ matrix.target }} --bin ${{ matrix.name }}
211211
212212 - name : Package binary (Darwin)
213213 run : |
Original file line number Diff line number Diff line change 2222 - uses : taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
2323 with :
2424 tool : cargo-audit
25- - run : cargo audit
25+ - run : cargo audit
26+ # Stable cargo ignores the publish-age policy, so the lockfile can pin
27+ # too-young crates (or deliberately via `just update-allow`); surface them.
28+ - name : Check lockfile against the publish-age cooldown
29+ run : |
30+ if ! rustup toolchain install nightly-2026-06-21 --profile minimal; then
31+ echo "::warning title=Publish-age cooldown check skipped::toolchain install failed"
32+ exit 0
33+ fi
34+ if ! cargo +nightly-2026-06-21 update --dry-run -Z min-publish-age > cooldown.txt 2>&1; then
35+ msg=$(head -20 cooldown.txt | sed ':a;N;$!ba;s/\n/%0A/g') # %0A = newline in annotations
36+ echo "::warning title=Publish-age cooldown probe failed::$msg"
37+ exit 0
38+ fi
39+ hits=$(grep -E "Downgrading|is too new" cooldown.txt || true)
40+ if [ -n "$hits" ]; then
41+ count=$(echo "$hits" | wc -l)
42+ msg=$(echo "$hits" | head -20 | sed ':a;N;$!ba;s/\n/%0A/g')
43+ echo "::warning title=Lockfile pins $count crate(s) younger than the publish-age cooldown::$msg"
44+ fi
You can’t perform that action at this time.
0 commit comments