Skip to content

Commit 08f4ca7

Browse files
committed
Rust: Preinstall extractor toolchain in tests
Install Rust 1.97.0 before parallel integration and QL tests start, avoiding concurrent rustup auto-installation races. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 28cef7d1-ef57-48e7-aba0-e63e74f97d92
1 parent 73f18b5 commit 08f4ca7

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

rust/ql/integration-tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
import tomllib
66

77

8+
def pytest_configure(config):
9+
# Install before xdist starts its workers to avoid concurrent rustup downloads.
10+
if not hasattr(config, "workerinput"):
11+
commands.run(
12+
"rustup toolchain install 1.97.0 --profile minimal --component rust-src"
13+
)
14+
15+
816
@pytest.fixture(params=[2018, 2021, 2024])
917
def rust_edition(request):
1018
return request.param

rust/ql/test/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ set -euo pipefail
88

99
# no need to install rust-src explicitly, it's listed in both toolchains
1010
cd "$(dirname "$0")"
11+
# toolchain forced by the extractor for rust-analyzer compatibility
12+
rustup toolchain install 1.97.0 --profile minimal --component rust-src
1113
pushd ../../extractor/src/nightly-toolchain
1214
rustup install
1315
popd

0 commit comments

Comments
 (0)