citadel/meta-gnome/recipes-support/mozjs68/mozjs68/0001-do-not-create-python-environment-new.patch

75 lines
2.7 KiB
Diff

From 9b32dd063116186d679578cff24366b19874699d Mon Sep 17 00:00:00 2001
From: Bruce Leidl <bruce@subgraph.com>
Date: Thu, 4 Apr 2019 15:30:20 -0400
Subject: [PATCH] do not create python environment new
---
build/moz.configure/init.configure | 18 ------------------
configure.py | 10 +++++++++-
js/src/old-configure | 2 +-
3 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
index 83b8d705..79d04b60 100644
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -257,24 +257,6 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
else:
python = sys.executable
- if not manager.up_to_date(python):
- log.info('Creating Python environment')
- manager.build(python)
-
- python = normsep(manager.python_path)
-
- if python != normsep(sys.executable):
- log.info('Reexecuting in the virtualenv')
- if env_python:
- del os.environ['PYTHON']
- # One would prefer to use os.execl, but that's completely borked on
- # Windows.
- sys.exit(subprocess.call([python] + sys.argv))
-
- # We are now in the virtualenv
- if not distutils.sysconfig.get_python_lib():
- die('Could not determine python site packages directory')
-
return python
diff --git a/configure.py b/configure.py
index 9b2bae9a..771e34e3 100644
--- a/configure.py
+++ b/configure.py
@@ -12,7 +12,15 @@ import textwrap
base_dir = os.path.abspath(os.path.dirname(__file__))
-sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
+sys.path.insert(0, os.path.join(base_dir, 'config'))
+def get_immediate_subdirectories(a_dir):
+ return [name for name in os.listdir(a_dir)
+ if os.path.isdir(os.path.join(a_dir, name))]
+for s in ["python", "testing/mozbase", "third_party/python"]:
+ sub_dir = os.path.join(base_dir, s)
+ for module_dir in get_immediate_subdirectories(sub_dir):
+ sys.path.insert(0, os.path.join(sub_dir, module_dir))
+
from mozbuild.configure import ConfigureSandbox
from mozbuild.makeutil import Makefile
from mozbuild.pythonutil import iter_modules_in_path
diff --git a/js/src/old-configure b/js/src/old-configure
index 2c579b77..830b6361 100644
--- a/js/src/old-configure
+++ b/js/src/old-configure
@@ -9974,7 +9974,7 @@ if test "$JS_STANDALONE"; then
if test "$no_recursion" != yes; then
trap '' EXIT
- if ! $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
+ if ! PYTHONPATH=$_topsrcdir/python/mozbuild/ $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
exit 1
fi
fi