summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/zmake.py
Commit message (Collapse)AuthorAgeFilesLines
...
* zmake: Adjust the 'building' message to show the commandSimon Glass2021-03-301-2/+4
| | | | | | | | | | | | | | It is useful to be able to see what zmake is doing sometimes. Add the command being run to the output, for informational purposes. BUG=b:177096315 BRANCH=none TEST=manually test by running zmake build Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I7a392a68c9053adb7ec9a2ccf14d52718bf4718a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2788845 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zmake: Send output to INFO by defaultSimon Glass2021-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | At present zmake sends most of its output to DEBUG in an attempt to deflect the onslaught of useless progress messages produced by ninja, as well as a good quantity of unactionable output from the Zephyr build system. While this approach certainly makes building bearable, unfortunately it hides a multitude of sins, including introducing build warnings. The correct level, if we have no other information, is INFO, since DEBUG is normally only useful to those debugging the build. Switch it over, with the expectation that future CLs will reduce the INFO output down to a trickle. BUG=b:177096315 BRANCH=none TEST=manually test by running zmake configure / build Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I57fd95034aadd91815cdf8671efc57f946d61255 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2788844 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zmake: Use a common function to report a failure messageSimon Glass2021-03-301-12/+17
| | | | | | | | | | | | | | | | | | | | At present when zmake fails the resulting messages is independently created in a different place for each subcommand. Move this in a common function, so we can make it consistent. Also adjust the output to show the command at the end, in case the user wants to copy it out and try it. Drop the exclaimation mark since errors are not all that exciting. BUG=b:177096315 BRANCH=none TEST=manually test by running zmake configure / build Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I913c3c86dcd257ed8a7f5d378b38e31d7c6d6465 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2788843 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add --coverage option to zmake configureJeremy Bettis2021-03-181-1/+4
| | | | | | | | | | | | | | | | | | zmake configure --coverage will add CONFIG_COVERAGE to the active kconfigs. BUG=b:183007888 TEST=zmake configure --coverage --test -B \ build/ztest-coverage/accel_cal zephyr/test/accel_cal BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I24465a29c9930762b81319f11fcf834e33d938cc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2770507 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: zmake: prune modules to only those required by the projectJack Rosenthal2021-02-231-0/+3
| | | | | | | | | | | | | | | | | | | | | Implement a new configuration option: "modules", which allows projects to require only specific modules. This is needed for chameleon so they can only require the modules they need (instead of all modules supported by zmake). From pfagerburg@: When zmake pulled in one of the EC modules, that module wanted a bunch of EC symbols to be defined in Chameleon's Kconfig, e.g., CROS_EC_RO and CROS_EC_RW. BUG=b:180545676 BRANCH=none TEST=provided unit test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17bf2ac9a8f75f2879e5a67b991fd60d77071c32 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702509 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: implement --modules-dir parameterJack Rosenthal2021-02-231-11/+15
| | | | | | | | | | | | | | | | | | | Implement a parameter --modules-dir parameter, which lets the user create a flat directory, with each Zephyr module named appropriately as a subdirectory. This allows Zmake to be used without a Chrome OS source tree if both --modules-dir and --zephyr-base are provided. BUG=b:179813084 BRANCH=none TEST=unit tests TEST=gitlab CI Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ibedd1721bcc3f4dc6bae9e9b19d548e82297fa2a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702507 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: rename "ec-shim" module to "ec"Jack Rosenthal2021-02-181-5/+5
| | | | | | | | | | | | | | | Now that all of our Zephyr EC code is in platform/ec/zephyr, this module should no longer be named "ec-shim" (which was used to distinguish it from the zephyr-chrome repository). BUG=b:177003034 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I475db4feab4fabbc8fc6025f06d6f3392a597b00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702505 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: drop platform_ec_dir propertyJack Rosenthal2021-02-181-5/+0
| | | | | | | | | | | | | This property is now unused. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5c76a85b85a0a071234f4d2e5a4a8582614f4d6e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702503 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: Always used the supplied build directorySimon Glass2021-02-181-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* zephyr: zmake: make --zephyr-base a global flag to zmakeJack Rosenthal2021-02-181-19/+33
| | | | | | | | | | | | | | | | | | | Since multiple commands may depend on the Zephyr base, make this a global flag to all Zmake commands (not just "zmake configure"). This adds a check that the actual version indicated at the Zephyr base used is actually supported (instead of the previous location-time check). This obsoletes the --version flag to zmake configure, since it's just read from the Zephyr base instead. BUG=b:179813084 BRANCH=none TEST=pass --zephyr-base outside chroot Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I56d73dac1711ef9ead18767fe0678c89567dbcd5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685475 Reviewed-by: Simon Glass <sjg@chromium.org>
* zmake: add documentation about where the args for Zmake class comes fromJack Rosenthal2021-02-181-1/+13
| | | | | | | | | | | | | | | The Zmake class and its methods are actually just automatically invoked by the command line options. Add some documentation about how that happens for someone just looking at this code for the first time. BUG=none BRANCH=none TEST=none Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I262d3f5bcd808944716d58e5bdf492b1657da442 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702694 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: drop version from module locationJack Rosenthal2021-02-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | Drop the version parameter when locating modules in a ChromiumOS checkout, since it's not actually needed. Tools like west do not use separate branches of third-party modules for different kernel versions, so we don't need to implement that. v2.5 (just recently cloned) actually works for Zephyr 2.4 as well, so we hard-code 2.5 as the version for hal_stm32 and cmsis until we change the manifest.xml to not have the version parameter. BUG=b:180531609 BRANCH=none TEST=zmake testall TEST=build, flash, boot AP on volteer Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I40e2c1310aee29bbf0aca64c128462a753058d27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702693 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: delay locating CrOS checkoutJack Rosenthal2021-02-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | For building outside of a ChromeOS environment, a user may have their own choice of where they put all of the repos for building Zephyr, and using the ChromeOS directory structure to find the repos in this case is unwanted. This also applies to the case where we have an ebuild to build the sources, cros-workon will locate the sources in different paths. We delay the evaluation of util.locate_cros_checkout until the code actually uses it, allowing us to not pass a checkout or locate one unless we actually need it. BUG=b:179813084 BRANCH=none TEST=zmake testall (note nothing useful for getting -m working yet, requires follow-on CLs) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5e0c6be294d907cf9ed528d2f938303c9fa8f275 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2685473 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: better parallelization/logging of pytestJack Rosenthal2021-02-081-19/+40
| | | | | | | | | | | | | | | | | | Run pytest file-by-file so that we can get better parallelization of the tests. While we are add it, add a small handler which parses the pytest output and prints the relevant info at the right log levels. This is needed so that we can see what is actually going on with CQ flake. BUG=chromium:1175647 BRANCH=none TEST=zmake -l DEBUG testall, observe log levels Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ia978ee2985151c0442e2ba74b429c751b0ba9152 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678897 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: add board-specific DTS overlaysJack Rosenthal2021-02-061-0/+3
| | | | | | | | | | | | | | | Allow board-specific DTS overlays to be placed at zephyr/dts/board-overlays/${BOARD}.dts in any module. Zmake will find the file and append it to the DTC_OVERLAY_FILE list when discovered. BUG=b:179491802 BRANCH=none TEST=provided unit test passes Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I53d4a04b6056689696b4615b5998937dbcf801c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678795 Reviewed-by: Simon Glass <sjg@chromium.org>
* zmake: allow zmake build/test to target project directoriesYuval Peress2021-02-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | Allows zmake to use the default platform/ec/build directory when running the build/test subcommand. Developers can now simply point to the actual projects without having to worry about where the build is being done. BRANCH=none BUG=none TEST=Added/modified unit tests TEST=zmake configure zephyr/test/system && \ zmake build zephyr/test/system && \ zmake test zephyr/test/system && \ echo SUCCESS TEST=rm -fr build/zephyr/test/system ; \ zmake build zephyr/test/system || echo SUCCESS Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id830f8dffc30f641fff0cd5ff50d30b2efedeece Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2665072 Reviewed-by: Simon Glass <sjg@chromium.org>
* zmake: enable default build directory for configure subcommandYuval Peress2021-02-041-6/+11
| | | | | | | | | | | | | | | | | Allow zmake to create a default build directory when running zmake configure. This provides a similar behavior to platform/ec's make system. Projects will be placed under platform/ec/build/zephyr/... BRANCH=none BUG=none TEST=Added unit test TEST=zmake configure -b zephyr/projects/volteer Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Icabed1b77cf5876a75898322d39806237e05d520 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2665071 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: zmake: auto-generate SYSCALL_INCLUDE_DIRSJack Rosenthal2021-02-041-1/+5
| | | | | | | | | | | | | | | This can be done by Zmake instead of needing to copy-paste between every CMakeLists.txt. BUG=b:179404290 BRANCH=none TEST=compile for volteer and kohaku Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I2c89e91d7cca7065ee7dcdaa05c7af49d65b4733 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676605 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: add an option for enabling bringup and plumb to zmake flagJack Rosenthal2021-01-271-1/+7
| | | | | | | | | | | | | | | | | | Add a Kconfig option for enabling the CONFIG_BRINGUP platform/ec option: CONFIG_PLATFORM_EC_BRINGUP, and make a command line flag in "zmake configure" for toggling this on: --bringup. BUG=none BRANCH=none TEST=zmake configure -B ~/volteer-build -b --bringup zephyr/projects/volteer flash on volteer observe bringup functions (siglog, power on delay, etc) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib915abba7c5777aa1d9391b55b1f912e53a5fdf5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631353 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zmake: remove prefer-zephyr-sdk from project configJack Rosenthal2021-01-261-15/+0
| | | | | | | | | | | | | | | No projects set this anymore. BUG=b:178363068 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib28017048695a5dbabaead83de49c85363fde665 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2647537 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
* zephyr: drop zephyr-chrome moduleJack Rosenthal2021-01-161-7/+2
| | | | | | | | | | | | | | | Remove zephyr-chrome module from zmake and enable the last directory in our CMakeLists.txt (drivers). BUG=b:177003034 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I551f59e6ce118d2939111126151984b65ce08c91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633655 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: drop zephyr-chrome from DTS_ROOTJack Rosenthal2021-01-151-6/+1
| | | | | | | | | | | | | Needed to clear file conflicts. BUG=b:177003034 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7ac8ed94f9bef4e834293cf5c011b3a52d862770 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2631346 Reviewed-by: Simon Glass <sjg@chromium.org>
* zmake: allow overriding default log level for file descriptorYuval Peress2021-01-141-1/+21
| | | | | | | | | | | | | | | | | | | | This change allows users of the multiproc logging functionality to override the log level used for a given file descriptor. This is particularly useful when addressing an issue with ninja builds that print everything to stdout (including errors). BRANCH=none BUG=b:176364631 TEST=introduce a bug then run zmake build $BUILD_DIR, observe most output is suppressed, but after the error takes place, all logging is made to CRITICAL. TEST=add unit test Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I1dba8a06f0dfebe91e49829dbb8d91f1b71f58f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2625550 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: add platform/ec/zephyr to DTS_ROOTJack Rosenthal2021-01-131-1/+6
| | | | | | | | | | | | | | This allows us to put a dts directory and include directory in platform/ec/zephyr for DTS preprocessing. BUG=b:177003034 BRANCH=none TEST=follow-up CLs Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I8999387cf948514d723f3dd8e876cabcd6bb6161 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627955 Reviewed-by: Simon Glass <sjg@chromium.org>
* zmake: Clean build directory on configure commandYuval Peress2021-01-121-0/+5
| | | | | | | | | | | | | | | | When running zmake configure first clear the build directory. BRANCH=none BUG=b:172569494 TEST=mkdir build/volteer ; touch build/volteer/test.txt ; \ zmake configure -B build/volteer \ ../zephyr-chrome/projects/experimental/volteer Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic31f21076f77587fdb74b95c536b7e6a5ee01e50 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2623995 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: zmake: Move tool tests to platform/ecYuval Peress2021-01-121-9/+4
| | | | | | | | | | | | | | This change copies the zmake tests from zephyr-chrome over to platform/ec to match the tool's relocation. BRANCH=none BUG=b:177003034 TEST=pytest zephyr/zmake/tests TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I764af51cfcea6821f3bc9274cdfbf42b2da4fb7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2622503
* zephyr: copy zmake to platform/ecJack Rosenthal2021-01-091-0/+271
This copies zmake into platform/ec/zephyr/zmake, as explained in go/zephyr-fewer-repos. Follow-on CLs will be submitted to: - Update the chromeos-base/zephyr-build-tools ebuild to reference this directory instead of the one in zephyr-chrome. - Remove the copy of zmake in zephyr-chrome. Those interested in the git history of this code prior to it being moved to platform/ec can find it here: https://chromium.googlesource.com/chromiumos/platform/zephyr-chrome/+log/bacea2e3e62c41000e5bdb4ed6433f24386d14bf/util BUG=b:177003034 BRANCH=none TEST=emerge with new path (requires follow-on CL) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ia957b3e35ce3b732968ebf8df603ef13298cc6b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2618501 Reviewed-by: Yuval Peress <peress@chromium.org>