Skip to content

Commit d027a5e

Browse files
committed
Rust: Preinstall extractor toolchain in tests
Install the fixed toolchain used by the extractor before parallel integration and QL tests start. This avoids concurrent rustup auto-installation races.
1 parent d9417a3 commit d027a5e

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

rust/ql/integration-tests/conftest.py

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

77

8+
def pytest_configure(config):
9+
# Install the fixed toolchain used by the extractor before xdist starts its
10+
# workers to avoid concurrent rustup downloads. The version here should
11+
# match `FIXED_RUST_TOOLCHAIN`.
12+
if not hasattr(config, "workerinput"):
13+
commands.run(
14+
"rustup toolchain install 1.97.0 --profile minimal --component rust-src"
15+
)
16+
17+
818
@pytest.fixture(params=[2018, 2021, 2024])
919
def rust_edition(request):
1020
return request.param

rust/ql/test/setup.sh

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

99
# no need to install rust-src explicitly, it's listed in both toolchains
1010
cd "$(dirname "$0")"
11+
# Install the fixed toolchain used by the extractor. The version here should
12+
# match `FIXED_RUST_TOOLCHAIN`.
13+
rustup toolchain install 1.97.0 --profile minimal --component rust-src
1114
pushd ../../extractor/src/nightly-toolchain
1215
rustup install
1316
popd

0 commit comments

Comments
 (0)