[webkit-changes] [WebKit/WebKit] f07375: [Xcode] Add a style check to keep xcschemes in sync

Elliott Williams noreply at github.com
Wed Oct 12 19:43:43 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f07375f48dbcfcd9dd3af8271ad9dfbaac22f4e4
      https://github.com/WebKit/WebKit/commit/f07375f48dbcfcd9dd3af8271ad9dfbaac22f4e4
  Author: Elliott Williams <emw at apple.com>
  Date:   2022-10-12 (Wed, 12 Oct 2022)

  Changed paths:
    M Tools/Scripts/webkitpy/style/checker.py
    A Tools/Scripts/webkitpy/style/checkers/xcscheme.py
    M WebKit.xcworkspace/xcshareddata/xcschemes/All WebKit Tools.xcscheme
    M WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit.xcscheme

  Log Message:
  -----------
  [Xcode] Add a style check to keep xcschemes in sync
https://bugs.webkit.org/show_bug.cgi?id=245587

Reviewed by Jonathan Bedard.

XcodeSchemeChecker defines relationships between schemes using set
algebra, e.g.: "Everything up to WebKit + Tools" is a union of "Everything
up to WebKit" and "All WebKit Tools". When given an xcscheme file, it
parses it and verifies that its relationships hold.

This helps keep the list of buildable targets in sync between schemes,
which is a challenge for WebKit since we have multiple listings of the
WebKit and Tools targets (and many more internally).

Here's an example failure message, which revealed that "All WebKit
Tools" depends on the TestWebKitAPI executable and not the entire
project, so it was skipping building TestIPC, TestWTF, etc.:

    ERROR: WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme:0:  targets should be equal to the targets in 'Everything up to WebKit.xcscheme' + 'All WebKit Tools.xcscheme'
    	Add:
    	- TestWebKitAPI (in project 'TestWebKitAPI', built for: analyze test run profile archive)
    	Remove:
    	- All (in project 'TestWebKitAPI', built for: analyze test run profile archive)  [xcscheme/sync] [5]

Currently, the rules are evaluated one-way, so a change to one scheme
_will not_ invalidate other schemes that define rules on it. However,
the whole scheme graph can easily be checked at once with:

    check-webkit-style WebKit.xcworkspace/xcshareddata/xcschemes/*

* Tools/Scripts/webkitpy/style/checker.py: Add xcscheme file type and
  XcodeSchemeChecker instantiation.
* Tools/Scripts/webkitpy/style/checkers/xcscheme.py: Added.

Fix a few small discrepencies revealed by the checker.

* WebKit.xcworkspace/xcshareddata/xcschemes/All WebKit Tools.xcscheme:
  Build the "All" aggregate from TestWebKitAPI, not just the main
  executable.
* WebKit.xcworkspace/xcshareddata/xcschemes/Everything up to WebKit + Tools.xcscheme:
  Build the "All" aggregate from bmalloc and explicitly depend on WTF.
  Both of these are probably unnecessary, since all the needed target
  are found by Xcode implicitly. We can clean these up from all schemes
  in a follow-up.

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




More information about the webkit-changes mailing list