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

Fix pip install static library not found errors for conda #2683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions plugins/python/uwsgiplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def get_python_version():
if 'UWSGI_PYTHON_NOLIB' not in os.environ:
LIBS = sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
# check if it is a non-shared build (but please, add --enable-shared to your python's ./configure script)
if not sysconfig.get_config_var('Py_ENABLE_SHARED'):
use_static_lib = not sysconfig.get_config_var('Py_ENABLE_SHARED')
if use_static_lib:
libdir = sysconfig.get_config_var('LIBPL')
# libdir does not exists, try to get it from the venv
version = get_python_version()
Expand Down Expand Up @@ -75,13 +76,17 @@ def get_python_version():
libpath = '%s/%s' % (libdir, sysconfig.get_config_var('LIBRARY'))
if not os.path.exists(libpath):
libpath = '%s/libpython%s.a' % (libdir, version)
LIBS.append(libpath)
# hack for messy linkers/compilers
if '-lutil' in LIBS:
LIBS.append('-lutil')
if '-lrt' in LIBS:
LIBS.append('-lrt')
else:

if os.path.exists(libpath):
LIBS.append(libpath)
# hack for messy linkers/compilers
if '-lutil' in LIBS:
LIBS.append('-lutil')
if '-lrt' in LIBS:
LIBS.append('-lrt')
else:
use_static_lib = False
if not use_static_lib:
try:
libdir = sysconfig.get_config_var('LIBDIR')
except Exception:
Expand Down