[webkit-changes] [WebKit/WebKit] 8cd335: [Xcode] Enable TAPI_USE_SRCROOT to avoid giving st...

Elliott Williams noreply at github.com
Mon Feb 20 10:39:52 PST 2023


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

  Changed paths:
    M Configurations/WebKitTargetConditionals.xcconfig
    M Source/WebGPU/Configurations/WebGPU.xcconfig
    M Source/WebInspectorUI/Configurations/WebInspectorUIFramework.xcconfig
    M Source/WebKit/Configurations/Base.xcconfig
    M Source/WebKit/Configurations/WebKit.xcconfig
    M Source/WebKit/UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj
    M Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig
    M Tools/Scripts/build-webkit
    M Tools/Scripts/sort-Xcode-project-file
    M Tools/Scripts/webkitdirs.pm

  Log Message:
  -----------
  [Xcode] Enable TAPI_USE_SRCROOT to avoid giving stale headers to tapi
https://bugs.webkit.org/show_bug.cgi?id=250612
rdar://103361037

Reviewed by Alexey Proskuryakov.

In recent Xcodes, TAPI_USE_SRCROOT will cause tapi to read headers from
the project's sources, as reported by Xcode. This is in contrast with
the traditional behavior, where tapi reads *any* header in the
framework's bundle directory, and is therefore liable to picking up
stale or incorrect headers left from a prior build.

In shipping Xcode, this behavior can be tested by building with
UseSRCROOTSupportForTAPI=1 as an environment variable.

* Configurations/WebKitTargetConditionals.xcconfig: Add target
  conditionals for shipping Xcode versions.

Enable TAPI_USE_SRCROOT via xcconfigs.

Work around a header-ordering bug in tapi (rdar://104432605) by sorting
all umbrella headers to the top of their targets' Headers phase.

* Source/WebGPU/Configurations/WebGPU.xcconfig: Enable TAPI_USE_SRCROOT.
* Source/WebKit/Configurations/Base.xcconfig: Ditto.
* Source/WebKit/Configurations/WebKit.xcconfig:
  - WebKit additionally needs a pre-include of config.h, because tapi's
    SRCROOT mode reads unprocessed headers that depend on config.h being
    imported first (this is rdar://104248994).
  - Use NORMAL_UMBRELLA_FRAMEWORKS_DIR on a line in the diff.
  - Remove reference to NSURLDownloadSPI.h, which is no longer part of
    the target.
* Source/WebKit/UIProcess/API/Cocoa/_WKUserContentFilterPrivate.h: Added
  a forward declaration needed for parsing in tapi.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj: Sort umbrella headers
  to the top, so that tapi sees them first.

* Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig: Enable
  TAPI_USE_SRCROOT.
* Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj: Sort
  umbrella headers to the top, so that tapi sees them first.

* Tools/Scripts/build-webkit: Set UseSRCROOTSupportForTAPI=YES by
  default where it is supported. This enables SRCROOT mode in EWS.
  Make-based builds are not affected.
* Tools/Scripts/sort-Xcode-project-file: Enforce header-ordering
  workaround described above.
* Tools/Scripts/webkitdirs.pm:
(xcodeVersion): Added getter subroutine for $xcodeVersion.
(XcodeOptions): When $ENV{UseSRCROOTSupportForTAPI} is
  truthy, set the TAPI_USE_SRCROOT build setting. This allows us to
  write config logic based on TAPI_USE_SRCROOT that works on older
  Xcodes.

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




More information about the webkit-changes mailing list