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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
diff --git a/python/mozbuild/mozbuild/build_commands.py b/python/mozbuild/mozbuild/build_commands.py
--- a/python/mozbuild/mozbuild/build_commands.py
+++ b/python/mozbuild/mozbuild/build_commands.py
@@ -183,10 +183,11 @@
directory=directory,
verbose=verbose,
keep_going=keep_going,
mach_context=command_context._mach_context,
append_env=append_env,
+ virtualenv_topobjdir=orig_topobjdir,
)
if status != 0:
return status
# Packaging the instrumented build is required to get the jarlog
@@ -206,11 +207,11 @@
pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get(
"LLVM_PROFDATA"
)
pgo_env["JARLOG_FILE"] = mozpath.join(orig_topobjdir, "jarlog/en-US.log")
pgo_cmd = [
- instr.virtualenv_manager.python_path,
+ command_context.virtualenv_manager.python_path,
mozpath.join(command_context.topsrcdir, "build/pgo/profileserver.py"),
]
subprocess.check_call(pgo_cmd, cwd=instr.topobjdir, env=pgo_env)
# Set the default build to MOZ_PROFILE_USE
diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -1220,10 +1220,11 @@
directory=None,
verbose=False,
keep_going=False,
mach_context=None,
append_env=None,
+ virtualenv_topobjdir=None,
):
"""Invoke the build backend.
``what`` defines the thing to build. If not defined, the default
target is used.
@@ -1297,10 +1298,11 @@
config_rc = self.configure(
metrics,
buildstatus_messages=True,
line_handler=output.on_line,
append_env=append_env,
+ virtualenv_topobjdir=virtualenv_topobjdir,
)
if config_rc != 0:
return config_rc
@@ -1635,10 +1637,11 @@
metrics,
options=None,
buildstatus_messages=False,
line_handler=None,
append_env=None,
+ virtualenv_topobjdir=None,
):
# Disable indexing in objdir because it is not necessary and can slow
# down builds.
self.metrics = metrics
mkdir(self.topobjdir, not_indexed=True)
@@ -1658,15 +1661,16 @@
if line.startswith("export "):
k, eq, v = line[len("export ") :].partition("=")
if eq == "=":
append_env[k] = v
+ virtualenv_topobjdir = virtualenv_topobjdir or self.topobjdir
build_site = CommandSiteManager.from_environment(
self.topsrcdir,
lambda: get_state_dir(specific_to_topsrcdir=True, topsrcdir=self.topsrcdir),
"build",
- os.path.join(self.topobjdir, "_virtualenvs"),
+ os.path.join(virtualenv_topobjdir, "_virtualenvs"),
)
build_site.ensure()
command = [build_site.python_path, os.path.join(self.topsrcdir, "configure.py")]
if options:
|