GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-90548: Fix musl version detection with --strip-all by cdce8p · Pull Request #137864 · python/cpython

Conversation

@cdce8p

@cdce8p cdce8p commented Aug 16, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The change introduced in #131313 accidentally broke the musl version detection for test.support.linked_with_musl if cpython is compiled with --strip-all. In these cases the regex in platform.libc_ver should match the filename: libc.musl-x86_64.so.1.
https://pkgs.alpinelinux.org/contents?file=libc.*&path=&name=musl&branch=edge&repo=main&arch=

--strip-all is used among other things by the Alpine based Python docker image.
https://github.com/docker-library/python/blob/19c93d12094b07ecc21f67144a309c2fa0a10ef0/3.14-rc/alpine3.22/Dockerfile#L74

With this change:

./configure
make LDFLAGS="-Wl,--strip-all"

/usr/src # LD_LIBRARY_PATH=$PWD ./python.exe
Python 3.14.0rc2 (main, Aug 16 2025, 14:50:44) [GCC 14.2.0] on linux
>>> import test.support
>>> test.support.linked_to_musl()
(1,)

/usr/src # LD_LIBRARY_PATH=$PWD ./python.exe -m test.pythoninfo|grep libc
platform.libc_ver: musl 1

/CC @bitdancer

  • Issue: Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 #90548

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cdce8p
pythongh-90548: Fix musl version detection with --strip-all
6dbbd12
@bedevere-app bedevere-app Bot added the awaiting review label Aug 16, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Aug 16, 2025
Multiple test failures on Alpine 3.15 / musl-1.2.2-r7 #90548
Closed
@AA-Turner AA-Turner added the needs backport to 3.14 bugs and security fixes label Aug 16, 2025
AA-Turner
AA-Turner reviewed Aug 16, 2025
View reviewed changes

@AA-Turner AA-Turner left a comment

Copy link
Copy Markdown
Member

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.

The added pattern seems ostensibly reasonable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Lib/platform.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner AA-Turner added the OS-linux label Aug 16, 2025
@cdce8p @AA-Turner
Update Lib/platform.py
10d9462
Co-authored-by: Adam Turner <[email protected]>
AA-Turner
AA-Turner reviewed Aug 16, 2025
View reviewed changes
Comment thread Lib/platform.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner
Update Lib/platform.py
cf036f4
@cdce8p

cdce8p commented Aug 16, 2025

Copy link
Copy Markdown
Contributor Author

@AA-Turner I believe the OS-Linux label might be incorrect. Alpine is technically unsupported. Never the less, since #131313 was added in 3.14, I would still appreciate if it could be backported. Especially as it also indirectly fixes test.support.linked_with_musl and thus some of the test failures on Alpine linux.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AA-Turner

AA-Turner commented Aug 16, 2025

Copy link
Copy Markdown
Member

I would still appreciate if it could be backported.

I already added the backport label. Anything else missing?

I believe the OS-Linux label might be incorrect. Alpine is technically unsupported.

Fair enough, though "linux" is sufficiently vague that I think it is probably fine. Ideally we'd have a "libc-musl" label, but given as you say Alpine is unsupported, it's too niche at present.

cdce8p reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cdce8p

cdce8p commented Aug 16, 2025

Copy link
Copy Markdown
Contributor Author

I would still appreciate if it could be backported.

I already added the backport label. Anything else missing?

No, all good. I just wasn't sure if a fix for an unsupported platform meant it couldn't be backported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland

StanFromIreland commented Aug 18, 2025

Copy link
Copy Markdown
Member

Fair enough, though "linux" is sufficiently vague that I think it is probably fine. Ideally we'd have a "libc-musl" label, but given as you say Alpine is unsupported, it's too niche at present.

FWIW we have a "musl" section in the Unsupported platforms project.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cdce8p

cdce8p commented Aug 21, 2025

Copy link
Copy Markdown
Contributor Author

@vstinner Would you mind taking a look at this one? I believe you also reviewed the predecessor #131313.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner approved these changes Sep 1, 2025
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

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.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Sep 1, 2025
@vstinner
vstinner merged commit 6528cf4 into python:main Sep 1, 2025
@miss-islington-app

miss-islington-app Bot commented Sep 1, 2025

Copy link
Copy Markdown

Thanks @cdce8p for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 1, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 1, 2025
@cdce8p @AA-Turner @miss-islington
pythongh-90548: Fix musl version detection with --strip-all (pythonGH…
d14afe3
…-137864)

(cherry picked from commit 6528cf4)

Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
@bedevere-app

bedevere-app Bot commented Sep 1, 2025

Copy link
Copy Markdown

GH-138348 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Sep 1, 2025
@vstinner

vstinner commented Sep 1, 2025

Copy link
Copy Markdown
Member

Merged, thanks for the fix and added tests!

cdce8p reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cdce8p
cdce8p deleted the musl-libc_ver branch September 1, 2025 17:22
hugovk pushed a commit that referenced this pull request Sep 7, 2025
@miss-islington @cdce8p @AA-Turner
[3.14] gh-90548: Fix musl version detection with --strip-all (GH-137864…
d36c9a8
…) (#138348)

Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
@miss-islington @cdce8p
@AA-Turner @kumaraditya303
[3.14] pythongh-90548: Fix musl version detection with --strip-all (p…
da5f681
…ythonGH-137864) (python#138348)

Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
lkollar pushed a commit to lkollar/cpython that referenced this pull request Sep 9, 2025
@cdce8p @AA-Turner @lkollar
pythongh-90548: Fix musl version detection with --strip-all (python#1…
5be4c97
…37864)

Co-authored-by: Adam Turner <[email protected]>
@cdce8p cdce8p mentioned this pull request Sep 19, 2025
Add Python 3.14 + drop Python 3.11 + update 3.13 home-assistant/docker-base#306
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AA-Turner AA-Turner AA-Turner left review comments
@vstinner vstinner vstinner approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

OS-linux

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@cdce8p @AA-Turner @StanFromIreland @vstinner
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.