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

Enable sccache for Servo CI #17106

Closed
luser opened this issue May 31, 2017 · 12 comments
Closed

Enable sccache for Servo CI #17106

luser opened this issue May 31, 2017 · 12 comments

Comments

@luser
Copy link
Contributor

@luser luser commented May 31, 2017

I've been testing sccache with Servo lately, and it's working pretty well for caching crate compilation. Details are available on this users.rlo thread. I needed to make one change to an upstream crate, and I finally submitted a PR to update that dependency which has now been merged.

Unless large chunks of the dependency graph change frequently I would expect a pretty good cache hit rate, which should save a fair amount of time for CI builds. Additionally, once we get S3 buckets configured we can set [build] ccache = 'sccache' and use sccache to cache the C++ compilation from the build, which may produce better results than using ccache, since multiple builders can share the same cache.

cc/ @alexcrichton @edunham @larsbergstrom

@aneeshusa
Copy link
Member

@aneeshusa aneeshusa commented Jun 2, 2017

Using environment variables is easier than updating the .servobuild file for CI. Will installing sccache and setting RUSTC_WRAPPER=sccache work? Those would both happen in saltfs.

@luser
Copy link
Contributor Author

@luser luser commented Jun 3, 2017

That will make it work for caching rust compiles, but not C++ compiles.

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Jun 3, 2017

OMG this is amazing - thank you so much for doing this, including the testing, @luser!

One question: do you know how well this handles invalidation when rustc or cargo are updated? I was chatting with @edunham and we were thinking about doing a "merge commit by merge commit" test of sccache as incremental builds for the last few months, catching a few updates to see.

@metajack We're gonna HAVE to try rolling this out to see if we can shave some time off of macOS builds :-)

bors-servo added a commit to servo/saltfs that referenced this issue Jun 3, 2017
…larsbergstrom

Support env vars in buildbot steps

This makes it possible to specify environment variables for CI builds directly in `buildbot_steps.yml`, whether permanently, such as configuring LLVM assertions in servo/servo#15564, or temporarily, e.g. testing out `SCCACHE` for servo/servo#17106 before putting it into saltfs or trying out Android env vars.
This is also helpful for windows, which AFAIK doesn't have an equivalent to the `env` command.

r? @larsbergstrom @edunham

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/687)
<!-- Reviewable:end -->
bors-servo added a commit to servo/saltfs that referenced this issue Jun 3, 2017
…larsbergstrom

Support env vars in buildbot steps

This makes it possible to specify environment variables for CI builds directly in `buildbot_steps.yml`, whether permanently, such as configuring LLVM assertions in servo/servo#15564, or temporarily, e.g. testing out `SCCACHE` for servo/servo#17106 before putting it into saltfs or trying out Android env vars.
This is also helpful for windows, which AFAIK doesn't have an equivalent to the `env` command.

r? @larsbergstrom @edunham

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/687)
<!-- Reviewable:end -->
bors-servo added a commit to servo/saltfs that referenced this issue Jun 3, 2017
…larsbergstrom

Support env vars in buildbot steps

This makes it possible to specify environment variables for CI builds directly in `buildbot_steps.yml`, whether permanently, such as configuring LLVM assertions in servo/servo#15564, or temporarily, e.g. testing out `SCCACHE` for servo/servo#17106 before putting it into saltfs or trying out Android env vars.
This is also helpful for windows, which AFAIK doesn't have an equivalent to the `env` command.

r? @larsbergstrom @edunham

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/687)
<!-- Reviewable:end -->
@aneeshusa
Copy link
Member

@aneeshusa aneeshusa commented Jun 3, 2017

Are there pre-built releases of sccache available? That would be the easiest way to deploy onto our build machines.

@aneeshusa
Copy link
Member

@aneeshusa aneeshusa commented Jun 4, 2017

Also, it looks like the build.ccache setting in .servobuild is just used to set the CCACHE environment variable, so we can do that directly.

@luser
Copy link
Contributor Author

@luser luser commented Jun 5, 2017

One question: do you know how well this handles invalidation when rustc or cargo are updated?

sccache hashes the contents of all the sharedlibs under $sysroot/lib and uses that as an input to the hash used for the cache key, so it shouldn't be a problem.

@luser
Copy link
Contributor Author

@luser luser commented Jun 5, 2017

Are there pre-built releases of sccache available? That would be the easiest way to deploy onto our build machines.

@alexcrichton has binary builds for Rust CI, so you ought to be able to use those until I get actual binary releases setup in sccache CI.

This was referenced Jun 5, 2017
@luser
Copy link
Contributor Author

@luser luser commented Jun 13, 2017

FWIW, I've been testing enabling sccache for Rust compilation in Firefox builds, and for our stylo builds (which build a big chunk of Servo code), it looks to save about 5 minutes per build.

bors-servo added a commit to servo/saltfs that referenced this issue Sep 12, 2017
Install sccache

Part of servo/servo#17106.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/688)
<!-- Reviewable:end -->
bors-servo added a commit to servo/saltfs that referenced this issue Sep 22, 2017
Install sccache

Part of servo/servo#17106.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/688)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Sep 27, 2017
Enable sccache

<!-- Please describe your changes on the following line: -->

 Update buildbot_steps lint to handle env variables.
Enable sccache for all builds.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17106  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they update the test commands

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17171)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Nov 15, 2017
Enable sccache

<!-- Please describe your changes on the following line: -->

 Update buildbot_steps lint to handle env variables.
Enable sccache for all builds.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17106  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they update the test commands

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17171)
<!-- Reviewable:end -->
@jdm
Copy link
Member

@jdm jdm commented Nov 27, 2017

This has been enabled.

@jdm jdm closed this Nov 27, 2017
@aneeshusa
Copy link
Member

@aneeshusa aneeshusa commented Dec 13, 2017

According to jdm who is in person with me right now, this is not actually fixed yet.

@aneeshusa aneeshusa reopened this Dec 13, 2017
bors-servo added a commit that referenced this issue Dec 13, 2017
Enable sccache

<!-- Please describe your changes on the following line: -->

 Update buildbot_steps lint to handle env variables.
Enable sccache for all builds.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #17106  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they update the test commands

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17171)
<!-- Reviewable:end -->
@luser
Copy link
Contributor Author

@luser luser commented Mar 13, 2018

FYI: I fixed my AppVeyor config, and the 0.2.6 release of sccache includes a Windows binary package: https://github.com/mozilla/sccache/releases/tag/0.2.6

@jdm
Copy link
Member

@jdm jdm commented Nov 13, 2019

This was fixed a while ago.

@jdm jdm closed this Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.