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

Musl support #429

Open
arasan01 opened this issue Sep 25, 2024 · 4 comments · May be fixed by #436
Open

Musl support #429

arasan01 opened this issue Sep 25, 2024 · 4 comments · May be fixed by #436

Comments

@arasan01
Copy link

arasan01 commented Sep 25, 2024

The combination of Yams and the Static Linux SDK allows the creation of a CLI in a single binary. To do this, the implementation needs to be changed from a direct dependency on Glibc to a dependency on both Glibc and Musl.

Here, import needs to be changed to support Musl.

#elseif canImport(Glibc)
import CoreFoundation
import Glibc
private let cpow: (_: Double, _: Double) -> Double = Glibc.pow
#elseif canImport(Musl)
import CoreFoundation
import Musl
private let cpow: (_: Double, _: Double) -> Double = Musl.pow
#endif
@arasan01
Copy link
Author

arasan01 commented Sep 25, 2024

I will create PR

arasan01 added a commit to arasan01/Yams that referenced this issue Sep 25, 2024
Change import to allow a choice between Glibc and Musl
musl pow ref: https://git.musl-libc.org/cgit/musl/tree/include/math.h
arasan01 added a commit to arasan01/Yams that referenced this issue Sep 25, 2024
Change import to allow a choice between Glibc and Musl
musl pow ref: https://git.musl-libc.org/cgit/musl/tree/include/math.h
@kkebo
Copy link

kkebo commented Nov 7, 2024

Musl support is really important for command line tools written in Swift and using Yams.

@PeqNP
Copy link

PeqNP commented Dec 14, 2024

Hey, nice! Same problem. If you don't have time to create PR, lmk. I'm happy to do it.

FYI, I simply changed Glibc to Musl by hand and was able to successfully cross-compile on macOS to linux.

@SimplyDanny
Copy link

Hey, nice! Same problem. If you don't have time to create PR, lmk. I'm happy to do it.

There already is a PR: #430.

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 a pull request may close this issue.

4 participants