Closed nosracd closed 1 year ago
Hi, many thanks for fixing long-standing issues and returning the project to be maintained :-)
We noticed a change in behaviour from this commit, particularly the move to using absolute paths now breaks build flows and would require sudo - this can be noticed when comparing the output of the previous and the new way of finding the PYTHON_SITE variable:
from distutils import sysconfig as sc
print("old", sc.get_python_lib(prefix='', plat_specific=True) # outputs: 'lib/python3/dist-packages' on Debian/Ubuntu based systems that do not use Python standard layout
import sysconfig as sc2
print("new", sc2.get_path('platlib')) # outputs: '/usr/lib/python3.8/site-packages' which is an absolute path
This may break the buildflow of other users as well (?)
Note: This had already been reported in #432
This PR fixes the following warnings, which occur while configuring a build directory:
These happen because of a this code block which occurs in three places in the current revision:
On my system,
PYTHON_SITE
ends up beinglib/python3/dist-packages
. This variable is used to set the output of Python build artifacts tobuild/lib/python3/dist-packages
and to install Python artifacts to/usr/local/lib/python3/dist-packages/lcm/
.This PR refactors the above Python call to instead be:
Now, on my system,
PYTHON_SITE
ends up being/usr/local/lib/python3.10/dist-packages
. This is still used to set the install path, but is probably not ideal for local build artifacts in the build directory. Instead, I've refactored these to be hard-coded to go tobuild/python
.