Title: [287884] trunk/Source
Revision
287884
Author
msab...@apple.com
Date
2022-01-11 09:55:07 -0800 (Tue, 11 Jan 2022)

Log Message

Fixed installhdr build failures in WebCore and WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=235059

Reviewed by Filip Pizlo.

Source/WebCore:

Reworked how SYSTEM_CONTENT_PATH is added to values to the minimum that is required for the build system.
Before this change, SYSTEM_CONTENT_PATH was added twice to some configuration variables due to is
incorrectly being added to NORMAL_WEBCORE_FRAMEWORKS_DIR.

Also refactored the computation of _javascript_CORE_PRIVATE_HEADERS_DIR to use the newly added
INSTALL_PATH_PREFIX value.

* Configurations/WebCore.xcconfig:

Source/WebKitLegacy:

On iOS, we need to create symbolic links for WebKitLegacy when using the SYSTEM_CONTENT_PATH.
Copied the creation script to the project and updated the configuration file accordingly.
 
* WebKitLegacy.xcodeproj/project.pbxproj:
* scripts/create-symlink-to-altroot.sh: Added.

Source/WebKitLegacy/mac:

Refactored how INSTALL_PATH is calculated to simplify the logic for the macOS / iOS
location difference for the WebKitLegacy framework.  In WebKitLegacy.xcconfig, that
required changing NORMAL_PRODUCTION_FRAMEWORKS_DIR.

Added the configuration values, ALTERNATE_ROOT_PATH and OUTPUT_ALTERNATE_ROOT_PATH, for
iOS builds to drive the newly added create symlinks script.

Did the same rework as in WebCore configuration to eliminate using SYSTEM_CONTENT_PATH 
twice for some paths.

* Configurations/WebKitLegacy.xcconfig:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287883 => 287884)


--- trunk/Source/WebCore/ChangeLog	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebCore/ChangeLog	2022-01-11 17:55:07 UTC (rev 287884)
@@ -1,3 +1,19 @@
+2022-01-11  Michael Saboff  <msab...@apple.com>
+
+        Fixed installhdr build failures in WebCore and WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=235059
+
+        Reviewed by Filip Pizlo.
+
+        Reworked how SYSTEM_CONTENT_PATH is added to values to the minimum that is required for the build system.
+        Before this change, SYSTEM_CONTENT_PATH was added twice to some configuration variables due to is
+        incorrectly being added to NORMAL_WEBCORE_FRAMEWORKS_DIR.
+
+        Also refactored the computation of _javascript_CORE_PRIVATE_HEADERS_DIR to use the newly added
+        INSTALL_PATH_PREFIX value.
+
+        * Configurations/WebCore.xcconfig:
+
 2022-01-11  Antoine Quint  <grao...@webkit.org>
 
         css/css-transitions/KeyframeEffect-setKeyframes.tentative.html is a failure

Modified: trunk/Source/WebCore/Configurations/WebCore.xcconfig (287883 => 287884)


--- trunk/Source/WebCore/Configurations/WebCore.xcconfig	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebCore/Configurations/WebCore.xcconfig	2022-01-11 17:55:07 UTC (rev 287884)
@@ -56,7 +56,10 @@
 HEADER_SEARCH_PATHS = PAL ForwardingHeaders /usr/include/libxslt /usr/include/libxml2 "$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore" "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(ANGLE_HEADER_SEARCH_PATHS) $(LIBWEBRTC_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS) $(SRCROOT);
 INFOPLIST_FILE = Info.plist;
 
-INSTALL_PATH = $(INSTALL_PATH_$(WK_COCOA_TOUCH));
+INSTALL_PATH_PREFIX = $(INSTALL_PATH_PREFIX_USE_SYSTEM_CONTENT_PATH_$(USE_SYSTEM_CONTENT_PATH));
+INSTALL_PATH_PREFIX_USE_SYSTEM_CONTENT_PATH_YES = $(SYSTEM_CONTENT_PATH);
+
+INSTALL_PATH = $(INSTALL_PATH_PREFIX)$(INSTALL_PATH_$(WK_COCOA_TOUCH));
 INSTALL_PATH_cocoatouch = $(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
 INSTALL_PATH_ = $(WEBCORE_FRAMEWORKS_DIR);
 
@@ -72,7 +75,7 @@
 UNEXPORTED_SYMBOLS_FILE = Configurations/WebCore.unexp;
 
 ALTERNATE_ROOT_PATH[sdk=iphone*] = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
-ALTERNATE_ROOT_PATH[sdk=macosx*] = $(DYLIB_INSTALL_NAME_BASE_PLATFORM_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR));
+ALTERNATE_ROOT_PATH[sdk=macosx*] = $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
 
 OUTPUT_ALTERNATE_ROOT_PATH[sdk=iphone*] = $(OUTPUT_ALTERNATE_ROOT_PATH_$(USE_SYSTEM_CONTENT_PATH));
 OUTPUT_ALTERNATE_ROOT_PATH_YES[sdk=iphone*] = $(DSTROOT)$(ALTERNATE_ROOT_PATH)/$(FULL_PRODUCT_NAME);
@@ -150,12 +153,9 @@
 SECTORDER_FLAGS_Production[sdk=iphoneos*] = -Wl,-order_file,$(SDKROOT)/AppleInternal/OrderFiles/WebCore.order;
 SECTORDER_FLAGS_Production[sdk=macosx*] = -Wl,-order_file,WebCore.order;
 
