diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2022-02-11 19:03:13 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-14 11:09:28 +0000 |
commit | a857836603e2237f6b1841308e7e115cd74f052b (patch) | |
tree | 92b9403004fc75afde0b8a2de18227ab35ef1ca4 | |
parent | 3fd1887ee80978cd249ae443c9eeb38f40f02e54 (diff) | |
download | chrome-ec-a857836603e2237f6b1841308e7e115cd74f052b.tar.gz |
Reland "zephyr: zmake: Drop support for building by project directory"
This reverts commit 59e9e0544ec4e449b11267053e5525d6de372a39.
With the CL in the CQ depend, this should now be safe to land.
Original change's description:
> Revert "zephyr: zmake: Drop support for building by project directory"
>
> This reverts commit 848a4a66b61a656d0bd0739526656f67213ee66e.
>
> Reason for revert: broke trogdor-zephyr
> https://ci.chromium.org/p/chromeos/builders/postsubmit/trogdor-zephyr-postsubmit
>
> Original change's description:
> > zephyr: zmake: Drop support for building by project directory
> >
> > This has been deprecated since November, and all code and
> > documentation has been updated to no longer mention building by
> > project directory path. Therefore, let's drop support for it.
> >
> > BUG=b:218868887
> > BRANCH=none
> > TEST=unit tests pass
> >
> > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
> > Change-Id: I4f0762df289a413007a8409c6a39026db8056937
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3452934
> > Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
>
> Bug: b:218868887
> Change-Id: I59f593aef0b9490a35b22c65d50bf5f978e56eb1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3454742
> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
> Reviewed-by: Evan Benn <evanbenn@chromium.org>
> Tested-by: Evan Benn <evanbenn@chromium.org>
> Owners-Override: Evan Benn <evanbenn@chromium.org>
Change-Id: I6f6e5a7594225b18ddc00c922c34ee87ee709420
Cq-Depend: chromium:3452985
Bug: b:218868887
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3456705
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/zmake/README.md | 4 | ||||
-rw-r--r-- | zephyr/zmake/zmake/__main__.py | 4 | ||||
-rw-r--r-- | zephyr/zmake/zmake/zmake.py | 19 |
3 files changed, 10 insertions, 17 deletions
diff --git a/zephyr/zmake/README.md b/zephyr/zmake/README.md index 63144a32db..6eb573154c 100644 --- a/zephyr/zmake/README.md +++ b/zephyr/zmake/README.md @@ -35,13 +35,13 @@ Chromium OS's meta-build tool for Zephyr ### zmake configure -**Usage:** `zmake configure [-h] [-t TOOLCHAIN] [--bringup] [--clobber] [--allow-warnings] [-B BUILD_DIR] [-b] [--test] project_name_or_dir [-c]` +**Usage:** `zmake configure [-h] [-t TOOLCHAIN] [--bringup] [--clobber] [--allow-warnings] [-B BUILD_DIR] [-b] [--test] project_name [-c]` #### Positional Arguments | | | |---|---| -| `project_name_or_dir` | Path to the project to build | +| `project_name` | Name of the project to setup | #### Optional Arguments diff --git a/zephyr/zmake/zmake/__main__.py b/zephyr/zmake/zmake/__main__.py index ce0588e5fa..ab60a00657 100644 --- a/zephyr/zmake/zmake/__main__.py +++ b/zephyr/zmake/zmake/__main__.py @@ -216,8 +216,8 @@ def get_argparser(): help="Test the .elf file after configuration", ) configure.add_argument( - "project_name_or_dir", - help="Path to the project to build", + "project_name", + help="Name of the project to setup", ) configure.add_argument( "-c", diff --git a/zephyr/zmake/zmake/zmake.py b/zephyr/zmake/zmake/zmake.py index 826d26b824..4b5d6feacb 100644 --- a/zephyr/zmake/zmake/zmake.py +++ b/zephyr/zmake/zmake/zmake.py @@ -192,7 +192,7 @@ class Zmake: def configure( self, - project_name_or_dir, + project_name, build_dir=None, toolchain=None, build_after_configure=False, @@ -203,19 +203,12 @@ class Zmake: allow_warnings=False, ): """Locate a project by name or directory and then call _configure.""" - root_dir = pathlib.Path(project_name_or_dir) - if not root_dir.is_dir(): - root_dir = self.module_paths["ec"] / "zephyr" + root_dir = self.module_paths["ec"] / "zephyr" found_projects = zmake.project.find_projects(root_dir) - if len(found_projects) == 1: - # Likely passed directory path, wants to build only - # project from there. - project = next(iter(found_projects.values())) - else: - try: - project = found_projects[project_name_or_dir] - except KeyError as e: - raise KeyError("No project named {}".format(project_name_or_dir)) from e + try: + project = found_projects[project_name] + except KeyError as e: + raise KeyError(f"No project named {project_name}") from e return self._configure( project=project, build_dir=build_dir, |