Adjust handling of Include paths that need quoting
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 20:54:55 +0000 (20:54 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 20:54:55 +0000 (20:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191314
<rdar://problem/45849143>

Reviewed by Dan Bernstein.

There are several places in the JavaScriptCore Xcode project where the
paths defined in HEADER_SEARCH_PATHS are quoted. That is, the
definitions look like:

    HEADER_SEARCH_PATHS = (
        "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
        "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
        "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
        "$(inherited)",
    );

The idea here is presumably to have the resulting $(CPP) command have
-I options where the associated paths are themselves quoted,
protecting against space characters in the paths.

This approach to quote management can break under Xcode 9. If
.xcfilelist files are added to the project, the 'objectVersion' value
in the Xcode project file is changed from 46 to 51. If a project with
objectVersion=51 is presented to Xcode 9 (as can happen when we build
for older OS's), it produces build lines where the quotes are escaped,
thereby becoming part of the path. The build then fails because a
search for a file normally found in a directory called "Foo" will be
looked for in "\"Foo\"", which doesn't exist.

Simply removing the escaped quotes from the HEADER_SEARCH_PATHS
definition doesn't work, leading to paths that need quoting due to
space characters but that don't get this quoting (the part of the path
after the space appears to simply go missing).

Removing the escaped quotes from the HEADER_SEARCH_PATHS and moving
the definitions to the .xcconfig fixes this problem.

* Configurations/ToolExecutable.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237881 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/ToolExecutable.xcconfig
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

index e568d89..04b9e3c 100644 (file)
@@ -1,3 +1,46 @@
+2018-11-06  Keith Rollin  <krollin@apple.com>
+
+        Adjust handling of Include paths that need quoting
+        https://bugs.webkit.org/show_bug.cgi?id=191314
+        <rdar://problem/45849143>
+
+        Reviewed by Dan Bernstein.
+
+        There are several places in the JavaScriptCore Xcode project where the
+        paths defined in HEADER_SEARCH_PATHS are quoted. That is, the
+        definitions look like:
+
+            HEADER_SEARCH_PATHS = (
+                "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
+                "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
+                "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
+                "$(inherited)",
+            );
+
+        The idea here is presumably to have the resulting $(CPP) command have
+        -I options where the associated paths are themselves quoted,
+        protecting against space characters in the paths.
+
+        This approach to quote management can break under Xcode 9. If
+        .xcfilelist files are added to the project, the 'objectVersion' value
+        in the Xcode project file is changed from 46 to 51. If a project with
+        objectVersion=51 is presented to Xcode 9 (as can happen when we build
+        for older OS's), it produces build lines where the quotes are escaped,
+        thereby becoming part of the path. The build then fails because a
+        search for a file normally found in a directory called "Foo" will be
+        looked for in "\"Foo\"", which doesn't exist.
+
+        Simply removing the escaped quotes from the HEADER_SEARCH_PATHS
+        definition doesn't work, leading to paths that need quoting due to
+        space characters but that don't get this quoting (the part of the path
+        after the space appears to simply go missing).
+
+        Removing the escaped quotes from the HEADER_SEARCH_PATHS and moving
+        the definitions to the .xcconfig fixes this problem.
+
+        * Configurations/ToolExecutable.xcconfig:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+
 2018-11-06  Michael Saboff  <msaboff@apple.com>
 
         Multiple stress/regexp-compile-oom.js tests are failing on High Sierra Debug and Release JSC testers.
index 251538c..61f65ea 100644 (file)
@@ -49,4 +49,4 @@ OTHER_CFLAGS = $(ASAN_OTHER_CFLAGS) -isystem icu;
 OTHER_LDFLAGS = $(ASAN_OTHER_LDFLAGS);
 
 // Explicitly add the PrivateHeaders directory to the search path so that generated header files can be found in production builds.
-HEADER_SEARCH_PATHS = "$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders" $(inherited);
+HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore" "${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}" "$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders" $(inherited);
index c3878e1..765c9a8 100644 (file)
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Debug;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Release;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Profiling;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Production;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Debug;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Release;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Production;
                };
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                                PRODUCT_NAME = "$(TARGET_NAME)";
                        };
                        name = Debug;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                                PRODUCT_NAME = "$(TARGET_NAME)";
                        };
                        name = Release;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                                PRODUCT_NAME = "$(TARGET_NAME)";
                        };
                        name = Profiling;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore\"",
-                                       "\"${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}\"",
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                                PRODUCT_NAME = "$(TARGET_NAME)";
                        };
                        name = Production;
                        isa = XCBuildConfiguration;
                        baseConfigurationReference = BC021BF2136900C300FC5467 /* ToolExecutable.xcconfig */;
                        buildSettings = {
-                               HEADER_SEARCH_PATHS = (
-                                       "\"$(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/PrivateHeaders\"",
-                                       "$(inherited)",
-                               );
                        };
                        name = Profiling;
                };