Skip to content

Is (cross-)compiling with an "alt" compiler and "non-alt" standard library supported? #43085

Closed
@SimonSapin

Description

@SimonSapin

#39754 added “alternate” builds for a small number of platforms. They disable LLVM assertions, significantly improving compile times compared to Nightly. More background: https://internals.rust-lang.org/t/disabling-llvm-assertions-in-nightly-builds/5388

Servo uses these by default when available. Them being only available for a small number of platforms is ok because that covers platforms most developers use, and we can fall back to "normal" slower Nightly compilers.

In #42967 we ran into an issue that only occurred on OS X, when compiling crates that depend on procedural macro crates, when using an "alt" compiler with a "non-alt" standard library. It seems in theory that enabling or disabling LLVM assertions in rustc should not have any effect on standard libraries, but we worked around that issue in servo/servo#17575 by making sure we download an std of the same kind as rustc.

It gets tricky when cross-compiling (for example to Android), since "alt" standard libraries are not necessarily available for the target platform even when they are for the host. In servo/servo#17604 we might need to rewrite our mach configuration handling and Rust bootstrapping to be able to support selecting an "alt" vs "non-alt" compiler depending on the cross-compilation target.

But do we really need to? Or is #42967 a rustc bug after all? "Should" it work to use an "alt" rustc with "non-alt" std?

CC @aturon since I don’t know are the appropriate people to ask, please redirect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions