msg224825 - (view) |
Author: Michael Dussere (Michael.Dussere) |
Date: 2014-08-05 13:28 |
|
Our python is installed on a shared directory that is accessed through a symbolic link. $ which python3.4-config /Produits/publics/x86_64.Linux.RH6/python/3.4.1/bin/python3.4-config $ 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" prefix_real=$(installed_prefix "$0") # Use sed to fix paths from their built-to locations to their installed-to # locations. prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#") exec_prefix_build="${prefix}" exec_prefix=$(echo "$exec_prefix_build" |
sed "s#$exec_prefix_build#$prefix_real#") includedir=$(echo "${prefix}/include" |
sed "s#$prefix_build#$prefix_real#") for includedirthereplacementofincludedir the replacement of includedirthereplacementofprefix_build by prefixrealisapplyedtwiceandsincetheprefix_real is applyed twice and since the prefixrealisapplyedtwiceandsincetheprefix_real contains prefixbuilditproduceawrongresult.InadditionIthinkitisstrangetohavelineslikethefollowingprefix=prefix_build it produce a wrong result. In addition I think it is strange to have lines like the following prefix=prefixbuilditproduceawrongresult.InadditionIthinkitisstrangetohavelineslikethefollowingprefix=(echo "$prefix_build" |
sed "s#$prefix_build#$prefix_real#") |
msg231307 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2014-11-18 07:19 |
|
Do you want to provide a patch? |
|
|
|
msg247108 - (view) |
Author: Romain Dossin (rdossin) * |
Date: 2015-07-22 10:45 |
|
I stumbled across the exact same problem and I have made a fix that is working, at least for the usage I have... |
|
|
|
msg249003 - (view) |
Author: Alexey Gorshkov (animus) |
Date: 2015-08-23 09:41 |
|
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'. |
|
|
|
msg303045 - (view) |
Author: Michał Górny (mgorny) * |
Date: 2017-09-26 15:16 |
|
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−es/x | sed -e s/x∥sed−es/x/$y/' ;-). I have to point out that the attached patch is wrong since it does readlink on CFLAGS &c. |
|
|
|
msg303096 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2017-09-27 05:45 |
|
New changeset 14086cfc5eed8c5e78342d79e5db87a135d75fa8 by Benjamin Peterson (Michał Górny) in branch 'master': closes bpo-22140: Prevent double substitution of prefix in python-config.sh (#3769) https://github.com/python/cpython/commit/14086cfc5eed8c5e78342d79e5db87a135d75fa8 |
|
|
|
msg303188 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2017-09-28 03:27 |
|
New changeset 68b131d5b674549bb637b366730497714ad11328 by Benjamin Peterson in branch '3.6': [3.6] closes bpo-22140: Prevent double substitution of prefix in python-config.sh (GH-3769) (#3793) https://github.com/python/cpython/commit/68b131d5b674549bb637b366730497714ad11328 |
|
|
|