-
Notifications
You must be signed in to change notification settings - Fork 229
cache Cargo artifacts #81
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
Conversation
notable changes in the docker-based testing infrastructure - the docker containers can now modify $CARGO_HOME, to re-use the outer Cargo registry, and the target directory to re-use build artifacts. - the docker containers are removed when their execution finishes because it's no longer necessary to re-start them to inspect them because all the interesting output is in the outer target directory
@homunkulus try |
cache Cargo artifacts notable changes in the docker-based testing infrastructure - the docker containers can now modify $CARGO_HOME, to re-use the outer Cargo registry, and the target directory to re-use build artifacts. - the docker containers are removed when their execution finishes because it's no longer necessary to re-start them to inspect them because all the interesting output is in the outer target directory r? @alexcrichton Let's see if this actually reduces test times ...
☀️ Test successful - status-appveyor, status-travis |
@homunkulus try |
cache Cargo artifacts notable changes in the docker-based testing infrastructure - the docker containers can now modify $CARGO_HOME, to re-use the outer Cargo registry, and the target directory to re-use build artifacts. - the docker containers are removed when their execution finishes because it's no longer necessary to re-start them to inspect them because all the interesting output is in the outer target directory r? @alexcrichton Let's see if this actually reduces test times ...
-it $target \ | ||
sh -c " | ||
groupadd -g $gid $group | ||
useradd -m -g $gid -u $uid $user |
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.
Have you tried the docker run --user
argument for this? I've done --user $uid:$gid
before and it's worked alright, just not great.
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.
I think this'd aovid the need for chown
as well
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.
I didn't know that existed. I'll give it a try.
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.
Done!
I've always been slightly wary of Docker volume sharing here, especially b/c the user/group never seem to quite match the way I want. If it works though and speeds things up though then sure! |
A single build job went from ~5m to ~2m 45s 🎉. |
💔 Test failed - status-travis |
-v `rustc --print sysroot`:/rust:ro \ | ||
-w /checkout \ | ||
-it $target \ | ||
sh -c "PATH=\$PATH:/rust/bin ci/run.sh $target" |
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.
This looks funny. Is there a way to extend PATH using the -e
flag?
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.
Hm, maybe:
-e PATH=\$PATH:/rust/bin
I'm not sure if that works but if it doesn't my assumption would be no :(
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.
This results in PATH='$PATH:/rust/bin' with a literal $PATH in there 😆.
@homunkulus try |
cache Cargo artifacts notable changes in the docker-based testing infrastructure - the docker containers can now modify $CARGO_HOME, to re-use the outer Cargo registry, and the target directory to re-use build artifacts. - the docker containers are removed when their execution finishes because it's no longer necessary to re-start them to inspect them because all the interesting output is in the outer target directory r? @alexcrichton Let's see if this actually reduces test times ...
sh ci/run-docker.sh $TARGET; | ||
else | ||
cargo test --target $TARGET && | ||
cargo test --target $TARGET --release; | ||
fi | ||
# Travis can't cache files that are not readable by "others" | ||
- chmod -R a+r $HOME/.cargo |
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.
Is this still needed?
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.
Yes, in case we ever add a dependency that brings a file that doesn't have the o+r bit set. FWIW, I originally found this problem with the bitflags crate; its .gitignore was rwx------
iirc.
@@ -45,13 +46,13 @@ install: | |||
script: | |||
- cargo generate-lockfile | |||
- if [[ $TRAVIS_OS_NAME = "linux" ]]; then | |||
sudo apt-get remove -y qemu-user-static && | |||
sudo apt-get install -y qemu-user-static && |
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.
mysterious
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.
This was never needed AFAIK
☀️ Test successful - status-appveyor, status-travis |
81: implement log2 and log2f r=japaric a=erikdesjardins closes rust-lang#27, closes rust-lang#28 Co-authored-by: Erik <[email protected]>
notable changes in the docker-based testing infrastructure
Cargo registry, and the target directory to re-use build artifacts.
because it's no longer necessary to re-start them to inspect them
because all the interesting output is in the outer target directory
r? @alexcrichton
Let's see if this actually reduces test times ...