Skip to content

Commit 21dd6a2

Browse files
committed
Fix use of absolute paths to Swift SDK metatadata
The generator incorrectly recorded absolute paths to Swift SDK metadata in bundle archive metadata, which is fragile and also can't be handled by SwiftPM.
1 parent fc7da52 commit 21dd6a2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Metadata.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,16 @@ extension SwiftSDKGenerator {
113113
ArtifactsArchiveMetadata(
114114
schemaVersion: "1.0",
115115
artifacts: artifacts.mapValues {
116-
.init(
116+
var relativePath = $0
117+
let prefixRemoved = relativePath.removePrefix(pathsConfiguration.artifactBundlePath)
118+
assert(prefixRemoved)
119+
120+
return .init(
117121
type: .swiftSDK,
118122
version: self.bundleVersion,
119123
variants: [
120124
.init(
121-
path: $0.string,
125+
path: relativePath.string,
122126
supportedTriples: hostTriples.map { $0.map(\.triple) }
123127
)
124128
]

0 commit comments

Comments
 (0)