aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2023-03-01 03:59:42 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-01 03:59:42 +0000
commitb06175eef89d16e2327cc2a6d655dc5d7739cf76 (patch)
tree53e215d0f1f48c91bd5c6b4a1f2d9cad2009a9a6
parentcf9d397b370334d27ea19d62567d7bd60058c62d (diff)
parent0daf08c1ae8fbcbc465d097b9153ee565d8b55c7 (diff)
downloadorchestrator-b06175eef89d16e2327cc2a6d655dc5d7739cf76.tar.gz
Replace envvars with ninja.environment am: 0daf08c1ae
Original change: https://android-review.googlesource.com/c/platform/build/orchestrator/+/2459852 Change-Id: I48c7547e0916758fff8a7e279db822d2fcb83ea3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rwxr-xr-xcore/orchestrator.py13
-rwxr-xr-xinner_build/inner_build_soong.py5
2 files changed, 3 insertions, 15 deletions
diff --git a/core/orchestrator.py b/core/orchestrator.py
index 5903e47..7c25b36 100755
--- a/core/orchestrator.py
+++ b/core/orchestrator.py
@@ -192,19 +192,6 @@ class Orchestrator():
# For now, use a default that is consistent with having the build work.
targets = self.opts.targets or ["vendor/nothing"]
print("Running ninja...")
-
- # TODO: Handle environment variables of each inner build in combined
- # execution.
- # soong_ui wraps the primary ninja execution with additinal
- # environment variables.
- # build/soong/ui/build/config.go#NewConfig
- # Several ninja actions expect these environment variables to be set.
- # A plain merge of environment variables across inner trees will likely
- # not work since each inner build might have varying settings (e.g.
- # different JDK toolchains.)
- # For now, set `OUT_DIR` which is inner tree agnostic.
- jail_cfg.add_envar(name="OUT_DIR", value=utils.choose_out_dir())
- jail_cfg.add_envar(name="TARGET_BUILD_VARIANT", value=self.variant)
# Disable network access in the combined ninja execution
jail_cfg.add_option(name="clone_newnet", value="true")
ninja_runner.run_ninja(context, jail_cfg, targets)
diff --git a/inner_build/inner_build_soong.py b/inner_build/inner_build_soong.py
index 1b409b3..e51711c 100755
--- a/inner_build/inner_build_soong.py
+++ b/inner_build/inner_build_soong.py
@@ -81,9 +81,10 @@ class InnerBuildSoong(common.Commands):
f"{p.stderr.decode() if p.stderr else ''}")
sys.exit(p.returncode)
- # Capture the environment variables from soong.
+ # Capture the environment variables passed by soong_ui to single-tree
+ # ninja.
env_path = os.path.join(args.out_dir, 'soong',
- 'soong.environment.used.build')
+ 'ninja.environment')
with open(env_path, "r", encoding='iso-8859-1') as f:
try:
env_json = json.load(f)