When using BINARY_ALIAS together with python3.6-config, i.e. symlinking it to another location, it starts outputting bogus paths. USES= python:3.6+ BINARY_ALIAS= python3-config=python${PYTHON_VER}-config It is convenient to use when porting applications that hardcode use of python3-config etc. 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 as it does with Python 2.7.
I noticed this too in ports r461704
Created attachment 195240 [details] python36.diff Here's a patch that maybe solves it. I have also opened an upstream issue here: https://bugs.python.org/issue34111 It's similar to the problem the LLVM wrapper scripts had (fixed in ports r466018).
Hi, The patch looks good to me, @antoine shall we exp-run this patch?
This looks fine, don't forget to bump PORTREVISION.
(In reply to Antoine Brodin from comment #4) Alright, thanks! tobik@ feel free to commit this patch.
(In reply to Martin Wilke from comment #5) Ok, thanks. The other lang/python3? ports have the same problem. Do I have approval to add the patch to them too? It applies as is to them. It would be pointless to only add it to lang/python36.
(In reply to Tobias Kortkamp from comment #6) I agree. Please Proceed.
A commit references this bug: Author: tobik Date: Thu Jul 26 08:58:52 UTC 2018 New revision: 475350 URL: https://svnweb.freebsd.org/changeset/ports/475350 Log: lang/python3?: Fix python3.?-config behavior when symlinked When python3.?-config is symlinked to another location it starts outputting bogus paths. For example $ pwd /home/tobias $ 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 This breaks ports trying to use BINARY_ALIAS together with python3.?-config. Apply a patch to resolve the symlink first before trying to find the install prefix. PR: 229749 Submitted by: tobik Reviewed by: antoine, miwi Approved by: python (miwi) Changes: head/lang/python34/Makefile head/lang/python34/files/patch-Misc__python-config.sh.in head/lang/python35/Makefile head/lang/python35/files/patch-Misc__python-config.sh.in head/lang/python36/Makefile head/lang/python36/files/patch-Misc__python-config.sh.in head/lang/python37/Makefile head/lang/python37/files/patch-Misc__python-config.sh.in