-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-141600: fix musl detection on Void Linux #141602
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
Conversation
fa53a96 to
87f95c1
Compare
|
!buildbot Alpine |
|
🤖 New build scheduled with the buildbot fleet by @zware for commit 87f95c1 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F141602%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Lib/platform.py
Outdated
| | (libc(_\w+)?\.so(?:\.(\d[0-9.]*))?) | ||
| | (musl-([0-9.]+)) | ||
| | (libc.musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) | ||
| | ((?:libc.|ld-)musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) |
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.
There is a bug in the existing regex, it should be libc\. instead of libc., no?
| | ((?:libc.|ld-)musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) | |
| | ((?:libc\.|ld-)musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) |
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 saw the bug and thought about fixing it, but then I wondered what esoteric musl-based distribution would break if the regex gets more specific. If this is not a concern, we can quote the dot.
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.
If later we discover Linux distributions where musl is not properly detected, we can update the regex again. For now, I would prefer to use a strict libc\..
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.
Done.
87f95c1 to
4e76b00
Compare
…41602) (cherry picked from commit 08477db) Co-authored-by: Andrew J. Hesford <[email protected]>
|
GH-141850 is a backport of this pull request to the 3.14 branch. |
This patch amends the search patterns in the function
platform.libc_verto properly recognize musl on Void Linux. Unlike Alpine, Void does not provide alibc.muslsymlink that points to the linker, so executables link to a generic (and unversioned)libc.so, which is just a symlink to the linker atld-musl-${arch}.so.${version}. By slightly modifying the pattern to acceptld-muslin addition tolibc.musl, the function will pick up the linker encoded in executable rather than the generic C library path.This patch also prevents a match against
libc.sofrom setting the returned library name tolibcwhen the library name has already been set toglibcormusl. Previously, the exclusion only applied when the library name was already set toglibc. This change is necessary because the pattern matching will pick up Void's genericlibc.soafter it has picked up theld-linuxlinker path.Finally, a unit test that relies (via the
linked_to_muslfunction) on the version returned bylibc_verhas been amended to accept a returned version consisting only of a single major number in addition to a complete full (major, minor, patch) triplet. The patterns admit the possibility that only the major version is known, so this must be accommodated.