swift-otel icon indicating copy to clipboard operation
swift-otel copied to clipboard

Support Musl

Open xlc opened this issue 1 year ago • 0 comments
trafficstars

Getting errors when trying to make build with static linked SDK following this guide and getting error:

.build/checkouts/swift-otel/Sources/OTel/Configuration/OTelEnvironment.swift:15:12: error: no such module 'Glibc'
 13 | 
 14 | #if os(Linux)
 15 |     import Glibc
    |            `- error: no such module 'Glibc'
 16 | #else
 17 |     import Darwin.C

From the above guide, the code should be something like this

#if os(macOS) || os(iOS)
import Darwin
#elseif canImport(Glibc)
import Glibc
#elseif canImport(Musl)
import Musl
#elseif os(Windows)
import ucrt
#else
#error(Unknown platform)
#endif

xlc avatar Oct 09 '24 02:10 xlc