CI - Fix cargo-related errors (#4242)

# Description of Changes

CI is currently failing in a bunch of places since we tweaked the Rust
versions available in our CI runner, and it revealed that many of our
workflows don't set the default rust toolchain.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing

- [x] CI passes in this PR

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
This commit is contained in:
Zeke Foppa
2026-02-10 00:38:50 -08:00
committed by GitHub
parent d8fcc9255e
commit 7b0ec8a4c4
4 changed files with 42 additions and 14 deletions
+27
View File
@@ -280,6 +280,8 @@ jobs:
ref: ${{ env.GIT_REF }}
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
@@ -332,6 +334,8 @@ jobs:
uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- run: echo ::add-matcher::.github/workflows/rust_matcher.json
- name: Cache Rust dependencies
@@ -359,6 +363,8 @@ jobs:
- uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- run: echo ::add-matcher::.github/workflows/rust_matcher.json
- name: Cache Rust dependencies
@@ -379,6 +385,9 @@ jobs:
permissions: read-all
steps:
- uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Set up Python env
run: |
test -d venv || python3 -m venv venv
@@ -415,6 +424,8 @@ jobs:
- name: Install Rust
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Install rust target
run: rustup target add ${{ matrix.target }}
@@ -489,6 +500,8 @@ jobs:
with:
ref: ${{ env.GIT_REF }}
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Run Unreal Engine tests
working-directory: sdks/unreal
env:
@@ -559,6 +572,8 @@ jobs:
ref: ${{ env.GIT_REF }}
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Check for docs change
run: cargo ci self-docs --check
@@ -611,6 +626,8 @@ jobs:
${{ runner.os }}-pnpm-store-
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
@@ -709,6 +726,8 @@ jobs:
- name: Install Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
@@ -735,6 +754,8 @@ jobs:
- name: Install SpacetimeDB CLI from the local checkout
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
cargo install --force --path crates/cli --locked --message-format=short
cargo install --force --path crates/standalone --locked --message-format=short
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
@@ -845,6 +866,8 @@ jobs:
- name: Install Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
@@ -877,6 +900,8 @@ jobs:
- name: Install SpacetimeDB CLI from the local checkout
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
cargo install --force --path crates/cli --locked --message-format=short
cargo install --force --path crates/standalone --locked --message-format=short
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
@@ -1062,6 +1087,8 @@ jobs:
ref: ${{ env.GIT_REF }}
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
+2
View File
@@ -41,6 +41,8 @@ jobs:
- name: Install Rust
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Install rust target
run: rustup target add ${{ matrix.target }}
+10 -14
View File
@@ -76,6 +76,8 @@ jobs:
- name: Install Rust toolchain
uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
@@ -99,29 +101,23 @@ jobs:
cargo clean -p v8 || true
cargo build -p v8
fi
if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
cargo clean --release -p v8 || true
cargo build --release -p v8
fi
- name: Install SpacetimeDB CLI from the local checkout
run: |
export CARGO_HOME="$HOME/.cargo"
echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
cargo install --force --path crates/cli --locked --message-format=short
cargo install --force --path crates/standalone --locked --message-format=short
# Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
rm -f $CARGO_HOME/bin/spacetime
ln -s $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
# Clear any existing information
spacetime server clear -y
# This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
# This may be due to reusing CARGO_TARGET_DIR while mixing different build strategies (`cargo install` and `cargo build -p`).
# However, this fix seems to work.
- name: Check v8 outputs
run: |
find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
cargo clean -p v8 || true
cargo build -p v8
fi
- name: Generate client bindings
working-directory: templates/chat-react-ts
run: |
@@ -12,6 +12,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: dsherret/rust-toolchain-file@v1
- name: Set default rust toolchain
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
# pnpm is required for regenerating the typescript bindings
- name: Set up Node.js
uses: actions/setup-node@v4