Skip to content

Add sccache support - #12526

Merged
zachhannum merged 3 commits into
mainfrom
feature/sccache-support
Jan 5, 2023
Merged

zachhannum merged 3 commits into
mainfrom
feature/sccache-support

Conversation

@zachhannum

@zachhannum zachhannum commented Jan 4, 2023 •

Copy link
Copy Markdown
Contributor

Intent

Addresses #12520. Adds support for sccache to the build. Set the environment variable SCCACHE_ENABLED=1 to use sccache, otherwise sccache will not be used. The pull-request Jenkinsfile has also been updated to use sccache.

Approach

An S3 bucket has been created to act as a build cache for Jenkins (and developers, if they so choose). Note that this does not add sccache for Windows or OSX at this time. We should create new issues to address this if needed.

Automated Tests

N/A

QA Notes

N/A

Documentation

N/A

Checklist

  • If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
  • If this PR adds or changes UI, the updated UI meets accessibility standards
  • A reviewer is assigned to this PR (if unsure who to assign, check Area Owners list)
  • This PR passes all local unit tests

This commit adds support for sccache to the build. Set the environment
variable SCCACHE_ENABLED=1 to use sccache, otherwise sccache will not be
used.
Comment thread cmake/modules/FindSccache.cmake Resolved
Comment thread dependencies/common/install-sccache Resolved
Per code review feedback, this file removes FindSccache.cmake, which is
uneccessary and updates the copyright for install-sccache to be the
current year.
Comment thread dependencies/common/install-sccache Resolved

@melissa-barca melissa-barca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@zachhannum zachhannum changed the title Add sccache support Add sccache dependency for macOS Jan 5, 2023
@zachhannum zachhannum changed the title Add sccache dependency for macOS Add sccache support Jan 5, 2023
@zachhannum
zachhannum merged commit 0dc231f into main Jan 5, 2023
@zachhannum
zachhannum deleted the feature/sccache-support branch January 5, 2023 20:10

@cm421 cm421 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for not getting these in before we merged, but I think the dependency script needs some attention

SCCACHE_PACKAGE_HASH="1bf58385dc27b66324bb9ee82084e65c4d2e60baa19e3d16d2ab4da6c1ae66b2"
fi

URL=https://github.com/mozilla/sccache/releases/download/v${VERSION}/sccache-v${VERSION}-${ARCH}-unknown-linux-musl.tar.gz

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this is in dependencies/common it needs to work across all OSes, and this wouldn't work for MacOS.

This script should either

  1. Be updated to work on MacOS and Linux, or
  2. Move into dependencies/linux and get called there until this script is updated to work for MacOS

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I created #12533 and #12532 to address the sccache dependency for macOS and Linux, but I will create a small patch to move this script for now!

if [ -n "$SCCACHE_ENABLED" ]; then
echo "Using sccache"

if [ -n "$AWS_ACCESS_KEY_ID" ] || [ $(aws sts get-caller-identity --query "Account" --profile ${AWS_PROFILE:-sso}) -eq 14 ]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do any of these need to be pre-defined before this script runs? If so we'll want to add that info into the wiki

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