Skip to content

Commit 70769fb

Browse files
committed
Workaround for CI failure due to Data.bytes not being present.
swift-ci still uses an older Xcode version with an older OS SDK that does not include `Data.bytes`. As a result, Swift Testing fails to build for Apple platforms. Work around the issue by manually constructing a `RawSpan` in the relevant place. Resolves rdar://169480914.
1 parent 6710381 commit 70769fb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Sources/Testing/Support/JSON.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ enum JSON {
4444
encoder.userInfo.merge(userInfo, uniquingKeysWith: { _, rhs in rhs})
4545

4646
let data = try encoder.encode(value)
47-
return try body(data.bytes)
47+
// WORKAROUND for older SDK on swift-ci (rdar://169480914)
48+
return try data.withUnsafeBytes { data in
49+
try body(data.bytes)
50+
}
4851
#else
4952
throw SystemError(description: "JSON encoding requires Foundation which is not available in this environment.")
5053
#endif

0 commit comments

Comments
 (0)