WebKit icon indicating copy to clipboard operation
WebKit copied to clipboard

[Xcode] Add a style check to keep xcschemes in sync

Open emw-apple opened this issue 2 years ago โ€ข 2 comments

8c2cba3a21c589907ad397125308db4486fcf3f2

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

Reviewed by NOBODY (OOPS!).

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.

https://github.com/WebKit/WebKit/commit/b63ba8620b07e8f7b3185f9bf01865a41023cf75

Misc iOS, tvOS & watchOS macOS Linux Windows
โœ… ๐Ÿงช style โœ… ๐Ÿ›  ios โœ… ๐Ÿ›  mac โœ… ๐Ÿ›  wpe โœ… ๐Ÿ›  ๐Ÿงช win
โœ… ๐Ÿงช bindings โœ… ๐Ÿ›  ios-sim โณ ๐Ÿ›  mac-debug โœ… ๐Ÿ›  gtk โœ… ๐Ÿ›  wincairo
โœ… ๐Ÿงช webkitperl โœ… ๐Ÿงช ios-wk2 โœ… ๐Ÿ›  mac-AS-debug โœ… ๐Ÿงช gtk-wk2
โœ… ๐Ÿงช webkitpy โœ… ๐Ÿงช api-ios โœ… ๐Ÿงช api-mac โœ… ๐Ÿงช api-gtk
โœ… ๐Ÿ›  tv โณ ๐Ÿงช mac-wk1
โœ… ๐Ÿ›  tv-sim โœ… ๐Ÿงช mac-wk2
โœ… ๐Ÿ›  watch loading ๐Ÿงช mac-AS-debug-wk2
โœ… ๐Ÿ›  watch-sim โœ… ๐Ÿงช mac-wk2-stress

emw-apple avatar Sep 23 '22 19:09 emw-apple

Committed 255464@main (f07375f48dbc): https://commits.webkit.org/255464@main

Reviewed commits have been landed. Closing PR #4643 and removing active labels.

webkit-commit-queue avatar Oct 13 '22 02:10 webkit-commit-queue