summaryrefslogtreecommitdiff
path: root/zephyr/zmake/zmake/version.py
Commit message (Collapse)AuthorAgeFilesLines
* Revert "zmake: Trim short version on full hashes"Jack Rosenthal2021-09-211-31/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 695b3c909c4846493eacd324e9c26933847372d1. Reason for revert: Broke CQ See https://ci.chromium.org/ui/p/chromeos/builders/postsubmit/trogdor-zephyr-postsubmit/314 Original change's description: > zmake: Trim short version on full hashes > > The ec_version.h contains both a long build string and also a 31 char > string. Change the short string to omit the commit count, and only > include full hashes, i.e. hayato_v2.6-ec:5bd1aa,os:ade7b4 not > hayato_v2.6.73670-ec:5bd1aa,os: > > Change test to be a real version string with hashes of the right length. > > BUG=None > BRANCH=None > TEST=./zephyr/zmake/run_tests.sh > > Change-Id: I18d73345036933594b8c74187796c3727f868629 > Signed-off-by: Jeremy Bettis <jbettis@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160464 > Tested-by: Jeremy Bettis <jbettis@chromium.org> > Auto-Submit: Jeremy Bettis <jbettis@chromium.org> > Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: None Change-Id: Ib4282f761c514c0ca2da6249d38ccc9cba852f6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3172040 Auto-Submit: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
* zmake: Trim short version on full hashesJeremy Bettis2021-09-201-14/+31
| | | | | | | | | | | | | | | | | | | | | The ec_version.h contains both a long build string and also a 31 char string. Change the short string to omit the commit count, and only include full hashes, i.e. hayato_v2.6-ec:5bd1aa,os:ade7b4 not hayato_v2.6.73670-ec:5bd1aa,os: Change test to be a real version string with hashes of the right length. BUG=None BRANCH=None TEST=./zephyr/zmake/run_tests.sh Change-Id: I18d73345036933594b8c74187796c3727f868629 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160464 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* system: Add CrOS FWID to version outputRob Barnes2021-09-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EC version does not follow the the AP and OS version. This causes confusion during development. This change augments the EC version output to include the CrOS FWID when available. The CrOS FWID will be missing when the CrOS EC is built outside of cros_sdk. When CrOS FWID is missing 'CROS_FWID_MISSING' will be used. Zephyr/zmake support will be added later, CROS_FWID32 is set to 'CROS_FWID_MISSING' in zephyr builds until then. BUG=b:188073399 TEST=version 21-05-20 16:43:18.627 Chip: Nuvoton NPCX993F A.00160101 21-05-20 16:43:18.631 Board: 1 21-05-20 16:43:18.631 RO: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.634 guybrush_13983.0.21_05_20 21-05-20 16:43:18.639 RW_A: * guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.641 * guybrush_13983.0.21_05_20 21-05-20 16:43:18.644 RW_B: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.644 guybrush_13983.0.21_05_20 21-05-20 16:43:18.647 Build: guybrush_v2.0.8770+f47439f75 21-05-20 16:43:18.651 guybrush_13983.0.21_05_20 2021-05-20 21-05-20 16:43:18.657 16:31:19 robbarnes@robbarnes0 ectool version RO version: guybrush_v2.0.8770+f47439f75 RO cros fwid: guybrush_13983.0.21_05_20 RW version: guybrush_v2.0.8770+f47439f75 RW cros fwid: guybrush_13983.0.21_05_20 Firmware copy: RO Build info: guybrush_v2.0.8770+f47439f75 guybrush_13983.0.21_05_20 2021-05-20 16:31:19 robbarnes@robbarnes0 Tool version: 1.1.9999-f47439f @robbarnes0 BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Ief0a0c6e9d35edc72ac2d4780ee203be41d7305f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2894145 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Reland "zephyr: pull in the version string from zmake"Jack Rosenthal2021-08-201-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 93adb802c1a626fbb73d762124e90be4fee08a8b. This commit was reverted due to build failures with the chromeos-zephyr ebuild. The root cause of the build failures was that the ebuild uses different working directories between the configure and build phases, and so the path to the include directory we generate during the configure phase won't work in the build phase. Use the full path here so that we can run the diffrerent phases in different working directories. Diff from original commit: Change-Id: Idcbd0c0546f9fcb12fcd66c617e024b8aa2a893a > --- a/zephyr/zmake/zmake/zmake.py > +++ b/zephyr/zmake/zmake/zmake.py > @@ -235,7 +235,7 @@ class Zmake: > self.logger.info("Clearing old build directory %s", build_dir) > shutil.rmtree(build_dir) > > - generated_include_dir = build_dir / "include" > + generated_include_dir = (build_dir / "include").resolve() > base_config = zmake.build_config.BuildConfig( > environ_defs={"ZEPHYR_BASE": str(zephyr_base), "PATH": "/usr/bin"}, > cmake_defs={ BUG=b:197287679 BRANCH=none TEST=emerge-volteer chromeos-zephyr Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I80cec7a1622edcecc670b7dbeed56dadcdf71555 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3111305 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* Revert "zephyr: pull in the version string from zmake"Rob Barnes2021-08-201-43/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 10809eb023d475681b45863e68d906fae4667eda. Reason for revert: Causing build errors b/197287679 Original change's description: > zephyr: pull in the version string from zmake > > Zmake computes a version string and stores it in FRID/FWID, but this > was never plumbed all the way out into the version functionality in > the OS, which was reporting the version generated by > util/getversion.sh. > > Add a mechanism to generate the version header from zmake and replace > the getversion.sh generation with that. > > BUG=b:184832251 > BRANCH=none > TEST=provided unit tests > TEST=get this version string on posix-ec: > posix-ec_v2.6.73347-cmsis:c3bd20,ec:c814a9,hal_stm32:f8ff8d,os:efe095 > 2021-08-18 14:10:18 jrosenth@germania > > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > Change-Id: Idec1c5f8b5f014126706e4fdc1f3d158edf40a63 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104625 > Reviewed-by: Denis Brockus <dbrockus@chromium.org> Bug: b:184832251 Change-Id: Ifcc4830e3097c8dc8126bb76adfeb3ce75a7a667 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3110293 Auto-Submit: Rob Barnes <robbarnes@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
* zephyr: zmake: organize the commit hashes a bit betterJack Rosenthal2021-08-191-1/+7
| | | | | | | | | | | | | | | | | | - Put EC repo first, since that's probably the most useful commit hash. - Put Zephyr kernel second, since that's probably the second most useful commit hash. - Put all other modules after that, alphasorted. BUG=b:184832251 BRANCH=none TEST=updated unit tests Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Id14e9706980d733637e29643dd355aaa82a51fc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105265 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: pull in the version string from zmakeJack Rosenthal2021-08-191-0/+43
| | | | | | | | | | | | | | | | | | | | | | Zmake computes a version string and stores it in FRID/FWID, but this was never plumbed all the way out into the version functionality in the OS, which was reporting the version generated by util/getversion.sh. Add a mechanism to generate the version header from zmake and replace the getversion.sh generation with that. BUG=b:184832251 BRANCH=none TEST=provided unit tests TEST=get this version string on posix-ec: posix-ec_v2.6.73347-cmsis:c3bd20,ec:c814a9,hal_stm32:f8ff8d,os:efe095 2021-08-18 14:10:18 jrosenth@germania Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Idec1c5f8b5f014126706e4fdc1f3d158edf40a63 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3104625 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: zmake: run black on all files, enable check in run_tests.shJack Rosenthal2021-07-121-18/+26
| | | | | | | | | | | | | | | Run black on all files. Enable check in run_tests.sh to enforce future formatting requirements. BUG=b:192389533 BRANCH=none TEST=run_tests.sh Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5d93ef61d32d0dab4fe4bf3a77faf3f6693be627 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002839 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: zmake: Run isort on all files, add check to run_tests.shJack Rosenthal2021-07-021-1/+1
| | | | | | | | | | | | | | | Run isort on all files, and enforce future formatting checks by putting in run_tests.sh. BUG=b:192389533 BRANCH=none TEST=run_tests.sh Cq-Depend: chromium:3003455 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I5795ffae30b88fe3a5f093ab7a0d8cd9389da285 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3002838 Reviewed-by: Yuval Peress <peress@chromium.org>
* zmake: Fall back to VCSID for version informationKeith Short2021-05-191-10/+37
| | | | | | | | | | | | | | | | | | | | The git repository information is not available to ebuilds after doing a "cros-workon-<board> start" on the package. Fall back to the VCSID in this case. BUG=b:188530338 BRANCH=none TEST=emerge zephyr-build-tools TEST=zmake testall TEST="cros-workon-volteer-zephyr start chromeos-zephyr" and "emerge-volteer-zephyr chromeos-zephyr" Cq-Depend: chromium:2902154 Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I03227005097b114061514ef1f1dcd79f242a1bf7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2903906 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: zmake: Change 2nd underscore for a hyphen in version formatJack Rosenthal2021-04-301-1/+1
| | | | | | | | | | | | | | | According to CL:2861267, this is apparently a load-bearing underscore, and should look more like the old CroS EC version format for factory process, GoldenEye, etc. to work out better. BUG=b:181337770 BRANCH=none TEST=unit tests Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Iab293eade1f8252f58e670175b946730405eb498 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2862904 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: zmake: add utility to compute version stringJack Rosenthal2021-04-291-0/+75
Add a function, get_version_string, which generates a version string to be used in FRID, FWID, or in headers for the build. The format selected was: LAST_COMPONENT_OF_PROJECT_DIR "_v" ZEPHYR_MAJOR_VERSION "." ZEPHYR_MINOR_VERSION "." TOTAL_COMMITS "_" VCS_HASHES Where VCS_HASHES is the (sorted) list of modules + Zephyr OS commit hashes, like so: mod1:02fd7a,mod2:b5991f,os:2c65cb There is also an option for a "static" version, like in CrOS EC OS, which is not affected by Git repository state. This is useful for comparing builds across commits. In this case, TOTAL_COMMITS is fixed to zero, and VCS_HASHES is set to "STATIC". Note: This is mostly just an initial pass at the version string format, and shouldn't be considered "final" yet. We can make further iterations on the format as we deem necessary. BUG=b:184832251 BRANCH=none TEST=unit tests Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I7560c7d677f5d5ec5cf26ff6048eea91843515c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2857914 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>