Skip to content

rustbuild: Avoid some extraneous rustc compiles on cross builds #44143

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

Merged
merged 2 commits into from
Aug 30, 2017

Conversation

alexcrichton
Copy link
Member

This tweaks a few locations here and there to avoid compiling rustc too many times on our cross-builders on CI.

Closes #44132

When we pass `--host` the `self.hosts` array doesn't contain `self.build`, so
check `self.build` to see if we can uplift.
@alexcrichton
Copy link
Member Author

r? @Mark-Simulacrum

@@ -671,7 +671,7 @@ impl Step for ErrorIndex {

builder.ensure(compile::Rustc {
compiler: builder.compiler(0, build.build),
target,
target: build.config.build,
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ErrorIndex depends on Rustc already so this is useless; let's remove it.

@@ -718,7 +718,7 @@ impl Build {
fn force_use_stage1(&self, compiler: Compiler, target: Interned<String>) -> bool {
!self.config.full_bootstrap &&
compiler.stage >= 2 &&
self.hosts.iter().any(|h| *h == target)
(self.hosts.iter().any(|h| *h == target) || target == self.build)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, something is wrong if this is necessary. I believe we try to make the first host self.build in config.rs; could you check on that logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I tried reordering this in config.rs but then it ended up building too much b/c it's using config.host to seed the matrix of what to build presumably? That is, when we do --host foo, we only want the host binaries for foo and not for the build triple. Do you think there's a better way to solve this though?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not then -- I think our current separation between target/host/build isn't really well thought out and probably various build steps build on the wrong platform (i.e., not optimal time-wise) today. I'm hoping to categorize the list of steps and make the distinction clearer.

All architectures use the same errors, no need to cross-compile a version only
to not look at it.
@alexcrichton
Copy link
Member Author

Ok fixed up the first comment, re-r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 29, 2017

📌 Commit 1d70b66 has been approved by Mark-Simulacrum

@arielb1 arielb1 added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 29, 2017
@arielb1
Copy link
Contributor

arielb1 commented Aug 29, 2017

I'm too wussy to roll this up, but this should help us get rid of our queue
so
@bors p=1

@bors
Copy link
Collaborator

bors commented Aug 30, 2017

⌛ Testing commit 1d70b66 with merge c2f9cc4...

bors added a commit that referenced this pull request Aug 30, 2017
rustbuild: Avoid some extraneous rustc compiles on cross builds

This tweaks a few locations here and there to avoid compiling rustc too many times on our cross-builders on CI.

Closes #44132
@bors
Copy link
Collaborator

bors commented Aug 30, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing c2f9cc4 to master...

@bors bors merged commit 1d70b66 into rust-lang:master Aug 30, 2017
@alexcrichton alexcrichton deleted the faster-bootstrap branch September 1, 2017 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants