Title: [261099] trunk/Source/WebKit
Revision
261099
Author
cdu...@apple.com
Date
2020-05-04 12:28:21 -0700 (Mon, 04 May 2020)

Log Message

[iOS] Unable to take RunningBoard process assertions in the iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=211254
<rdar://problem/62674074>

Reviewed by Geoffrey Garen.

Add com.apple.runningboard.assertions.webkit entitlement to iOS Simulator builds so that
we can take RunningBoard assertions on those platforms too.

While doing this, I found that we were not adding the entitlements properly for simulator
builds. For simulator builds, entitlements go into an __entitlements section of the binary,
rather than in the signature. Use CODE_SIGN_ENTITLEMENTS directive in xcconfig so that
XCode does the right thing for simulator builds.

* Configurations/BaseXPCService.xcconfig:
* Resources/ios/XPCService-embedded-simulator.entitlements: Added.
* Scripts/process-entitlements.sh:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261098 => 261099)


--- trunk/Source/WebKit/ChangeLog	2020-05-04 19:18:10 UTC (rev 261098)
+++ trunk/Source/WebKit/ChangeLog	2020-05-04 19:28:21 UTC (rev 261099)
@@ -1,3 +1,23 @@
+2020-05-04  Chris Dumez  <cdu...@apple.com>
+
+        [iOS] Unable to take RunningBoard process assertions in the iOS Simulator
+        https://bugs.webkit.org/show_bug.cgi?id=211254
+        <rdar://problem/62674074>
+
+        Reviewed by Geoffrey Garen.
+
+        Add com.apple.runningboard.assertions.webkit entitlement to iOS Simulator builds so that
+        we can take RunningBoard assertions on those platforms too.
+
+        While doing this, I found that we were not adding the entitlements properly for simulator
+        builds. For simulator builds, entitlements go into an __entitlements section of the binary,
+        rather than in the signature. Use CODE_SIGN_ENTITLEMENTS directive in xcconfig so that
+        XCode does the right thing for simulator builds.
+
+        * Configurations/BaseXPCService.xcconfig:
+        * Resources/ios/XPCService-embedded-simulator.entitlements: Added.
+        * Scripts/process-entitlements.sh:
+
 2020-05-04  Darin Adler  <da...@apple.com>
 
         Remove now-unneded HAVE(WINDOW_SERVER_OCCLUSION_NOTIFICATIONS)

Modified: trunk/Source/WebKit/Configurations/BaseXPCService.xcconfig (261098 => 261099)


--- trunk/Source/WebKit/Configurations/BaseXPCService.xcconfig	2020-05-04 19:18:10 UTC (rev 261098)
+++ trunk/Source/WebKit/Configurations/BaseXPCService.xcconfig	2020-05-04 19:28:21 UTC (rev 261099)
@@ -77,11 +77,8 @@
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macosx = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily);
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_maccatalyst = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily);
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iphoneos = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iosdevicefamily);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iphonesimulator = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily);
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_appletvos = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iosdevicefamily);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_appletvsimulator = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily);
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_watchos = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iosdevicefamily);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_watchsimulator = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily);
 
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_$(WK_XPC_SERVICE_VARIANT)) --entitlements $(WK_PROCESSED_XCENT_FILE);
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_ = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_Normal);
@@ -88,9 +85,11 @@
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_Normal = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_Normal_VALIDATION_$(WK_LIBRARY_VALIDATION_ENABLED));
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_macfamily_VARIANT_Normal_VALIDATION_YES = -o library;
 WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iosdevicefamily = --entitlements $(WK_PROCESSED_XCENT_FILE);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily_XBS_$(RC_XBS));
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily_XBS_ = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily_XBS_NO);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily_XBS_NO = --entitlements $(WK_PROCESSED_XCENT_FILE);
-WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS_iossimulatorfamily_XBS_YES = ;
 
+// For simulator builds, entitlements are added to a special __entitlements section on the binary rather than the signature.
+CODE_SIGN_ENTITLEMENTS = $(CODE_SIGN_ENTITLEMENTS_$(WK_PLATFORM_NAME));
+CODE_SIGN_ENTITLEMENTS_iphonesimulator = Resources/ios/XPCService-embedded-simulator.entitlements
+CODE_SIGN_ENTITLEMENTS_appletvsimulator = Resources/ios/XPCService-embedded-simulator.entitlements
+CODE_SIGN_ENTITLEMENTS_watchsimulator = Resources/ios/XPCService-embedded-simulator.entitlements
+
 OTHER_CODE_SIGN_FLAGS = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS);

Added: trunk/Source/WebKit/Resources/ios/XPCService-embedded-simulator.entitlements (0 => 261099)


--- trunk/Source/WebKit/Resources/ios/XPCService-embedded-simulator.entitlements	                        (rev 0)
+++ trunk/Source/WebKit/Resources/ios/XPCService-embedded-simulator.entitlements	2020-05-04 19:28:21 UTC (rev 261099)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.security.get-task-allow</key>
+	<true/>
+	<key>com.apple.runningboard.assertions.webkit</key>
+	<true/>
+</dict>
+</plist>

Modified: trunk/Source/WebKit/Scripts/process-entitlements.sh (261098 => 261099)


--- trunk/Source/WebKit/Scripts/process-entitlements.sh	2020-05-04 19:18:10 UTC (rev 261098)
+++ trunk/Source/WebKit/Scripts/process-entitlements.sh	2020-05-04 19:28:21 UTC (rev 261099)
@@ -205,9 +205,10 @@
 rm -f "${WK_PROCESSED_XCENT_FILE}"
 plistbuddy Clear dict
 
+# Simulator entitlements should be added to Resources/ios/XPCService-ios-simulator.entitlements
 if [[ "${WK_PLATFORM_NAME}" =~ .*simulator ]]
 then
-    [[ "${RC_XBS}" != YES ]] && plistbuddy Add :com.apple.security.get-task-allow bool YES
+    cp "${CODE_SIGN_ENTITLEMENTS}" "${WK_PROCESSED_XCENT_FILE}"
 elif [[ "${WK_PLATFORM_NAME}" == macosx ]]
 then
     [[ "${RC_XBS}" != YES ]] && plistbuddy Add :com.apple.security.get-task-allow bool YES
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to