ketiltrout / getdata

The GetData Project is the reference implementation of the Dirfile Standards, a filesystem-based, column-oriented database format for time-ordered binary data.
http://getdata.sourceforge.net/
GNU Lesser General Public License v2.1
4 stars 7 forks source link

Incorrect default python install path in Ubuntu 22.04 #8

Open sbenton opened 2 years ago

sbenton commented 2 years ago

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.)

sbenton commented 1 day ago

Closed because I could not reproduce on one test system, but reopened since I did reproduce on another.