Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Bazel dependencies #61

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
7.2.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/DerivedData/
/.swiftpm/
bazel-*
MODULE.bazel.lock
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
cc_library(
name = "CIndexStore",
hdrs = ["Sources/CIndexStore/include/indexstore.h"],
aspect_hints = ["@build_bazel_rules_swift//swift:auto_module"],
copts = ["-std=c++17"],
linkstatic = True,
tags = ["swift_module=CIndexStore"],
Expand Down
7 changes: 4 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_apple", version = "3.1.1", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_swift", version = "1.13.0", repo_name = "build_bazel_rules_swift")
bazel_dep(name = "apple_support", version = "1.16.0")
bazel_dep(name = "platforms", version = "0.0.9")
bazel_dep(name = "rules_apple", version = "3.6.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_swift", version = "2.1.1", repo_name = "build_bazel_rules_swift")

non_module_deps = use_extension("//:repositories.bzl", "bzlmod_deps")
use_repo(non_module_deps, "StaticIndexStore")
2 changes: 1 addition & 1 deletion Sources/CSwiftDemangle/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ cc_library(
hdrs = glob([
"include/**/*.h",
]),
aspect_hints = ["@build_bazel_rules_swift//swift:auto_module"],
copts = ["-std=c++17"],
includes = [
"PrivateHeaders/include",
Expand All @@ -16,7 +17,6 @@ cc_library(
linkopts = [
"-lswiftDemangle",
],
tags = ["swift_module=CSwiftDemangle"],
textual_hdrs = glob([
"**/*.def",
]),
Expand Down
5 changes: 5 additions & 0 deletions Sources/CSwiftDemangle/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module CSwiftDemangle {
header "CSwiftDemangle.h"
link "CSwiftDemangle"
export *
}
2 changes: 1 addition & 1 deletion Tests/IndexStoreTests/DetermineIndexStorePath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
/// - Returns: Index store path for the current test environment
func determineIndexStorePath() -> String {
if let testSrcDir: String = ProcessInfo.processInfo.environment["TEST_SRCDIR"] {
return testSrcDir + "/__main__/Tests/IndexStoreTests/Data/main.indexstore"
return testSrcDir + "/_main/Tests/IndexStoreTests/Data/main.indexstore"
}
guard let service = ProcessInfo.processInfo.environment["XPC_SERVICE_NAME"] else {
preconditionFailure("Expected XPC_SERVICE_NAME environment variable")
Expand Down
14 changes: 12 additions & 2 deletions Tests/SwiftDemangleTests/SwiftDemangleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,18 @@ final class SwiftDemangleTests: XCTestCase {
func testSwiftExtensionUSR() throws {
let demangler = Demangler()
let root = try XCTUnwrap(demangler.demangle(symbol: kExtensionUSR))
let modules = Set(root.breadthFirstSequence().filter { $0.kind == .module }.compactMap { $0.text })
XCTAssertEqual(modules, ["Unidirectional", "Onboarding", "LyftKit"])
let textNodes = Set(root.breadthFirstSequence().compactMap { $0.text })
XCTAssertEqual(textNodes, [
"EffectProducer",
"GuestUser",
"LyftKit",
"NonemptyStack",
"Onboarding",
"OnboardingActionMask",
"OnboardingState",
"submitNameEffect",
"Unidirectional",
])
}

func testBreathFirstSequence() throws {
Expand Down
Loading