Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Support compiling against Musl #71

Closed

Conversation

simonjbeaumont
Copy link

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.

@FranzBusch
Copy link
Contributor

@swift-server-bot test this please

@FranzBusch
Copy link
Contributor

I am happy to get this in but we should see that projects start to drop this dependency since it is no longer needed.

@simonjbeaumont
Copy link
Author

@FranzBusch Agreed. But it would still be useful in the short term as it is used in a few places where I'm sprinkling this change around.

@simonjbeaumont
Copy link
Author

Actually, I think we don't need this one after all :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants