-
-
Notifications
You must be signed in to change notification settings - Fork 235
Fix musl detection in Python 3.12 and below #827
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
cpython-unix/patch-cpython-configure-target-triple-musl-3.10.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| From d7a70fe9ffa0e4e173bae545cdcba62dc7a2a1f1 Mon Sep 17 00:00:00 2001 | ||
| From: Geoffrey Thomas <[email protected]> | ||
| Date: Sat, 25 Oct 2025 18:49:45 -0400 | ||
| Subject: [PATCH 1/1] LOCAL: configure.ac: Fix musl detection | ||
| Forwarded: not-needed | ||
|
|
||
| Newer versions of Python rework this code significantly, so this does | ||
| not need to be upstreamed. | ||
| --- | ||
| configure.ac | 5 +++++ | ||
| 1 file changed, 5 insertions(+) | ||
|
|
||
| diff --git a/configure.ac b/configure.ac | ||
| index ac3be3850a9..9c7c02ea6de 100644 | ||
| --- a/configure.ac | ||
| +++ b/configure.ac | ||
| @@ -866,6 +866,11 @@ EOF | ||
|
|
||
| if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then | ||
| PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` | ||
| + case "$CC" in | ||
| + musl-*) | ||
| + PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` | ||
| + ;; | ||
| + esac | ||
| AC_MSG_RESULT([$PLATFORM_TRIPLET]) | ||
| else | ||
| AC_MSG_RESULT([none]) | ||
| -- | ||
| 2.39.5 (Apple Git-154) | ||
|
|
36 changes: 36 additions & 0 deletions
36
cpython-unix/patch-cpython-configure-target-triple-musl-3.12.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| From 851c49bafb1fe11c02eafe4850e952cafec548b7 Mon Sep 17 00:00:00 2001 | ||
| From: Geoffrey Thomas <[email protected]> | ||
| Date: Sat, 25 Oct 2025 18:49:45 -0400 | ||
| Subject: [PATCH 1/1] LOCAL: configure.ac: Fix musl detection | ||
| Forwarded: not-needed | ||
|
|
||
| We set HOST_CC to regular (glibc) clang and CC to musl-clang. | ||
| AC_CANONICAL_HOST sets build_os based on the output of config.guess, | ||
| which looks at HOST_CC in preference to CC, and therefore misreports the | ||
| target triple as gnu. Directly checking CC works for us. | ||
|
|
||
| Newer versions of Python rework this code significantly to not rely on | ||
| build_os and do musl detection internally, so this does not need to be | ||
| upstreamed. | ||
| --- | ||
| configure.ac | 4 ++-- | ||
| 1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/configure.ac b/configure.ac | ||
| index 1a02d19f1b2..ee743c11aa5 100644 | ||
| --- a/configure.ac | ||
| +++ b/configure.ac | ||
| @@ -1108,8 +1108,8 @@ EOF | ||
|
|
||
| if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then | ||
| PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` | ||
| - case "$build_os" in | ||
| - linux-musl*) | ||
| + case "$CC" in | ||
| + musl-*) | ||
| PLATFORM_TRIPLET=`echo "$PLATFORM_TRIPLET" | sed 's/linux-gnu/linux-musl/'` | ||
| ;; | ||
| esac | ||
| -- | ||
| 2.39.5 (Apple Git-154) | ||
|
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit: This mixed line length wrapping is perturbing
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 meant to remove those last two lines because we're not backporting the code, not sure how I left them in.... will fix when I figure out the build failure