Skip to content

Commit 1ff8aa6

Browse files
Remove DEPLOYMENT_LOCATION hack for BwB mode (#2790)
Introduced in 2fee67a, this is non longer needed after e600086 and possibly as early as after c17968b. Signed-off-by: Brentley Jones <github@brentleyjones.com>
1 parent 806ed7e commit 1ff8aa6

File tree

8 files changed

+25
-260
lines changed

8 files changed

+25
-260
lines changed

examples/integration/test/fixtures/bwb.xcodeproj/project.pbxproj

Lines changed: 0 additions & 132 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/rules_ios/test/fixtures/bwb.xcodeproj/project.pbxproj

Lines changed: 0 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/generators/legacy/src/Generator/CreateProject.swift

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,11 @@ $(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8484
""",
8585
"BUILD_MARKER_FILE": "$(OBJROOT)/build_marker",
8686
"BUILD_WORKSPACE_DIRECTORY": "$(SRCROOT)",
87-
// `BUILT_PRODUCTS_DIR` isn't actually used by the build, since
88-
// `DEPLOYMENT_LOCATION` is set. It does prevent `DYLD_LIBRARY_PATH`
89-
// from being modified though.
90-
"BUILT_PRODUCTS_DIR": """
91-
$(INDEXING_BUILT_PRODUCTS_DIR__$(INDEX_ENABLE_BUILD_ARENA))
92-
""",
9387
"CLANG_ENABLE_OBJC_ARC": true,
9488
"CLANG_MODULES_AUTOLINK": false,
9589
"CONFIGURATION_BUILD_DIR": "$(BUILD_DIR)/$(BAZEL_PACKAGE_BIN_DIR)",
9690
"COPY_PHASE_STRIP": false,
9791
"DEBUG_INFORMATION_FORMAT": "dwarf",
98-
"DEPLOYMENT_LOCATION": """
99-
$(INDEXING_DEPLOYMENT_LOCATION__$(INDEX_ENABLE_BUILD_ARENA)),
100-
""",
10192
"DSTROOT": "$(PROJECT_TEMP_DIR)",
10293
"ENABLE_DEFAULT_SEARCH_PATHS": "NO",
10394
// Xcode's default for `ENABLE_STRICT_OBJC_MSGSEND` doesn't match
@@ -108,18 +99,6 @@ $(INDEXING_DEPLOYMENT_LOCATION__$(INDEX_ENABLE_BUILD_ARENA)),
10899
"INDEX_DATA_STORE_DIR": "$(INDEX_DATA_STORE_DIR)",
109100
"INDEX_FORCE_SCRIPT_EXECUTION": true,
110101
"INDEX_IMPORT": indexImport,
111-
"INDEXING_BUILT_PRODUCTS_DIR__": """
112-
$(INDEXING_BUILT_PRODUCTS_DIR__NO)
113-
""",
114-
"INDEXING_BUILT_PRODUCTS_DIR__NO": "$(BUILD_DIR)",
115-
// Index Build doesn't respect `DEPLOYMENT_LOCATION`, but we also
116-
// don't need the `DYLD_LIBRARY_PATH` fix for it
117-
"INDEXING_BUILT_PRODUCTS_DIR__YES": "$(CONFIGURATION_BUILD_DIR)",
118-
"INDEXING_DEPLOYMENT_LOCATION__": """
119-
$(INDEXING_DEPLOYMENT_LOCATION__NO)
120-
""",
121-
"INDEXING_DEPLOYMENT_LOCATION__NO": true,
122-
"INDEXING_DEPLOYMENT_LOCATION__YES": false,
123102
"INDEXING_PROJECT_DIR__": "$(INDEXING_PROJECT_DIR__NO)",
124103
"INDEXING_PROJECT_DIR__NO": absoluteProjectDirPath,
125104
"INDEXING_PROJECT_DIR__YES": indexingProjectDirPath,
@@ -171,6 +150,30 @@ $(PROJECT_TEMP_DIR)/$(BAZEL_PACKAGE_BIN_DIR)/$(COMPILE_TARGET_NAME)
171150
"SWIFT_USE_INTEGRATED_DRIVER": false,
172151
"TAPI_EXEC": "/usr/bin/true",
173152
], uniquingKeysWith: { _, r in r })
153+
} else {
154+
buildSettings.merge([
155+
// `BUILT_PRODUCTS_DIR` isn't actually used by the build, since
156+
// `DEPLOYMENT_LOCATION` is set. It does prevent `DYLD_LIBRARY_PATH`
157+
// from being modified though.
158+
"BUILT_PRODUCTS_DIR": """
159+
$(INDEXING_BUILT_PRODUCTS_DIR__$(INDEX_ENABLE_BUILD_ARENA))
160+
""",
161+
"DEPLOYMENT_LOCATION": """
162+
$(INDEXING_DEPLOYMENT_LOCATION__$(INDEX_ENABLE_BUILD_ARENA)),
163+
""",
164+
// Index Build doesn't respect `DEPLOYMENT_LOCATION`, but we also
165+
// don't need the `DYLD_LIBRARY_PATH` fix for it
166+
"INDEXING_BUILT_PRODUCTS_DIR__": """
167+
$(INDEXING_BUILT_PRODUCTS_DIR__NO)
168+
""",
169+
"INDEXING_BUILT_PRODUCTS_DIR__NO": "$(BUILD_DIR)",
170+
"INDEXING_BUILT_PRODUCTS_DIR__YES": "$(CONFIGURATION_BUILD_DIR)",
171+
"INDEXING_DEPLOYMENT_LOCATION__": """
172+
$(INDEXING_DEPLOYMENT_LOCATION__NO)
173+
""",
174+
"INDEXING_DEPLOYMENT_LOCATION__NO": true,
175+
"INDEXING_DEPLOYMENT_LOCATION__YES": false,
176+
], uniquingKeysWith: { _, r in r })
174177
}
175178

176179
var buildConfigurations: [XCBuildConfiguration] = []

tools/generators/legacy/src/Generator/SetTargetConfigurations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ $(BAZEL_OUT)\#(linkParams.path.string.dropFirst(9))
336336
buildSettings.set("EXECUTABLE_NAME", to: executableName)
337337
}
338338

339-
if target.product.type.isLaunchable {
339+
if buildMode == .xcode && target.product.type.isLaunchable {
340340
// We need `BUILT_PRODUCTS_DIR` to point to where the
341341
// binary/bundle is actually at, for running from scheme to work
342342
buildSettings["BUILT_PRODUCTS_DIR"] = """

tools/generators/legacy/test/CreateProjectTests.swift

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ $(SYMROOT)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
202202
"BUILD_MARKER_FILE": "$(OBJROOT)/build_marker",
203203
"BUILD_WORKSPACE_DIRECTORY": "$(SRCROOT)",
204204
"BAZEL_INTEGRATION_DIR": "$(INTERNAL_DIR)/bazel",
205-
"BUILT_PRODUCTS_DIR": """
206-
$(INDEXING_BUILT_PRODUCTS_DIR__$(INDEX_ENABLE_BUILD_ARENA))
207-
""",
208205
"CC": "$(BAZEL_INTEGRATION_DIR)/clang.sh",
209206
"CXX": "$(BAZEL_INTEGRATION_DIR)/clang.sh",
210207
"CLANG_ENABLE_OBJC_ARC": true,
@@ -215,9 +212,6 @@ $(BUILD_DIR)/$(BAZEL_PACKAGE_BIN_DIR)
215212
""",
216213
"COPY_PHASE_STRIP": false,
217214
"DEBUG_INFORMATION_FORMAT": "dwarf",
218-
"DEPLOYMENT_LOCATION": """
219-
$(INDEXING_DEPLOYMENT_LOCATION__$(INDEX_ENABLE_BUILD_ARENA)),
220-
""",
221215
"DSTROOT": "$(PROJECT_TEMP_DIR)",
222216
"ENABLE_DEFAULT_SEARCH_PATHS": "NO",
223217
"ENABLE_STRICT_OBJC_MSGSEND": true,
@@ -229,18 +223,6 @@ $(INDEXING_DEPLOYMENT_LOCATION__$(INDEX_ENABLE_BUILD_ARENA)),
229223
"INDEX_DATA_STORE_DIR": "$(INDEX_DATA_STORE_DIR)",
230224
"INDEX_FORCE_SCRIPT_EXECUTION": true,
231225
"INDEX_IMPORT": "/tmp/index-import",
232-
"INDEXING_BUILT_PRODUCTS_DIR__": """
233-
$(INDEXING_BUILT_PRODUCTS_DIR__NO)
234-
""",
235-
"INDEXING_BUILT_PRODUCTS_DIR__NO": "$(BUILD_DIR)",
236-
"INDEXING_BUILT_PRODUCTS_DIR__YES": """
237-
$(CONFIGURATION_BUILD_DIR)
238-
""",
239-
"INDEXING_DEPLOYMENT_LOCATION__": """
240-
$(INDEXING_DEPLOYMENT_LOCATION__NO)
241-
""",
242-
"INDEXING_DEPLOYMENT_LOCATION__NO": true,
243-
"INDEXING_DEPLOYMENT_LOCATION__YES": false,
244226
"INDEXING_PROJECT_DIR__": "$(INDEXING_PROJECT_DIR__NO)",
245227
"INDEXING_PROJECT_DIR__NO": """
246228
/tmp/bazel-output-base/rules_xcodeproj/build_output_base/execroot/rules_xcodeproj

0 commit comments

Comments
 (0)