Skip to content

Commit dc87ee7

Browse files
committed
Support index-import on all Xcode 16.x versions
Similar to: bazelbuild/rules_swift#1504 Part of #3160 This PR updates the index-import dependency to include both version 5.8 and 6.1 as the hash algorithm changed in Swift 6.1. To make this change backwards compatible we switch to the 5.8 version on Xcode 16.2 and under. Signed-off-by: Luis Padron <heyluispadron@gmail.com>
1 parent 601661d commit dc87ee7

29 files changed

+145
-32
lines changed

MODULE.bazel

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bazel_dep(name = "bazel_features", version = "1.3.0")
1010
bazel_dep(name = "bazel_skylib", version = "1.3.0")
1111
bazel_dep(
1212
name = "rules_swift",
13-
version = "1.18.0",
13+
version = "2.8.0",
1414
max_compatibility_level = 2,
1515
repo_name = "build_bazel_rules_swift",
1616
)
@@ -28,6 +28,7 @@ non_module_deps = use_extension("//xcodeproj:extensions.bzl", "non_module_deps")
2828
use_repo(
2929
non_module_deps,
3030
"rules_xcodeproj_index_import",
31+
"rules_xcodeproj_index_import_legacy",
3132
)
3233

3334
# Non-release dependencies
@@ -55,12 +56,6 @@ bazel_dep(
5556
repo_name = "io_bazel_stardoc",
5657
)
5758

