Commit Graph

26 Commits

Author SHA1 Message Date
Marc Herbert 236de3f142 xtensa-build-zephyr.py: drop check=True, now the default
Commit 475e09f17d ("xtensa-build-zephyr.py: default to
subprocess.run(check=True)") switched the default value of the
execute_command() function to "True". Remove all the "check=True"
arguments that are now redundant.

Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-21 11:30:09 +01:00
Marc Herbert 475e09f17d xtensa-build-zephyr.py: default to subprocess.run(check=True)
The default value is wrong, change it. See pylint warning W1510

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-19 10:52:20 +01:00
Marc Herbert 35e588080d xtensa-build-zephyr.py: add #pylint:disable=W0312,C0103,C0116
This reduces the number of warnings from about 600 to a more manageable
350.

Disable W0312 because the entire file uses tabs.
Disable C0103 because we have higher priority than naming conventions.
Disable C0116 because the script is small enough, shouldn't require
              pydoc everywhere.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-19 10:52:20 +01:00
Marc Herbert c9ee109296 xtensa-build-zephyr.py: add cavstool.py to staging directory
This is required to read Zephyr logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-08 13:15:38 +01:00
Marc Herbert f9c461009a xtensa-build-zephyr.py: add for loop to install files into staging
Preparation to copy multiple files. Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-08 13:15:38 +01:00
Marc Herbert 93f20d577c xtensa-build-zephyr.py: forbid shell=True
The entire purpose of replacing the older shell script with Python was
to achieve cross platform compatibility. shell=True would lose that.

See also
https://docs.python.org/3/library/subprocess.html#security-considerations

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-04 16:24:43 +01:00
Andrey Borisovich ce3264a507 platform: Move configuration from Zephyr to SOF
Move software configuration from Zephyr samples directory
to SOF platforms directory using Zephyr overlay mechanism.
How it works:
1. Gets zephyr board defconfig values
2. Applies Zephyr samples prj.conf values on top of it
3. Then applies our new overlay.conf on top of it
4. Final "summary" of Kconfig settings is written to autoconf.h header

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-03-18 16:14:19 +00:00
Marc Herbert a62fc4b9af xtensa-build-zephyr.py: restore ability to override CI
This has been useful to test Zephyr work in progress.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert ffdf001eee xtensa-build-zephyr.py: clone zephyr with --depth 5
This restores the performance of the original shell script and makes a
big difference in CI. CI clones over and over again whereas developers
clone rarely and can run a simple git fetch --unshallow.

Don't use --depth 0 to provide more context in the logs and also make it
more obvious that this is a shallow clone and not just git log -n 1.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert 5a80db78af xtensa-build-zephyr.py: give -z option a long form --zephyr-ref
This makes the code more readable and other scripts possibly too.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert df6b48c889 xtensa-build-zephyr.py: make "unsupported OS" actually a warning
Running on a mac crashed with "undefined xtensa_tools_version_postfix",
that should not be fatal (there are other toolchains).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-15 13:39:12 +00:00
Marc Herbert d8572420d0 xtensa-build-zephyr.py: un-hardcode execute_command() wrapper
Duplicating all parameters of subprocess.run() is not just tedious and
error-prone, it makes the script compatible only with a range of
specific Python versions.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-14 15:04:45 +00:00
Kai Vehmanen 6d0ecc37cc xtensa-build-all: add a separate target for JSL
Use intel_adsp_cavs20_jsl Zephyr board when building for
Intel Jasper Lake.

BugLink: https://github.com/thesofproject/sof/issues/4539
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-14 11:35:35 +00:00
Marc Herbert 0ee59c317e xtensa-build-zephyr.py: do not update SOF submodules after west init
This script is run from an existing SOF repo that is assumed to be fully
initialized. Updating existing submodules is a potentially destructive
operation.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-11 12:52:41 +00:00
Marc Herbert 78667c028d xtensa-build-zephyr.py: do not modify submodules after building!
The older shell script had a deprecated convenience hack to clone
submodules before building rimage but _only if submodules were missing_!

While trying to preserve that, the new script changed that to an
unconditional git submodule update that can be destructive when
submodules are already present.

Generally speaking, using git and building must always be two very
distinct activities. No one wants the source code to change quietly from
one build to the next.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-11 12:52:41 +00:00
Marc Herbert 7a847a5bd8 xtensa-build-zephyr.py: de-duplicate common code
De-duplicate this code:

	if args.platforms:
		build_platforms()
		show_installed_files()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-10 13:15:11 +00:00
Marc Herbert fc3bc3c805 xtensa-build-zephyr.py: don't git_submodules_update() twice
A second git_submodules_update() immediately after the first one does
not make sense. This looks like something leftover from a past
experiment.

Fixes initial commit 1de3ef3675 ("Rewritten xtensa-build-zephyr.sh to
python")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-03-10 13:15:11 +00:00
Chao Song f645b36cc8 xtensa-build-zephyr.py: use string path for rimage_desc
PosixPath doesn't convert to string automatically, and
it is not acceptable in sign_cmd, convert it to string
explicitly.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-03-07 12:02:33 +00:00
Chao Song de7016edd4 platforms: tgl: renamme tgl_ipc4_overlay.conf
Rename tgl_ipc4_overlay.conf to ipc4_overlay.conf,
because it is under tgl folder.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-03-07 12:02:33 +00:00
Kai Vehmanen 26e08d4d55 xtensa-build-zephyr: use separate Zephyr config for TGPH builds
Zephyr recently added support for separate configs for 2-core and 4-core
variants of cAVS2.5. Use the new "tgph" configuration for when building
SOF for TigerLake-H variant.

BugLink: https://github.com/thesofproject/sof/issues/5018
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-01 22:49:36 +00:00
Chao Song 6f71808e3e xtensa-build-zephyr.py: add ipc4 build support for tgl
Add ipc4 build support for tgl with OVERLAY_CONFIG.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
2022-02-26 11:06:59 +00:00
Marc Herbert ce8bc4a394 xtensa-build-zephyr.py: important -v verbosity fixes
The most important fix is the addition of the "flush" argument which
means are commands are now printed when they are run and not all at the
end when everything is done.

Commands run by this script are very few so they are always shown.  This
makes it possible to debug just this script without being completely
drown in build noise. All '-v's are passed to west.

Pass -v to `west sign`, not just to `west build`.

Drop the manual "-DCMAKE_VERBOSE_MAKEFILE=ON", west knows how to do that.

Print directories first so commands are aligned, more visible and can be
copied. Use shlex to quote whitespace.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-24 14:46:17 +00:00
Marc Herbert 9fb7a607eb xtensa-build-zephyr.py: fix -C option so it can support whitespace
Make it possible to invoke -C multiple times which is required to
support whitespace as in:

  -C=--warn-uninitialized  -C '-DEXTRA_FLAGS=-Werror -g0'

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-21 09:23:40 +00:00
Marc Herbert 7d9aa8e04b xtensa-build-zephyr.py: switch to RawTextHelpFormatter and """
We need control to format add_argument(help=...) strings manually too.

Zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-02-21 09:23:40 +00:00
Andrey Borisovich bb314fca61 Fix for xtensa-build-zephyr.py. This fixes 1de3ef3
Existing xtensa-build-zephyr.py failed to copy sof logger
executable to staging directory due to missing '.exe' file extension.
This fixes the script.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-18 11:25:47 +00:00
Andrey Borisovich 1de3ef3675 Rewritten xtensa-build-zephyr.sh to python
Created new script with similar functionality to allow SOF + Zephyr
builds on both Windows and Linux operating systems.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-02-16 12:02:40 +00:00