summaryrefslogtreecommitdiffstats
path: root/external/meta-openembedded/meta-oe/dynamic-layers/meta-python/recipes-extended/mozjs/mozjs/0004-do-not-create-python-environment.patch
blob: 985fc36c188b5b140f4615b892aad4c2cca01675 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
From 5028d1cd669c179ed49061316d04c8e8862a5bd8 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Thu, 12 Jul 2018 15:04:47 +0800
Subject: [PATCH 1/5] do not create python environment

Use oe's python environment rather than create one of host

Upstream-Status: Inappropriate [oe specific]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

Rebase to 60.9.0 (firefox-esr sources)
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 build/moz.configure/init.configure | 18 ------------------
 configure.py                       | 10 +++++++++-
 3 files changed, 11 insertions(+), 21 deletions(-)

--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -250,24 +250,6 @@ def virtualenv_python(env_python, build_
     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
 
 
--- 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"]:
+    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