blob: a3c1b69e29617cfe88f7d4d541cfefeae9b35b8f [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 5028d1cd669c179ed49061316d04c8e8862a5bd8 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Thu, 12 Jul 2018 15:04:47 +0800
4Subject: [PATCH 1/5] do not create python environment
5
6Use oe's python environment rather than create one of host
7
8Upstream-Status: Inappropriate [oe specific]
9
10Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
11---
12 build/moz.configure/init.configure | 18 ------------------
13 configure.py | 10 +++++++++-
14 js/src/old-configure | 4 ++--
15 3 files changed, 11 insertions(+), 21 deletions(-)
16
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017--- a/build/moz.configure/init.configure
18+++ b/build/moz.configure/init.configure
Brad Bishop15ae2502019-06-18 21:44:24 -040019@@ -250,24 +250,6 @@ def virtualenv_python(env_python, build_
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080020 else:
21 python = sys.executable
22
23- if not manager.up_to_date(python):
24- log.info('Creating Python environment')
25- manager.build(python)
26-
27- python = normsep(manager.python_path)
28-
29- if python != normsep(sys.executable):
30- log.info('Reexecuting in the virtualenv')
31- if env_python:
32- del os.environ['PYTHON']
33- # One would prefer to use os.execl, but that's completely borked on
34- # Windows.
35- sys.exit(subprocess.call([python] + sys.argv))
36-
37- # We are now in the virtualenv
38- if not distutils.sysconfig.get_python_lib():
39- die('Could not determine python site packages directory')
40-
41 return python
42
Brad Bishop15ae2502019-06-18 21:44:24 -040043
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080044--- a/configure.py
45+++ b/configure.py
46@@ -12,7 +12,15 @@ import textwrap
47
48
49 base_dir = os.path.abspath(os.path.dirname(__file__))
50-sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
51+sys.path.insert(0, os.path.join(base_dir, 'config'))
52+def get_immediate_subdirectories(a_dir):
53+ return [name for name in os.listdir(a_dir)
54+ if os.path.isdir(os.path.join(a_dir, name))]
55+for s in ["python", "testing/mozbase"]:
56+ sub_dir = os.path.join(base_dir, s)
57+ for module_dir in get_immediate_subdirectories(sub_dir):
58+ sys.path.insert(0, os.path.join(sub_dir, module_dir))
59+
60 from mozbuild.configure import ConfigureSandbox
Brad Bishop15ae2502019-06-18 21:44:24 -040061 from mozbuild.makeutil import Makefile
62 from mozbuild.pythonutil import iter_modules_in_path
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080063--- a/js/src/old-configure
64+++ b/js/src/old-configure
Brad Bishop15ae2502019-06-18 21:44:24 -040065@@ -9974,7 +9974,7 @@ if test "$JS_STANDALONE"; then
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066
67 if test "$no_recursion" != yes; then
68 trap '' EXIT
69- if ! $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
70+ if ! PYTHONPATH=$_topsrcdir/python/mozbuild/ $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
71 exit 1
72 fi
73 fi