Skip to content

Commit

Permalink
python3: Fix race condition when doing parallel builds
Browse files Browse the repository at this point in the history
When doing parallel builds, host Python can install the python3 symlink
before the Python standard library is installed completely.

When this occurs, it is possible for other packages to detect the
python3 symlink and try to use host Python before it is fully installed.

This adds a patch to make commoninstall (where the standard library is
installed) a prerequisite of bininstall (where the python3 symlink is
installed), so that commoninstall is fully completed before bininstall
begins.

Patch has been submitted upstream:
python/cpython#104693

Fixes: #19241

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 67e47f1)
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
  • Loading branch information
jefferyto committed May 24, 2023
1 parent 8388941 commit 9c5eb22
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1361,7 +1361,7 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
fi

-bininstall: altbininstall
+bininstall: commoninstall altbininstall
if test ! -d $(DESTDIR)$(LIBPC); then \
echo "Creating directory $(LIBPC)"; \
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \

0 comments on commit 9c5eb22

Please sign in to comment.