various docker fixes
v2 cover various docker fixes
Hi,
Unfortunately this series grew a little while I was re-basing as I noticed a couple of bugs. An upstream change in debootstrap which I'd been happily using for Ubuntu images caused a breakage which I've hopefully now fixed:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903657
However since I upgraded by devbox I hadn't clocked to the fact I should have been using the stable debootstrap anyway but our ugly shell version check failed to pick it up. That's now fixed and I can now bootstrap away.
I grabbed a couple of Philippe's patches while I was at it as they were relevant to the other changes. It does mean the un-reviewed count has gone up slightly:
patch docker/base debian tricore on qemu debian9.patch patch docker/split configure_qemu from build_qemu.patch patch docker/move make check into check_qemu helper.patch patch docker/gracefully skip check_qemu.patch
patch docker/Makefile.include don t include partial images.patch patch docker/disable debian powerpc user cross.patch patch docker/add test unit runner.patch
patch docker/add expansion for docker test FOO to Makefile.patch patch docker/drop QEMU_TARGET check fallback in EXECUTABLE.patch patch docker/add hint to docker.py check.patch
patch docker/add commentary to debian bootstrap.docker.patch patch docker/ignore distro versioning of debootstrap.patch
Alex Bennée (14):
tests/.gitignore: don't ignore docker tests
docker: base debian-tricore on qemu:debian9
docker: fail more gracefully on docker.py check
docker: split configure_qemu from build_qemu
docker: move make check into check_qemu helper
docker: gracefully skip check_qemu
docker: Makefile.include don't include partial images
docker: disable debian-powerpc-user-cross
docker: add test-unit runner
docker: add expansion for docker-test-FOO to Makefile.include
docker: drop QEMU_TARGET check, fallback in EXECUTABLE not set
docker: add --hint to docker.py check
docker: add commentary to debian-bootstrap.docker
docker: ignore distro versioning of debootstrap
Philippe Mathieu-Daudé (2):
shippable: Build the TriCore docker image
docker: Update debootstrap script after Debian migration from Alioth
to Salsa
.shippable.yml | 2 ++ tests/.gitignore | 1 + tests/docker/Makefile.include | 26 ++++++++++++------- tests/docker/common.rc | 23 +++++++++++++++- tests/docker/docker.py | 10 +++++-- .../dockerfiles/debian-bootstrap.docker | 1 + tests/docker/dockerfiles/debian-bootstrap.pre | 13 ++++++---- .../dockerfiles/debian-tricore-cross.docker | 2 +- tests/docker/test-clang | 2 +- tests/docker/test-debug | 2 +- tests/docker/test-full | 2 +- tests/docker/test-quick | 2 +- tests/docker/test-unit | 21 +++++++++++++++ 13 files changed, 85 insertions(+), 22 deletions(-) create mode 100755 tests/docker/test-unit
Signature · 1 line
2.17.1
PATCH v2 1/16 tests/.gitignore: don't ignore docker tests
The .gitignore was being a little over enthusiastic hiding files.
---
v2
- minor wording tweak for more explicitness
--- tests/.gitignore | 1 + 1 file changed, 1 insertion(+)
tests/.gitignore +1 -0
@@ -9,6 +9,7 @@ qht-bench rcutorture test-* !test-*.c +!docker/test-* test-qapi-commands.[ch] test-qapi-events.[ch] test-qapi-types.[ch]
Signature · 1 line
2.17.1
PATCH v2 2/16 docker: base debian-tricore on qemu:debian9
In reply to Alex BennéeWe need both git and a working compiler to build the tools. Although the qemu:debian9 image also has a bunch of extra dependencies it would be fairly unusual for a user not to already have this layer available for one of our many other docker images so lets not complicate things.
--- tests/docker/dockerfiles/debian-tricore-cross.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/dockerfiles/debian-tricore-cross.docker +1 -1
@@ -7,7 +7,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later # -FROM debian:9 +FROM qemu:debian9 MAINTAINER Philippe Mathieu-Daudé <[email protected]>
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 02/16] docker: base debian-tricore on qemu:debian9
Quoted 6 lines · Alex Bennée
We need both git and a working compiler to build the tools. Although the qemu:debian9 image also has a bunch of extra dependencies it would be fairly unusual for a user not to already have this layer available for one of our many other docker images so lets not complicate things.
Signed-off-by Alex Bennée <[email protected]>
Quoted 18 lines
--- tests/docker/dockerfiles/debian-tricore-cross.docker | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/docker/dockerfiles/debian-tricore-cross.docker +1
-1@@ -7,7 +7,7 @@ # # SPDX-License-Identifier: GPL-2.0-or-later # -FROM debian:9 +FROM qemu:debian9 MAINTAINER Philippe Mathieu-Daudé <[email protected]>
PATCH v2 3/16 shippable: Build the TriCore docker image
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
--- .shippable.yml | 2 ++ 1 file changed, 2 insertions(+)
.shippable.yml +2 -0
@@ -25,6 +25,8 @@ env: TARGET_LIST=mips64el-softmmu,mips64el-linux-user - IMAGE=debian-ppc64el-cross TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user + - IMAGE=debian-tricore-cross + TARGET_LIST= build: pre_ci: - make docker-image-${IMAGE} V=1
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 03/16] shippable: Build the TriCore docker image
Quoted 13 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- .shippable.yml | 2 ++ 1 file changed, 2 insertions(+).shippable.yml +0
-0
.shippable.yml env: · line 32
Quoted 8 lines
.shippable.yml +2
-0@@ -25,6 +25,8 @@ env: TARGET_LIST=mips64el-softmmu,mips64el-linux-user - IMAGE=debian-ppc64el-cross TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user + - IMAGE=debian-tricore-cross + TARGET_LIST= build: pre_ci: - make docker-image-${IMAGE} V=1
Serves me right for not waiting until the shippable build finished. This needs to be dropped as while we can build the image we can't use it to build anything.
--
Alex Bennée
Re: [Qemu-devel] [PATCH v2 for 3.0 03/16] shippable: Build the TriCore docker image
Quoted 20 lines · Alex Bennée
Quoted 17 lines · Alex Bennée
From: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>Signed-off-by Alex Bennée <[email protected]>--- .shippable.yml | 2 ++ 1 file changed, 2 insertions(+).shippable.yml +1
-0@@ -25,6 +25,8 @@ env: TARGET_LIST=mips64el-softmmu,mips64el-linux-user - IMAGE=debian-ppc64el-cross TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user + - IMAGE=debian-tricore-cross
Quoted 8 lines
.shippable.yml env: · line 32
Quoted 4 lines
.shippable.yml +1
-0+ TARGET_LIST= build: pre_ci: - make docker-image-${IMAGE} V=1Serves me right for not waiting until the shippable build finished. This needs to be dropped as while we can build the image we can't use it to build anything.
It was tagged 'RFC' ;)
PATCH v2 4/16 docker: fail more gracefully on docker.py check
In reply to Alex BennéeAs this is called directly from the Makefile while determining dependencies and it is possible the user was configured in one window but not have credentials in the other. Let's catch the Exceptions and deal with it quietly.
--- tests/docker/docker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tests/docker/docker.py +6 -1
@@ -479,7 +479,12 @@ class CheckCommand(SubCommand): def run(self, args, argv): tag = args.tag - dkr = Docker() + try: + dkr = Docker() + except: + print("Docker not set up") + return 1 + info = dkr.inspect_tag(tag) if info is None: print("Image does not exist")
Signature · 1 line
2.17.1
PATCH v2 5/16 docker: split configure_qemu from build_qemu
In reply to Alex BennéeThis allows some tests that just want to configure QEMU's source tree to do so.
--- tests/docker/common.rc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tests/docker/common.rc +6 -1
@@ -21,7 +21,7 @@ requires() done } -build_qemu() +configure_qemu() { config_opts="--enable-werror \ ${TARGET_LIST:+--target-list=${TARGET_LIST}} \
@@ -32,6 +32,11 @@ build_qemu() echo $config_opts $QEMU_SRC/configure $config_opts || \ { cat config.log && test_fail "Failed to run 'configure'"; } +} + +build_qemu() +{ + configure_qemu $@ make $MAKEFLAGS }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 05/16] docker: split configure_qemu from build_qemu
Quoted 4 lines · Alex Bennée
This allows some tests that just want to configure QEMU's source tree to do so.
Signed-off-by Alex Bennée <[email protected]>
Quoted 30 lines
--- tests/docker/common.rc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)tests/docker/common.rc +6
-1@@ -21,7 +21,7 @@ requires() done } -build_qemu() +configure_qemu() { config_opts="--enable-werror \ ${TARGET_LIST:+--target-list=${TARGET_LIST}} \@@ -32,6 +32,11 @@ build_qemu() echo $config_opts $QEMU_SRC/configure $config_opts || \ { cat config.log && test_fail "Failed to run 'configure'"; } +} + +build_qemu() +{ + configure_qemu $@ make $MAKEFLAGS }
PATCH v2 6/16 docker: move make check into check_qemu helper
In reply to Alex BennéeNot all docker images can run the check step. Let's move everything into a common helper so we don't need to replicate checks in the future.
---
v2
- add "move" to Let's everything in commit message
--- tests/docker/common.rc | 10 ++++++++++ tests/docker/test-clang | 2 +- tests/docker/test-debug | 2 +- tests/docker/test-full | 2 +- tests/docker/test-quick | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-)
tests/docker/common.rc +10 -0
@@ -40,6 +40,16 @@ build_qemu() make $MAKEFLAGS } +check_qemu() +{ + if test -z "$@"; then + TEST="check" + else + TEST="$@" + fi + make $MAKEFLAGS $TEST +} + test_fail() { echo "$@"
tests/docker/test-clang +1 -1
@@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \ #--extra-cflags=-fno-sanitize=float-divide-by-zero" build_qemu $OPTS -make $MAKEFLAGS check +check_qemu install_qemu
tests/docker/test-debug +1 -1
@@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" OPTS="--enable-debug --enable-sanitizers $OPTS" build_qemu $OPTS -make $MAKEFLAGS V=1 check +check_qemu check V=1 install_qemu
tests/docker/test-full +1 -1
@@ -15,4 +15,4 @@ cd "$BUILD_DIR" -build_qemu && make check $MAKEFLAGS && install_qemu +build_qemu && check_qemu && install_qemu
tests/docker/test-quick +1 -1
@@ -18,5 +18,5 @@ cd "$BUILD_DIR" DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu" TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ build_qemu -make check $MAKEFLAGS +check_qemu install_qemu
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 06/16] docker: move make check into check_qemu helper
Quoted 22 lines · Alex Bennée
Not all docker images can run the check step. Let's move everything into a common helper so we don't need to replicate checks in the future.
Signed-off-by Alex Bennée <[email protected]>---
v2
- add "move" to Let's everything in commit message--- tests/docker/common.rc | 10 ++++++++++ tests/docker/test-clang | 2 +- tests/docker/test-debug | 2 +- tests/docker/test-full | 2 +- tests/docker/test-quick | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-)tests/docker/common.rc +0
-0
tests/docker/common.rc build_qemu() · line 48
Quoted 9 lines
tests/docker/common.rc +6
-0@@ -40,6 +40,16 @@ build_qemu() make $MAKEFLAGS } +check_qemu() +{ + if test -z "$@"; then + TEST="check" + else + TEST="$@"
This is a bit confuse:
check_qemu V=1 -> TEST=V=1
tests/docker/common.rc build_qemu() · line 50
Quoted 2 lines
tests/docker/common.rc +2
-0+ fi + make $MAKEFLAGS $TEST
-> make V=1
Quoted 21 lines
tests/docker/common.rc +2
-0+} + test_fail() { echo "$@"tests/docker/test-clang +1
-1@@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \ #--extra-cflags=-fno-sanitize=float-divide-by-zero" build_qemu $OPTS -make $MAKEFLAGS check +check_qemu install_qemutests/docker/test-debug +0
-0
tests/docker/test-debug OPTS="--cxx=clang++ --cc=clang --host-cc=clang" · line 25
Quoted 5 lines
tests/docker/test-debug +1
-1@@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" OPTS="--enable-debug --enable-sanitizers $OPTS" build_qemu $OPTS -make $MAKEFLAGS V=1 check +check_qemu check V=1
Gotcha!
Quoted 23 lines
tests/docker/test-debug +0
-0install_qemutests/docker/test-full +1
-1@@ -15,4 +15,4 @@ cd "$BUILD_DIR" -build_qemu && make check $MAKEFLAGS && install_qemu +build_qemu && check_qemu && install_qemutests/docker/test-quick +1
-1@@ -18,5 +18,5 @@ cd "$BUILD_DIR" DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu" TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ build_qemu -make check $MAKEFLAGS +check_qemu install_qemu
Re: [Qemu-devel] [PATCH v2 for 3.0 06/16] docker: move make check into check_qemu helper
Quoted 35 lines · Philippe Mathieu-Daudé
Quoted 22 lines · Alex Bennée
Not all docker images can run the check step. Let's move everything into a common helper so we don't need to replicate checks in the future.
Signed-off-by Alex Bennée <[email protected]>---
v2
- add "move" to Let's everything in commit message--- tests/docker/common.rc | 10 ++++++++++ tests/docker/test-clang | 2 +- tests/docker/test-debug | 2 +- tests/docker/test-full | 2 +- tests/docker/test-quick | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-)tests/docker/common.rc +0
-0tests/docker/common.rc build_qemu() · line 48
Quoted 9 lines
tests/docker/common.rc +6
-0@@ -40,6 +40,16 @@ build_qemu() make $MAKEFLAGS } +check_qemu() +{ + if test -z "$@"; then + TEST="check" + else + TEST="$@"This is a bit confuse:
Quoted 6 lines
check_qemuV=1 -> TEST=V=1tests/docker/common.rc build_qemu() · line 50
Quoted 2 lines
tests/docker/common.rc +2
-0+ fi + make $MAKEFLAGS $TEST-> make V=1
How about s/TEST/INVOCATION/?
Quoted 39 lines
Quoted 22 lines
tests/docker/common.rc +2
-0+} + test_fail() { echo "$@"tests/docker/test-clang +1
-1@@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \ #--extra-cflags=-fno-sanitize=float-divide-by-zero" build_qemu $OPTS -make $MAKEFLAGS check +check_qemu install_qemutests/docker/test-debug +0
-0tests/docker/test-debug OPTS="--cxx=clang++ --cc=clang --host-cc=clang" · line 25
Quoted 5 lines
tests/docker/test-debug +1
-1@@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" OPTS="--enable-debug --enable-sanitizers $OPTS" build_qemu $OPTS -make $MAKEFLAGS V=1 check +check_qemu check V=1Gotcha!
Quoted 9 lines
tests/docker/test-debug +0
-0install_qemutests/docker/test-full +0
-0@@ -15,4 +15,4 @@ cd "$BUILD_DIR"
Quoted 14 lines
Quoted 8 lines
tests/docker/test-full +1
-1-build_qemu && make check $MAKEFLAGS && install_qemu +build_qemu && check_qemu && install_qemutests/docker/test-quick +0
-0tests/docker/test-quick cd "$BUILD_DIR" · line 22
Quoted 6 lines
tests/docker/test-quick +1
-1@@ -18,5 +18,5 @@ cd "$BUILD_DIR" DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu" TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ build_qemu -make check $MAKEFLAGS +check_qemu install_qemu
--
Alex Bennée
Re: [Qemu-devel] [PATCH v2 for 3.0 06/16] docker: move make check into check_qemu helper
Quoted 36 lines · Alex Bennée
Quoted 35 lines · Philippe Mathieu-Daudé
Quoted 22 lines · Alex Bennée
Not all docker images can run the check step. Let's move everything into a common helper so we don't need to replicate checks in the future.
Signed-off-by Alex Bennée <[email protected]>---
v2
- add "move" to Let's everything in commit message--- tests/docker/common.rc | 10 ++++++++++ tests/docker/test-clang | 2 +- tests/docker/test-debug | 2 +- tests/docker/test-full | 2 +- tests/docker/test-quick | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-)tests/docker/common.rc +0
-0tests/docker/common.rc build_qemu() · line 48
Quoted 9 lines
tests/docker/common.rc +6
-0@@ -40,6 +40,16 @@ build_qemu() make $MAKEFLAGS } +check_qemu() +{ + if test -z "$@"; then + TEST="check" + else + TEST="$@"This is a bit confuse:
Quoted 8 lines
Quoted 6 lines
check_qemuV=1 -> TEST=V=1tests/docker/common.rc build_qemu() · line 50
Quoted 2 lines
tests/docker/common.rc +2
-0+ fi + make $MAKEFLAGS $TEST-> make V=1How about s/TEST/INVOCATION/?
INVOCATION or make $MAKEFLAGS ${@:-check}:
Quoted 58 lines
Quoted 39 lines
Quoted 22 lines
tests/docker/common.rc +2
-0+} + test_fail() { echo "$@"tests/docker/test-clang +1
-1@@ -23,5 +23,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" #OPTS="$OPTS --extra-cflags=-fsanitize=undefined \ #--extra-cflags=-fno-sanitize=float-divide-by-zero" build_qemu $OPTS -make $MAKEFLAGS check +check_qemu install_qemutests/docker/test-debug +0
-0tests/docker/test-debug OPTS="--cxx=clang++ --cc=clang --host-cc=clang" · line 25
Quoted 5 lines
tests/docker/test-debug +1
-1@@ -22,5 +22,5 @@ OPTS="--cxx=clang++ --cc=clang --host-cc=clang" OPTS="--enable-debug --enable-sanitizers $OPTS" build_qemu $OPTS -make $MAKEFLAGS V=1 check +check_qemu check V=1Gotcha!
Quoted 9 lines
tests/docker/test-debug +0
-0install_qemutests/docker/test-full +0
-0@@ -15,4 +15,4 @@ cd "$BUILD_DIR"Quoted 14 lines
Quoted 8 lines
tests/docker/test-full +1
-1-build_qemu && make check $MAKEFLAGS && install_qemu +build_qemu && check_qemu && install_qemutests/docker/test-quick +0
-0tests/docker/test-quick cd "$BUILD_DIR" · line 22
Quoted 6 lines
tests/docker/test-quick +1
-1@@ -18,5 +18,5 @@ cd "$BUILD_DIR" DEF_TARGET_LIST="x86_64-softmmu,aarch64-softmmu" TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ build_qemu -make check $MAKEFLAGS +check_qemu install_qemu--
Alex Bennée
PATCH v2 7/16 docker: gracefully skip check_qemu
In reply to Alex BennéeNot all our images are able to run the tests. Rather than use features we can just check for the existence and run-ability of gtester. If the image has been setup for binfmt_misc it will be able to run anyway.
--- tests/docker/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
tests/docker/common.rc +7 -1
@@ -47,7 +47,13 @@ check_qemu() else TEST="$@" fi - make $MAKEFLAGS $TEST + + if type gtester > /dev/null 2>&1 && \ + gtester --version > /dev/null 2>&1; then + make $MAKEFLAGS $TEST + else + echo "No working gtester, skipping make $TEST" + fi } test_fail()
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 07/16] docker: gracefully skip check_qemu
Quoted 14 lines · Alex Bennée
Not all our images are able to run the tests. Rather than use features we can just check for the existence and run-ability of gtester. If the image has been setup for
binfmt_miscit will be able to run anyway.Signed-off-by Alex Bennée <[email protected]>--- tests/docker/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tests/docker/common.rc +0
-0
tests/docker/common.rc check_qemu() · line 51
Quoted 6 lines
tests/docker/common.rc +2
-1@@ -47,7 +47,13 @@ check_qemu() else TEST="$@" fi - make $MAKEFLAGS $TEST + + if type gtester > /dev/null 2>&1 && \
commit e465ce7d09939d631f1861e0bd8873417c1c0d65
tests: Use "command -v" instead of which(1) in shell scripts
When which(1) is not installed, we would complain "perl not found" because it's the first set_prog_path check. The error message is wrong.
Fix it by using "command -v", a native way to query the existence of a command.
Quoted 9 lines
tests/docker/common.rc +5
-0+ gtester --version > /dev/null 2>&1; then + make $MAKEFLAGS $TEST + else + echo "No working gtester, skipping make $TEST" + fi } test_fail()
Re: [Qemu-devel] [PATCH v2 for 3.0 07/16] docker: gracefully skip check_qemu
Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 14 lines · Alex Bennée
Not all our images are able to run the tests. Rather than use features we can just check for the existence and run-ability of gtester. If the image has been setup for
binfmt_miscit will be able to run anyway.Signed-off-by Alex Bennée <[email protected]>--- tests/docker/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tests/docker/common.rc +0
-0tests/docker/common.rc check_qemu() · line 51
Quoted 6 lines
tests/docker/common.rc +2
-1@@ -47,7 +47,13 @@ check_qemu() else TEST="$@" fi - make $MAKEFLAGS $TEST + + if type gtester > /dev/null 2>&1 && \commit
e465ce7d09939d631f1861e0bd8873417c1c0d65
Quoted 1 line
tests: Use "command -v" instead of which(1) in shell scripts
type is also a shell built-in albeit an 1982 bashism. I'll switch to command -v as tending towards POSIX is what we should aim for (although our test-FOO/common.rc structure seems a little confused).
Quoted 17 lines
When which(1) is not installed, we would complain "perl not found" because it's the first
set_prog_pathcheck. The error message is wrong.Fix it by using "command -v", a native way to query the existence of a command.
Quoted 9 lines
tests/docker/common.rc +5
-0+ gtester --version > /dev/null 2>&1; then + make $MAKEFLAGS $TEST + else + echo "No working gtester, skipping make $TEST" + fi } test_fail()
--
Alex Bennée
Re: [Qemu-devel] [PATCH v2 for 3.0 07/16] docker: gracefully skip check_qemu
Quoted 25 lines · Alex Bennée
Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 14 lines · Alex Bennée
Not all our images are able to run the tests. Rather than use features we can just check for the existence and run-ability of gtester. If the image has been setup for
binfmt_miscit will be able to run anyway.Signed-off-by Alex Bennée <[email protected]>--- tests/docker/common.rc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)tests/docker/common.rc +0
-0tests/docker/common.rc check_qemu() · line 51
Quoted 6 lines
tests/docker/common.rc +2
-1@@ -47,7 +47,13 @@ check_qemu() else TEST="$@" fi - make $MAKEFLAGS $TEST + + if type gtester > /dev/null 2>&1 && \commit
e465ce7d09939d631f1861e0bd8873417c1c0d65
Quoted 5 lines
Quoted 1 line
tests: Use "command -v" instead of which(1) in shell scripts
type is also a shell built-in albeit an 1982 bashism. I'll switch to command -v as tending towards POSIX is what we should aim for (although our test-FOO/common.rc structure seems a little confused).
Thanks, with 'command -v':
Quoted 23 lines
Quoted 18 lines
When which(1) is not installed, we would complain "perl not found" because it's the first
set_prog_pathcheck. The error message is wrong.Fix it by using "command -v", a native way to query the existence of a command.
Quoted 9 lines
tests/docker/common.rc +5
-0+ gtester --version > /dev/null 2>&1; then + make $MAKEFLAGS $TEST + else + echo "No working gtester, skipping make $TEST" + fi } test_fail()--
Alex Bennée
PATCH v2 8/16 docker: Makefile.include don't include partial images
In reply to Alex BennéeRename DOCKER_INTERMEDIATE_IMAGES to DOCKER_PARTIAL_IMAGES and add the incomplete cross compiler images that can build tests but can't build QEMU itself. We also add debian, debian-bootstrap and the tricode images to the list.
--- tests/docker/Makefile.include | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
tests/docker/Makefile.include +7 -2
@@ -6,7 +6,7 @@ DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles DOCKER_DEPRECATED_IMAGES := debian # we don't run tests on intermediate images (used as base by another image) -DOCKER_INTERMEDIATE_IMAGES := debian8 debian9 debian8-mxe debian-ports debian-sid +DOCKER_PARTIAL_IMAGES := debian debian8 debian9 debian8-mxe debian-ports debian-sid debian-bootstrap DOCKER_IMAGES := $(filter-out $(DOCKER_DEPRECATED_IMAGES),$(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds
@@ -121,6 +121,11 @@ docker-image-travis: NOUSER=1 # Specialist build images, sometimes very limited tools docker-image-tricore-cross: docker-image-debian9 +# These images may be good enough for building tests but not for test builds +DOCKER_PARTIAL_IMAGES += debian-alpha-cross debian-hppa-cross debian-m68k-cross debian-sh4-cross +DOCKER_PARTIAL_IMAGES += debian-sparc64-cross debian-mips64-cross debian-riscv64-cross +DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-cross + # Rules for building linux-user powered images # # These are slower than using native cross compiler setups but can
@@ -137,7 +142,7 @@ docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user # Expand all the pre-requistes for each docker image and test combination -$(foreach i,$(filter-out $(DOCKER_INTERMEDIATE_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \ +$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \ $(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \ $(eval .PHONY: docker-$t@$i) \ $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 08/16] docker: Makefile.include don't include partial images
Quoted 24 lines · Alex Bennée
Rename
DOCKER_INTERMEDIATE_IMAGEStoDOCKER_PARTIAL_IMAGESand add the incomplete cross compiler images that can build tests but can't build QEMU itself. We also add debian, debian-bootstrap and the tricode images to the list.Signed-off-by Alex Bennée <[email protected]>--- tests/docker/Makefile.include | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)tests/docker/Makefile.include +1
-1@@ -6,7 +6,7 @@ DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles DOCKER_DEPRECATED_IMAGES := debian # we don't run tests on intermediate images (used as base by another image) -DOCKER_INTERMEDIATE_IMAGES := debian8 debian9 debian8-mxe debian-ports debian-sid +DOCKER_PARTIAL_IMAGES := debian debian8 debian9 debian8-mxe debian-ports debian-sid debian-bootstrap DOCKER_IMAGES := $(filter-out $(DOCKER_DEPRECATED_IMAGES),$(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds
tests/docker/Makefile.include docker-image-travis: NOUSER=1 · line 127
Quoted 7 lines
tests/docker/Makefile.include +4
-0@@ -121,6 +121,11 @@ docker-image-travis: NOUSER=1 # Specialist build images, sometimes very limited tools docker-image-tricore-cross: docker-image-debian9 +# These images may be good enough for building tests but not for test builds +DOCKER_PARTIAL_IMAGES += debian-alpha-cross debian-hppa-cross debian-m68k-cross debian-sh4-cross +DOCKER_PARTIAL_IMAGES += debian-sparc64-cross debian-mips64-cross debian-riscv64-cross +DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-cross
What about inverting the logic? Only keep track of 'full' images, and use the $(filter ) function.
Anyway:
Quoted 14 lines
tests/docker/Makefile.include +2
-1+ # Rules for building linux-user powered images # # These are slower than using native cross compiler setups but can@@ -137,7 +142,7 @@ docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user # Expand all the pre-requistes for each docker image and test combination -$(foreach i,$(filter-out $(DOCKER_INTERMEDIATE_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \ +$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \ $(foreach t,$(DOCKER_TESTS) $(DOCKER_TOOLS), \ $(eval .PHONY: docker-$t@$i) \ $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \
PATCH v2 9/16 docker: disable debian-powerpc-user-cross
In reply to Alex BennéeWhile we can build we can't run the unit tests due to a missing system call (249 - swapcontext). This could be a code generation issue as other architectures don't seem to have this system call.
--- tests/docker/Makefile.include | 3 +++ 1 file changed, 3 insertions(+)
tests/docker/Makefile.include +3 -0
@@ -140,6 +140,9 @@ docker-binfmt-image-debian-powerpc-user: QEMU_TARGET = ppc-linux-user docker-binfmt-image-debian-powerpc-user: EXECUTABLE = ${BUILD_DIR}/ppc-linux-user/qemu-ppc docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user +# Unfortunalty while we can build with this image we can't run unit +# tests due to missing system call: 249 which causes an abort +DOCKER_PARTIAL_IMAGES += debian-powerpc-user-cross # Expand all the pre-requistes for each docker image and test combination $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 09/16] docker: disable debian-powerpc-user-cross
Quoted 5 lines · Alex Bennée
While we can build we can't run the unit tests due to a missing system call (249 - swapcontext). This could be a code generation issue as other architectures don't seem to have this system call.
Signed-off-by Alex Bennée <[email protected]>
Quoted 22 lines
--- tests/docker/Makefile.include | 3 +++ 1 file changed, 3 insertions(+)tests/docker/Makefile.include +3
-0@@ -140,6 +140,9 @@ docker-binfmt-image-debian-powerpc-user: QEMU_TARGET = ppc-linux-user docker-binfmt-image-debian-powerpc-user: EXECUTABLE = ${BUILD_DIR}/ppc-linux-user/qemu-ppc docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user +# Unfortunalty while we can build with this image we can't run unit +# tests due to missing system call: 249 which causes an abort +DOCKER_PARTIAL_IMAGES += debian-powerpc-user-cross # Expand all the pre-requistes for each docker image and test combination $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPRECATED_IMAGES)), \
PATCH v2 10/16 docker: add test-unit runner
In reply to Alex BennéeThis test doesn't even build QEMU, it just builds and runs all the unit tests. Intended to make checking unit tests on all docker images easier.
---
v2
- make script -e to error out on failure
- add comment as to why the configure step is run
--- tests/docker/test-unit | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/docker/test-unit
tests/docker/test-unit new file +21 -0
@@ -0,0 +1,21 @@ +#!/bin/bash -e +# +# Build and run the unit tests +# +# Copyright (c) 2018 Linaro Ltd. +# +# Authors: +# Alex Bennée <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +cd "$BUILD_DIR" + +# although we are not building QEMU itself we still need a configured +# build for the unit tests to be built and run +configure_qemu +check_qemu check-unit
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 10/16] docker: add test-unit runner
Quoted 5 lines · Alex Bennée
This test doesn't even build QEMU, it just builds and runs all the unit tests. Intended to make checking unit tests on all docker images easier.
Signed-off-by Alex Bennée <[email protected]>
Quoted 38 lines
---
v2
- make script -e to error out on failure
- add comment as to why the configure step is run--- tests/docker/test-unit | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tests/docker/test-unittests/docker/test-unit new file +21
-0@@ -0,0 +1,21 @@ +#!/bin/bash -e +# +# Build and run the unit tests +# +# Copyright (c) 2018 Linaro Ltd. +# +# Authors: +# Alex Bennée <[email protected]> +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +cd "$BUILD_DIR" + +# although we are not building QEMU itself we still need a configured +# build for the unit tests to be built and run +configure_qemu +check_qemu check-unit
PATCH v2 11/16 docker: add expansion for docker-test-FOO to Makefile.include
In reply to Alex BennéeThis allows us to run a particular test on all docker images. For example:
make docker-test-unit
Will run the unit tests on every supported image. At the same time rename docker-test to docker-all-tests to be clearer.
---
v2
- docker-test -> docker-all-tests
--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/docker/Makefile.include +4 -2
@@ -151,7 +151,8 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \ ) \ $(foreach t,$(DOCKER_TESTS), \ - $(eval docker-test: docker-$t@$i) \ + $(eval docker-all-tests: docker-$t@$i) \ + $(eval docker-$t: docker-$t@$i) \ ) \ )
@@ -161,7 +162,8 @@ docker: @echo 'Available targets:' @echo @echo ' docker: Print this help.' - @echo ' docker-test: Run all image/test combinations.' + @echo ' docker-all-tests: Run all image/test combinations.' + @echo ' docker-TEST: Run TEST on all image combinations.' @echo ' docker-clean: Kill and remove residual docker testing containers.' @echo ' docker-TEST@IMAGE: Run "TEST" in container "IMAGE".' @echo ' Note: "TEST" is one of the listed test name,'
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 11/16] docker: add expansion for docker-test-FOO to Makefile.include
Hi Alex,
Quoted 22 lines · Alex Bennée
This allows us to run a particular test on all docker images. For example:
make docker-test-unit
Will run the unit tests on every supported image. At the same time rename docker-test to docker-all-tests to be clearer.
Signed-off-by Alex Bennée <[email protected]>---
v2
- docker-test -> docker-all-tests--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +0
-0
tests/docker/Makefile.include $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR · line 155
Quoted 6 lines
tests/docker/Makefile.include +2
-1@@ -151,7 +151,8 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \ ) \ $(foreach t,$(DOCKER_TESTS), \ - $(eval docker-test: docker-$t@$i) \ + $(eval docker-all-tests: docker-$t@$i) \ + $(eval docker-$t: docker-$t@$i) \
Is this supposed to work this way?
$ make docker-test-quick@debian-alpha-cross make: *** No rule to make target 'docker-test-quick@debian-alpha-cross'. Stop.
Quoted 14 lines
tests/docker/Makefile.include +2
-1) \ )@@ -161,7 +162,8 @@ docker: @echo 'Available targets:' @echo @echo ' docker: Print this help.' - @echo ' docker-test: Run all image/test combinations.' + @echo ' docker-all-tests: Run all image/test combinations.' + @echo ' docker-TEST: Run TEST on all image combinations.' @echo ' docker-clean: Kill and remove residual docker testing containers.' @echo ' docker-TEST@IMAGE: Run "TEST" in container "IMAGE".' @echo ' Note: "TEST" is one of the listed test name,'
Re: [Qemu-devel] [PATCH v2 for 3.0 11/16] docker: add expansion for docker-test-FOO to Makefile.include
Quoted 34 lines · Philippe Mathieu-Daudé
Hi Alex,
Quoted 22 lines · Alex Bennée
This allows us to run a particular test on all docker images. For example:
make docker-test-unit
Will run the unit tests on every supported image. At the same time rename docker-test to docker-all-tests to be clearer.
Signed-off-by Alex Bennée <[email protected]>---
v2
- docker-test -> docker-all-tests--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +0
-0tests/docker/Makefile.include $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR · line 155
Quoted 6 lines
tests/docker/Makefile.include +2
-1@@ -151,7 +151,8 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \ ) \ $(foreach t,$(DOCKER_TESTS), \ - $(eval docker-test: docker-$t@$i) \ + $(eval docker-all-tests: docker-$t@$i) \ + $(eval docker-$t: docker-$t@$i) \Is this supposed to work this way?
Quoted 3 lines
$ make docker-test-quick@debian-alpha-cross make: *** No rule to make target 'docker-test-quick@debian-alpha-cross'.
No
make docker-test-quick
will make the test-quick on all images.
Your example fails because debian-alpha-cross is a PARTIAL image, good for building test cases but not QEMU so it's not expanded in the above
bit: $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i)
Quoted 5 lines
Stop.
Quoted 3 lines
tests/docker/Makefile.include +0
-0) \ )
Quoted 11 lines
tests/docker/Makefile.include docker: · line 169
Quoted 11 lines
tests/docker/Makefile.include +2
-1@@ -161,7 +162,8 @@ docker: @echo 'Available targets:' @echo @echo ' docker: Print this help.' - @echo ' docker-test: Run all image/test combinations.' + @echo ' docker-all-tests: Run all image/test combinations.' + @echo ' docker-TEST: Run TEST on all image combinations.' @echo ' docker-clean: Kill and remove residual docker testing containers.' @echo ' docker-TEST@IMAGE: Run "TEST" in container "IMAGE".' @echo ' Note: "TEST" is one of the listed test name,'
--
Alex Bennée
Re: [Qemu-devel] [PATCH v2 for 3.0 11/16] docker: add expansion for docker-test-FOO to Makefile.include
Quoted 42 lines · Alex Bennée
Quoted 34 lines · Philippe Mathieu-Daudé
Hi Alex,
Quoted 22 lines · Alex Bennée
This allows us to run a particular test on all docker images. For example:
make docker-test-unit
Will run the unit tests on every supported image. At the same time rename docker-test to docker-all-tests to be clearer.
Signed-off-by Alex Bennée <[email protected]>---
v2
- docker-test -> docker-all-tests--- tests/docker/Makefile.include | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +0
-0tests/docker/Makefile.include $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR · line 155
Quoted 6 lines
tests/docker/Makefile.include +2
-1@@ -151,7 +151,8 @@ $(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES) $(DOCKER_DEPR $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \ ) \ $(foreach t,$(DOCKER_TESTS), \ - $(eval docker-test: docker-$t@$i) \ + $(eval docker-all-tests: docker-$t@$i) \ + $(eval docker-$t: docker-$t@$i) \Is this supposed to work this way?
Quoted 3 lines
$ make docker-test-quick@debian-alpha-cross make: *** No rule to make target 'docker-test-quick@debian-alpha-cross'.No
Quoted 7 lines
make docker-test-quick
will make the test-quick on all images.
Your example fails because debian-alpha-cross is a PARTIAL image, good for building test cases but not QEMU so it's not expanded in the above
bit: $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i)
I noticed too late ;)
Quoted 22 lines
Quoted 6 lines
Stop.
Quoted 3 lines
tests/docker/Makefile.include +0
-0) \ )Quoted 11 lines
tests/docker/Makefile.include docker: · line 169
Quoted 11 lines
tests/docker/Makefile.include +2
-1@@ -161,7 +162,8 @@ docker: @echo 'Available targets:' @echo @echo ' docker: Print this help.' - @echo ' docker-test: Run all image/test combinations.' + @echo ' docker-all-tests: Run all image/test combinations.' + @echo ' docker-TEST: Run TEST on all image combinations.' @echo ' docker-clean: Kill and remove residual docker testing containers.' @echo ' docker-TEST@IMAGE: Run "TEST" in container "IMAGE".' @echo ' Note: "TEST" is one of the listed test name,'--
Alex Bennée
PATCH v2 12/16 docker: drop QEMU_TARGET check, fallback in EXECUTABLE not set
In reply to Alex BennéeThe addition of QEMU_TARGET was intended to ensure we fall back to checking for the existence of an image if the build system was not currently configured to build it. However this breaks the direct use of the rule for building custom binfmt_misc images. We already check for EXECUTABLE so let us just use that as a proxy for deciding if we are just going to check the image exits.
--- tests/docker/Makefile.include | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
tests/docker/Makefile.include +1 -4
@@ -58,13 +58,11 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker $(if $(EXECUTABLE),,\ $(error EXECUTABLE not set, debootstrap of debian-$* would fail)) - $(if $(wildcard $(EXECUTABLE)),,\ - $(error Please build $(EXECUTABLE) first)) $(if $(DEB_ARCH),,\ $(error DEB_ARCH not set, debootstrap of debian-$* would fail)) $(if $(DEB_TYPE),,\ $(error DEB_TYPE not set, debootstrap of debian-$* would fail)) - $(if $(filter $(QEMU_TARGET),$(TARGET_DIRS)), \ + $(if $(wildcard $(EXECUTABLE)), \ $(call quiet-command, \ DEB_ARCH=$(DEB_ARCH) \ DEB_TYPE=$(DEB_TYPE) \
@@ -136,7 +134,6 @@ DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-c # broken so we need a qemu-linux-user for this target docker-binfmt-image-debian-powerpc-user: DEB_ARCH = powerpc docker-binfmt-image-debian-powerpc-user: DEB_TYPE = jessie -docker-binfmt-image-debian-powerpc-user: QEMU_TARGET = ppc-linux-user docker-binfmt-image-debian-powerpc-user: EXECUTABLE = ${BUILD_DIR}/ppc-linux-user/qemu-ppc docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 12/16] docker: drop QEMU_TARGET check, fallback in EXECUTABLE not set
Quoted 8 lines · Alex Bennée
The addition of
QEMU_TARGETwas intended to ensure we fall back to checking for the existence of an image if the build system was not currently configured to build it. However this breaks the direct use of the rule for building custombinfmt_miscimages. We already check for EXECUTABLE so let us just use that as a proxy for deciding if we are just going to check the image exits.Signed-off-by Alex Bennée <[email protected]>
Quoted 32 lines
--- tests/docker/Makefile.include | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)tests/docker/Makefile.include +1
-4@@ -58,13 +58,11 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker $(if $(EXECUTABLE),,\ $(error EXECUTABLE not set, debootstrap of debian-$* would fail)) - $(if $(wildcard $(EXECUTABLE)),,\ - $(error Please build $(EXECUTABLE) first)) $(if $(DEB_ARCH),,\ $(error DEB_ARCH not set, debootstrap of debian-$* would fail)) $(if $(DEB_TYPE),,\ $(error DEB_TYPE not set, debootstrap of debian-$* would fail)) - $(if $(filter $(QEMU_TARGET),$(TARGET_DIRS)), \ + $(if $(wildcard $(EXECUTABLE)), \ $(call quiet-command, \ DEB_ARCH=$(DEB_ARCH) \ DEB_TYPE=$(DEB_TYPE) \@@ -136,7 +134,6 @@ DOCKER_PARTIAL_IMAGES += debian-tricore-cross debian-powerpc-cross fedora-i386-c # broken so we need a qemu-linux-user for this target docker-binfmt-image-debian-powerpc-user: DEB_ARCH = powerpc docker-binfmt-image-debian-powerpc-user: DEB_TYPE = jessie -docker-binfmt-image-debian-powerpc-user: QEMU_TARGET = ppc-linux-user docker-binfmt-image-debian-powerpc-user: EXECUTABLE = ${BUILD_DIR}/ppc-linux-user/qemu-ppc docker-image-debian-powerpc-user-cross: docker-binfmt-image-debian-powerpc-user DOCKER_USER_IMAGES += debian-powerpc-user
PATCH v2 13/16 docker: add --hint to docker.py check
In reply to Alex BennéeWhen a check fails we currently just report why we failed. This is not totally helpful to people who want to boot-strap a new image. Add a --hint option which we can pass down to give a bit more information.
--- tests/docker/Makefile.include | 3 ++- tests/docker/docker.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
tests/docker/Makefile.include +2 -1
@@ -73,7 +73,8 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \ "BUILD","binfmt debian-$* (debootstrapped)"), \ $(call quiet-command, \ - $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $<, \ + $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $< \ + --hint "you will need to build $(EXECUTABLE)", \ "CHECK", "debian-$* exists")) endif
tests/docker/docker.py +2 -1
@@ -475,6 +475,7 @@ class CheckCommand(SubCommand): default="checksum", help="check type") parser.add_argument("--olderthan", default=60, type=int, help="number of minutes") + parser.add_argument("--hint", default="", help="hint to user") def run(self, args, argv): tag = args.tag
@@ -487,7 +488,7 @@ class CheckCommand(SubCommand): info = dkr.inspect_tag(tag) if info is None: - print("Image does not exist") + print("Image does not exist %s" % (args.hint)) return 1 if args.checktype == "checksum":
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 13/16] docker: add --hint to docker.py check
Quoted 5 lines · Alex Bennée
When a check fails we currently just report why we failed. This is not totally helpful to people who want to boot-strap a new image. Add a --hint option which we can pass down to give a bit more information.
Signed-off-by Alex Bennée <[email protected]>
Quoted 41 lines
--- tests/docker/Makefile.include | 3 ++- tests/docker/docker.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)tests/docker/Makefile.include +2
-1@@ -73,7 +73,8 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \ "BUILD","binfmt debian-$* (debootstrapped)"), \ $(call quiet-command, \ - $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $<, \ + $(DOCKER_SCRIPT) check --quiet qemu:debian-$* $< \ + --hint "you will need to build $(EXECUTABLE)", \ "CHECK", "debian-$* exists")) endiftests/docker/docker.py +2
-1@@ -475,6 +475,7 @@ class CheckCommand(SubCommand): default="checksum", help="check type") parser.add_argument("--olderthan", default=60, type=int, help="number of minutes") + parser.add_argument("--hint", default="", help="hint to user") def run(self, args, argv): tag = args.tag@@ -487,7 +488,7 @@ class CheckCommand(SubCommand): info = dkr.inspect_tag(tag) if info is None: - print("Image does not exist") + print("Image does not exist %s" % (args.hint)) return 1 if args.checktype == "checksum":
Philippe Mathieu-Daudé
Tested-byRe: [Qemu-devel] [PATCH v2 for 3.0 13/16] docker: add --hint to docker.py check
Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Alex Bennée
When a check fails we currently just report why we failed. This is not totally helpful to people who want to boot-strap a new image. Add a --hint option which we can pass down to give a bit more information.
Signed-off-by Alex Bennée <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>
PATCH v2 14/16 docker: Update debootstrap script after Debian migration from Alioth to Salsa
In reply to Alex BennéeFrom: Philippe Mathieu-Daudé <[email protected]>
This silents the following warning:
Cloning into './debootstrap.git'...
warning: redirecting to https://salsa.debian.org/installer-team/debootstrap.git/
See https://lists.debian.org/debian-devel-announce/2018/01/msg00004.html
--- tests/docker/dockerfiles/debian-bootstrap.pre | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/dockerfiles/debian-bootstrap.pre +1 -1
@@ -62,7 +62,7 @@ if [ -z $DEBOOTSTRAP_DIR ]; then NEED_DEBOOTSTRAP=true fi if $NEED_DEBOOTSTRAP; then - DEBOOTSTRAP_SOURCE=https://anonscm.debian.org/git/d-i/debootstrap.git + DEBOOTSTRAP_SOURCE=https://salsa.debian.org/installer-team/debootstrap.git git clone ${DEBOOTSTRAP_SOURCE} ./debootstrap.git export DEBOOTSTRAP_DIR=./debootstrap.git DEBOOTSTRAP=./debootstrap.git/debootstrap
Signature · 1 line
2.17.1
PATCH v2 15/16 docker: add commentary to debian-bootstrap.docker
In reply to Alex BennéeThis is just a note that later versions of debootstrap don't technically need this hack.
--- tests/docker/dockerfiles/debian-bootstrap.docker | 1 + 1 file changed, 1 insertion(+)
tests/docker/dockerfiles/debian-bootstrap.docker +1 -0
@@ -9,6 +9,7 @@ FROM scratch ADD . / # Patch all mounts as docker already has stuff set up +# (this is not needed for later debootstraps but is harmless atm) RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions # Run stage 2
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 15/16] docker: add commentary to debian-bootstrap.docker
Quoted 4 lines · Alex Bennée
This is just a note that later versions of debootstrap don't technically need this hack.
Signed-off-by Alex Bennée <[email protected]>
Quoted 17 lines
--- tests/docker/dockerfiles/debian-bootstrap.docker | 1 + 1 file changed, 1 insertion(+)tests/docker/dockerfiles/debian-bootstrap.docker +1
-0@@ -9,6 +9,7 @@ FROM scratch ADD . / # Patch all mounts as docker already has stuff set up +# (this is not needed for later debootstraps but is harmless atm) RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions # Run stage 2
PATCH v2 16/16 docker: ignore distro versioning of debootstrap
In reply to Alex BennéeWe do a minimum version check for the debootstrap but if the distro has added their own minor version tick it would fail and fall-back to the SCM version. This is sub-optimal as the latest/greatest version may be broken at any one particular time. We fix that with a little sed magic on the version string before passing to our ugly shell versioning check.
--- tests/docker/dockerfiles/debian-bootstrap.pre | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
tests/docker/dockerfiles/debian-bootstrap.pre +7 -4
@@ -56,10 +56,13 @@ if [ -z $DEBOOTSTRAP_DIR ]; then if [ -z $DEBOOTSTRAP ]; then echo "No debootstrap installed, attempting to install from SCM" NEED_DEBOOTSTRAP=true - elif ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; "${DEBOOTSTRAP}" --version \ - | cut -d ' ' -f 2) | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -c &>/dev/null; then - echo "debootstrap too old, attempting to install from SCM" - NEED_DEBOOTSTRAP=true + else + INSTALLED_VERSION=$(${DEBOOTSTRAP} --version | sed 's/debootstrap \([0-9\.]*\)[^0-9\.]*.*/\1/') + if ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; echo "${INSTALLED_VERSION}") \ + | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -C ; then + echo "debootstrap too old, attempting to install from SCM" + NEED_DEBOOTSTRAP=true + fi fi if $NEED_DEBOOTSTRAP; then DEBOOTSTRAP_SOURCE=https://salsa.debian.org/installer-team/debootstrap.git
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH v2 for 3.0 16/16] docker: ignore distro versioning of debootstrap
Quoted 8 lines · Alex Bennée
We do a minimum version check for the debootstrap but if the distro has added their own minor version tick it would fail and fall-back to the SCM version. This is sub-optimal as the latest/greatest version may be broken at any one particular time. We fix that with a little sed magic on the version string before passing to our ugly shell versioning check.
Signed-off-by Alex Bennée <[email protected]>
Quoted 27 lines
--- tests/docker/dockerfiles/debian-bootstrap.pre | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)tests/docker/dockerfiles/debian-bootstrap.pre +7
-4@@ -56,10 +56,13 @@ if [ -z $DEBOOTSTRAP_DIR ]; then if [ -z $DEBOOTSTRAP ]; then echo "No debootstrap installed, attempting to install from SCM" NEED_DEBOOTSTRAP=true - elif ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; "${DEBOOTSTRAP}" --version \ - | cut -d ' ' -f 2) | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -c &>/dev/null; then - echo "debootstrap too old, attempting to install from SCM" - NEED_DEBOOTSTRAP=true + else + INSTALLED_VERSION=$(${DEBOOTSTRAP} --version | sed 's/debootstrap \([0-9\.]*\)[^0-9\.]*.*/\1/') + if ! (echo "${MIN_DEBOOTSTRAP_VERSION}" ; echo "${INSTALLED_VERSION}") \ + | sort -t . -n -k 1,1 -k 2,2 -k 3,3 -C ; then + echo "debootstrap too old, attempting to install from SCM" + NEED_DEBOOTSTRAP=true + fi fi if $NEED_DEBOOTSTRAP; then DEBOOTSTRAP_SOURCE=https://salsa.debian.org/installer-team/debootstrap.git
Quoted 18 lines · Alex Bennée
Hi,
Unfortunately this series grew a little while I was re-basing as I noticed a couple of bugs. An upstream change in debootstrap which I'd been happily using for Ubuntu images caused a breakage which I've hopefully now fixed:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903657
However since I upgraded by devbox I hadn't clocked to the fact I should have been using the stable debootstrap anyway but our ugly shell version check failed to pick it up. That's now fixed and I can now bootstrap away.
I grabbed a couple of Philippe's patches while I was at it as they were relevant to the other changes. It does mean the un-reviewed count has gone up slightly:
Quoted 12 lines
patch docker/base debian tricore on qemu debian9.patch patch docker/split
configure_qemufrom build_qemu.patch patch docker/move make check intocheck_qemuhelper.patch patch docker/gracefully skip check_qemu.patch
patch docker/Makefile.include don t include partial images.patch patch docker/disable debian powerpc user cross.patch patch docker/add test unit runner.patch
patch docker/add expansion for docker test FOO to Makefile.patch patch docker/dropQEMU_TARGETcheck fallback in EXECUTABLE.patch patch docker/add hint todocker.pycheck.patch
patch docker/add commentary to debian bootstrap.docker.patch patch docker/ignore distro versioning of debootstrap.patch
[Note]
I hit:
$ make docker-binfmt-image-debian-powerpc-user
BUILD binfmt debian-powerpc-user (debootstrapped)
Cloning into './debootstrap.git'...
remote: Enumerating objects: 3262, done.
remote: Counting objects: 100% (3262/3262), done.
remote: Compressing objects: 100% (902/902), done.
remote: Total 3262 (delta 2353), reused 3245 (delta 2339)
Receiving objects: 100% (3262/3262), 531.08 KiB | 335.00 KiB/s, done.
Resolving deltas: 100% (2353/2353), done.
The command '/bin/sh -c /debootstrap/debootstrap --second-stage'
returned a non-zero code: 139
Traceback (most recent call last):
File "tests/docker/docker.py", line 536, in <module>
sys.exit(main())
File "tests/docker/docker.py", line 533, in main
return args.cmdobj.run(args, argv)
File "tests/docker/docker.py", line 348, in run
extra_files_cksum=cksum)
File "tests/docker/docker.py", line 231, in build_image
quiet=quiet)
File "tests/docker/docker.py", line 158, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'build', '-t',
'qemu:debian-powerpc-user', '-f',
'/tmp/docker_buildPNDAtz/tmpIVpPn7.docker', '/tmp/docker_buildPNDAtz']'
returned non-zero exit status 139
make: *** [tests/docker/Makefile.include:62:
docker-binfmt-image-debian-powerpc-user] Error 1"returned non-zero exit status 139" seems to be qemu-user crashing for not being statistically linked.
Once rebuilt after ./configure --static, it worked:
$ make docker-binfmt-image-debian-powerpc-user V=1 [...] I: Extracting zlib1g... ppc-linux-user/qemu-ppc had no associated libraries (static build?) Sending build context to Docker daemon 226.5MB Step 1/7 : FROM scratch Step 2/7 : ADD . / Step 3/7 : RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions Step 4/7 : RUN /debootstrap/debootstrap --second-stage I: Installing core packages... [...]
Quoted 67 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Alex Bennée
Hi,
Unfortunately this series grew a little while I was re-basing as I noticed a couple of bugs. An upstream change in debootstrap which I'd been happily using for Ubuntu images caused a breakage which I've hopefully now fixed:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903657
However since I upgraded by devbox I hadn't clocked to the fact I should have been using the stable debootstrap anyway but our ugly shell version check failed to pick it up. That's now fixed and I can now bootstrap away.
I grabbed a couple of Philippe's patches while I was at it as they were relevant to the other changes. It does mean the un-reviewed count has gone up slightly:
Quoted 12 lines
patch docker/base debian tricore on qemu debian9.patch patch docker/split
configure_qemufrom build_qemu.patch patch docker/move make check intocheck_qemuhelper.patch patch docker/gracefully skip check_qemu.patch
patch docker/Makefile.include don t include partial images.patch patch docker/disable debian powerpc user cross.patch patch docker/add test unit runner.patch
patch docker/add expansion for docker test FOO to Makefile.patch patch docker/dropQEMU_TARGETcheck fallback in EXECUTABLE.patch patch docker/add hint todocker.pycheck.patch
patch docker/add commentary to debian bootstrap.docker.patch patch docker/ignore distro versioning of debootstrap.patch[Note]
I hit:
$ make docker-binfmt-image-debian-powerpc-user BUILD binfmt debian-powerpc-user (debootstrapped) Cloning into './debootstrap.git'... remote: Enumerating objects: 3262, done. remote: Counting objects: 100% (3262/3262), done. remote: Compressing objects: 100% (902/902), done. remote: Total 3262 (delta 2353), reused 3245 (delta 2339) Receiving objects: 100% (3262/3262), 531.08 KiB | 335.00 KiB/s, done. Resolving deltas: 100% (2353/2353), done. The command '/bin/sh -c /debootstrap/debootstrap --second-stage' returned a non-zero code: 139 Traceback (most recent call last): File "tests/docker/docker.py", line 536, in <module> sys.exit(main()) File "tests/docker/docker.py", line 533, in main return args.cmdobj.run(args, argv) File "tests/docker/docker.py", line 348, in run extra_files_cksum=cksum) File "tests/docker/docker.py", line 231, in build_image quiet=quiet) File "tests/docker/docker.py", line 158, in _do_check return subprocess.check_call(self._command + cmd, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['docker', 'build', '-t', 'qemu:debian-powerpc-user', '-f', '/tmp/docker_buildPNDAtz/tmpIVpPn7.docker', '/tmp/docker_buildPNDAtz']' returned non-zero exit status 139 make: *** [tests/docker/Makefile.include:62: docker-binfmt-image-debian-powerpc-user] Error 1
Quoted 2 lines
"returned non-zero exit status 139" seems to be qemu-user crashing for not being statistically linked.
What system are you building on? Basically --static is always safer but as long as there isn't a clash between host/guest file system layouts it can work which is why I don't enforce it (although earlier patches tried to).
Quoted 14 lines
Once rebuilt after ./configure --static, it worked:
$ make docker-binfmt-image-debian-powerpc-user V=1 [...] I: Extracting zlib1g... ppc-linux-user/qemu-ppc had no associated libraries (static build?) Sending build context to Docker daemon 226.5MB Step 1/7 : FROM scratch Step 2/7 : ADD . / Step 3/7 : RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions Step 4/7 : RUN /debootstrap/debootstrap --second-stage I: Installing core packages... [...]
--
Alex Bennée
Quoted 68 lines · Alex Bennée
Quoted 67 lines · Philippe Mathieu-Daudé
Quoted 18 lines · Alex Bennée
Hi,
Unfortunately this series grew a little while I was re-basing as I noticed a couple of bugs. An upstream change in debootstrap which I'd been happily using for Ubuntu images caused a breakage which I've hopefully now fixed:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903657
However since I upgraded by devbox I hadn't clocked to the fact I should have been using the stable debootstrap anyway but our ugly shell version check failed to pick it up. That's now fixed and I can now bootstrap away.
I grabbed a couple of Philippe's patches while I was at it as they were relevant to the other changes. It does mean the un-reviewed count has gone up slightly:
Quoted 12 lines
patch docker/base debian tricore on qemu debian9.patch patch docker/split
configure_qemufrom build_qemu.patch patch docker/move make check intocheck_qemuhelper.patch patch docker/gracefully skip check_qemu.patch
patch docker/Makefile.include don t include partial images.patch patch docker/disable debian powerpc user cross.patch patch docker/add test unit runner.patch
patch docker/add expansion for docker test FOO to Makefile.patch patch docker/dropQEMU_TARGETcheck fallback in EXECUTABLE.patch patch docker/add hint todocker.pycheck.patch
patch docker/add commentary to debian bootstrap.docker.patch patch docker/ignore distro versioning of debootstrap.patch[Note]
I hit:
$ make docker-binfmt-image-debian-powerpc-user BUILD binfmt debian-powerpc-user (debootstrapped) Cloning into './debootstrap.git'... remote: Enumerating objects: 3262, done. remote: Counting objects: 100% (3262/3262), done. remote: Compressing objects: 100% (902/902), done. remote: Total 3262 (delta 2353), reused 3245 (delta 2339) Receiving objects: 100% (3262/3262), 531.08 KiB | 335.00 KiB/s, done. Resolving deltas: 100% (2353/2353), done. The command '/bin/sh -c /debootstrap/debootstrap --second-stage' returned a non-zero code: 139 Traceback (most recent call last): File "tests/docker/docker.py", line 536, in <module> sys.exit(main()) File "tests/docker/docker.py", line 533, in main return args.cmdobj.run(args, argv) File "tests/docker/docker.py", line 348, in run extra_files_cksum=cksum) File "tests/docker/docker.py", line 231, in build_image quiet=quiet) File "tests/docker/docker.py", line 158, in _do_check return subprocess.check_call(self._command + cmd, **kwargs) File "/usr/lib/python2.7/subprocess.py", line 190, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['docker', 'build', '-t', 'qemu:debian-powerpc-user', '-f', '/tmp/docker_buildPNDAtz/tmpIVpPn7.docker', '/tmp/docker_buildPNDAtz']' returned non-zero exit status 139 make: *** [tests/docker/Makefile.include:62: docker-binfmt-image-debian-powerpc-user] Error 1
Quoted 7 lines
Quoted 2 lines
"returned non-zero exit status 139" seems to be qemu-user crashing for not being statistically linked.
What system are you building on? Basically --static is always safer but as long as there isn't a clash between host/guest file system layouts it can work which is why I don't enforce it (although earlier patches tried to).
$ docker info Server Version: 18.05.0-ce Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Plugins: Volume: local Network: bridge host macvlan null overlay Kernel Version: 4.16.0-2-amd64 Operating System: Debian GNU/Linux buster/sid OSType: linux Architecture: x86_64
Quoted 14 lines
Quoted 14 lines
Once rebuilt after ./configure --static, it worked:
$ make docker-binfmt-image-debian-powerpc-user V=1 [...] I: Extracting zlib1g... ppc-linux-user/qemu-ppc had no associated libraries (static build?) Sending build context to Docker daemon 226.5MB Step 1/7 : FROM scratch Step 2/7 : ADD . / Step 3/7 : RUN sed -i 's/in_target mount/echo not for docker in_target mount/g' /debootstrap/functions Step 4/7 : RUN /debootstrap/debootstrap --second-stage I: Installing core packages... [...]