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 #6666
Conversation
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 previously had `import Glibc` in them.
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda hate that we have to do this kind of dance for very basic operations like exiting a process (!) or signal handling. This feels like something swift-system should provide abstractions for tbh.
100%, but until then we have to import platform-specific libcs explicitly. |
sigaction(SIGINT, &action, nil) | ||
kill(getpid(), SIGINT) | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this diff looks like it is doing more than just Musl support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is just code rearrangement; every case did
sigaction(SIGINT, &action, nil)
kill(getpid(), SIGINT)
and I think Max just moved it outside of the #if
conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those lines are common for all cases, they only differ in handler setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see the #endif
moved 👍
…xd/canimport-musl # Conflicts: # Sources/swiftpm-xctest-helper/main.swift
@swift-ci smoke test |
@swift-ci test windows |
This has already been pitched. Would you take that over, @MaxDesiatov, since you are adding Musl, including adding Bionic and the BSD libcs? I'll be happy to help split off Bionic, I just don't want to push all this through the Evolution process. |
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.