Bug 2094352 - Automake adds a folder "local" on top of the Python prefix when using the --with-python_prefix flag
Summary: Automake adds a folder "local" on top of the Python prefix when using the --w...
Keywords:
Status: CLOSED DUPLICATE of bug 2026979
Alias: None
Product: Fedora
Classification: Fedora
Component: python3.10
Version: 36
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Python Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-07 13:08 UTC by Panos Asproulis
Modified: 2022-06-09 15:11 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-09 15:11:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Panos 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.

Comment 1 Frédéric Bérat 2022-06-09 15:00:45 UTC
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

Comment 2 Miro Hrončok 2022-06-09 15:11:55 UTC
Yes, this is a bug but it will not be easy to fix. Read https://docs.fedoraproject.org/en-US/fedora/latest/release-notes/developers/Development_Python/#sect-install_scheme for some possible workarounds.

*** This bug has been marked as a duplicate of bug 2026979 ***


Note You need to log in before you can comment on or make changes to this bug.