Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue22140

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:"python-config --includes" returns a wrong path (double prefix)
Type:behaviorStage:resolved
Components:BuildVersions:Python 3.8, Python 3.7, Python 3.6, Python 3.4, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Michael.Dussere, animus, benjamin.peterson, mgorny, rdossin, serhiy.storchaka
Priority:normalKeywords:patch

Created on2014-08-05 13:28 byMichael.Dussere, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
patch_python_sym_links.txtrdossin,2015-07-22 10:45review
Pull Requests
URLStatusLinkedEdit
PR 3769mergedmgorny,2017-09-26 15:13
PR 3793mergedbenjamin.peterson,2017-09-28 03:23
Messages (7)
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 /Produitslrwxrwxrwx 1 root root 13 Oct 31  2013 /Produits -> /nfs/ProduitsWith 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.4mThe 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 $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 followingprefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
msg231307 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)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 -e s/$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)*(Python committer)Date: 2017-09-27 05:45
New changeset14086cfc5eed8c5e78342d79e5db87a135d75fa8 by Benjamin Peterson (Michał Górny) in branch 'master':closesbpo-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)*(Python committer)Date: 2017-09-28 03:27
New changeset68b131d5b674549bb637b366730497714ad11328 by Benjamin Peterson in branch '3.6':[3.6] closesbpo-22140: Prevent double substitution of prefix in python-config.sh (GH-3769) (#3793)https://github.com/python/cpython/commit/68b131d5b674549bb637b366730497714ad11328
History
DateUserActionArgs
2022-04-11 14:58:06adminsetgithub: 66338
2020-11-27 14:00:05iritkatriellinkissue31713 superseder
2017-09-28 03:27:44benjamin.petersonsetmessages: +msg303188
2017-09-28 03:23:50benjamin.petersonsetpull_requests: +pull_request3777
2017-09-27 05:45:08benjamin.petersonsetstatus: open -> closed

nosy: +benjamin.peterson
messages: +msg303096

resolution: fixed
stage: patch review -> resolved
2017-09-26 15:16:52mgornysetmessages: +msg303045
versions: + Python 3.5, Python 3.6, Python 3.7, Python 3.8
2017-09-26 15:13:21mgornysetkeywords: +patch
stage: needs patch -> patch review
pull_requests: +pull_request3754
2017-09-25 17:44:22mgornysetnosy: +mgorny
2015-08-23 09:41:05animussetnosy: +animus
messages: +msg249003
2015-07-22 10:45:56rdossinsetfiles: +patch_python_sym_links.txt
nosy: +rdossin
messages: +msg247108

2014-11-18 07:19:37serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg231307

components: + Build, - Demos and Tools
stage: needs patch
2014-08-05 13:28:32Michael.Dusserecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp