Rust: fix parallel execution of tests using the nightly toolchain#19876
Merged
Rust: fix parallel execution of tests using the nightly toolchain#19876
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes the nightly toolchain definition and ensures rust-src is installed for parallel QL tests by updating the setup script and extractor logic.
- setup.sh now installs toolchains from a dedicated
nightly_toolchaindirectory instead of scanning multiple files. - qltest.rs uses
include_str!to write the nightly toolchain file instead of an inline constant. - Adds a standalone
rust-toolchain.tomlwith the nightly channel andrust-srccomponent.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rust/ql/test/setup.sh | Switches to a single install step using the nightly_toolchain dir |
| rust/extractor/src/qltest.rs | Replaces format!/const with include_str! for the toolchain file |
| rust/extractor/src/nightly_toolchain/rust-toolchain.toml | Defines the nightly channel and includes rust-src component |
Comments suppressed due to low confidence (1)
rust/ql/test/setup.sh:15
- Running
rustup installwithout a localrust-toolchain.tomlin this directory may fail or install an unintended default. Ensure it’s pointed at the intended toolchain file or run it from the correct directory.
rustup install
rust/ql/test/setup.sh
Outdated
| # We do this for each `rust-toolchain.toml` we use in the tests (and the root one in `rust` last, so it becomes the | ||
| # default). | ||
|
|
||
| # no to install rust-src explicitly, it's listed in the following toolchains |
There was a problem hiding this comment.
[nitpick] The comment has a typo and is unclear. Consider rephrasing to: # no need to install rust-src explicitly, it’s included in the nightly toolchain file.
Suggested change
| # no to install rust-src explicitly, it's listed in the following toolchains | |
| # no need to install rust-src explicitly, it’s included in the nightly toolchain file |
a497e8f to
ad20060
Compare
Since we dropped checked in toolchain files for tests requiring nightly, the `setup.sh` script was not doing its job of setting up the toolchains and the `rust-src` component, occasionally leading to test failures.
ad20060 to
1f66f90
Compare
aibaars
approved these changes
Jun 25, 2025
aibaars
approved these changes
Jun 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since we dropped checked in toolchain files for tests requiring nightly, the
setup.shscript was not doing its job of setting up the toolchains and therust-srccomponent, occasionally leading to test failures.