Bug 315061

Summary: [CMake] Avoid unnecessary rebuilds after CMake preset reconfigure
Product: WebKit Reporter: zak ridouh <zakr>
Component: CMakeAssignee: zak ridouh <zakr>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

zak ridouh
Reported 2026-05-18 17:16:37 PDT
Several CMake helpers wrote generated build inputs (the ccache launcher, a Swift modulemap, a WebPushDaemon stub, an empty WebGPU cmakeconfig.h, a LayoutTestHelper stub config.h, an AppleFeatures stub) using file(WRITE), which is unconditional and always bumps the mtime. The rewrite-compile-commands script did the same. As a result, every reconfigure marked a chunk of PCHs and generated sources stale even when their content was identical, forcing ~70 build steps and a framework relink. Switch those writes to file(CONFIGURE OUTPUT ... CONTENT ...) and teach rewrite-compile-commands to compare before writing. Both only update the file when content actually differs, so mtimes stay stable across no-op reconfigures. This drops the no changes reconfigure + rebuild time from ~50s to ~1s.
Attachments
Radar WebKit Bug Importer
Comment 1 2026-05-18 17:16:43 PDT
zak ridouh
Comment 2 2026-05-18 17:45:55 PDT
EWS
Comment 3 2026-05-18 22:00:35 PDT
Committed 313460@main (9da1138b4ab4): <https://commits.webkit.org/313460@main> Reviewed commits have been landed. Closing PR #65150 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.