Skip to content

Support compiling against Musl #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 8, 2024
Merged

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
3 of 6 checks passed
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