Skip to content

rustbuild: Dist on cross builds produce way too many tarballs #38365

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

Closed
alexcrichton opened this issue Dec 14, 2016 · 7 comments
Closed

rustbuild: Dist on cross builds produce way too many tarballs #38365

alexcrichton opened this issue Dec 14, 2016 · 7 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@alexcrichton
Copy link
Member

The dist step on cross builds takes over half an hour, and that's a crazy amount of time for something which should take at most 5 minutes.

The list of tarballs created is massively duplicated. Namely we create around 60 source tarballs (!!). Looks like we're also packaging up the standard library dozens of times for the same target.

My guess as to what's happening is that by default rustbuild is doing a cross product of (host x target) and doing all the builds. We should skip a massive number of them for distribution and ideally not even put them into the step list at all!

Note that this isn't a fire at the moment as everything's just overwriting what was previously created, but this sounds like something that could become a fire!

Should also be a relatively easy bug to knock out for anyone who wants to become familiar with rustbuild!

@alexcrichton alexcrichton added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 14, 2016
@xen0n
Copy link
Contributor

xen0n commented Dec 17, 2016

A closer look at the list shows we're certainly building target-agnostic components over and over, which is everything! (I incorrectly assumed the std is different and require full cross product, but upon looking at the dist directory layout at static.rust-lang.org I immediately realized it's not the case.)

So we only have to skip the execution of steps that have s.host != s.target for dist rules? It seems creation of the steps are not as straightforward to work around. I could prepare a patch for this.

@alexcrichton
Copy link
Member Author

I think that's along the right lines, yeah. I'm not sure if that's precisely the strategy that we want, but it sounds about right.

In general the build triple builds everything, so we should only package from there. I think for packaging the rustc package, however, there may be some snags. In any case would be great to test out!

@xen0n
Copy link
Contributor

xen0n commented Dec 20, 2016

FYI it seems that the make distcheck steps on buildbot are also affected by the same symptom, which is very awful as here every target takes ~3h instead of a few minutes... Just check out the buildbot waterfall. I could integrate a fix into #38468 hopefully before the next nightly build triggers.

@xen0n
Copy link
Contributor

xen0n commented Dec 20, 2016

(Or you could directly push into my branch instead, the fix would just be an additional test for kind == Kind::Test. It's 3 am here and I need some rest, maybe couldn't get up in time. I'd personally appreciate seeing this land just after the i128 PR as a quickened nightly update benefits everyone.)

@alexcrichton
Copy link
Member Author

@xen0n your fix in #38468 will fix those problems, right? Or could you elaborate on what's taking too long?

@xen0n
Copy link
Contributor

xen0n commented Dec 20, 2016

@alexcrichton Take this build for an example. distcheck after #38367 essentially equals to a dist followed by a test; you can see in the logs where although the dist steps are taking somewhat longer, the real waste of time comes in the form of multiple compilations of LLVM and multiple runs of the full testsuite, but the host list as configured is as short as 2 hosts! Therefore I now believe test should be covered too.

@alexcrichton
Copy link
Member Author

Ah yeah distcheck takes forever in its own right, but we hope to fix that soon!

alexcrichton added a commit to alexcrichton/rust that referenced this issue Dec 20, 2016
…hton

rustbuild: Eliminate duplication of dist tarballs

Fixes rust-lang#38365 by not constructing the duplicate steps in the first place, as suggested. The source package step is lacking the check as in other steps, so it is added as well.

Tested locally with the `alexcrichton/rust-slave-linux-cross:2016-11-11` container (with the build slave init replaced with no-op, of course).

r? @alexcrichton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants