Skip to content

Test that we can build a sysroot for at least all tier 2 targets? #3251

Closed
@saethlin

Description

@saethlin

We currently cannot build sysroots for the following targets which are documented as tier 2:

i586-unknown-netbsd
x86_64-fortanix-unknown-sgx
thumbv8m.base-none-eabi
thumbv8m.main-none-eabi
thumbv8m.main-none-eabihf

There are a variety of causes for this; netbsd was added to the tier 2 list by mistake and should be tier 3, the sgx target runs into a deny lint while building backtrace that -Zbuild-std seems to evade somehow, and the thumbv8m targets emit this, which is a bug in rustc-build-sysroot (the target name get mangled by Path::file_stem):

$ cargo +nightly miri setup --target thumbv8m.base-none-eabi
Preparing a sysroot for Miri (target: thumbv8m.base-none-eabi)...
warning: Patch `rustc-std-workspace-alloc v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-alloc)` was not used in the crate graph.
Patch `rustc-std-workspace-std v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-std)` was not used in the crate graph.
Check that the patched package version and available features are compatible
with the dependency requirements. If the patch has a different version from
what is locked in the Cargo.lock file, run `cargo update` to use the new
version. This may also occur with an optional dependency that is not enabled.
    Checking core v0.0.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
   Compiling compiler_builtins v0.1.103
    Checking rustc-std-workspace-core v1.99.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/rustc-std-workspace-core)
    Checking alloc v0.0.0 (/home/ben/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc)
    Checking custom-local-sysroot v0.0.0 (/tmp/.tmpfH3QUJ)
    Finished release [optimized] target(s) in 7.85s
fatal error: failed to build sysroot: failed to read cargo out dir

Caused by:
    No such file or directory (os error 2)

I think if these targets are documented to be tier 2 "guaranteed to build", we should at least be aware if cargo-miri cannot build sysroots for them. I am of course happy to just do all these builds myself and file bugs when I find issues, but it would be neat if such a check were maintained by the team. But such a build will take some time to run; currently we have 62 tier 2 targets.

Should we have an automated check for the build status of all our tier 2 targets? If so, where?


Decision: Let's add a nightly workflow to build all the sysroots for tier 2 targets.

When this was opened, we had a handful of targets documented as tier 2 that don't build:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions