Skip to content

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

Closed
@alexcrichton

Description

@alexcrichton
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!

Activity

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
on Dec 14, 2016
xen0n

xen0n commented on Dec 17, 2016

@xen0n
Contributor

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

alexcrichton commented on Dec 17, 2016

@alexcrichton
MemberAuthor

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

xen0n commented on Dec 20, 2016

@xen0n
Contributor

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

xen0n commented on Dec 20, 2016

@xen0n
Contributor

(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

alexcrichton commented on Dec 20, 2016

@alexcrichton
MemberAuthor

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

xen0n

xen0n commented on Dec 20, 2016

@xen0n
Contributor

@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

alexcrichton commented on Dec 20, 2016

@alexcrichton
MemberAuthor

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

added a commit that references this issue on Dec 20, 2016

Rollup merge of rust-lang#38468 - xen0n:tarball-wrangling, r=alexcric…

6e2a901
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@xen0n

        Issue actions

          rustbuild: Dist on cross builds produce way too many tarballs · Issue #38365 · rust-lang/rust