Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run-make -Zbuild-std tests fail on compiler_builtins on older branches #130634

Closed
cuviper opened this issue Sep 20, 2024 · 8 comments · Fixed by #130642
Closed

run-make -Zbuild-std tests fail on compiler_builtins on older branches #130634

cuviper opened this issue Sep 20, 2024 · 8 comments · Fixed by #130642
Labels
-Zbuild-std Unstable Cargo option: Compile the standard library yourself. A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.

Comments

@cuviper
Copy link
Member

cuviper commented Sep 20, 2024

I tried: merging backports on 1.82-beta (#130569)

I expected to see this happen: Test successful

Instead, this happened: The job dist-various-1 failed!

failures:
    [run-make] tests/run-make/compiler-builtins
    [run-make] tests/run-make/thumb-none-cortex-m

Both tests use -Zbuild-std and failed to build compiler_builtins v0.1.126:

error[E0433]: failed to resolve: could not find `naked_asm` in `arch`
##[error]  --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.126/src/arm.rs:26:21
   |
26 |         core::arch::naked_asm!(
   |                     ^^^^^^^^^ could not find `naked_asm` in `arch`

error[E0433]: failed to resolve: could not find `naked_asm` in `arch`
##[error]  --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.126/src/arm.rs:39:21
   |
39 |         core::arch::naked_asm!(
   |                     ^^^^^^^^^ could not find `naked_asm` in `arch`

error[E0433]: failed to resolve: could not find `naked_asm` in `arch`
##[error]  --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.126/src/arm.rs:54:21
   |
54 |         core::arch::naked_asm!(
   |                     ^^^^^^^^^ could not find `naked_asm` in `arch`

error[E0433]: failed to resolve: could not find `naked_asm` in `arch`
##[error]  --> /cargo/registry/src/index.crates.io-6f17d22bba15001f/compiler_builtins-0.1.126/src/arm.rs:66:21
   |
66 |         core::arch::naked_asm!(
   |                     ^^^^^^^^^ could not find `naked_asm` in `arch`

Note that beta's library/Cargo.lock only has compiler_builtins v0.1.123, so it appears cargo isn't heeding that with -Zbuild-std.

arch::naked_asm! was added in #130146 and started being used in rust-lang/compiler-builtins#686 for 0.1.126.

To unblock beta, I'm going to add //@ only-nightly to those tests, as suggested on my PR, especially since -Zbuild-std is unstable anyway. This particular failure shouldn't be an issue when the current nightlies are promoted to the next beta, but we should think about this kind of failure mode in the long term too.

@cuviper cuviper added the C-bug Category: This is a bug. label Sep 20, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 20, 2024
@workingjubilee
Copy link
Member

We should probably add a test using the beta compiler to the compiler_builtins CI.

cuviper added a commit to cuviper/rust that referenced this issue Sep 20, 2024
@workingjubilee
Copy link
Member

We could also add running the beta compiler with -Zbuild-std to rust-lang/rust's CI?

@cuviper
Copy link
Member Author

cuviper commented Sep 20, 2024

I think this kind of thing would also be an issue once we get to the stable promotion. I don't know if compiler_builtins wants to promise any kind of MSRV, but really I would have expected the library lock file to be used.

@saethlin
Copy link
Member

I'm very surprised there isn't a lockfile being used here. Does -Zbuild-std not use one automatically? Should be modify the tests to cp in the one from library/Cargo.lock?

@workingjubilee
Copy link
Member

well at least now libstd has its own lockfile, so that makes things easier.

@cuviper
Copy link
Member Author

cuviper commented Sep 20, 2024

Those run-make tests are using stage0 cargo, which is 1.81.0 on the beta branch, and @weihanglo pointed out that this version doesn't have the logic to find the relatively new library/Cargo.lock.

Maybe run-make should always use the current stage's cargo as a prereq? (i.e. the same stage as rustc)

@saethlin saethlin added A-testsuite Area: The testsuite used to check the correctness of rustc and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 20, 2024
@saethlin
Copy link
Member

Maybe run-make should always use the current stage's cargo as a prereq? (i.e. the same stage as rustc)

Definitely. I thought using bootstrap cargo was sus when I wrote that but I had already spent a lot of time trying to get any cargo to run.

@fmease fmease added the -Zbuild-std Unstable Cargo option: Compile the standard library yourself. label Sep 20, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Sep 21, 2024

Maybe run-make should always use the current stage's cargo as a prereq?

Yes, I should've done that even if bootstrap cargo somehow worked

@bors bors closed this as completed in 4336628 Sep 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 21, 2024
Rollup merge of rust-lang#130642 - cuviper:run-make-cargo, r=jieyouxu

Pass the current cargo to `run-make` tests

A couple tests were using `BOOTSTRAP_CARGO` with `-Zbuild-std`, but that
stage0 cargo might not always be in sync with in-tree changes. In
particular, those tests started failing on the beta branch because the
older cargo couldn't find the library `Cargo.lock`, and then couldn't
build the latest version of `compiler_builtins` that had nightly changes.

Fixes rust-lang#130634
r? `@saethlin`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-Zbuild-std Unstable Cargo option: Compile the standard library yourself. A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants