Bug 234941 - postprocess-headers.sh: Avoid redundant processing to speed up incremental Xcode builds
Summary: postprocess-headers.sh: Avoid redundant processing to speed up incremental Xc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-06 17:55 PST by Elliott Williams
Modified: 2022-01-10 09:11 PST (History)
9 users (show)

See Also:


Attachments
Patch (3.73 KB, patch)
2022-01-06 18:01 PST, Elliott Williams
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Williams 2022-01-06 17:55:22 PST
postprocess-headers.sh: Avoid redundant processing to speed up incremental Xcode builds
Comment 1 Elliott Williams 2022-01-06 18:01:16 PST
Created attachment 448552 [details]
Patch
Comment 2 Elliott Williams 2022-01-07 17:23:07 PST
Alexey <ap@webkit.org> pointed me to similar patches in the past that have caused problems. I don't think they invalidate my approach here, but am curious to hear if you think otherwise:

- https://bugs.webkit.org/show_bug.cgi?id=220239
- https://bugs.webkit.org/show_bug.cgi?id=166810

These involved conditionally skipping a write to a file when its prerequisites changed. Skipping writes meant not updating an output file's modification time, which caused the respective scripts to execute on every rebuild after it had decided to skip writing an output file.

This patch determines whether *Xcode* skipped a copy, and only skips postprocessing if Xcode skipped copying. Skipping postprocessing should not lead to situations where Xcode tries to copy a header repeatedly, since Xcode's build system is not interested in whether this script runs at all.

- https://bugs.webkit.org/show_bug.cgi?id=77510

I'm not sure how this one is related -- seems like it ultimately caused problems because of complex Make logic that broke rebuilds.

--

It's worth noting that we only have postprocess-headers.sh because APPLY_RULES_IN_COPY_FILES is not supported by the legacy build system. Changing it to only process a file once per copy matches behavior we get from the copy file build rule in XCBuild.
Comment 3 EWS 2022-01-10 09:10:31 PST
Committed r287837 (245889@main): <https://commits.webkit.org/245889@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448552 [details].
Comment 4 Radar WebKit Bug Importer 2022-01-10 09:11:22 PST
<rdar://problem/87343965>