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

Installation broken on alpine 3.14 #290

Open
apatrushev opened this issue Nov 7, 2021 · 2 comments
Open

Installation broken on alpine 3.14 #290

apatrushev opened this issue Nov 7, 2021 · 2 comments

Comments

@apatrushev
Copy link

musl detection

return sysconfig.get_config_var('HOST_GNU_TYPE') == 'x86_64-pc-linux-musl'
broken on alpine 3.14 because sysconfig.get_config_var('HOST_GNU_TYPE') returns x86_64-alpine-linux-musl instead of x86_64-pc-linux-musl

@adiroiban
Copy link

Note that sysconfig.get_config_var('HOST_GNU_TYPE') will not always help.

at least not on Python 2.7 and not on void linux with musl.

$ ldd --version
musl libc (x86_64)
Version 1.1.24
Dynamic Program Loader
Usage: ldd [options] [--] pathname

$ ./bin/python
Python 2.7.18 (d2b7dcc, Nov  7 2022, 10:28:51)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_config_var('HOST_GNU_TYPE')
'x86_64-pc-linux-gnu'
>>>

I am detecting musl via

>>> import platform
>>> platform.libc_ver()
('', '')

@adiroiban
Copy link

Maybe something like this will do.

it works for me :)

import platform

def is_x86_64_musl():
    is_x86_64 = platform.processor() == 'x86_64'
    # I don't know how to detect `musl` in another way.
    unknown_libc = platform.libc_ver()[0] == ''
    return is_x86_64 and unknown_libc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants