-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
"python-config --includes" returns a wrong path (double prefix) #66338
Comments
Our python is installed on a shared directory that is accessed through a symbolic link. $ ls -al /Produits
lrwxrwxrwx 1 root root 13 Oct 31 2013 /Produits -> /nfs/Produits With this configuration python-config returns a wrong path (it gives a double /nfs prefix) $ python3.4-config --includes
-I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m -I/nfs/nfs/Produits/publics/x86_64.Linux.RH6/python/3.4.1/include/python3.4m The problem is due to a double string replacement in the script prefix_build="/Produits/publics/x86_64.Linux.RH6/python/3.4.1" # Use sed to fix paths from their built-to locations to their installed-to for $includedir the replacement of $prefix_build by $prefix_real is applyed twice and since the $prefix_real contains $prefix_build it produce a wrong result. In addition I think it is strange to have lines like the following |
Do you want to provide a patch? |
I stumbled across the exact same problem and I have made a fix that is working, at least for the usage I have... |
I don't understand: Why python-config needs to seek "realpath"? Why python-config is trying to be smarter than one who starts ./configure script? As so, the right thing to this, is remove "smart" parts from python-config. But as for fast hack in to this is replace line 'prefix_real=$(installed_prefix "$0")' with 'prefix_real=$prefix_build'. |
I've submitted a pull request with another fix. I've tried to keep the changes at minimal but I couldn't stand keeping meaningless 'echo $x | sed -e s/$x/$y/' ;-). I have to point out that the attached patch is wrong since it does readlink on CFLAGS &c. |
Patches 0004 and 0009 relied upon environment variables that were used to drive custom logic in distutils when executed by an external Python interpreter. This issue should have been mostly addressed upstream [0], but even if that was not the case, distutils is no longer a supported installation method for packages to use for installation as of 09de823. As such, there shouldn't be a need to continue to patch it as setuptools vendors its own distutils that supercedes the one provided by Python. Patches 0010 and 0026 (see [1] [2] [3]) can be removed due to a fix introduced in 3.7 [4]. Patch 0028 can be dropped since commit 3fed424 removed the dependency on a host provided python to build host-python3. [0] python/cpython@9731330 [1]: python/cpython#67096 [2]: python/cpython#75894 [3]: python/cpython#66338 [4]: python/cpython@14086cf Signed-off-by: Vincent Fazio <vfazio@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: