Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

ci: key the Rust cargo cache on the toolchain that built it (#10568)

Chris Lu50464702d2d2
diff --git a/.github/workflows/rust-volume-server-tests.yml b/.github/workflows/rust-volume-server-tests.yml
index 2ed2e90c23..7626fd93a8 100644
--- a/.github/workflows/rust-volume-server-tests.yml
+++ b/.github/workflows/rust-volume-server-tests.yml
@@ -42,6 +42,12 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
+ # cargo tracks its own inputs but not the runner's C toolchain, so a cached
+ # target/ can carry C objects built against a different glibc than we link against.
+ - name: Fingerprint build toolchain
+ id: toolchain
+ run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
+
- name: Cache cargo registry and target
uses: actions/cache@v6
with:
@@ -49,9 +55,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
seaweed-volume/target
- key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
+ key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
restore-keys: |
- rust-
+ rust-${{ steps.toolchain.outputs.fingerprint }}-
- name: Build Rust volume server
run: cd seaweed-volume && cargo build --release
@@ -79,6 +85,12 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
+ # cargo tracks its own inputs but not the runner's C toolchain, so a cached
+ # target/ can carry C objects built against a different glibc than we link against.
+ - name: Fingerprint build toolchain
+ id: toolchain
+ run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
+
- name: Cache cargo registry and target
uses: actions/cache@v6
with:
@@ -86,9 +98,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
seaweed-volume/target
- key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
+ key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
restore-keys: |
- rust-
+ rust-${{ steps.toolchain.outputs.fingerprint }}-
- name: Build Go weed binary
run: |
@@ -155,6 +167,12 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
+ # cargo tracks its own inputs but not the runner's C toolchain, so a cached
+ # target/ can carry C objects built against a different glibc than we link against.
+ - name: Fingerprint build toolchain
+ id: toolchain
+ run: echo "fingerprint=$(getconf GNU_LIBC_VERSION | tr ' ' '-')-rustc-$(rustc -V | awk '{print $2}')" >> "$GITHUB_OUTPUT"
+
- name: Cache cargo registry and target
uses: actions/cache@v6
with:
@@ -162,9 +180,9 @@ jobs:
~/.cargo/registry
~/.cargo/git
seaweed-volume/target
- key: rust-${{ hashFiles('seaweed-volume/Cargo.lock') }}
+ key: rust-${{ steps.toolchain.outputs.fingerprint }}-${{ hashFiles('seaweed-volume/Cargo.lock') }}
restore-keys: |
- rust-
+ rust-${{ steps.toolchain.outputs.fingerprint }}-
- name: Build Go weed binary
run: |