Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From 5028d1cd669c179ed49061316d04c8e8862a5bd8 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Thu, 12 Jul 2018 15:04:47 +0800 |
| 4 | Subject: [PATCH 1/5] do not create python environment |
| 5 | |
| 6 | Use oe's python environment rather than create one of host |
| 7 | |
| 8 | Upstream-Status: Inappropriate [oe specific] |
| 9 | |
| 10 | Signed-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 Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 17 | --- a/build/moz.configure/init.configure |
| 18 | +++ b/build/moz.configure/init.configure |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 19 | @@ -250,24 +250,6 @@ def virtualenv_python(env_python, build_ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 20 | 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 Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 43 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 44 | --- 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 Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 61 | from mozbuild.makeutil import Makefile |
| 62 | from mozbuild.pythonutil import iter_modules_in_path |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 63 | --- a/js/src/old-configure |
| 64 | +++ b/js/src/old-configure |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 65 | @@ -9974,7 +9974,7 @@ if test "$JS_STANDALONE"; then |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 66 | |
| 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 |