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>
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>
Recent combination of tgl and tgl-h building resulted in use of an invalid
defconfig file for tgl-h platform. This commit reverts that change.
Fixes: f1e6e1fdd3
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
This is especially important considering some sof-bin releases are now
"hybrid": with a mix of XTOS and Zephyr.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes copy/paste of commit de41202f8f ("zephyr: build: Add initial
build support for SOF application.")
This fixes the dictionary hash when using Zephyr; no more fallback on
the git SHA1.
When using Zephyr, SOF_ROOT_SOURCE_DIR (and SOF_ROOT_BINARY_DIR) are used
only by version.cmake
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When building Zephyr, CMAKE_CURRENT_SOURCE_DIR does not point at
SOF. Use SOF_ROOT_SOURCE_DIRECTORY instead.
No impact besides the logs.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Some git servers like Github allow fetching by full length SHA so this
useful information to share.
(Others forbid this entirely, see last page of `git help fetch-pack`)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
version.cmake has a not very intuitive logic to make sure sof_versions.h
is always up to date without triggering a full rebuild. Add comments and
rephrase some logs to make it less hard to follow.
Absolutely zero functional change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Combined case label tgl and tgl-h similarly as in xtensa-build-zephyr.sh
Corrected code formatting.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
If the user doesn't set the path to own private key, the default path is
placed in the variable containing the user's key. This causes a leak of the
default key of one platform to the others platforms, which will treat it as
a key supplied from the user.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
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>
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>
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>
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>
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>
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>
Fixes incremental builds of topology2 that were missing ALSA_CONFIG_DIR.
This was making it impossible to troubleshoot alsatplg issues like #5249.
Now incremental builds fail or pass the same as builds from scratch.
Fixes commit 308a24a92b ("topology2: Add build support")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The -a option was recently broken by the addition of platform(s) that
don't have a toolchain available in the Docker image. Every platform can
be built by someone but no one can built -a(ll) platforms right now.
Add a new platform array to make the distinction between default
platforms built by the -a option versus work in progress.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
No one else has it.
Gets rid of the only shellcheck warning.
Fixes commit 7453e3d571 ("scripts: add renoir support")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
scripts/ has kconfig defaults and CMake code that can affect the
dictionary. Note this does not fix#3890 because .config (and maybe
others) are still not hashed but it helps a bit.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
execute_process() runs in the current directory of the process invoking
cmake. This can be completely outside the git repo.
Fixes commit a5899812b7 ("version.cmake: don't trust CI to record time
and versions and log ourselves")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Include DEFAULT_PLATFORMS in SUPPORTED_PLATFORMS instead of the other
way round. SUPPORTED_PLATFORMS will always be bigger than
DEFAULT_PLATFORMS and it's easier to add a platform than remove one.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Passing spurious --board and source directory arguments to an already
build directory does not help but it does not hurt either and it
simplifies the code. It also provides a more consistent west command in
the set -x "logs", one that can be re-used in any circumstance.
The only restriction is to make sure CMAKE_ARGS is empty on all but the
first invocation but that's not new and unchanged here.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zephyr also a version.h too so the situation was a buggy #include mess
that (among others) dropped the SOF git version from the SOF banner when
using Zephyr. It's absolutely impossible to fix this mess while keeping
two .h files both named exactly the same and even included with the
exact same '#include version.h' line, I mean no sof/version.h or other
prefix.
As a bonus, this rename also reduces the XTOS-only confusion between
"version.h" and cavs/version.h".
Generating a file in the source tree is a serious bug (to be fixed
later), it means this file is never cleaned. Do not hide this bug with a
.gitignore rule.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
We should gradually switch to ninja as a default.
ninja-build is apparently missing from build-essential
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
It's super annoying and time-consuming to update the image and wonder
why the previous one is still used. Shortcuts are nice in interactive
use but pointless in scripts.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
There's frequent confusion between image ID and image digest: display
both.
Show both sof and thesofproject/sof.
Use set -x to display the full command that is run.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add build support for topology2. Topology2 will be built only if the
alsatplg version if 1.2.6 or greater.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Align with xtensa-build-all.sh and add a "-v" option to toggle
verbose build log ("west -v build").
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Fixes new shellcheck 0.8.0 warning:
SC2268 (style): Avoid x-prefix in comparisons as it no longer serves a
purpose.
This script requires bash anyway.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes old (Aug 2020) and untested commit b2a325a3b7 ("cmake: Handle
empty SOF_SRC_HASH_LONG") which tried to use GIT_LOG_HASH as a fallback
for the SOF_SRC_HASH .ldc checksum but always fell back on "0" instead
because of a misunderstanding of cmake's surprisingly complex "if"
operator.
Before Zephyr this was not an issue in practice because GIT_LOG_HASH was
empty anyway when SOURCE_DIRECTORY/.git was missing, so there was
nothing to lose.
For the Zephyr builds this will now use the SOF SHA1 as the .ldc checksum
for now. Probably not ideal yet but far better than the current constant
"0" which means no check at all.
Also log the SOF_SRC_HASH fallback value now and change the second
fallback (when GIT_LOG_HASH is also missing) from "0" to the
searchable hexspeak "baadf00d".
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This is a logical revert of eb45907
Based on recently merged #4941, C99 comments are now OK. I never found
any rationale or even written down coding style for excluding them in
the first place.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Recent commit b9fcc4156e ("xtensa-build-zephyr: fix incremental build,
pass CMAKE_ARGS only once") fixed incremental builds. For this it first
needs to guess whether the most recent CMake configuration step failed
or succeeded so it knows what is the current "checkpoint" and what is
the next west command to run. Merely testing whether the build directory
already exists is a very bad guess because that directory could have
been created by some other person or script, or - much worse - it could
have been created by a failed CMake configuration step!
The latter situation makes debugging CMake failures very tedious because
it requires manually deleting the build directory after each CMake
configuration failure.
Fix this by not merely looking for a build directory but by looking
whether there is either a build.ninja or a Makefile is found in that
directory. This is a much better indication that the CMake configuration
succeeded.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
The standard location of dictionary.txt is under codespell's package, on
my machine atm (codespell 2.1, Artix Linux):
/usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt
Since we enable the codespell by default for SOF I have constant:
No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory
The patch proposes to try to fix up the path following the
recommendation found here:
https://github.com/codespell-project/codespell/issues/1540
Mainline commit:
0ee3e7b8893e ("checkpatch: get default codespell dictionary path from package location")
Link: https://lkml.kernel.org/r/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Default behavior is still to clone the default Zephyr branch (main) but
this could be changed with just one line.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero functional change.
Rename clone() to west_init_update() and build_all() to
build_platforms(). Also expand description of the west_init_update()
feature in the usage message and add a direct SHA1 fetch example.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>