summaryrefslogtreecommitdiff
path: root/dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-10-03 23:49:50 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-10-03 23:49:50 +0100
commitc410d7a91a496a4fbbca686c80f7446305222d55 (patch)
tree8ba974498cd1061dd4e883a34bd5e9be93a95214 /dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch
parentc99c2410831577bef101e22948e954f85f56cba1 (diff)
gentoo auto-resync : 03:10:2023 - 23:49:49
Diffstat (limited to 'dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch')
-rw-r--r--dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch39
1 files changed, 39 insertions, 0 deletions
diff --git a/dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch b/dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch
new file mode 100644
index 000000000000..c552831cfd6b
--- /dev/null
+++ b/dev-util/meson/files/1.2.2/0001-python-dependency-ensure-that-setuptools-doesn-t-inj.patch
@@ -0,0 +1,39 @@
+From 5f96e35b873d6230970fd63ba2e706bbd3f4e26f Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Fri, 8 Sep 2023 16:54:48 -0400
+Subject: [PATCH 1/7] python dependency: ensure that setuptools doesn't inject
+ itself into distutils
+
+We do not use setuptools for anything, and only lightly use distutils.
+Unpredictable issues can occur due to setuptools monkey-patching, which
+interferes with our intended use. Tell setuptools to simply never get
+involved.
+
+Note: while it's otherwise possible to check if the probe is run using
+sys.executable and avoid forking, setuptools unconditionally injects
+itself at startup in a way that requires subprocess isolation to
+disable.
+
+(cherry picked from commit 9f610ad5b72ea91de2d7aeb6f3266d0a7477062e)
+---
+ mesonbuild/dependencies/python.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/mesonbuild/dependencies/python.py b/mesonbuild/dependencies/python.py
+index 160772888..f04494674 100644
+--- a/mesonbuild/dependencies/python.py
++++ b/mesonbuild/dependencies/python.py
+@@ -113,7 +113,9 @@ class BasicPythonExternalProgram(ExternalProgram):
+
+ with importlib.resources.path('mesonbuild.scripts', 'python_info.py') as f:
+ cmd = self.get_command() + [str(f)]
+- p, stdout, stderr = mesonlib.Popen_safe(cmd)
++ env = os.environ.copy()
++ env['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib'
++ p, stdout, stderr = mesonlib.Popen_safe(cmd, env=env)
+
+ try:
+ info = json.loads(stdout)
+--
+2.42.0
+