Skip to content

Improve build time of x86_64-linux-gnu target #1760

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
wants to merge 1 commit into from

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Apr 13, 2019

By using prebuilt perl, we could reduce build-time up to 3 minutes.

@tesuji
Copy link
Contributor Author

tesuji commented Apr 14, 2019

r? @kinnison

@tesuji tesuji force-pushed the docker branch 3 times, most recently from 769deab to 9f55e76 Compare April 14, 2019 09:14
RUN ./configure.gnu
RUN make -j$(nproc)
RUN make install
RUN curl -L https://github.com/lzutao/rustup.rs/releases/download/perl-5.28.0/perl-5.28.0.tar.gz | tar xzf - -C /
Copy link
Contributor Author

@tesuji tesuji Apr 14, 2019

Choose a reason for hiding this comment

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

We should upload it to somewhere rather than in my own fork.

Copy link
Contributor

Choose a reason for hiding this comment

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

Certainly I wouldn't like this part of the change. I do feel like we can find a better solution where we don't use non-packaged perl at all, but I don't see what it is yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's better but not the best solution we have. Should we ping alexcrichton
to see what he think about this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah... @alexcrichton If you have a moment could you weigh in on a better way to do this part of rustup CI? I really don't like storing built binaries of Perl like this, but I also dislike that we end up rebuilding perl an awful lot.

Copy link
Member

Choose a reason for hiding this comment

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

Instead of a prebuilt perl, could this perhaps take the same strategy as #1724 and use the prebuilt images from rust-lang/rust for deployment?

Copy link
Contributor Author

@tesuji tesuji Apr 16, 2019

Choose a reason for hiding this comment

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

I did the change in my branch.
The Travis build log here.

There are two blocking points:

  • The build is failed, but I don't see why it's failed. It complains about
    linker `cc` not found, but gcc and g++ is included in rust
    x86_64 and i686 docker image?
  • The build time is increase. The average build time is 17 minutes and 30
    seconds (with build succeed and all tests passed).
    Now the build time is at least 18 minutes (with tests uncompleted).

Copy link
Contributor

Choose a reason for hiding this comment

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

It's possible that travis will cache the image now for us, reducing the cost of using a larger docker image, but the cc not found is a pain.

Copy link
Contributor Author

@tesuji tesuji Apr 16, 2019

Choose a reason for hiding this comment

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

@kinnison We use rust's images. Those images could be changed or updated so the
cache will be invalid (correct me if I'm wrong).

Copy link
Contributor

Choose a reason for hiding this comment

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

It would, but not very often. (I think at least every 90 days but likely more often than that) so I think it won't be too bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I forgot. We download the tar-compressed docker images from aws with curl (about 1GB). So I don't think Travis would (automatically) cache this file for us. We could force Travis cache this file, but it's not recommended by Travis and is inefficient.

@pickfire
Copy link
Contributor

@lzutao Is it possible to use POSIX-compatible shell instead of bash? The CI script named .bash does seem to have POSIX-compatible code, should it be renamed to sh?

@tesuji tesuji force-pushed the docker branch 2 times, most recently from 37a4d53 to 501533a Compare April 15, 2019 05:07
@tesuji
Copy link
Contributor Author

tesuji commented Apr 15, 2019

@pickfire All shell scripts should be POSIX-compliant now, except the local keyword.

@pickfire
Copy link
Contributor

@lzutao Is it possible to remove to local keyword? Nice, the files have been renamed to .sh.

@tesuji
Copy link
Contributor Author

tesuji commented Apr 15, 2019

@pickfire I don't think that removing local keyword is necessary. The local
keyword protects helper functions from messing up with each others because
of global variables.

@tesuji tesuji force-pushed the docker branch 3 times, most recently from adc56b5 to 863aca5 Compare April 15, 2019 11:58
@pickfire
Copy link
Contributor

@lzutao I understand your concern but different parts of scripts are run separately and the use of local break running the script with dash.

@tesuji
Copy link
Contributor Author

tesuji commented Apr 15, 2019

IIRC, dash supports local keyword. Those scripts are running fine with
dash on my machine and on CI.

@tesuji tesuji force-pushed the docker branch 2 times, most recently from 0984730 to eb4547c Compare April 15, 2019 15:34
@pickfire
Copy link
Contributor

Wait, I tested it on function level and it works but not on global level.

@tesuji
Copy link
Contributor Author

tesuji commented Apr 16, 2019

I think currently we only use local only in function's block, not on global block
as I know. @pickfire

This would reduce build time upto 3 minutes. The final Perl tarball
was built in the same image from Dockerfile.
@tesuji
Copy link
Contributor Author

tesuji commented Apr 27, 2019

Closed in favor of #1815 .

@tesuji tesuji closed this Apr 27, 2019
@tesuji tesuji deleted the docker branch April 29, 2019 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants