Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/actions/checkout-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Check out rust-lang/rust
description: >
Checks out the rust-lang/rust commit of the toolchain into `<path>/build/rust`, where y.sh runs
the rustc tests. Unlike the anonymous full clone y.sh would do, this checkout is authenticated
and shallow, so GitHub does not rate-limit it.

inputs:
path:
description: The cg_gcc directory.
default: .

runs:
using: composite
steps:
- id: toolchain
shell: bash
working-directory: ${{ inputs.path }}
run: |
commit="$(rustc -vV | sed -n 's/^commit-hash: //p')"
if [ -z "$commit" ]; then
echo "::error::could not find the commit of the toolchain"
exit 1
fi
echo "commit=$commit" >> "$GITHUB_OUTPUT"

- uses: actions/checkout@v7
with:
repository: rust-lang/rust
ref: ${{ steps.toolchain.outputs.commit }}
path: ${{ inputs.path }}/build/rust
persist-credentials: false
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ jobs:
if: ${{ matrix.libgccjit_version.gcc == 'gcc-15-without-int128' }}
run: cat tests/failing-ui-tests-without-128bit-integers.txt >> tests/failing-ui-tests.txt

- name: Check out rust-lang/rust
if: ${{ contains(matrix.commands, '-rustc') }}
uses: ./.github/actions/checkout-rust

- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot --no-builtins-tests ${{ matrix.commands }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ jobs:
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
run: ./y.sh prepare

- name: Check out rust-lang/rust
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
uses: ./.github/actions/checkout-rust

- name: Run tests
# FIXME: re-enable those tests for libgccjit 12.
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:
- name: Add more failing tests (some panic and debuginfo tests fail)
run: cat tests/failing-lto-tests.txt >> tests/failing-ui-tests.txt

- name: Check out rust-lang/rust
uses: ./.github/actions/checkout-rust

- name: Run tests
run: |
# FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros.
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/rustup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ jobs:
git config --global user.name "User"
./y.sh prepare

- name: Check out rust-lang/rust
if: ${{ contains(matrix.commands, '-rustc') }}
uses: ./.github/actions/checkout-rust
with:
path: rust/compiler/rustc_codegen_gcc

- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot --no-builtins-tests ${{ matrix.commands }}
Expand Down Expand Up @@ -252,6 +258,11 @@ jobs:
git config --global user.name "User"
./y.sh prepare

- name: Check out rust-lang/rust
uses: ./.github/actions/checkout-rust
with:
path: rust/compiler/rustc_codegen_gcc

- name: Run tests
run: |
# Without this, `tee` masks the exit status of `y.sh test`.
Expand Down
17 changes: 16 additions & 1 deletion build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,18 +559,33 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
let _ = git_clone("https://github.com/rust-lang/rust.git", Some(&rust_dir_path), false);
let rust_dir: Option<&Path> = Some(&rust_dir_path);
run_command(&[&"git", &"checkout", &"--", &"tests/"], rust_dir)?;
run_command_with_output_and_env(&[&"git", &"fetch"], rust_dir, Some(env))?;
let rustc_commit = match rustc_version_info(env.get("RUSTC").map(|s| s.as_str()))?.commit_hash {
Some(commit_hash) => commit_hash,
None => return Err("Couldn't retrieve rustc commit hash".to_string()),
};
if rustc_commit != "unknown" {
// GitHub rate-limits a fetch right after a full clone, so only fetch a missing commit.
let commit_object = format!("{rustc_commit}^{{commit}}");
let has_commit = run_command_with_output_and_env_no_err(
&[&"git", &"rev-parse", &"--quiet", &"--verify", &commit_object],
rust_dir,
Some(env),
)
.is_ok();
if !has_commit {
run_command_with_output_and_env(
&[&"git", &"fetch", &"origin", &rustc_commit],
rust_dir,
Some(env),
)?;
}
run_command_with_output_and_env(
&[&"git", &"checkout", &rustc_commit],
rust_dir,
Some(env),
)?;
} else {
run_command_with_output_and_env(&[&"git", &"fetch"], rust_dir, Some(env))?;
run_command_with_output_and_env(&[&"git", &"checkout"], rust_dir, Some(env))?;
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2026-10-24"
channel = "nightly-2026-10-26"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]
Loading