summaryrefslogtreecommitdiff
path: root/zephyr/zmake
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-02-12 19:56:19 -0700
committerCommit Bot <commit-bot@chromium.org>2021-02-18 17:23:50 +0000
commitdb3d75fed17094bacb637e1a5b941149f1087375 (patch)
treee4cfe7a8c8938aa98309be065e2ade5b18403de4 /zephyr/zmake
parentb54655a55feb3d98dbad7e23965d953d8326186d (diff)
downloadchrome-ec-db3d75fed17094bacb637e1a5b941149f1087375.tar.gz
zephyr: zmake: Always used the supplied build directory
If --build-dir is provided it seems better to always use it. The current logic in resolve_build_dir() assumes that the build will progress far enough that we recognise the build directory. If it doesn't, then the flag is ignored and we build in a default location. It isn't clear to me why that is better than always using the directory. Drop this unnecessary logic. BRANCH=none BUG=b:178731498 TEST=pytest zephyr/zmake/ zmake configure -B /tmp/z/vol zephyr/projects/volteer/ -t zephyr && zmake build /tmp/z/vol in the chroot: FEATURES=test sudo -E emerge -q zephyr-build-tools zmake testall Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I9e46d91e79cc946016cf8d33ed6ea1f3862c977e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2697123 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/zmake')
-rw-r--r--zephyr/zmake/zmake/util.py3
-rw-r--r--zephyr/zmake/zmake/zmake.py6
2 files changed, 1 insertions, 8 deletions
diff --git a/zephyr/zmake/zmake/util.py b/zephyr/zmake/zmake/util.py
index 946fd41521..1f052a3688 100644
--- a/zephyr/zmake/zmake/util.py
+++ b/zephyr/zmake/zmake/util.py
@@ -180,8 +180,7 @@ def resolve_build_dir(platform_ec_dir, project_dir, build_dir):
Returns:
The resolved build directory (using build_dir if not None).
"""
- if build_dir and (not pathlib.Path.exists(build_dir) or pathlib.Path.exists(
- build_dir / 'project' / 'zmake.yaml')):
+ if build_dir:
return build_dir
if not pathlib.Path.exists(project_dir / 'zmake.yaml'):
diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py
index 2d174f0ed8..3998c191c7 100644
--- a/zephyr/zmake/zmake/zmake.py
+++ b/zephyr/zmake/zmake/zmake.py
@@ -179,9 +179,6 @@ class Zmake:
def build(self, build_dir, output_files_out=None):
"""Build a pre-configured build directory."""
- build_dir = util.resolve_build_dir(platform_ec_dir=self.platform_ec_dir,
- project_dir=build_dir,
- build_dir=build_dir)
project = zmake.project.Project(build_dir / 'project')
procs = []
@@ -233,9 +230,6 @@ class Zmake:
"""Test a build directory."""
procs = []
output_files = []
- build_dir = util.resolve_build_dir(platform_ec_dir=self.platform_ec_dir,
- project_dir=build_dir,
- build_dir=build_dir)
self.build(build_dir, output_files_out=output_files)
# If the project built but isn't a test, just bail.