Skip to content
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

Sweep the cache before uploading it #246

Merged
merged 1 commit into from
May 20, 2019
Merged

Conversation

Nemo157
Copy link
Contributor

@Nemo157 Nemo157 commented May 20, 2019

Description

Use cargo-sweep along with -Zmtime-on-use for removing unused data from the Travis cache.

cargo-sweep will remove all files that were not used during the current build, so for example old versions of dependencies. To be able to track this accurately it needs cargo/rustc to mark the files it uses during the current build, the -Zmtime-on-use flag is an unstable flag to tell it to do so.

With this implemented the files uploaded to Travis should only be the relevant ones, keeping the cache minimal and actually usable. This will then mean that future builds will only have to build what has changed and run much faster.

Motivation and Context

Fixes #243

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@Nemo157
Copy link
Contributor Author

Nemo157 commented May 20, 2019

I wish there were an easy way to look at the cache content, the ones from this branch are still half a gig larger than my testing on travis-ci.com and the test job is taking twice as long. But at least comparing https://travis-ci.org/rustasync/tide/builds/535025048 and https://travis-ci.org/rustasync/tide/builds/535036746 the latter used about half the time for the test job.

Once this is merged I might hit the "delete all caches" button on Travis and see if it creates a smaller cache inline with what I was seeing in the future.

- cargo build
-Zmtime-on-use
--manifest-path tide/Cargo.toml
--no-default-features
Copy link
Contributor Author

Choose a reason for hiding this comment

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

rust-lang/cargo#6972 means that this does some extra work, but it's still faster than the test build so doesn't really matter at this point.

Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

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

Looks good!

@yoshuawuyts yoshuawuyts merged commit 114c17c into http-rs:master May 20, 2019
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.

Travis CI caching for tests is timing out
2 participants