Skip to content

make install DESTDIR=... does not create the lib-dynload directory in DESTDIR if the real lib-dynload directory exists #98782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hroncok opened this issue Oct 27, 2022 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@hroncok
Copy link
Contributor

hroncok commented Oct 27, 2022

Bug report

When Python 3.12 is installed and make install DESDIR=... runs with Python 3.12, the entire lib-dynload directory is skipped.

I believe this is a result of changes in the Makefile #94474

To reproduce:

$ ./configure
$ make -j...
$ make install DESTDIR=/tmp/python
...
Creating directory /usr/local/lib/python3.12/lib-dynload
/usr/bin/install -c -m 755 Modules/array.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/array.cpython-312-x86_64-linux-gnu.so
/usr/bin/install -c -m 755 Modules/_asyncio.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so
...

Everything is fine, /tmp/python/usr/local/lib/python3.12/lib-dynload/ is created and contains the standard library extension modules.

Now try again:

$ rm -rf /tmp/python  # undo the previous DESTDIR installation
$ sudo mkdir -p /usr/local/lib/python3.12/lib-dynload  # or sudo make install without DESTDIR
$ make install DESTDIR=/tmp/python
...
/usr/bin/install -c -m 755 Modules/array.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/array.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/tmp/python/usr/local/lib/python3.12/lib-dynload/array.cpython-312-x86_64-linux-gnu.so': No such file or directory
...
/usr/bin/install -c -m 755 Modules/xxlimited.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/xxlimited.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/tmp/python/usr/local/lib/python3.12/lib-dynload/xxlimited.cpython-312-x86_64-linux-gnu.so': No such file or directory
/usr/bin/install -c -m 755 Modules/xxlimited_35.cpython-312-x86_64-linux-gnu.so /usr/local/lib/python3.12/lib-dynload/xxlimited_35.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/tmp/python/usr/local/lib/python3.12/lib-dynload/xxlimited_35.cpython-312-x86_64-linux-gnu.so': No such file or directory
...

/tmp/python/usr/local/lib/python3.12/lib-dynload/ is missing entirely. The command succeeds anyway.

A workaround is to mkdir -p .../usr/local/lib/python3.12/lib-dynload/ before running make install DESTDIR=...

In Fedora, we build and install Python this way, when we create the package. As a result, when Python 3.12 is installed during the RPM package build, the build fails because the extension modules are missing. Since we try to use Python 3.12 as the Python for regen, this happens to us.

Your environment

  • CPython versions tested on: 3.11.0a1 or the main branch
  • Operating system and architecture: Fedora Linux x86_64
@hroncok hroncok added the type-bug An unexpected behavior, bug, or error label Oct 27, 2022
@merwok merwok changed the title make install DESTDIR=... does not create the lib-dynload directory in DESTDIR if the real lib-dynload direcotry exists make install DESTDIR=... does not create the lib-dynload directory in DESTDIR if the real lib-dynload directory exists Jan 13, 2023
@hroncok
Copy link
Contributor Author

hroncok commented Apr 9, 2023

I suppose this was fixed by @mgorny in #100329

@hroncok hroncok closed this as completed Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant