Commit Graph

19 Commits

Author SHA1 Message Date
Marc Herbert dfc6b46e1d scripts/docker-run.sh: fix wrong "id -n" command -> "id -u"
Fixes commit d09844ab98 ("zephyr/docker-build.sh: match UID with
'adduser' instead of 'chgrp -R'")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-09-02 18:28:30 +01:00
Marc Herbert d09844ab98 zephyr/docker-build.sh: match UID with 'adduser' instead of 'chgrp -R'
This fixes SOF version.cmake which was just broken by a recent git
security update and started to fail like this:

```
  -- SOF version.cmake starting at 2022-04-25T18:14:56Z UTC
  -- /workdir/zephyr/.. is at git commit with parent(s):
  fatal: unsafe repository ('/workdir' is owned by someone else)
  To add an exception for this directory, call:

   git config --global --add safe.directory /workdir
```
(example at https://github.com/thesofproject/sof/runs/6162885265)

chgrp -R was always an ugly hack because it was messing with
(persistent) file permissions on the host, outside the container. This
new adduser solution is unfortunately much more code but it does not
leak any side effect outside the container.

Do not fix scripts/docker-run.sh yet because there is still no UID
mismatch between Github Actions and the SOF container (they're both
1001) but add a warning + TODO.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-26 22:08:53 +01:00
Marc Herbert bde4858625 topologies: docker --env USE_XARGS, NO_PROCESSORS and VERBOSE
Building in parallel is much faster but it makes logs unreadable and
build failures impossible to understand. This is especially true when
building with recent ALSA that produces of deprecation warnings, see
examples below. For test topologies the problem is even worse: its
XARGS parallel build provides no log at all.

To find what actually fails, it is required to fall back on a single
threaded and verbose build and this is achieved with the variables
USE_XARGS, NO_PROCESSORS and VERBOSE. Pass these through docker-run.sh
and CMake.

Examples from #5608
https://github.com/thesofproject/sof/runs/5717553555?check_suite_focus=true
https://sof-ci.01.org/sofpr/PR5608/build12556/build/tools.txt

ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...
ALSA pcm.c:1471:(parse_hw_config) deprecated bclk value 'codec_slave',...
ALSA pcm.c:1523:(parse_hw_config) deprecated fsync value 'codec_slave',...

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-04-05 14:37:28 +01:00
Marc Herbert 55e862c92e docker-run.sh: switch from "sof" shortcut to full "thesoftproject/sof"
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>
2022-01-07 15:25:53 +00:00
Marc Herbert f79d2341af docker-run.sh: log command run and image digests
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>
2022-01-07 15:25:53 +00:00
Marc Herbert 5e17731290 .github: run new test-repro-build.sh
... in Github Actions.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 45a6d1fb87 Fix docker-run.sh so it can be invoked from anywhere
$(pwd) was not a very good idea.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 9b03553d1d docker-run.sh: log the docker image version
Especially useful when forgetting to update the 'sof' tag

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Fred Oh 4b9fbaf24b docker-run.sh: minor alignment fix
Removed extra spaces.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Fred Oh 77ef08a951 docker-run.sh: set http/https proxy when docker run
Use http/https proxys setting from the host.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Marc Herbert 9938a66db4 docker-run.sh: use --tty only when we have one
--tty is not compatible with github actions, fails with "the input
device is not a TTY"

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-22 13:42:03 +00:00
Jaska Uimonen 89acc5e4f0 docker-run.sh: pass-through PRIVATE_KEY_OPTION
Pass PRIVATE_KEY_OPTION environment variable to docker to be able to
define external key for signing.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-25 13:41:33 +01:00
Marc Herbert 2b9206231c docker-run.sh: pass-through CMAKE_BUILD_TYPE
... thanks to the docker --env option which is smart enough not to pass
anything when there is nothing to pass.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Marc Herbert 1c6930e29f docker-run.sh: fix quoting issues
As reported by shellcheck

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Curtis Malainey 23d9c78a5c scripts: allocate tty on docker
Bash and menuconfig cannot run without this flag. Docker-run just hangs
without it

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-09-12 19:52:34 +01:00
Janusz Jankowski ba2fefb172 license: use spdx identifier in shell scripts
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Pan Xiuli 3b2cfd80f9 scripts: remove all soft related stuff
soft is now sof/tools remove all outdated things.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-01-10 15:10:10 +00:00
Pan Xiuli 0ca1c79d06 scripts: docker: remove -t flag
t flag is used to allocate a pseudo-TTY, but in some cases pseudo-tty is
not support. Removed for more useage.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-11-06 14:51:26 +08:00
Dylan Reid e3dfa4e1bd scripts: Add ability to build in a container
Having a docker container that contains the cross compiler and host
dependencies eases setup and maintenance of local builds.

The container setup procedure is based of the wiki instruction. A few
more dependencies were added.

In addition to the ct-ng and xtensa-newlib steps, this container builds
top of tree alsa-lib and alsa-utils as distros seem to be slow to update
them with the needed topology features.

The docker-run.sh script is used to automatically bind mount local
soft.git and sof.git directories in to the container. This provides
build artifacts in the same place as a local "make" would.

Use it like the following:

./scripts/docker-run.sh make
./scripts/docker-run.sh ./scripts/xtensa-build-all.sh
etc...

The container only needs to be re-built when the toolchain or alsa
dependencies are modified.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
2018-04-30 16:24:56 +01:00