58-
# Use newer versions of deps in development
59-
single_version_override(
60-
module_name = "rules_swift",
61-
version = "2.3.0",
62-
)
63-
6459
# Some of our deps are forcing a new stardoc on us, so pinning for now
6560
single_version_override(
6661
module_name = "stardoc",

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

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

examples/integration/test/fixtures/bwb_project_spec.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/rules_ios/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bazel_dep(
2020
)
2121
bazel_dep(
2222
name = "rules_ios",
23-
version = "5.5.1",
23+
version = "5.6.0",
2424
repo_name = "build_bazel_rules_ios",
2525
)
2626

examples/rules_ios/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22

33
http_archive(
44
name = "build_bazel_rules_ios",
5-
sha256 = "c417b69639a737eb44e2af13309f1b00950d6d0c48f67c64ee36d3ea750f687e",
6-
url = "https://github.com/bazel-ios/rules_ios/releases/download/4.6.0/rules_ios.4.6.0.tar.gz",
5+
sha256 = "e0dbd18f1d7a48a4b98e97dbdc45dfc7f0b1cf902afe86c442614db17f560611",
6+
url = "https://github.com/bazel-ios/rules_ios/releases/download/5.6.0/rules_ios.5.6.0.tar.gz",
77
)
88

99
load(

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

Lines changed: 1 addition & 0 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_project_spec.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/internal/pbxproj_partials/write_pbxproj_prefix_tests.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def _write_pbxproj_prefix_test_impl(ctx):
5353
import_index_build_indexstores = (
5454
ctx.attr.import_index_build_indexstores
5555
),
56+
legacy_index_import = ctx.attr.legacy_index_import,
5657
index_import = ctx.attr.index_import,
5758
install_path = "a/project.xcodeproj",
5859
minimum_xcode_version = ctx.attr.minimum_xcode_version,
@@ -144,6 +145,7 @@ write_pbxproj_prefix_test = unittest.make(
144145
"default_xcode_configuration": attr.string(mandatory = True),
145146
"execution_root_file": attr.string(mandatory = True),
146147
"import_index_build_indexstores": attr.bool(mandatory = True),
148+
"legacy_index_import": attr.string(mandatory = True),
147149
"index_import": attr.string(mandatory = True),
148150
"minimum_xcode_version": attr.string(mandatory = True),
149151
"platforms": attr.string_list(mandatory = True),
@@ -180,6 +182,7 @@ def write_pbxproj_prefix_test_suite(name):
180182
default_xcode_configuration,
181183
execution_root_file,
182184
import_index_build_indexstores,
185+
legacy_index_import,
183186
index_import,
184187
minimum_xcode_version,
185188
platforms,
@@ -204,6 +207,7 @@ def write_pbxproj_prefix_test_suite(name):
204207
default_xcode_configuration = default_xcode_configuration,
205208
execution_root_file = execution_root_file,
206209
import_index_build_indexstores = import_index_build_indexstores,
210+
legacy_index_import = legacy_index_import,
207211
index_import = index_import,
208212
minimum_xcode_version = minimum_xcode_version,
209213
platforms = platforms,
@@ -233,6 +237,7 @@ def write_pbxproj_prefix_test_suite(name):
233237
default_xcode_configuration = "Debug",
234238
execution_root_file = "an/execution/root/file",
235239
import_index_build_indexstores = True,
240+
legacy_index_import = "some/path/to/legacy/index_import",
236241
index_import = "some/path/to/index_import",
237242
minimum_xcode_version = "14.2.1",
238243
platforms = [
@@ -262,6 +267,8 @@ def write_pbxproj_prefix_test_suite(name):
262267
"an/execution/root/file",
263268
# targetIdsFile
264269
"a/path/to/target_ids_list",
270+
# legacyIndexImport
271+
"some/path/to/legacy/index_import",
265272
# indexImport
266273
"some/path/to/index_import",
267274
# resolvedRepositoriesFile
@@ -296,6 +303,7 @@ def write_pbxproj_prefix_test_suite(name):
296303
default_xcode_configuration = "Release",
297304
execution_root_file = "an/execution/root/file",
298305
import_index_build_indexstores = False,
306+
legacy_index_import = "some/path/to/legacy/index_import",
299307
index_import = "some/path/to/index_import",
300308
platforms = [
301309
"MACOS",
@@ -328,6 +336,8 @@ def write_pbxproj_prefix_test_suite(name):
328336
"an/execution/root/file",
329337
# targetIdsFile
330338
"a/path/to/target_ids_list",
339+
# legacyIndexImport
340+
"some/path/to/legacy/index_import",
331341
# indexImport
332342
"some/path/to/index_import",
333343
# resolvedRepositoriesFile

tools/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ _XCSCHEMES = [
176176
# targetIdsFile
177177
"bazel-out/darwin_arm64-dbg/bin/external/_main~internal~rules_xcodeproj_generated/generator/tools/xcodeproj/xcodeproj_target_ids",
178178
# indexImport
179-
"bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/_main~non_module_deps~rules_xcodeproj_index_import/index-import",
179+
"bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/_main~non_module_deps~rules_xcodeproj_index_import_legacy/index-import",
180180
# resolvedRepositoriesFile
181181
"bazel-out/darwin_arm64-dbg/bin/external/_main~internal~rules_xcodeproj_generated/generator/tools/generators/xcodeproj/xcodeproj_pbxproj_partials/resolved_repositories",
182182
# minimumXcodeVersion

tools/generators/legacy/src/DTO/Project.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ struct Project: Equatable {
3939
var customXcodeSchemes: [XcodeScheme] = []
4040
let targetIdsFile: String
4141
let targetNameMode: TargetNameMode
42+
let legacyIndexImport: String
4243
let indexImport: String
4344
let preBuildScript: String?
4445
let postBuildScript: String?
@@ -61,7 +62,8 @@ extension Project: Decodable {
6162
case schemeAutogenerationMode = "s"
6263
case targetIdsFile = "T"
6364
case targetNameMode = "N"
64-
case indexImport = "i"
65+
case legacyIndexImport = "i"
66+
case indexImport = "j"
6567
case preBuildScript = "p"
6668
case postBuildScript = "P"
6769
}
@@ -107,6 +109,8 @@ extension Project: Decodable {
107109
TargetNameMode.self,
108110
forKey: .targetNameMode
109111
) ?? .auto
112+
legacyIndexImport = try container
113+
.decode(String.self, forKey: .legacyIndexImport)
110114
indexImport = try container
111115
.decode(String.self, forKey: .indexImport)
112116
preBuildScript = try container

0 commit comments

Comments
 (0)