-
Notifications
You must be signed in to change notification settings - Fork 7
Description
In Ubuntu 22.04 the pythondir gets identified as ${exec_prefix}/local/lib/python3.10/dist-packages. But because ${exec_prefix} defaults to /usr/local this makes the pythondir be under /usr/local/local/... (with an extra local). With non-default prefixes, the extra local is likely to also be undesired.
This appears to be due to a debian patch to use the "posix_local" scheme as the default in sysconfig. So the issue will impact all debian-derives distros that inherit this behaviour. A debian mailing list post on the topic suggests that build tools can use the "posix_prefix" scheme instead. But when I change m4/python.m4 to try that, then pythondir becomes ${exec_prefix}/lib/python3.10/site-packages, which solves the extra local, but now uses the site-packages subdirectory instead of the desired dist-packages on debian-derived systems.
I'm not sure how best to fix this. It's possible to detect the "posix_local" scheme and then specifically hack out the extra local. But that feels fragile and like asking for future trouble. One could argue this is a debian bug, but I don't think doing so helps make the problem go away.
My workaround is to configure with --with-python-module-dir=/usr/local/lib/python3.10/dist-packages
(This discussion all applies after the fix in pull request #7 has been merged, to fix python version detection with more than 3 digits.)