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

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

Closed
SimonSapin opened this issue Jul 6, 2017 · 13 comments
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@SimonSapin
Copy link
Contributor

#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.

@metajack
Copy link
Contributor

metajack commented Jul 6, 2017

cc @jonathandturner

@SimonSapin
Copy link
Contributor Author

Disabling LLVM assertions in Nightly would make this whole issue go away since alternate compiler builds would become unnecessary.

@Mark-Simulacrum
Copy link
Member

cc @alexcrichton

@alexcrichton
Copy link
Member

I believe the tl;dr; is basically "no, this is not a supported configuration". The intention was that these builds would be for developer-only machines which didn't need the full power of the rest of the toolchain.

@SimonSapin
Copy link
Contributor Author

Developers working on platform-specific issues or features need to cross-compile. We don’t need full toolchains for target (as opposed to host) platforms, only std.

We can probably rework bootstrapping on our side so that "non-alt" builds are used for cross-compiling, but if fixing #42967 on the rustc side is reasonably feasible that would be nicer.

@sophiajt
Copy link
Contributor

@SimonSapin - iirc, the way alt builds were added was kind of a hack to begin with, intended as a way to get Servo a build without assertions. It was acknowledged at the time it wasn't the best solution, but we hoped that it would be good enough.

It sounds like we're saying now that the hack didn't end up being good enough. If that's the case, sounds like we should get people together again to see if we can come up with another solution.

@SimonSapin
Copy link
Contributor Author

I’m not sure “not good enough” applies. There is one known issue. I don’t know if that makes the whole approach flawed or if it’s “just” a bug/regression that can be fixed.

(Specifically, when loading a procedural macro crate, the hash/filename expected by that crate for std didn’t match the one available on disk. On OS X only.)

@sophiajt
Copy link
Contributor

@alexcrichton - is there a way to address this hash/filename issue on macOS? Is it possible it's just a bug that hasn't gotten fixed yet?

@SimonSapin
Copy link
Contributor Author

I bisected #42967. I can reproduce it in dfa7e21 but not in e40ef96, leaving #42433 as the only change.

@SimonSapin
Copy link
Contributor Author

That PR adds --enable-profiler to the configuration of most builds but not "alternate" ones. Could that affect the hash of std? Is there a reason not to? I think enabling it everywhere might fix the issue.

SimonSapin added a commit to SimonSapin/rust that referenced this issue Jul 11, 2017
@SimonSapin
Copy link
Contributor Author

Opened #43167

steveklabnik added a commit to steveklabnik/rust that referenced this issue Jul 13, 2017
…hton

Enable profiler on "alternate" builds

This hopefully fixes rust-lang#42967 and rust-lang#43085.
@Mark-Simulacrum Mark-Simulacrum added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label Jul 19, 2017
@Mark-Simulacrum
Copy link
Member

Closing as per #43085 (comment). We should try to keep these in sync when possible, I guess, though...

@SimonSapin
Copy link
Contributor Author

Ah, yes. I meant for #43167 to close this. We moved Servo back to using alt rustc with normal std in servo/servo#17727.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants