[New-bugs-announce] [issue34111] python-config breaks when symlinked to another location

tobik report at bugs.python.org
Sat Jul 14 07:21:51 EDT 2018


New submission from tobik <python at tobik.me>:

When symlinking python3.6-config to another location, it starts
outputting bogus paths.  It's convenient to symlink the system
python3.6-config to somewhere else in PATH to make sure the build
of an application with a hardcoded use of python3-config is using
the right Python version.  This is something that we would like to
do in FreeBSD Ports instead of having to patch build files.

It works fine with python2.7-config.  However when I try a similar
thing with python3.6-config it starts outputting bogus paths.  For
example

$ pwd
/home/tobias
$ python2.7-config --includes
-I/usr/local/include/python2.7 -I/usr/local/include/python2.7
$ ln -s /usr/local/bin/python2.7-config python2-config
$ ./python2-config --includes
-I/usr/local/include/python2.7 -I/usr/local/include/python2.7
$ python3.6-config --includes
-I/usr/local/include/python3.6m -I/usr/local/include/python3.6m
$ ln -s /usr/local/bin/python3.6-config python3-config
$ ./python3-config --includes
-I/home/include/python3.6m -I/home/include/python3.6m

It would be nice if this could just work.  This was on FreeBSD but
the same problem exists on e.g. Void Linux too.

The problem seems to be that the path to the original script is not
resolved properly when trying to determine the install prefix.
Adding realpath(1) to python-config seems to solve it.

----------
files: patch-Misc__python-config.sh.in
messages: 321650
nosy: tobik
priority: normal
severity: normal
status: open
title: python-config breaks when symlinked to another location
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47690/patch-Misc__python-config.sh.in

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34111>
_______________________________________


More information about the New-bugs-announce mailing list