Skip to content

Commit

Permalink
unix: patch packaging.tags in pip as well
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
indygreg committed Feb 18, 2020
1 parent cb4b4b9 commit fc2ae22
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc2ae22

Please sign in to comment.