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 #6666

Merged
merged 2 commits into from Jul 4, 2023
Merged

Add support for Musl libc #6666

merged 2 commits into from Jul 4, 2023

Conversation

MaxDesiatov
Copy link
Member

@MaxDesiatov MaxDesiatov commented Jun 22, 2023

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.

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.
@MaxDesiatov MaxDesiatov self-assigned this Jun 22, 2023
@MaxDesiatov MaxDesiatov marked this pull request as ready for review June 22, 2023 15:19
@MaxDesiatov
Copy link
Member Author

@swift-ci smoke test

Copy link
Member

@neonichu neonichu left a 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.

@MaxDesiatov
Copy link
Member Author

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
Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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
@MaxDesiatov
Copy link
Member Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Member Author

@swift-ci test windows

@finagolfin
Copy link
Contributor

100%, but until then we have to import platform-specific libcs explicitly.

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.

@MaxDesiatov MaxDesiatov merged commit e98f5c9 into main Jul 4, 2023
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/canimport-musl branch July 4, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants