From de31c65d4a3798333fbfefe54e7393e71ca3d3f4 Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 2 Jul 2026 06:55:26 +0000 Subject: [PATCH 1/4] fix(ci): add lockfile-aware stale cache purge on ARM runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Self-hosted ARM runners keep target/ between runs. When Dependabot merges bump dependencies, stale .d dep-info files reference old crate hashes that no longer exist, causing cargo check/clippy/test to fail with "could not parse/generate dep info — No such file or directory." Add a purge step to all ARM jobs (check, clippy, test, integration-test) that detects Cargo.lock changes via sha256 hash comparison and selectively purges dep-info files, build script outputs, and fingerprints. Only triggers when deps actually changed — no-op on normal runs. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cb70a6..979f29a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,19 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 + - name: Purge stale dep-info on lockfile change + run: | + LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) + STORED_HASH="" + [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) + if [ "$LOCK_HASH" != "$STORED_HASH" ]; then + echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + mkdir -p target + echo "$LOCK_HASH" > target/.cargo-lock-hash + fi - run: cargo check clippy: @@ -84,6 +97,19 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 + - name: Purge stale dep-info on lockfile change + run: | + LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) + STORED_HASH="" + [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) + if [ "$LOCK_HASH" != "$STORED_HASH" ]; then + echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + mkdir -p target + echo "$LOCK_HASH" > target/.cargo-lock-hash + fi - run: cargo clippy -- -D warnings fmt: @@ -105,6 +131,19 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 + - name: Purge stale dep-info on lockfile change + run: | + LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) + STORED_HASH="" + [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) + if [ "$LOCK_HASH" != "$STORED_HASH" ]; then + echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + mkdir -p target + echo "$LOCK_HASH" > target/.cargo-lock-hash + fi - run: cargo test integration-test: @@ -130,6 +169,19 @@ jobs: with: shared-key: integration-test cache-all-crates: "true" + - name: Purge stale dep-info on lockfile change + run: | + LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) + STORED_HASH="" + [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) + if [ "$LOCK_HASH" != "$STORED_HASH" ]; then + echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + mkdir -p target + echo "$LOCK_HASH" > target/.cargo-lock-hash + fi - name: Build dk binary run: cargo build --release - name: Wait for dakera server From 866c313ccab72f6b3d6fdeb4fc24fe678787a4d5 Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 2 Jul 2026 07:04:16 +0000 Subject: [PATCH 2/4] fix(ci): unconditional registry+artifact purge on ARM runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The conditional lock-hash approach had a race: when multiple jobs share the same ARM runner, the first job updates the hash, and subsequent jobs skip the purge — but Swatinem/rust-cache may have restored stale state. Also, the dep-info purge alone isn't enough: registry source files (~/.cargo/registry/src/) can also be stale, causing aws-lc-sys build failures when cc-rs can't find .c source files. Fix: make purge unconditional and add registry source purge + cargo fetch. The overhead is ~3s per job (fast when .crate tarballs cached). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 72 ++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 979f29a..5cdfcc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,19 +71,13 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale dep-info on lockfile change + - name: Purge stale build artifacts and re-extract sources run: | - LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) - STORED_HASH="" - [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) - if [ "$LOCK_HASH" != "$STORED_HASH" ]; then - echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - mkdir -p target - echo "$LOCK_HASH" > target/.cargo-lock-hash - fi + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + rm -rf ~/.cargo/registry/src + cargo fetch --locked - run: cargo check clippy: @@ -97,19 +91,13 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale dep-info on lockfile change + - name: Purge stale build artifacts and re-extract sources run: | - LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) - STORED_HASH="" - [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) - if [ "$LOCK_HASH" != "$STORED_HASH" ]; then - echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - mkdir -p target - echo "$LOCK_HASH" > target/.cargo-lock-hash - fi + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + rm -rf ~/.cargo/registry/src + cargo fetch --locked - run: cargo clippy -- -D warnings fmt: @@ -131,19 +119,13 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale dep-info on lockfile change + - name: Purge stale build artifacts and re-extract sources run: | - LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) - STORED_HASH="" - [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) - if [ "$LOCK_HASH" != "$STORED_HASH" ]; then - echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - mkdir -p target - echo "$LOCK_HASH" > target/.cargo-lock-hash - fi + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + rm -rf ~/.cargo/registry/src + cargo fetch --locked - run: cargo test integration-test: @@ -169,19 +151,13 @@ jobs: with: shared-key: integration-test cache-all-crates: "true" - - name: Purge stale dep-info on lockfile change + - name: Purge stale build artifacts and re-extract sources run: | - LOCK_HASH=$(sha256sum Cargo.lock | cut -d' ' -f1) - STORED_HASH="" - [ -f target/.cargo-lock-hash ] && STORED_HASH=$(cat target/.cargo-lock-hash) - if [ "$LOCK_HASH" != "$STORED_HASH" ]; then - echo "::notice::Cargo.lock changed — purging stale dep-info and build artifacts" - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - mkdir -p target - echo "$LOCK_HASH" > target/.cargo-lock-hash - fi + find target -name '*.d' -delete 2>/dev/null || true + rm -rf target/debug/build target/release/build + rm -rf target/debug/.fingerprint target/release/.fingerprint + rm -rf ~/.cargo/registry/src + cargo fetch --locked - name: Build dk binary run: cargo build --release - name: Wait for dakera server From 8c70e42244fd5208c0d5cb6f3ee063e826f6e940 Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 2 Jul 2026 09:07:18 +0000 Subject: [PATCH 3/4] =?UTF-8?q?fix(ci):=20simplify=20ARM=20cache=20purge?= =?UTF-8?q?=20=E2=80=94=20rm=20-rf=20target/=20instead=20of=20selective=20?= =?UTF-8?q?delete?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2 approach (delete dep-info + registry/src + cargo fetch) was wrong: cargo fetch only downloads .crate archives, doesn't extract to registry/src/. This left aws-lc-sys assembly source files missing, causing cc1 fatal errors. The correct fix: just nuke target/ entirely. Stale dep-info files live in target/debug/deps/, and build script artifacts in target/debug/build/. Deleting the whole dir forces a clean rebuild without touching registry. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 36 ++++++++---------------------------- 1 file changed, 8 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cdfcc8..697bb89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,13 +71,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale build artifacts and re-extract sources - run: | - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - rm -rf ~/.cargo/registry/src - cargo fetch --locked + - name: Purge stale build artifacts + run: rm -rf target/ - run: cargo check clippy: @@ -91,13 +86,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale build artifacts and re-extract sources - run: | - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - rm -rf ~/.cargo/registry/src - cargo fetch --locked + - name: Purge stale build artifacts + run: rm -rf target/ - run: cargo clippy -- -D warnings fmt: @@ -119,13 +109,8 @@ jobs: - uses: Swatinem/rust-cache@v2 with: shared-key: arm64-ci-v2 - - name: Purge stale build artifacts and re-extract sources - run: | - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - rm -rf ~/.cargo/registry/src - cargo fetch --locked + - name: Purge stale build artifacts + run: rm -rf target/ - run: cargo test integration-test: @@ -151,13 +136,8 @@ jobs: with: shared-key: integration-test cache-all-crates: "true" - - name: Purge stale build artifacts and re-extract sources - run: | - find target -name '*.d' -delete 2>/dev/null || true - rm -rf target/debug/build target/release/build - rm -rf target/debug/.fingerprint target/release/.fingerprint - rm -rf ~/.cargo/registry/src - cargo fetch --locked + - name: Purge stale build artifacts + run: rm -rf target/ - name: Build dk binary run: cargo build --release - name: Wait for dakera server From a3006302f95a0ddf0720bf8f9864b3b9943ab0df Mon Sep 17 00:00:00 2001 From: Dakera Ops Date: Thu, 2 Jul 2026 10:25:34 +0000 Subject: [PATCH 4/4] fix(ci): serialize integration test after ARM compile jobs to avoid CARGO_HOME race Concurrent ARM jobs (check/clippy/test) race on shared ~/.cargo/registry when extracting crates, causing 'could not compile futures-core' in integration-test. Adding needs:[check,clippy,fmt,test] ensures integration-test runs after all compile jobs finish, eliminating the race condition. Co-Authored-By: Paperclip --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 697bb89..824fd89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,7 @@ jobs: integration-test: name: Integration Test (Container) + needs: [check, clippy, fmt, test] runs-on: [self-hosted, linux, arm64] services: dakera: