From fc2ae22ee83de2527d9a90e514a72950840fb014 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Mon, 17 Feb 2020 21:58:58 -0800 Subject: [PATCH] unix: patch packaging.tags in pip as well Like setuptools, pip 20 also contains a copy of packaging.tags that needs to be taught how to react when running from a statically linked binary. Closes #30. --- cpython-unix/build-cpython.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index f80614d0..5a5f6684 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -197,6 +197,22 @@ diff --git a/src/pip/_internal/utils/glibc.py b/src/pip/_internal/utils/glibc.py gnu_get_libc_version = process_namespace.gnu_get_libc_version except AttributeError: +diff --git a/src/pip/_vendor/packaging/tags.py b/src/pip/_vendor/packaging/tags.py +index 60a69d8..08c0597 100644 +--- a/src/pip/_vendor/packaging/tags.py ++++ b/src/pip/_vendor/packaging/tags.py +@@ -466,7 +466,10 @@ def _glibc_version_string_ctypes(): + # which libc our process is actually using. + # + # Note: typeshed is wrong here so we are ignoring this line. +- process_namespace = ctypes.CDLL(None) # type: ignore ++ try: ++ process_namespace = ctypes.CDLL(None) # type: ignore ++ except OSError: ++ return None + try: + gnu_get_libc_version = process_namespace.gnu_get_libc_version + except AttributeError: EOF ${ROOT}/out/python/install/bin/python3 setup.py install