diff options
author | Tristan Honscheid <honscheid@google.com> | 2023-04-04 13:33:49 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-06 22:55:35 +0000 |
commit | 171aa03229bff92769583d78252fb13fc8d32247 (patch) | |
tree | c13ac4247f1731408a7931099800990d7070c241 /zephyr/program/nissa/BUILD.py | |
parent | 67d4a05823bcf880117611942bcd0025274c1ed5 (diff) | |
download | chrome-ec-171aa03229bff92769583d78252fb13fc8d32247.tar.gz |
zmake: Track project inheritance in ProjectConfig
Add an `inherited_from` list field to the ProjectConfig dataclass that
tracks what project(s) the current project inherited from. When using
the `.variant()` project resgistration method, `inherited_from` is
automatically appended with the base project's name. When the following
`BUILD.py` file is processed...
```
baseboard = register_raw_project(project_name="base")
variant1 = baseboard.variant(project_name="variant1")
variant2 = variant1.variant(project_name="variant2")
```
... variant1's `config.inherited_from` field will be `['base']` and
variant2's will be `['base','variant1'].
It is also possible to manually specify `inherited_from` when
registering a project (either as a string or list of strings):
```
register_raw_project(
project_name="myboard",
inherited_from=["root","baseboard1"],
)
```
This method is how the EC's `BUILD.py` files are configured.
In either case, the project's full name can be accessed by reading the
ProjectConfig object's `full_name` property to join the names of the
parent boards plus the current project name. In the case of the above
example, the property would read `"root.baseboard1.myboard"`.
The full name is not consumed anywhere within zmake; it is intended to
be used for external reporting tools and does not affect the builds.
BRANCH=None
BUG=b:276947804
TEST=zephyr/zmake/run_tests.sh
Change-Id: I7d7413175c9c670a64e7ade01a41e46a2fb8d743
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4400532
Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'zephyr/program/nissa/BUILD.py')
-rw-r--r-- | zephyr/program/nissa/BUILD.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/zephyr/program/nissa/BUILD.py b/zephyr/program/nissa/BUILD.py index 621db42e5e..0a10912552 100644 --- a/zephyr/program/nissa/BUILD.py +++ b/zephyr/program/nissa/BUILD.py @@ -4,7 +4,8 @@ """Define zmake projects for nissa.""" -# Nivviks and Craask, Pujjo, Xivu, Xivur, Uldren has NPCX993F, Nereid and Joxer, Yaviks, Yavilla has ITE81302 +# Nivviks and Craask, Pujjo, Xivu, Xivur, Uldren has NPCX993F, Nereid +# and Joxer, Yaviks, Yavilla has ITE81302 def register_nissa_project( @@ -27,6 +28,7 @@ def register_nissa_project( here / f"{chip_kconfig}_program.conf", here / project_name / "project.conf", ], + inherited_from=["nissa"], ) |