Skip to content
Draft
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
9 changes: 9 additions & 0 deletions src/ci/citool/src/jobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ pub struct Job {
pub free_disk: Option<bool>,
/// Documentation link to a resource that could help people debug this CI job.
pub doc_url: Option<String>,
/// Keep rustup installed in the CI environment of this job.
/// Normally, rustup is uninstalled at the start of the job.
pub keep_rustup: Option<bool>,
/// Whether the job is executed on AWS CodeBuild.
pub codebuild: Option<bool>,
/// Which Python version (if any) is required. On Windows, this is typically required to run
Expand Down Expand Up @@ -170,6 +173,7 @@ fn validate_job_database(db: &JobDatabase) -> anyhow::Result<()> {
only_on_channel,
free_disk,
doc_url,
keep_rustup,
codebuild,
required_python_version,

Expand All @@ -184,6 +188,7 @@ fn validate_job_database(db: &JobDatabase) -> anyhow::Result<()> {
&& *free_disk == auto_job.free_disk
&& *doc_url == auto_job.doc_url
&& *codebuild == auto_job.codebuild
&& *keep_rustup == auto_job.keep_rustup
&& *required_python_version == auto_job.required_python_version
{
Ok(())
Expand Down Expand Up @@ -360,6 +365,10 @@ fn calculate_jobs(
env.extend(crate::yaml_map_to_json(&job.env));
let full_name = format!("{prefix} - {}", job.name);

if job.keep_rustup.unwrap_or(false) {
env.insert("KEEP_RUSTUP_INSTALLED".to_string(), "1".into());
}

// When the default `@bors try` job is executed (which is usually done
// for benchmarking performance, running crater or for downloading the
// built toolchain using `rustup-toolchain-install-master`),
Expand Down
23 changes: 23 additions & 0 deletions src/ci/docker/host-x86_64/test-x86_64-cargo-stable/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ubuntu:26.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
make \
file \
curl \
ca-certificates \
python3 \
git \
cmake \
libssl-dev \
pkg-config \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY /scripts/cargo-stable-tests.sh /tmp/cargo-stable-tests.sh
ENV SCRIPT="bash /tmp/cargo-stable-tests.sh"
1 change: 1 addition & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ docker \
--env PR_CI_JOB \
--env OBJDIR_ON_HOST="$objdir" \
--env CODEGEN_BACKENDS \
--env KEEP_RUSTUP_INSTALLED \
--env LLVM_VERSION \
--env DISABLE_CI_RUSTC_IF_INCOMPATIBLE="$DISABLE_CI_RUSTC_IF_INCOMPATIBLE" \
--init \
Expand Down
14 changes: 14 additions & 0 deletions src/ci/docker/scripts/cargo-stable-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -eux

# Run Cargo tests using the stable Rust compiler

TOOLCHAIN=stable

rustup install --no-self-update "${TOOLCHAIN}"

# We run Cargo tests directly, because we need to override the compiler used by Cargo's tests
# to stable. That would be non-trivial with the way bootstrap is currently set up.
cd src/tools/cargo || exit 1
cargo +${TOOLCHAIN} test --workspace --exclude benchsuite --exclude resolver-tests
5 changes: 5 additions & 0 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ auto:
doc_url: https://rustc-dev-guide.rust-lang.org/tests/rust-for-linux.html
<<: *job-linux-4c

# Runs Cargo tests with the stable compiler toolchain.
- name: test-x86_64-cargo-stable
keep_rustup: true
<<: *job-linux-4c

- name: test-x86_64-gnu
<<: *job-linux-4c

Expand Down
5 changes: 4 additions & 1 deletion src/ci/scripts/run-build-from-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ echo "::add-matcher::src/ci/github-actions/problem_matchers.json"
# Remove any preexisting rustup installation since it can interfere
# with the cargotest step and its auto-detection of things like Clippy in
# the environment
rustup self uninstall -y || true
if [[ "${KEEP_RUSTUP_INSTALLED-0}" -ne "1" ]]; then
rustup self uninstall -y || true
fi

if [ -z "${IMAGE+x}" ]; then
src/ci/run.sh
else
Expand Down
Loading