Skip to content
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

Add support for Musl libc with canImport(Musl) checks #772

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

MaxDesiatov
Copy link
Contributor

Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html), it requires a different import, which now should be applied to files that have import Glibc in them.

Musl is a low footprint libc that's used in Linux distributions such as Alpine Linux, which allows producing fairly small container images. Additionally, unlike Glibc, musl allows full static linking, meaning apps can be easily distributed to an arbitrary Linux distribution that may have a version of Glibc incompatible with the one that Swift is usually built with or no Glibc installed at all.

Since Musl is sufficiently different from Glibc (see https://wiki.musl-libc.org/functional-differences-from-glibc.html), it requires a different import, which now should be applied to files that have `import Glibc` in them.

Musl is a low footprint libc that's used in Linux distributions such as Alpine Linux, which allows producing fairly small container images. Additionally, unlike Glibc, musl allows full static linking, meaning apps can be easily distributed to an arbitrary Linux distribution that may have a version of Glibc incompatible with the one that Swift is usually built with or no Glibc installed at all.
@MaxDesiatov MaxDesiatov self-assigned this Jul 18, 2023
@MaxDesiatov MaxDesiatov added enhancement New feature or request Linux Linux platform support labels Jul 18, 2023
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov requested a review from al45tair July 18, 2023 13:47
@al45tair
Copy link
Contributor

@swift-ci Please test Windows platform

@al45tair
Copy link
Contributor

(Windows failed during checkout.)

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 66f1c0d into main Jul 18, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/canimport-musl branch July 18, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Linux Linux platform support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants