-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Enable sccache for macOS CoreCLR legs #128675
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
Open
steveisok
wants to merge
8
commits into
dotnet:main
Choose a base branch
from
steveisok:mac-sccache-ci
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4ea4000
Enable sccache as compiler launcher in build-commons (with macOS -Xar…
steveisok 8c3499b
Enable sccache for osx_arm64 CI legs
steveisok da190c5
Enable sccache for osx_x64 CoreCLR_Libraries leg
steveisok 8be4c69
Expand sccache to remaining applicable macOS CI legs
steveisok f891935
Merge branch 'main' into mac-sccache-ci
steveisok f15f385
Merge branch 'main' into mac-sccache-ci
agocke 1e45d96
Use NuGet sccache package for macOS CI
agocke 98655bb
Simplify macOS sccache package download
agocke File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| # Wrapper around sccache for macOS builds. | ||
| # sccache cannot parse -Xarch_<arch> flags that CMake generates for PCH | ||
| # includes, and also drops plain -include flags during compilation. | ||
| # We rewrite "-Xarch_<arch> -include<path>" to "-Xclang -include -Xclang <path>" | ||
| # which sccache passes through correctly to the clang frontend. | ||
|
|
||
| args=() | ||
| skip_xarch=false | ||
|
|
||
| for arg in "$@"; do | ||
| if $skip_xarch; then | ||
| skip_xarch=false | ||
| if [[ "$arg" == -include* ]]; then | ||
| # Rewrite -include<path> to -Xclang -include -Xclang <path> | ||
| local_path="${arg#-include}" | ||
| args+=("-Xclang" "-include" "-Xclang" "$local_path") | ||
| else | ||
| args+=("$arg") | ||
| fi | ||
| continue | ||
| fi | ||
| if [[ "$arg" == -Xarch_* ]]; then | ||
| skip_xarch=true | ||
| continue | ||
| fi | ||
| args+=("$arg") | ||
| done | ||
|
|
||
| exec sccache "${args[@]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
src/coreclr/build-runtime.sh(removed in this PR), so it applied to the CoreCLR runtime component build. By moving it intobuild_native()inbuild-commons.sh, the launcher is now injected for every native build that sources this file —src/native/corehost/build.sh,src/native/libs/build-native.sh, and Mono viasrc/tests/build.sh— wheneverUSE_SCCACHE=trueis in the environment, on all platforms (not just macOS). On linux/freebsd legs whereUSE_SCCACHEis already set bysetup-sccache.yml, corehost and native-libs compilations will now also be wrapped bysccache, which is a behavioral change not mentioned in the PR description. This is likely a beneficial expansion of caching, but please confirm it's intended and that the corehost/native-libs builds don't emit any flagssccachechokes on (the-Xarch_handling is only applied on the osx/maccatalyst path). Worth calling out explicitly since the PR title/description scope this as a macOS-only change.