[webkit-changes] [WebKit/WebKit] 36cefe: [Xcode] Move header migration logic to a script phase

Elliott Williams noreply at github.com
Mon Feb 6 14:47:57 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 36cefe446ec77fb3dd2e3949f083868b6679c54f
      https://github.com/WebKit/WebKit/commit/36cefe446ec77fb3dd2e3949f083868b6679c54f
  Author: Elliott Williams <emw at apple.com>
  Date:   2023-02-06 (Mon, 06 Feb 2023)

  Changed paths:
    M Configurations/WebKitProjectPaths.xcconfig
    M Source/WebKit/Configurations/WebKit.xcconfig
    A Source/WebKit/MigratedHeaders-input.xcfilelist
    A Source/WebKit/MigratedHeaders-output.xcfilelist
    A Source/WebKit/Scripts/migrate-headers.py
    M Source/WebKit/Scripts/postprocess-header-rule
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  [Xcode] Move header migration logic to a script phase
https://bugs.webkit.org/show_bug.cgi?id=251635

Reviewed by Alexey Proskuryakov.

WebKit and WebKitLegacy "migrate" headers from other frameworks which
they reexport symbols from. On Mac, some of these migrated headers are
public (namely the WebKitLegacy API on that platform), but on all
embedded platforms the migrated headers are private. Xcode doesn't
natively support headers that have different visibility per-platform.

Previously, we cheated by using a build setting to "redirect" migrated
headers into the PrivateHeaders/ directory on embedded platforms.
Unfortunately, this breaks tapi's SRCROOT mode, so we need to implement
a different workaround.

Replace the migrated header references in both projects with a script
phase that calls a new script, migrate-headers.py. This script reads
from a filelist to process headers and write them to the appropriate
headers folder. Headers that are written to
$(WK_MAC_PUBLIC_IOS_PRIVATE_HEADERS_DIR) are the ones with per-platform
visibility.

* Configurations/WebKitProjectPaths.xcconfig:
* Source/WebKit/Configurations/WebKit.xcconfig:
* Source/WebKit/MigratedHeaders-input.xcfilelist: Added.
* Source/WebKit/MigratedHeaders-output.xcfilelist: Added.
* Source/WebKit/Scripts/migrate-headers.py: Added.
* Source/WebKit/Scripts/postprocess-header-rule: Now, migrated headers
  that this script sees come from
  $(BUILT_PRODUCTS_DIR)/WebKitLegacy.framework, instead of
  WebKitLegacy's SRCROOT. This means they have already been
  postprocessed by WebKitLegacy. Remove the logic that is duplicated by
  WebKitLegacy's postprocessing script.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/259916@main




More information about the webkit-changes mailing list