The Makefile.pre.in rule for creating directories is specified as:
$(DESTSHARED):
@for i in $(DESTDIRS); \
do \
if test ! -d $(DESTDIR)$$i; then \
echo "Creating directory $$i"; \
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
else true; \
fi; \
done
This means that if $(DESTSHARED) exists already (note: missing $(DESTDIR)!), i.e. Python 3.12 has been installed into the system, the directories in $(DESTDIR) won't be created and the successive sharedinstall rules fail due to the missing destination, e.g.:
/usr/bin/install -c -m 755 Modules/array.cpython-312-x86_64-linux-gnu.so /usr/lib/python3.12/lib-dynload/array.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/var/tmp/portage/dev-lang/python-3.12.0_alpha3/image/usr/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/_asyncio.cpython-312-x86_64-linux-gnu.so /usr/lib/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/var/tmp/portage/dev-lang/python-3.12.0_alpha3/image/usr/lib/python3.12/lib-dynload/_asyncio.cpython-312-x86_64-linux-gnu.so': No such file or directory
/usr/bin/install -c -m 755 Modules/_bisect.cpython-312-x86_64-linux-gnu.so /usr/lib/python3.12/lib-dynload/_bisect.cpython-312-x86_64-linux-gnu.so
/usr/bin/install: cannot create regular file '/var/tmp/portage/dev-lang/python-3.12.0_alpha3/image/usr/lib/python3.12/lib-dynload/_bisect.cpython-312-x86_64-linux-gnu.so': No such file or directory
Activity
pythongh-100221: Fix creating dirs in `make sharedinstall`
gh-100221: Fix creating dirs in `make sharedinstall` (GH-100329)
zware commented on Feb 8, 2023
Is this only an issue on 3.12, or is 3.11 also affected?
mgorny commented on Feb 8, 2023
I think the relevant code technically exists in 3.11 too but it's not being used since setup.py is used to install the extensions.
zware commented on Feb 8, 2023
Ok, we'll leave 3.11 as is for now, then.
Thanks for the patch!
Merge branch 'main' into inlinecomp2