From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: marex@denx.de, crwulff@gmail.com, qemu-devel@nongnu.org,
laurent@vivier.eu
Subject: Re: [PATCH 1/9] tests/docker: Add debian-nios2-cross image
Date: Tue, 12 Oct 2021 18:03:49 +0100 [thread overview]
Message-ID: <87h7dmw4kn.fsf@linaro.org> (raw)
In-Reply-To: <20211001153347.1736014-2-richard.henderson@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> Build the entire cross tool chain from source.
> For this reason, default to caching.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> tests/docker/Makefile.include | 19 ++++
> .../dockerfiles/debian-nios2-cross.docker | 34 +++++++
> .../build-toolchain.sh | 97 +++++++++++++++++++
> 3 files changed, 150 insertions(+)
> create mode 100644 tests/docker/dockerfiles/debian-nios2-cross.docker
> create mode 100755 tests/docker/dockerfiles/debian-nios2-cross.docker.d/build-toolchain.sh
>
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index ff5d732889..2ccd93caa4 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -168,10 +168,28 @@ docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.dock
> qemu/debian-hexagon-cross --add-current-user, \
> "PREPARE", "debian-hexagon-cross"))
We need^H^H^H^H (might need, see bellow) a separate patch with:
docker-image-debian10: NOUSER=1
to ensure the images we base our "handbuilt" compilers on don't include
a potentially clashing uid (which should only be added for local
builds).
> +docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-nios2-cross.docker
> + $(if $(NOCACHE), \
> + $(call quiet-command, \
> + $(DOCKER_SCRIPT) build -t qemu/debian-nios2-cross -f $< \
> + $(if $V,,--quiet) --no-cache \
> + --registry $(DOCKER_REGISTRY) --extra-files \
> + $(DOCKER_FILES_DIR)/debian-nios2-cross.docker.d/build-toolchain.sh, \
> + "BUILD", "debian-nios2-cross"), \
> + $(call quiet-command, \
> + $(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \
> + qemu/debian-nios2-cross $(DOCKER_REGISTRY), \
> + "FETCH", "debian-nios2-cross") \
> + $(call quiet-command, \
> + $(DOCKER_SCRIPT) update $(if $V,,--quiet) \
> + qemu/debian-nios2-cross --add-current-user, \
> + "PREPARE", "debian-nios2-cross"))
> +
Could we update the comment above to something like:
#
# The build rule for these cross compilers are special in so far for
# most of the time we don't want to build them. While dockers caching
# does avoid this most of the time sometimes we want to force the
# issue. Also we want to ensure the image they are based on hasn't
# been polluted with our UID because it will fail when users build
# their local version from what has been pushed upstream.
#
> # Specialist build images, sometimes very limited tools
> docker-image-debian-tricore-cross: docker-image-debian10
> docker-image-debian-all-test-cross: docker-image-debian10
> docker-image-debian-arm64-test-cross: docker-image-debian11
> +docker-image-debian-nios2-cross: docker-image-debian10
> docker-image-debian-powerpc-test-cross: docker-image-debian11
>
> # These images may be good enough for building tests but not for test builds
> @@ -180,6 +198,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross
> DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross
> DOCKER_PARTIAL_IMAGES += debian-hppa-cross
> DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross
> +DOCKER_PARTIAL_IMAGES += debian-nios2-cross
> DOCKER_PARTIAL_IMAGES += debian-riscv64-cross
> DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross
> DOCKER_PARTIAL_IMAGES += debian-tricore-cross
> diff --git a/tests/docker/dockerfiles/debian-nios2-cross.docker b/tests/docker/dockerfiles/debian-nios2-cross.docker
> new file mode 100644
> index 0000000000..208737fc5e
> --- /dev/null
> +++ b/tests/docker/dockerfiles/debian-nios2-cross.docker
> @@ -0,0 +1,34 @@
> +#
> +# Docker NIOS2 cross-compiler target
> +#
> +# This docker target is used for building tests. As it also needs to be
> +# able to build QEMU itself in CI we include it's build-deps. It is also
> +# a "stand-alone" image so as not to be triggered by re-builds on other
> +# base images given it takes a long time to build.
> +#
> +FROM qemu/debian10
> +
> +# Install build utilities for building gcc and glibc.
> +# ??? The build-dep isn't working, missing a number of
> +# minimal build dependiencies, e.g. libmpc.
> +
> +RUN apt update && \
> + DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
> + DEBIAN_FRONTEND=noninteractive eatmydata \
> + apt install -y --no-install-recommends \
> + bison \
> + flex \
> + gawk \
> + libmpc-dev \
> + libmpfr-dev \
> + rsync \
> + texinfo \
> + wget \
> + $(apt-get -s build-dep --arch-only gcc | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) \
> + $(apt-get -s build-dep --arch-only glibc | egrep ^Inst | fgrep '[all]' | cut -d\ -f2)
> +
> +ADD build-toolchain.sh /root/build-toolchain.sh
> +
> +RUN cd /root && ./build-toolchain.sh
We need to split this like in hexagon and have a second stage which does
a:
COPY --from=0 /usr/local /usr/local
This will limit the size of the final image (and also avoid duplicting
the UID in the hexagon build).
--
Alex Bennée
next prev parent reply other threads:[~2021-10-12 17:13 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 15:33 [PATCH 0/9] nios2: Enable cross compile and fix signals Richard Henderson
2021-10-01 15:33 ` [PATCH 1/9] tests/docker: Add debian-nios2-cross image Richard Henderson
2021-10-12 17:03 ` Alex Bennée [this message]
2021-10-12 18:24 ` Richard Henderson
2021-10-12 18:33 ` Alex Bennée
2021-10-14 9:34 ` Alex Bennée
2021-10-14 17:17 ` Richard Henderson
2021-10-14 17:25 ` Alex Bennée
2021-10-01 15:33 ` [PATCH 1/2] tests/docker: Remove fedora-i386-cross from DOCKER_PARTIAL_IMAGES Richard Henderson
2021-10-14 9:35 ` Alex Bennée
2021-10-01 15:33 ` [PATCH 2/9] linux-user/nios2: Properly emulate EXCP_TRAP Richard Henderson
2021-10-14 9:36 ` Alex Bennée
2021-10-01 15:33 ` [PATCH 2/2] tests/docker: Fix fedora-i386-cross Richard Henderson
2021-10-14 9:38 ` Alex Bennée
2021-10-01 15:33 ` [PATCH 3/9] linux-user/nios2: Fixes for signal frame setup Richard Henderson
2021-10-14 9:43 ` Alex Bennée
2021-10-01 15:33 ` [PATCH 4/9] linux-user/elfload: Rename ARM_COMMPAGE to HI_COMMPAGE Richard Henderson
2021-10-12 6:11 ` Laurent Vivier
2021-10-01 15:33 ` [PATCH 5/9] linux-user/nios2: Map a real kuser page Richard Henderson
2021-10-01 15:33 ` [PATCH 6/9] linux-user/nios2: Fix EA vs PC confusion Richard Henderson
2021-10-01 15:33 ` [PATCH 7/9] linux-user/nios2: Fix sigmask in setup_rt_frame Richard Henderson
2021-10-12 6:16 ` Laurent Vivier
2021-10-01 15:33 ` [PATCH 8/9] linux-user/nios2: Use set_sigmask in do_rt_sigreturn Richard Henderson
2021-10-12 6:29 ` Laurent Vivier
2021-10-01 15:33 ` [PATCH 9/9] tests/tcg: Enable container_cross_cc for nios2 Richard Henderson
2021-10-11 19:06 ` [PATCH 0/9] nios2: Enable cross compile and fix signals Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7dmw4kn.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=crwulff@gmail.com \
--cc=laurent@vivier.eu \
--cc=marex@denx.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).