Skip to content

Conversation

simonjbeaumont
Copy link
Contributor

Motivation

When building for Linux, we would like to be able to build this package on top of Musl, as well as the usual Glibc.

Modifications

Replace imports of Glibc with conditional imports using the following pattern:

- import Glibc
+ #if canImport(Glibc)
+ import Glibc
+ #elseif canImport(Musl)
+ import Musl
+ #else
+ #error("Unsupported runtime")
+ #endif

Result

Can compile against Musl.

@ktoso
Copy link
Member

ktoso commented May 8, 2024

@swift-server-bot test this please

@ktoso
Copy link
Member

ktoso commented May 8, 2024

Thank you!

@ktoso ktoso enabled auto-merge (squash) May 8, 2024 22:26
@ktoso ktoso added this to the 1.1.1 milestone May 8, 2024
@ktoso ktoso merged commit 11c756c into apple:main May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants