diff options
author | Christian Tismer <tismer@stackless.com> | 2022-01-03 18:32:07 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2022-01-05 11:16:40 +0100 |
commit | 981ffb345928cf740a5b751aaef43a266d077d13 (patch) | |
tree | 36f37fe5efae29c3de4c3a93e287cf73ab92abdf | |
parent | 03109e44630ed23a10aba232108906b801c76fb5 (diff) |
build_scripts: Avoid a racing condition in install
On macOS and a custom Python built, the "install" option
crashes with an import error.
This is a timing problem, because an import is triggered
when it is already being processed. The problem is hidden
by the use of virtualenv.
[ChangeLog][PySide6] The move from distutils to
setuptools caused a racing condition with certain
Python builds.
Change-Id: I4dcda2b083234e88c272a1794388f6d0e7b8f0e5
Pick-to: 6.2
Fixes: PYSIDE-1760
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
-rw-r--r-- | build_scripts/main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index 82b0f31aa..a69b4fa69 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -62,6 +62,11 @@ from setuptools.command.bdist_egg import bdist_egg as _bdist_egg from setuptools.command.develop import develop as _develop from setuptools.command.build_py import build_py as _build_py +# PYSIDE-1760: Although not used here, pre-load this module early to avoid +# a racing condition with the import order. Note that this problem +# happens only with custom builds of Python without virtual environment. +import setuptools.command.install_scripts + from sysconfig import get_config_var # Use the distutils implementation within setuptools from setuptools._distutils.errors import DistutilsSetupError |