Skip to content

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

Merged
merged 4 commits into from
Oct 1, 2016
Merged

cache Cargo artifacts #81

merged 4 commits into from
Oct 1, 2016

Conversation

japaric
Copy link
Member

@japaric japaric commented Sep 30, 2016

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 ...

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
@japaric
Copy link
Member Author

japaric commented Sep 30, 2016

@homunkulus try

@homunkulus
Copy link
Contributor

⌛ Trying commit 43e019d with merge d9e8a15...

japaric pushed a commit that referenced this pull request Sep 30, 2016
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 ...
@homunkulus
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
State: approved= try=True

@japaric
Copy link
Member Author

japaric commented Sep 30, 2016

@homunkulus try

@homunkulus
Copy link
Contributor

⌛ Trying commit 0c9b651 with merge 952d10c...

japaric pushed a commit that referenced this pull request Sep 30, 2016
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
Copy link
Member

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.

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@alexcrichton
Copy link
Member

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!

@japaric
Copy link
Member Author

japaric commented Sep 30, 2016

A single build job went from ~5m to ~2m 45s 🎉.

@homunkulus
Copy link
Contributor

💔 Test failed - status-travis

-v `rustc --print sysroot`:/rust:ro \
-w /checkout \
-it $target \
sh -c "PATH=\$PATH:/rust/bin ci/run.sh $target"
Copy link
Member Author

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?

Copy link
Member

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 :(

Copy link
Member Author

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 😆.

@japaric
Copy link
Member Author

japaric commented Sep 30, 2016

@homunkulus try

@homunkulus
Copy link
Contributor

⌛ Trying commit b60d251 with merge 4174596...

japaric pushed a commit that referenced this pull request Sep 30, 2016
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
Copy link
Member

Choose a reason for hiding this comment

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

Is this still needed?

Copy link
Member Author

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 &&
Copy link
Member

Choose a reason for hiding this comment

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

mysterious

Copy link
Member Author

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

@homunkulus
Copy link
Contributor

☀️ Test successful - status-appveyor, status-travis
State: approved= try=True

@japaric japaric merged commit 960f7a8 into master Oct 1, 2016
@japaric japaric deleted the cache branch October 1, 2016 00:00
tgross35 pushed a commit to tgross35/compiler-builtins that referenced this pull request Feb 23, 2025
81: implement log2 and log2f r=japaric a=erikdesjardins

closes rust-lang#27, closes rust-lang#28

Co-authored-by: Erik <[email protected]>
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.

3 participants