Skip to content

Add CI job for running Cargo tests with the stable toolchain - #166238

Draft
Kobzol wants to merge 2 commits into
rust-lang:mainfrom
Kobzol:cargo-stable-tests
Draft

Kobzol wants to merge 2 commits into
rust-lang:mainfrom
Kobzol:cargo-stable-tests

Conversation

@Kobzol

@Kobzol Kobzol commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

This is one of the pre-requisites that the Cargo team wants to have before moving the Cargo repo from a git submodule to a Josh subtree.

try-job: test-x86_64-cargo-stable

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Nov 20, 2026
@Kobzol

Kobzol commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=test-x86_64-cargo-stable

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 20, 2026
Add CI job for running Cargo tests with the stable toolchain


try-job: test-x86_64-cargo-stable
@rust-bors

rust-bors Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

💔 Test for f3e518e failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@weihanglo weihanglo left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant, why not? Let's see whether it would make compiler contributors' life better or worse 😬

View changes since this review

RUSTDOC=$(rustup +"${TOOLCHAIN}" which rustdoc)

# Run Cargo tests with the given toolchain
../x test cargo --set build.rustc="${RUSTC}" --set build.rustdoc="${RUSTDOC}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this set RUSTC_BOOTSTRAP=1 or not? If you remembered, there is some nuance when it is on and off in cargo test suite .

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bootstrap seems to pass it at the moment, yes. But I'm actually thinking of running the tests completely outside of bootstrap, because there are some complications there with overriding the rustc toolchain.

Would it be enough for t-cargo if we just executed cargo +stable test in the src/tool/cargo directory?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, maybe beta as well but we can do stable first.

There are some container tests and nightly only tests only enabled bases on certain env vars, not sure if we want to go that far in this PR, maybe yes? (though might need some m cargo test support tweak)

https://github.com/rust-lang/cargo/blob/ae8f06eb41b8c4a534d0f280f1b9d287f45ead73/.github/workflows/main.yml#L239

and we might want to run cargo test --workspace --exclude benchsuite --exclude resolver-tests

@Kobzol

Kobzol commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Add CI job for running Cargo tests with the stable toolchain

try-job: test-x86_64-cargo-stable
@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 0988960 failed: CI. Failed job:

@Kobzol
Kobzol force-pushed the cargo-stable-tests branch from cb3f63c to 6fbca12 Compare November 23, 2026 14:25
@Kobzol

Kobzol commented Nov 23, 2026

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 23, 2026
Add CI job for running Cargo tests with the stable toolchain

try-job: test-x86_64-cargo-stable
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

💔 Test for b9cf0d8 failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-cargo-stable failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
# 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
#!/bin/sh

# ignore-tidy-file-linelength

set -ex

@rust-bors

rust-bors Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #166456) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants