blob: ba317bc0c58ccf8abdd19fc6d1b990b463a775fe [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
17diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
18index 2123beb..6fe6591 100644
19--- a/build/moz.configure/init.configure
20+++ b/build/moz.configure/init.configure
21@@ -179,24 +179,6 @@ def virtualenv_python(env_python, build_env, mozconfig, help):
22 else:
23 python = sys.executable
24
25- if not manager.up_to_date(python):
26- log.info('Creating Python environment')
27- manager.build(python)
28-
29- python = normsep(manager.python_path)
30-
31- if python != normsep(sys.executable):
32- log.info('Reexecuting in the virtualenv')
33- if env_python:
34- del os.environ['PYTHON']
35- # One would prefer to use os.execl, but that's completely borked on
36- # Windows.
37- sys.exit(subprocess.call([python] + sys.argv))
38-
39- # We are now in the virtualenv
40- if not distutils.sysconfig.get_python_lib():
41- die('Could not determine python site packages directory')
42-
43 return python
44
45 set_config('PYTHON', virtualenv_python)
46diff --git a/configure.py b/configure.py
47index f7392d0..45323a5 100644
48--- a/configure.py
49+++ b/configure.py
50@@ -12,7 +12,15 @@ import textwrap
51
52
53 base_dir = os.path.abspath(os.path.dirname(__file__))
54-sys.path.insert(0, os.path.join(base_dir, 'python', 'mozbuild'))
55+sys.path.insert(0, os.path.join(base_dir, 'config'))
56+def get_immediate_subdirectories(a_dir):
57+ return [name for name in os.listdir(a_dir)
58+ if os.path.isdir(os.path.join(a_dir, name))]
59+for s in ["python", "testing/mozbase"]:
60+ sub_dir = os.path.join(base_dir, s)
61+ for module_dir in get_immediate_subdirectories(sub_dir):
62+ sys.path.insert(0, os.path.join(sub_dir, module_dir))
63+
64 from mozbuild.configure import ConfigureSandbox
65 from mozbuild.util import (
66 indented_repr,
67diff --git a/js/src/old-configure b/js/src/old-configure
68index ee4527b..75b00e1 100644
69--- a/js/src/old-configure
70+++ b/js/src/old-configure
71@@ -10512,7 +10512,7 @@ if test "$MOZ_BUILD_APP" != js -o -n "$JS_STANDALONE"; then
72 ;;
73 esac
74
75- eval $dumpenv $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args
76+ eval $dumpenv PYTHONPATH=$_topsrcdir/python/mozbuild/ $PYTHON $_topsrcdir/build/subconfigure.py --prepare "$srcdir" "$moz_config_dir" "$_CONFIG_SHELL" $ac_configure_args
77
78 done
79
80@@ -10931,7 +10931,7 @@ if test "$JS_STANDALONE"; then
81
82 if test "$no_recursion" != yes; then
83 trap '' EXIT
84- if ! $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
85+ if ! PYTHONPATH=$_topsrcdir/python/mozbuild/ $PYTHON $_topsrcdir/build/subconfigure.py --list subconfigures --skip skip_subconfigures; then
86 exit 1
87 fi
88 fi
89--
902.7.4
91