Skip to content

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

@cuviper

Description

@cuviper
Member

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.

Activity

added
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 20, 2024
workingjubilee

workingjubilee commented on Sep 20, 2024

@workingjubilee
Member

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

workingjubilee

workingjubilee commented on Sep 20, 2024

@workingjubilee
Member

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

cuviper

cuviper commented on Sep 20, 2024

@cuviper
MemberAuthor

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

saethlin commented on Sep 20, 2024

@saethlin
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

workingjubilee commented on Sep 20, 2024

@workingjubilee
Member

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

cuviper

cuviper commented on Sep 20, 2024

@cuviper
MemberAuthor

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)

added
A-testsuiteArea: The testsuite used to check the correctness of rustc
and removed
needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.
on Sep 20, 2024
saethlin

saethlin commented on Sep 20, 2024

@saethlin
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.

added
-Zbuild-stdUnstable Cargo option: Compile the standard library yourself.
on Sep 20, 2024
jieyouxu

jieyouxu commented on Sep 21, 2024

@jieyouxu
Member

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

10 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Zbuild-stdUnstable Cargo option: Compile the standard library yourself.A-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @cuviper@saethlin@fmease@jieyouxu@workingjubilee

      Issue actions

        run-make `-Zbuild-std` tests fail on `compiler_builtins` on older branches · Issue #130634 · rust-lang/rust