Skip to content

Commit c946f52

Browse files
3405691582jakepetroules
authored andcommitted
OpenBSD uses versioned triples for imports.
Without this change, the build will fail to find modules since the import path on OpenBSD currently uses versioned triples.
1 parent 41c04b4 commit c946f52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/PackageModel/UserToolchain.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,10 @@ public final class UserToolchain: Toolchain {
741741
// targetInfo from the compiler
742742
let targetInfo = try customTargetInfo ?? Self.getTargetInfo(swiftCompiler: swiftCompilers.compile)
743743
self._targetInfo = targetInfo
744-
triple = try swiftSDK.targetTriple ?? Self.getHostTriple(targetInfo: targetInfo, versioned: false)
744+
triple = try Self.getHostTriple(targetInfo: targetInfo, versioned: false)
745+
if !triple.isDarwin() {
746+
triple = try Self.getHostTriple(targetInfo: targetInfo, versioned: true)
747+
}
745748
}
746749

747750
// Change the triple to the specified arch if there's exactly one of them.

0 commit comments

Comments
 (0)