postprocess-headers.sh: Avoid redundant processing to speed up incremental Xcode builds
Created attachment 448552 [details] Patch
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.
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].
<rdar://problem/87343965>