DescriptionPanos Asproulis
2022-06-07 13:08:19 UTC
Description of problem:
I encountered a problem with the version of automake in Fedora 36: when configuring a source project designed to build with the GNU automake tools one can use the option --with-python_prefix in order to specify the directory where the Python packages of this project (if it has any) are supposed to be installed e.g.
./configure --prefix=/opt/apps/my-project --with-python_prefix=/opt/apps/my-project
and in this case the application will be installed in
/opt/apps/my-project/
while the Python packages will be installed in
/opt/apps/my-project/lib/python3.10/site-packages/
However, in Fedora 36 this option results in the Python packages ending up in directory:
/opt/apps/my-project/local/lib/python3.10/site-packages/
So, automake adds a “local” folder to the Python prefix and this can create a lot of problems because applications may not be able to find the required Python packages as before.
I assume that this is a bug and not something added to automake on purpose.
How reproducible:
100%
Steps to Reproduce:
1. Open a project which uses the GNU Build system and it contains Python code among other things e.g. C, C++ etc.
2. Run the configure command with the --with-python_prefix option and specify a directory prefix to install the Python modules.
3. After doing the building and the installation of the project examine the directory which contains the Python modules to see that it is under a "local" path added to the specified Python prefix.
Actual results:
The installed Python modules will be under a "local" subdirectory under the Python prefix directory as %python-prefix/local/lib/python3.10/site-packages.
Expected results:
The installed Python modules will be under the specified Python prefix subdirectory which is %python-prefix/lib/python3.10/site-packages.
Additional info:
Fedora 35 and RHEL9 do not have this issue.
After some investigation, it looks like the problem doesn't come from automake, but from a change in behavior from python:
python -c "import sysconfig
import sys
sitedir = sysconfig.get_path('purelib', vars={'base':'/builddir/build/tmp/build/inst/'})
sys.stdout.write(sitedir)"
/builddir/build/tmp/build/inst/local/lib/python3.10/site-packages
Whereas, on f35:
python -c "import sysconfig
import sys
sitedir = sysconfig.get_path('purelib', vars={'base':'/builddir/build/tmp/build/inst/'})
sys.stdout.write(sitedir)"
/builddir/build/tmp/build/inst/lib/python3.10/site-packages