-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Use Docker for Travis #34016
Use Docker for Travis #34016
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
This seems like a sound strategy overall 👍 People have long asked us for an "official" Dockerfile... and there have been several community ones. I guess those would contain |
RUN apt-get update | ||
RUN apt-get -y install curl g++ git make | ||
RUN apt-get -y install libedit-dev zlib1g-dev | ||
RUN apt-get -y install llvm-3.7-tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In other words, you should change this to:
RUN apt-get update && apt-get install -y \
curl \
g++ \
git \
make \
libedit-dev \
llvm-3.7-tools \
zlib1g-dev
If we're going use Docker in this repo we should probably use the same images that we do in other repos, and put their Dockerfiles somewhere discoverable. @alexcrichton has been maintaining several Dockerfiles for various official CI purposes. |
As I understand, @alexcrichton's images do not include LLVM. So there is a choice between using the same image and saving build time by not building LLVM. |
Yeah I'm fine doing this, especially if we don't have to rely on LLVM's apt repos which seem to go down from time to time. We don't really have an "official docker image" because I'm not sure whether that actually makes sense, this is just for building Rust, for example. It's basically just a few tiny packages anyway so it shouldn't matter a whole lot. One thing that may actually be pretty cool is that mounting volumes as Can you also be sure to add comments to the Dockerfile? Would be good to know why all the packages are getting installed (the list looks correct, however) |
@sanxiyn r=me if you comment the dockerfile per acrichto |
I think it is important to merge this, or an alternative, as soon as possible. As I don't have write access on this repo, I'm not capable of triggering a rerun of a failed pull request build. It means that the author will need to push a new ammended commit to change the hash, close and reopen the PR or have someone from the Rust team triggering the build again manually. |
That release of ubuntu contains LLVM 3.7, fine. but 3.8 is already out. Now, what will happen when we start requiring some version none of the available ubuntus ship? |
Build it from source as part of the Dockerfile. |
I suggested this because it is common practice to cache the Docker layers when using Docker for CI. Effectively, this would mean that since LLVM was built from a previous That said, I just briefly Googled around and found that Travis doesn't make caching with Docker easy (relevant Issue), unlike other CI solutions. |
Followed @frewsxcv's comment to combine apt-get update and install. Thanks! Also commented dependencies as suggested by @alexcrichton. I will try out-of-tree build in a followup pull request. |
@bors r=brson p=1 |
📌 Commit b1651fb has been approved by |
Hopefully this will never happen. First LLVM release (without patches) we supported is LLVM 3.6 released in February 2015. We haven't broken LLVM 3.6 support yet. |
Use Docker for Travis The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org. Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker. LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04. Fix #34009.
The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.
Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.
LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.
Fix #34009.