-NORMAL_WEBCORE_FRAMEWORKS_PREFIX = $(NORMAL_WEBCORE_FRAMEWORKS_PREFIX_$(USE_SYSTEM_CONTENT_PATH));
-NORMAL_WEBCORE_FRAMEWORKS_PREFIX_YES = $(SYSTEM_CONTENT_PATH);
+NORMAL_WEBCORE_FRAMEWORKS_DIR[sdk=iphone*] = $(PRODUCTION_FRAMEWORKS_DIR);
+NORMAL_WEBCORE_FRAMEWORKS_DIR[sdk=macosx*] = $(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
 
-NORMAL_WEBCORE_FRAMEWORKS_DIR[sdk=iphone*] = $(NORMAL_WEBCORE_FRAMEWORKS_PREFIX)$(PRODUCTION_FRAMEWORKS_DIR);
-NORMAL_WEBCORE_FRAMEWORKS_DIR[sdk=macosx*] = $(NORMAL_WEBCORE_FRAMEWORKS_PREFIX)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
-
 WEBCORE_FRAMEWORKS_DIR = $(WEBCORE_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_$(WK_USE_OVERRIDE_FRAMEWORKS_DIR));
 WEBCORE_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(NORMAL_WEBCORE_FRAMEWORKS_DIR);
 WEBCORE_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
@@ -185,7 +185,7 @@
 _javascript_CORE_PRIVATE_HEADERS_DIR_Release = $(_javascript_CORE_PRIVATE_HEADERS_engineering);
 _javascript_CORE_PRIVATE_HEADERS_DIR_Debug = $(_javascript_CORE_PRIVATE_HEADERS_engineering);
 _javascript_CORE_PRIVATE_HEADERS_DIR_Production = $(_javascript_CORE_PRIVATE_HEADERS_DIR_Production_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
-_javascript_CORE_PRIVATE_HEADERS_DIR_Production_COCOA_TOUCH_YES = $(SDKROOT)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/Frameworks/_javascript_Core.framework/PrivateHeaders;
+_javascript_CORE_PRIVATE_HEADERS_DIR_Production_COCOA_TOUCH_YES = $(SDKROOT)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(INSTALL_PATH_PREFIX)$(SYSTEM_LIBRARY_DIR)/Frameworks/_javascript_Core.framework/PrivateHeaders;
 _javascript_CORE_PRIVATE_HEADERS_DIR_Production_COCOA_TOUCH_NO = $(SDKROOT)$(PRODUCTION_FRAMEWORKS_DIR)/_javascript_Core.framework/PrivateHeaders;
 _javascript_CORE_PRIVATE_HEADERS_engineering = $(BUILT_PRODUCTS_DIR)/_javascript_Core.framework/PrivateHeaders;
 

Modified: trunk/Source/WebKitLegacy/ChangeLog (287883 => 287884)


--- trunk/Source/WebKitLegacy/ChangeLog	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebKitLegacy/ChangeLog	2022-01-11 17:55:07 UTC (rev 287884)
@@ -1,3 +1,16 @@
+2022-01-11  Michael Saboff  <msab...@apple.com>
+
+        Fixed installhdr build failures in WebCore and WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=235059
+
+        Reviewed by Filip Pizlo.
+
+        On iOS, we need to create symbolic links for WebKitLegacy when using the SYSTEM_CONTENT_PATH.
+        Copied the creation script to the project and updated the configuration file accordingly.
+ 
+        * WebKitLegacy.xcodeproj/project.pbxproj:
+        * scripts/create-symlink-to-altroot.sh: Added.
+
 2022-01-10  Alex Christensen  <achristen...@webkit.org>
 
         Start using C++20

Modified: trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj (287883 => 287884)


--- trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebKitLegacy/WebKitLegacy.xcodeproj/project.pbxproj	2022-01-11 17:55:07 UTC (rev 287884)
@@ -3080,6 +3080,7 @@
 				532424B1254905FE00A6975B /* Check For Inappropriate Files In Framework */,
 				1A3193D5191856E500E1CF89 /* Symlink WebKitPluginHost */,
 				537CF83A22EFBFB100C6EBB3 /* Check .xcfilelists */,
+				650473452789431C00AF78A2 /* Create Symlink to Alt Root Path */,
 			);
 			buildRules = (
 				535E08C322545B4C00DF00CA /* PBXBuildRule */,
@@ -3324,6 +3325,25 @@
 			shellPath = /bin/sh;
 			shellScript = "# Touch Info.plist to let Xcode know it needs to copy it into the built product\nif [[ \"${CONFIGURATION}\" != \"Production\" ]]; then\n    touch \"${PROJECT_DIR}/mac/Info.plist\";\nfi;\n";
 		};
+		650473452789431C00AF78A2 /* Create Symlink to Alt Root Path */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 8;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+			);
+			name = "Create Symlink to Alt Root Path";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+				"${OUTPUT_ALTERNATE_ROOT_PATH}",
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+			shellPath = /bin/sh;
+			shellScript = "\"${SRCROOT}/scripts/create-symlink-to-altroot.sh\"\n";
+		};
 		7C02321B251B9A8A00BA7BB6 /* Generate Preferences */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (287883 => 287884)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2022-01-11 17:55:07 UTC (rev 287884)
@@ -1,3 +1,22 @@
+2022-01-11  Michael Saboff  <msab...@apple.com>
+
+        Fixed installhdr build failures in WebCore and WebKitLegacy
+        https://bugs.webkit.org/show_bug.cgi?id=235059
+
+        Reviewed by Filip Pizlo.
+
+        Refactored how INSTALL_PATH is calculated to simplify the logic for the macOS / iOS
+        location difference for the WebKitLegacy framework.  In WebKitLegacy.xcconfig, that
+        required changing NORMAL_PRODUCTION_FRAMEWORKS_DIR.
+
+        Added the configuration values, ALTERNATE_ROOT_PATH and OUTPUT_ALTERNATE_ROOT_PATH, for
+        iOS builds to drive the newly added create symlinks script.
+
+        Did the same rework as in WebCore configuration to eliminate using SYSTEM_CONTENT_PATH 
+        twice for some paths.
+
+        * Configurations/WebKitLegacy.xcconfig:
+
 2022-01-10  Alex Christensen  <achristen...@webkit.org>
 
         Start using C++20

Modified: trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig (287883 => 287884)


--- trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig	2022-01-11 17:50:05 UTC (rev 287883)
+++ trunk/Source/WebKitLegacy/mac/Configurations/WebKitLegacy.xcconfig	2022-01-11 17:55:07 UTC (rev 287884)
@@ -61,13 +61,14 @@
 
 HEADER_SEARCH_PATHS = "$(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders" "$(BUILT_PRODUCTS_DIR)/DerivedSources/WebKitLegacy" "$(BUILT_PRODUCTS_DIR)/usr/local/include" $(WEBGPU_HEADER_SEARCH_PATHS) $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) $(LIBWEBRTC_HEADER_SEARCH_PATHS) $(HEADER_SEARCH_PATHS) $(SRCROOT);
 INFOPLIST_FILE = mac/Info.plist;
-INSTALL_PATH = $(INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_$(USE_SYSTEM_CONTENT_PATH));
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_YES = $(SYSTEM_CONTENT_PATH)$(WEBKIT_LEGACY_FRAMEWORKS_DIR);
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_ = $(INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_NO);
-INSTALL_PATH_USE_SYSTEM_CONTENT_PATH_NO = $(INSTALL_PATH_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
-INSTALL_PATH_COCOA_TOUCH_YES = $(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
-INSTALL_PATH_COCOA_TOUCH_NO = $(WEBKIT_LEGACY_FRAMEWORKS_DIR);
 
+INSTALL_PATH_PREFIX = $(INSTALL_PATH_PREFIX_USE_SYSTEM_CONTENT_PATH_$(USE_SYSTEM_CONTENT_PATH));
+INSTALL_PATH_PREFIX_USE_SYSTEM_CONTENT_PATH_YES = $(SYSTEM_CONTENT_PATH);
+
+INSTALL_PATH = $(INSTALL_PATH_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
+INSTALL_PATH_COCOA_TOUCH_YES = $(INSTALL_PATH_PREFIX)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
+INSTALL_PATH_COCOA_TOUCH_NO = $(INSTALL_PATH_PREFIX)$(WEBKIT_LEGACY_FRAMEWORKS_DIR);
+
 DYLIB_INSTALL_NAME_BASE = $(DYLIB_INSTALL_NAME_BASE_$(WK_USE_ALTERNATE_FRAMEWORKS_DIR));
 DYLIB_INSTALL_NAME_BASE_NO = $(NORMAL_WEBKIT_LEGACY_FRAMEWORKS_DIR);
 DYLIB_INSTALL_NAME_BASE_YES = $(DYLIB_INSTALL_NAME_BASE);
@@ -77,6 +78,11 @@
 INSTALLHDRS_SCRIPT_PHASE = YES;
 APPLY_RULES_IN_COPY_HEADERS = $(WK_USE_NEW_BUILD_SYSTEM);
 
+ALTERNATE_ROOT_PATH[sdk=iphone*] = $(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
+
+OUTPUT_ALTERNATE_ROOT_PATH[sdk=iphone*] = $(OUTPUT_ALTERNATE_ROOT_PATH_$(USE_SYSTEM_CONTENT_PATH));
+OUTPUT_ALTERNATE_ROOT_PATH_YES[sdk=iphone*] = $(DSTROOT)$(ALTERNATE_ROOT_PATH)/$(FULL_PRODUCT_NAME);
+
 PRODUCT_NAME = WebKitLegacy;
 PRODUCT_BUNDLE_IDENTIFIER = com.apple.$(PRODUCT_NAME:rfc1034identifier);
 UMBRELLA_FRAMEWORKS_DIR = $(PRODUCTION_FRAMEWORKS_DIR)/WebKit.framework/Versions/A/Frameworks;
@@ -116,12 +122,9 @@
 WEBKIT_LEGACY_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(NORMAL_WEBKIT_LEGACY_FRAMEWORKS_DIR);
 WEBKIT_LEGACY_FRAMEWORKS_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
 
-NORMAL_PRODUCTION_FRAMEWORKS_PREFIX = $(NORMAL_PRODUCTION_FRAMEWORKS_PREFIX_$(USE_SYSTEM_CONTENT_PATH));
-NORMAL_PRODUCTION_FRAMEWORKS_PREFIX_YES = $(SYSTEM_CONTENT_PATH);
-
 NORMAL_PRODUCTION_FRAMEWORKS_DIR = $(NORMAL_PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
-NORMAL_PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_YES = $(SDKROOT)$(NORMAL_PRODUCTION_FRAMEWORKS_PREFIX)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
-NORMAL_PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_NO = $(NEXT_ROOT)$(NORMAL_PRODUCTION_FRAMEWORKS_PREFIX)$(SYSTEM_LIBRARY_DIR)/Frameworks;
+NORMAL_PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_YES = $(SDKROOT)$(INSTALL_PATH_PREFIX)$(WK_ALTERNATE_WEBKIT_SDK_PATH)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks;
+NORMAL_PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_NO = $(NEXT_ROOT)$(INSTALL_PATH_PREFIX)$(SYSTEM_LIBRARY_DIR)/Frameworks;
 
 PRODUCTION_FRAMEWORKS_DIR = $(PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH));
 PRODUCTION_FRAMEWORKS_DIR_COCOA_TOUCH_YES = $(NORMAL_PRODUCTION_FRAMEWORKS_DIR);

Added: trunk/Source/WebKitLegacy/scripts/create-symlink-to-altroot.sh (0 => 287884)


--- trunk/Source/WebKitLegacy/scripts/create-symlink-to-altroot.sh	                        (rev 0)
+++ trunk/Source/WebKitLegacy/scripts/create-symlink-to-altroot.sh	2022-01-11 17:55:07 UTC (rev 287884)
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+echo "ATTEMPTING SYMLINK for WebKitLegacy"
+echo "ALTERNATE_ROOT_PATH = ${ALTERNATE_ROOT_PATH}"
+echo "OUTPUT_ALTERNATE_ROOT_PATH = ${OUTPUT_ALTERNATE_ROOT_PATH}"
+echo "DSTROOT = ${DSTROOT}"
+echo "INSTALL_PATH = ${INSTALL_PATH}"
+
+if [[ -z "${OUTPUT_ALTERNATE_ROOT_PATH}" ]]; then
+    exit 0
+fi
+
+if [[ "${SKIP_INSTALL}" = "YES" ]]; then
+    exit 0
+fi
+
+# Convert eg. `/System/Library/PrivateFrameworks` to `../../..`
+RELATIVE_PATH_FROM_SYMLINK_TO_ROOT=$(echo "${ALTERNATE_ROOT_PATH}" | sed -E -e "s/\/[a-zA-Z0-9_]+/..\//g" -e "s/\/$//")
+SYMLINK_VALUE="${RELATIVE_PATH_FROM_SYMLINK_TO_ROOT}${INSTALL_PATH}/${FULL_PRODUCT_NAME}"
+
+if [[ -L "${OUTPUT_ALTERNATE_ROOT_PATH}" ]]; then
+    EXISTING_SYMLINK_VALUE=$(readlink "${OUTPUT_ALTERNATE_ROOT_PATH}")
+
+    if [[ "${EXISTING_SYMLINK_VALUE}" == "${SYMLINK_VALUE}" ]]; then
+        exit 0
+    fi
+
+    echo "warning: existing symlink is incorrect; expected ${SYMLINK_VALUE}, got ${EXISTING_SYMLINK_VALUE}"
+elif [[ -e "${OUTPUT_ALTERNATE_ROOT_PATH}" ]]; then
+    echo "error: expected a symlink at ${OUTPUT_ALTERNATE_ROOT_PATH}"
+    exit 1
+fi
+
+echo "RELATIVE_PATH_FROM_SYMLINK_TO_ROOT = ${RELATIVE_PATH_FROM_SYMLINK_TO_ROOT}"
+echo "SYMLINK_VALUE = ${SYMLINK_VALUE}"
+echo
+
+echo ln -sf "${SYMLINK_VALUE}" "${OUTPUT_ALTERNATE_ROOT_PATH}"
+ln -sf "${SYMLINK_VALUE}" "${OUTPUT_ALTERNATE_ROOT_PATH}"
Property changes on: trunk/Source/WebKitLegacy/scripts/create-symlink-to-altroot.sh
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to