mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0
@ 2024-08-12  9:15 Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

We have been using the same distro/toolchain for more than a year now,
so let's update them to their newest versions.

pip3 now warns that we are not in a venv. Acknowledge this and ignore
it as we want labgrid to be available to pytest in the container without
having to source a virtualenv first.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/Containerfile b/test/Containerfile
index fe3e3a6186b0..06d155bf4d28 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -2,7 +2,7 @@
 # This Containerfile is used to build an image containing basic stuff to be used
 # to build barebox and run our test suites.
 
-FROM debian:bullseye
+FROM debian:bookworm
 MAINTAINER Sascha Hauer <s.hauer@pengutronix.de>
 LABEL Description="This image is for building and testing barebox inside a container"
 
@@ -49,7 +49,7 @@ RUN apt-get update && apt-get install -y \
 	u-boot-tools \
 	&& rm -rf /var/lib/apt/lists/*
 
-ENV GCC_VERSION=13.1.0
+ENV GCC_VERSION=14.2.0
 
 # Manually install the kernel.org Crosstool based toolchains
 RUN korg_crosstool_dl() { wget -nv -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${1}/${2}/${1}-gcc-${2}-nolibc-${3}.tar.xz | tar -C /opt -xJ ; } && \
@@ -70,7 +70,7 @@ RUN echo barebox ALL=NOPASSWD: ALL > /etc/sudoers.d/barebox
 RUN cd /tmp && \
     git clone --depth 1 -b v23.0 https://github.com/labgrid-project/labgrid && \
     cd labgrid && \
-    pip3 install . && \
+    pip3 install --break-system-packages . && \
     ln -s $(which pytest) /usr/local/bin/labgrid-pytest;
 
 ENV CROSS_COMPILE_arm=/opt/gcc-${GCC_VERSION}-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi-
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/6] ci: container: add kvx-elf- toolchain
  2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
@ 2024-08-12  9:15 ` Ahmad Fatoum
  2024-08-12  9:29   ` Yann Sionneau
  2024-08-12  9:15 ` [PATCH 3/6] ci: container: update to newer Labgrid Ahmad Fatoum
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Yann Sionneau, Ahmad Fatoum

ARCH=kvx build has been broken in the past, because it was the only
barebox platform that wasn't build tested.

There are prebuilt toolchains of acceptable footprint (64M compressed),
so let's integrate them into the image, so we can add it to build test.

There's no prebuilt Qemu unfortunately, so actually testing the result
will have to wait.

Cc: Yann Sionneau <ysionneau@kalrayinc.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/Containerfile b/test/Containerfile
index 06d155bf4d28..2f8c969d824f 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -60,6 +60,13 @@ RUN korg_crosstool_dl() { wget -nv -O - https://mirrors.edge.kernel.org/pub/tool
     korg_crosstool_dl x86_64 ${GCC_VERSION} powerpc-linux     && \
     korg_crosstool_dl x86_64 ${GCC_VERSION} riscv64-linux
 
+RUN wget -O kvx.tgz https://github.com/kalray/build-scripts/releases/download/v5.0.0/gcc-kalray-kvx-ubuntu-22.04-v5.0.0.tar.gz
+
+RUN echo "d27b3d6e6246f5debffee0bb01e77eb133bd32c658782a68a779cf9fb4c436bc kvx.tgz" | \
+    sha256sum --check --status
+
+RUN tar -C /opt -xzf kvx.tgz && rm kvx.tgz
+
 RUN wget "https://github.com/qemu/qemu/blob/v5.2.0/pc-bios/opensbi-riscv32-generic-fw_dynamic.bin?raw=true" -O /usr/share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
 
 # Create our user/group
@@ -79,5 +86,6 @@ ENV CROSS_COMPILE_mips=/opt/gcc-${GCC_VERSION}-nolibc/mips-linux/bin/mips-linux-
 ENV CROSS_COMPILE_openrisc=/opt/gcc-${GCC_VERSION}-nolibc/or1k-linux/bin/or1k-linux-
 ENV CROSS_COMPILE_powerpc=/opt/gcc-${GCC_VERSION}-nolibc/powerpc-linux/bin/powerpc-linux-
 ENV CROSS_COMPILE_riscv=/opt/gcc-${GCC_VERSION}-nolibc/riscv64-linux/bin/riscv64-linux-
+ENV CROSS_COMPILE_kvx=/opt/gcc-kalray-kvx-v5.0.0/bin/kvx-elf-
 
 USER barebox:barebox
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/6] ci: container: update to newer Labgrid
  2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
@ 2024-08-12  9:15 ` Ahmad Fatoum
  2024-08-12 12:52   ` Yann Sionneau
  2024-08-12  9:15 ` [PATCH 4/6] test: sandbox: support testing with Labgrid Ahmad Fatoum
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The now current release is v23.0.6 from April 2024, but master has
fixes, which enable us to run Labgrid tests against the sandbox
architecture. Therefore point at the newest commit on the master branch.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/Containerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/Containerfile b/test/Containerfile
index 2f8c969d824f..c09051a1505a 100644
--- a/test/Containerfile
+++ b/test/Containerfile
@@ -75,8 +75,9 @@ RUN echo barebox ALL=NOPASSWD: ALL > /etc/sudoers.d/barebox
 
 # install labgrid
 RUN cd /tmp && \
-    git clone --depth 1 -b v23.0 https://github.com/labgrid-project/labgrid && \
+    git clone --depth 1 https://github.com/labgrid-project/labgrid && \
     cd labgrid && \
+    git checkout 16db15a953 && \
     pip3 install --break-system-packages . && \
     ln -s $(which pytest) /usr/local/bin/labgrid-pytest;
 
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 4/6] test: sandbox: support testing with Labgrid
  2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 3/6] ci: container: update to newer Labgrid Ahmad Fatoum
@ 2024-08-12  9:15 ` Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 5/6] ci: pytest: test sandbox configuration with labgrid Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 6/6] ci: build: add kvx build test Ahmad Fatoum
  4 siblings, 0 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

From: Bastian Krause <bst@pengutronix.de>

It turns out there is already support in Labgrid to execute an
interactive console application and run tests against it.

Switch our test/sandbox/sandbox_defconfig.yaml to use this, so we can
eventually test sandbox in CI as well.

For proper operation, we require that labgrid doesn't buffer output
of the barebox sandbox process, which was recently fixed in [1].

[1]: https://github.com/labgrid-project/labgrid/pull/1440

Signed-off-by: Bastian Krause <bst@pengutronix.de>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 test/emulate.pl                     |  6 +++---
 test/sandbox/sandbox_defconfig.yaml | 17 ++++++++++-------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/test/emulate.pl b/test/emulate.pl
index 086fae0f7708..df21d5c727bf 100755
--- a/test/emulate.pl
+++ b/test/emulate.pl
@@ -340,12 +340,12 @@ sub emulate {
 
 	    vsystem($temu{temu_bin}, "tinyemu.cfg", @OPTS) == 0
 		or die "Error running emulator: $?\n";
-    } elsif (defined $target{drivers}{NativeExecutableDriver}) {
-	    my %exec = %{$target{drivers}{NativeExecutableDriver}};
+    } elsif (defined $target{drivers}{ExternalConsoleDriver}) {
+	    my %exec = %{$target{drivers}{ExternalConsoleDriver}};
 
 	    pushd($args{builddir}) if $tuxmake;
 
-	    vsystem($exec{command}, @OPTS) == 0 or die "Error running emulator: $?\n";
+	    vsystem($exec{cmd}, @OPTS) == 0 or die "Error running emulator: $?\n";
     }
 
     popd() if $tuxmake;
diff --git a/test/sandbox/sandbox_defconfig.yaml b/test/sandbox/sandbox_defconfig.yaml
index 784f49146605..eb9ab7f17a55 100644
--- a/test/sandbox/sandbox_defconfig.yaml
+++ b/test/sandbox/sandbox_defconfig.yaml
@@ -1,12 +1,15 @@
 targets:
   main:
     drivers:
-      NativeExecutableDriver: # not yet supported by labgrid, only for interactive use
-        command: ./barebox
-        image: barebox
+      ExternalConsoleDriver:
+        cmd: !template "$LG_BUILDDIR/barebox"
+      ExternalPowerDriver:
+        cmd_on: 'true'
+        cmd_off: 'true'
+      BareboxDriver:
+        prompt: "barebox@[^:]+:[^ ]+ "
+      BareboxTestStrategy: {}
     runner:
       tuxmake_arch: um
-images:
-  barebox: !template "$LG_BUILDDIR/barebox"
-tools:
-  qemu: /usr/local/bin/temu
+imports:
+  -  ../strategy.py
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 5/6] ci: pytest: test sandbox configuration with labgrid
  2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2024-08-12  9:15 ` [PATCH 4/6] test: sandbox: support testing with Labgrid Ahmad Fatoum
@ 2024-08-12  9:15 ` Ahmad Fatoum
  2024-08-12  9:15 ` [PATCH 6/6] ci: build: add kvx build test Ahmad Fatoum
  4 siblings, 0 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Now that we updated to a Labgrid version that can test sandbox barebox
and changed our environment YAML to use it, let's test this in CI.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/test-labgrid-pytest.yml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/test-labgrid-pytest.yml b/.github/workflows/test-labgrid-pytest.yml
index 2e038e371f1e..70bc570f005b 100644
--- a/.github/workflows/test-labgrid-pytest.yml
+++ b/.github/workflows/test-labgrid-pytest.yml
@@ -47,6 +47,10 @@ jobs:
             lgenv: 'test/riscv/qemu-virt64@rv64i_defconfig.yaml'
             defconfig: rv64i_defconfig
 
+          - ARCH: sandbox
+            lgenv: 'test/sandbox/sandbox_defconfig.yaml'
+            defconfig: sandbox_defconfig
+
     steps:
     - name: Checkout code
       uses: actions/checkout@v4
@@ -68,7 +72,7 @@ jobs:
         export KBUILD_OUTPUT=build-${{matrix.arch}}
 
         for i in ${{matrix.lgenv}}; do
-          grep -wqe QEMUDriver: "$i" || continue
+          grep -wq '\(QEMUDriver\|ExternalConsoleDriver\): "$i" || continue
 
           cfg=$(basename $i .yaml)
           echo "Testing $cfg"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 6/6] ci: build: add kvx build test
  2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2024-08-12  9:15 ` [PATCH 5/6] ci: pytest: test sandbox configuration with labgrid Ahmad Fatoum
@ 2024-08-12  9:15 ` Ahmad Fatoum
  4 siblings, 0 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12  9:15 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Now that we ship a toolchain for Kalray's MPPA Coolidge CPU, let's
enable build test on that architecture as well.

With this, all architectures now have defconfigs that are build tested.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 .github/workflows/build-defconfigs.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/build-defconfigs.yml b/.github/workflows/build-defconfigs.yml
index 46f59fd118c1..f8cb7c2a5929 100644
--- a/.github/workflows/build-defconfigs.yml
+++ b/.github/workflows/build-defconfigs.yml
@@ -3,7 +3,7 @@ name: build images
 on: [push, pull_request]
 
 env:
-  ARCH: arm mips powerpc riscv sandbox x86 openrisc
+  ARCH: arm mips powerpc riscv sandbox x86 openrisc kvx
 
 jobs:
   defconfigs:
-- 
2.39.2




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/6] ci: container: add kvx-elf- toolchain
  2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
@ 2024-08-12  9:29   ` Yann Sionneau
  0 siblings, 0 replies; 9+ messages in thread
From: Yann Sionneau @ 2024-08-12  9:29 UTC (permalink / raw)
  To: Ahmad Fatoum, barebox; +Cc: Julian Vetter, Jonathan Borne

Hello Ahmad,

Le 8/12/24 à 11:15, Ahmad Fatoum a écrit :
> ARCH=kvx build has been broken in the past, because it was the only
> barebox platform that wasn't build tested.
>
> There are prebuilt toolchains of acceptable footprint (64M compressed),
> so let's integrate them into the image, so we can add it to build test.
>
> There's no prebuilt Qemu unfortunately, so actually testing the result
> will have to wait.
> [...]

Ack, lgtm.

Thanks a lot!

-- 

Yann








^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/6] ci: container: update to newer Labgrid
  2024-08-12  9:15 ` [PATCH 3/6] ci: container: update to newer Labgrid Ahmad Fatoum
@ 2024-08-12 12:52   ` Yann Sionneau
  2024-08-12 13:30     ` Ahmad Fatoum
  0 siblings, 1 reply; 9+ messages in thread
From: Yann Sionneau @ 2024-08-12 12:52 UTC (permalink / raw)
  To: barebox

Hi Ahmad,

Le 8/12/24 à 11:15, Ahmad Fatoum a écrit :
> The now current release is v23.0.6 from April 2024, but master has
> fixes, which enable us to run Labgrid tests against the sandbox
> architecture. Therefore point at the newest commit on the master branch.
>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>   test/Containerfile | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/test/Containerfile b/test/Containerfile
> index 2f8c969d824f..c09051a1505a 100644
> --- a/test/Containerfile
> +++ b/test/Containerfile
> @@ -75,8 +75,9 @@ RUN echo barebox ALL=NOPASSWD: ALL > /etc/sudoers.d/barebox
>   
>   # install labgrid
>   RUN cd /tmp && \
> -    git clone --depth 1 -b v23.0 https://github.com/labgrid-project/labgrid && \
> +    git clone --depth 1 https://github.com/labgrid-project/labgrid && \

This triggers `error: pathspec '16db15a953' did not match any file(s) 
known to git` on my side

I suggest removing the `--depth 1`

Cheers,

-- 

Yann








^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/6] ci: container: update to newer Labgrid
  2024-08-12 12:52   ` Yann Sionneau
@ 2024-08-12 13:30     ` Ahmad Fatoum
  0 siblings, 0 replies; 9+ messages in thread
From: Ahmad Fatoum @ 2024-08-12 13:30 UTC (permalink / raw)
  To: Yann Sionneau, barebox

Hello Yann,

On 12.08.24 14:52, Yann Sionneau wrote:
> Hi Ahmad,
> 
> Le 8/12/24 à 11:15, Ahmad Fatoum a écrit :
>> The now current release is v23.0.6 from April 2024, but master has
>> fixes, which enable us to run Labgrid tests against the sandbox
>> architecture. Therefore point at the newest commit on the master branch.
>>
>> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
>> ---
>>   test/Containerfile | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/test/Containerfile b/test/Containerfile
>> index 2f8c969d824f..c09051a1505a 100644
>> --- a/test/Containerfile
>> +++ b/test/Containerfile
>> @@ -75,8 +75,9 @@ RUN echo barebox ALL=NOPASSWD: ALL > /etc/sudoers.d/barebox
>>     # install labgrid
>>   RUN cd /tmp && \
>> -    git clone --depth 1 -b v23.0 https://github.com/labgrid-project/labgrid && \
>> +    git clone --depth 1 https://github.com/labgrid-project/labgrid && \
> 
> This triggers `error: pathspec '16db15a953' did not match any file(s) known to git` on my side
> 
> I suggest removing the `--depth 1`

Thanks. v24.0 was released today, so I'll just point at that.

Cheers,
Ahmad

> 
> Cheers,
> 


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-08-12 13:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-12  9:15 [PATCH 1/6] ci: container: update to Debian Bookworm with GCC v14.2.0 Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 2/6] ci: container: add kvx-elf- toolchain Ahmad Fatoum
2024-08-12  9:29   ` Yann Sionneau
2024-08-12  9:15 ` [PATCH 3/6] ci: container: update to newer Labgrid Ahmad Fatoum
2024-08-12 12:52   ` Yann Sionneau
2024-08-12 13:30     ` Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 4/6] test: sandbox: support testing with Labgrid Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 5/6] ci: pytest: test sandbox configuration with labgrid Ahmad Fatoum
2024-08-12  9:15 ` [PATCH 6/6] ci: build: add kvx build test Ahmad Fatoum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox