Skip to content

Commit 3952f68

Browse files
committed
Try linking again SwiftSyntax in SkipUnless.canBuildMacroUsingSwiftSyntaxFromSourceKitLSPBuild
I don’t remember the exact failure scenario but there were issues where the modules could be found but linking against the swift-syntax libraries from the sourcekit-lsp build failed. If this happens, skip any macro tests.
1 parent bce4cf6 commit 3952f68

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Sources/SKTestSupport/SkipUnless.swift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,11 @@ public actor SkipUnless {
436436
let project = try await SwiftPMTestProject(
437437
files: [
438438
"MyMacros/MyMacros.swift": #"""
439-
import SwiftCompilerPlugin
440-
import SwiftSyntax
441-
import SwiftSyntaxBuilder
442-
import SwiftSyntaxMacros
439+
import SwiftParser
440+
441+
func test() {
442+
_ = Parser.parse(source: "let a")
443+
}
443444
"""#,
444445
"MyMacroClient/MyMacroClient.swift": """
445446
""",
@@ -453,6 +454,9 @@ public actor SkipUnless {
453454
skipMessage: """
454455
Skipping because macro could not be built using build artifacts in the sourcekit-lsp build directory. \
455456
This usually happens if sourcekit-lsp was built using a different toolchain than the one used at test-time.
457+
458+
Reason:
459+
\(error)
456460
"""
457461
)
458462
}

0 commit comments

Comments
 (0)