Skip to content

Commit 53a322b

Browse files
authored
Update Bazel dependencies (#61)
Updates the following, mostly in order to support rules_swift 2.x: * Bazel version defined in `.bazelversion` to the latest stable release (7.2.1) * Add `apple_support` (required for Bazel 7.x) * Update `platforms`: 0.0.8 -> 0.0.9 * Update `rules_apple`: 3.1.1 -> 3.6.0 * Update `rules_swift`: 1.13.0 -> 2.1.1 Also update tests to pass CI since it looks like GitHub's macOS runner image environments may have changed recently. --------- Signed-off-by: JP Simard <[email protected]>
1 parent 7a07270 commit 53a322b

File tree

8 files changed

+26
-8
lines changed

8 files changed

+26
-8
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.4.0
1+
7.2.1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/DerivedData/
55
/.swiftpm/
66
bazel-*
7+
MODULE.bazel.lock

BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
33
cc_library(
44
name = "CIndexStore",
55
hdrs = ["Sources/CIndexStore/include/indexstore.h"],
6+
aspect_hints = ["@build_bazel_rules_swift//swift:auto_module"],
67
copts = ["-std=c++17"],
78
linkstatic = True,
89
tags = ["swift_module=CIndexStore"],

MODULE.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ module(
44
compatibility_level = 1,
55
)
66

7-
bazel_dep(name = "platforms", version = "0.0.8")
8-
bazel_dep(name = "rules_apple", version = "3.1.1", repo_name = "build_bazel_rules_apple")
9-
bazel_dep(name = "rules_swift", version = "1.13.0", repo_name = "build_bazel_rules_swift")
7+
bazel_dep(name = "apple_support", version = "1.16.0")
8+
bazel_dep(name = "platforms", version = "0.0.9")
9+
bazel_dep(name = "rules_apple", version = "3.6.0", repo_name = "build_bazel_rules_apple")
10+
bazel_dep(name = "rules_swift", version = "2.1.1", repo_name = "build_bazel_rules_swift")
1011

1112
non_module_deps = use_extension("//:repositories.bzl", "bzlmod_deps")
1213
use_repo(non_module_deps, "StaticIndexStore")

Sources/CSwiftDemangle/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cc_library(
88
hdrs = glob([
99
"include/**/*.h",
1010
]),
11+
aspect_hints = ["@build_bazel_rules_swift//swift:auto_module"],
1112
copts = ["-std=c++17"],
1213
includes = [
1314
"PrivateHeaders/include",
@@ -16,7 +17,6 @@ cc_library(
1617
linkopts = [
1718
"-lswiftDemangle",
1819
],
19-
tags = ["swift_module=CSwiftDemangle"],
2020
textual_hdrs = glob([
2121
"**/*.def",
2222
]),
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module CSwiftDemangle {
2+
header "CSwiftDemangle.h"
3+
link "CSwiftDemangle"
4+
export *
5+
}

Tests/IndexStoreTests/DetermineIndexStorePath.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
/// - Returns: Index store path for the current test environment
1111
func determineIndexStorePath() -> String {
1212
if let testSrcDir: String = ProcessInfo.processInfo.environment["TEST_SRCDIR"] {
13-
return testSrcDir + "/__main__/Tests/IndexStoreTests/Data/main.indexstore"
13+
return testSrcDir + "/_main/Tests/IndexStoreTests/Data/main.indexstore"
1414
}
1515
guard let service = ProcessInfo.processInfo.environment["XPC_SERVICE_NAME"] else {
1616
preconditionFailure("Expected XPC_SERVICE_NAME environment variable")

Tests/SwiftDemangleTests/SwiftDemangleTests.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,18 @@ final class SwiftDemangleTests: XCTestCase {
2424
func testSwiftExtensionUSR() throws {
2525
let demangler = Demangler()
2626
let root = try XCTUnwrap(demangler.demangle(symbol: kExtensionUSR))
27-
let modules = Set(root.breadthFirstSequence().filter { $0.kind == .module }.compactMap { $0.text })
28-
XCTAssertEqual(modules, ["Unidirectional", "Onboarding", "LyftKit"])
27+
let textNodes = Set(root.breadthFirstSequence().compactMap { $0.text })
28+
XCTAssertEqual(textNodes, [
29+
"EffectProducer",
30+
"GuestUser",
31+
"LyftKit",
32+
"NonemptyStack",
33+
"Onboarding",
34+
"OnboardingActionMask",
35+
"OnboardingState",
36+
"submitNameEffect",
37+
"Unidirectional",
38+
])
2939
}
3040

3141
func testBreathFirstSequence() throws {

0 commit comments

Comments
 (0)