Use current Rust in SourceHut CI

ober

91e33ae25b6f0f140a7332def40bfd9d0034275d

diff --git a/.build.yml b/.build.yml
index fcd0a30..8ff03e1 100644
--- a/.build.yml
+++ b/.build.yml
@@ -14,11 +14,7 @@ packages:
   - uuid-dev
   - liblz4-dev
   - zlib1g-dev
-  # Rust toolchain for the vendored adblock-rust-ffi staticlib (cmake runs
-  # `cargo build --release`, linked into libjerboa_browser). Cargo.lock pins the
-  # deps; if bookworm's rustc is ever too old, switch this to a rustup install.
-  - cargo
-  - rustc
+  - curl
 sources:
   - https://git.sr.ht/~lisp/jerboa-browser
   # Chez Scheme is vendored in the jerboa repo (vendor/ChezScheme); cloned so CI
@@ -60,6 +56,14 @@ tasks:
       SCHEME="$(command -v scheme)" "$J" pkg pack --output "$PWD/jerboa-browser-0.1.0.jpkg"
       SCHEME="$(command -v scheme)" "$J" pkg verify "$PWD/jerboa-browser-0.1.0.jpkg"
       SCHEME="$(command -v scheme)" "$J" pkg verify --reproduce
+  - setup-rust: |
+      # Build tasks need a current Rust toolchain for vendored crates using
+      # language features newer than Debian bookworm's packaged rustc.
+      if [ ! -x "$HOME/.cargo/bin/cargo" ]; then
+        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
+          | sh -s -- -y --profile minimal --default-toolchain stable
+      fi
+      echo 'source "$HOME/.cargo/env"' >> ~/.buildenv
   - build: |
       cd jerboa-browser
       qmake6 --version || true
@@ -71,10 +75,11 @@ tasks:
       # The interpreter test suites load (std crypto native-rust); build its
       # cdylib once into jerbuild's cache so they can dlopen it. The compiled
       # binary links these symbols statically (built above) and needs none. The
-      # bundled crate's Cargo.lock is v4, which bookworm's cargo can't parse, so
-      # use a current toolchain via rustup.
-      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
-        | sh -s -- -y --profile minimal --default-toolchain stable
+      # bundled crate's Cargo.lock is v4, so keep using the rustup toolchain.
+      if [ ! -x "$HOME/.cargo/bin/cargo" ]; then
+        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
+          | sh -s -- -y --profile minimal --default-toolchain stable
+      fi
       export PATH="$HOME/.cargo/bin:$PATH"
       JH="$(jerbuild --jerboa-home)"
       # The crypto FFI exports (jerboa_sha*, _aead_*, _hmac_*, …) are behind the