Bug 312680
| Summary: | [CMake] ccache hashes not portable across worktrees on Apple platforms | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Lewis <simon.lewis> |
| Component: | CMake | Assignee: | Simon Lewis <simon.lewis> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | ||
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Simon Lewis
WebKitCCache.cmake sets CCACHE_SLOPPINESS via set(ENV{...}), and the mac
presets set CCACHE_BASEDIR via the preset environment block. Both apply
only to the cmake process — when ninja later spawns ccache, neither is
set, so cache entries are stored with absolute paths and a second
worktree of the same revision gets ~0% hits.
WebKitCCache.cmake also unconditionally overwrites
CMAKE_CXX_COMPILER_LAUNCHER, discarding any -D the user passed.
On APPLE, generate ${CMAKE_BINARY_DIR}/ccache-launcher — a sh wrapper
that exports CCACHE_BASEDIR=${CMAKE_SOURCE_DIR}, CCACHE_NOHASHDIR, and
the sloppiness flags before exec'ing ccache — and point
CMAKE_{C,CXX,ASM,OBJC,OBJCXX}_COMPILER_LAUNCHER at it. Skip the block
entirely if CMAKE_CXX_COMPILER_LAUNCHER is already set.
With the existing -fdebug-prefix-map in OptionsMac.cmake this gives 100%
hits (99.8% direct) in a fresh worktree against a cache warmed elsewhere.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Simon Lewis
Pull request: https://github.com/WebKit/WebKit/pull/63043
EWS
Committed 311955@main (b36a53b5d2b8): <https://commits.webkit.org/311955@main>
Reviewed commits have been landed. Closing PR #63043 and removing active labels.