Skip to content

Commit

Permalink
Roots should be packaged in the system cryptex on macOS and iOS
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260153
rdar://113862633

Reviewed by Andy Estes.

This will package a root into /System/Cryptexes/OS instead of / on
macOS, Mac Catalyst, and iOS.

* Tools/Scripts/package-root:
(usage):
* Tools/Scripts/webkitdirs.pm:
(usesCryptexPath):

Canonical link: https://commits.webkit.org/267157@main
  • Loading branch information
rreno committed Aug 22, 2023
1 parent d933b28 commit 62a8351
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Tools/Scripts/package-root
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,15 @@ sub usage()
{
my $usage = <<EOF;
Bundles up products created with build-webkit into a zip suitable for sharing as a root.
The archive is created in the top level webkit directory.
The archive is created in the build directory for the chosen platform and SDK.
Usage: $programName [configuration options]
--help Show this help message
--sdk Specifies SDK for which the roots are staged
(Default: currently installed Base SDK)
--ios-device Use "iphoneos.internal" SDK if installed, else "iphoneos" SDK (iOS only)
--tvos-device Use "appletvos.internal" SDK if installed, else "appletvos" SDK (tvOS only)
--watchos-device Use "watchos.internal" SDK if installed, else "watchos" SDK (watchOS only)
--device DEPRECATED alias of --ios-device
--ios-simulator Use "iphonesimulator.internal" SDK if installed, else "iphonesimulator" SDK (iOS only)
--simulator DEPRECATED alias of --ios-simulator
Expand All @@ -74,8 +76,10 @@ setConfiguration();

my @privateFrameworks = qw(WebCore WebGPU WebKitLegacy);
my @publicFrameworks = qw(JavaScriptCore WebKit);
my $privateInstallPath = "/System/Library/PrivateFrameworks";
my $publicInstallPath = "/System/Library/Frameworks";
my $packagedRootBasePath = usesCryptexPath() ? "/System/Cryptexes/OS/" : "/";
$packagedRootBasePath = "$packagedRootBasePath" . "System/iOSSupport/" if isMacCatalystWebKit();
my $privateInstallPath = "$packagedRootBasePath" . "System/Library/PrivateFrameworks";
my $publicInstallPath = "$packagedRootBasePath" . "System/Library/Frameworks";

my $configuration = configuration();
my $platform = xcodeSDKPlatformName();
Expand All @@ -102,7 +106,7 @@ foreach my $framework (@publicFrameworks) {
die "Check to see that you have built $framework for $configuration-$platform" if $?;
}

system 'ditto', "$productDir/usr", "$stagingRoot/usr";
system 'ditto', "$productDir/usr", "$stagingRoot" . "$packagedRootBasePath" . "usr";

chdir $stagingRoot;
print "Creating compressed archive ...\n";
Expand Down
7 changes: 7 additions & 0 deletions Tools/Scripts/webkitdirs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ BEGIN {
&isInspectorFrontend
&isJSCOnly
&isLinux
&isMacCatalystWebKit
&isPlayStation
&isWPE
&isWinCairo
Expand Down Expand Up @@ -193,6 +194,7 @@ BEGIN {
&splitVersionString
&tsanIsEnabled
&ubsanIsEnabled
&usesCryptexPath
&willUseAppleTVDeviceSDK
&willUseAppleTVSimulatorSDK
&willUseIOSDeviceSDK
Expand Down Expand Up @@ -1867,6 +1869,11 @@ sub isAppleCocoaWebKit()
return isAppleMacWebKit() || isEmbeddedWebKit() || isMacCatalystWebKit();
}

sub usesCryptexPath
{
return isAppleMacWebKit() || isMacCatalystWebKit() || isIOSWebKit();
}

sub simulatorDeviceFromJSON
{
my $runtime = shift;
Expand Down

0 comments on commit 62a8351

Please sign in to comment.