qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 04/18] tests/docker: update debian-arm64-cross with lci-t


From: Alex Bennée
Subject: Re: [PATCH v2 04/18] tests/docker: update debian-arm64-cross with lci-tool
Date: Mon, 28 Feb 2022 14:39:17 +0000
User-agent: mu4e 1.7.9; emacs 28.0.91

Daniel P. Berrangé <berrange@redhat.com> writes:

> $SUBJECT  =~ s/lci-tool/lcitool/
>
> On Fri, Feb 25, 2022 at 05:20:07PM +0000, Alex Bennée wrote:
>> Using lci-tool update debian-arm64-cross to a Debian 11 based system.
>
> Likewise
>
>> As a result we can drop debian-arm64-test-cross just for building
>> tests.
>> 
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Message-Id: <20220211160309.335014-5-alex.bennee@linaro.org>
>> ---
>>  .gitlab-ci.d/container-cross.yml              |  10 +-
>>  tests/docker/Makefile.include                 |   3 -
>>  .../dockerfiles/debian-arm64-cross.docker     | 186 +++++++++++++++---
>>  .../debian-arm64-test-cross.docker            |  13 --
>>  tests/lcitool/refresh                         |  11 ++
>>  tests/tcg/configure.sh                        |   2 +-
>>  6 files changed, 173 insertions(+), 52 deletions(-)
>>  delete mode 100644 tests/docker/dockerfiles/debian-arm64-test-cross.docker
>> 
>
>
>
>> +RUN export DEBIAN_FRONTEND=noninteractive && \
>> +    apt-get update && \
>> +    apt-get install -y eatmydata && \
>> +    eatmydata apt-get dist-upgrade -y && \
>> +    eatmydata apt-get install --no-install-recommends -y \
>> +            bash \
>
>     ...snip native packages...
>
>> +            texinfo && \
>> +    eatmydata apt-get autoremove -y && \
>> +    eatmydata apt-get autoclean -y && \
>> +    sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
>> +    dpkg-reconfigure locales
>>  
>> -RUN apt update && \
>> -    DEBIAN_FRONTEND=noninteractive eatmydata \
>> -    apt install -y --no-install-recommends \
>> -        libbz2-dev:arm64 \
>> -        liblzo2-dev:arm64 \
>> -        librdmacm-dev:arm64 \
>> -        libsnappy-dev:arm64 \
>> -        libxen-dev:arm64
>> +ENV LANG "en_US.UTF-8"
>> +ENV MAKE "/usr/bin/make"
>> +ENV NINJA "/usr/bin/ninja"
>> +ENV PYTHON "/usr/bin/python3"
>> +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
>>  
>> -# nettle
>> -ENV QEMU_CONFIGURE_OPTS $QEMU_CONFIGURE_OPTS --enable-nettle
>> +RUN export DEBIAN_FRONTEND=noninteractive && \
>> +    dpkg --add-architecture arm64 && \
>> +    eatmydata apt-get update && \
>> +    eatmydata apt-get dist-upgrade -y && \
>> +    eatmydata apt-get install --no-install-recommends -y dpkg-dev && \
>> +    eatmydata apt-get install --no-install-recommends -y \
>> +            g++-aarch64-linux-gnu \
>
>   ...snip cross packages...
>
>> +            zlib1g-dev:arm64 && \
>> +    eatmydata apt-get autoremove -y && \
>> +    eatmydata apt-get autoclean -y && \
>> +    mkdir -p /usr/local/share/meson/cross && \
>> +    echo "[binaries]\n\
>> +c = '/usr/bin/aarch64-linux-gnu-gcc'\n\
>> +ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'\n\
>> +strip = '/usr/bin/aarch64-linux-gnu-strip'\n\
>> +pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'\n\
>> +\n\
>> +[host_machine]\n\
>> +system = 'linux'\n\
>> +cpu_family = 'aarch64'\n\
>> +cpu = 'aarch64'\n\
>> +endian = 'little'" > /usr/local/share/meson/cross/aarch64-linux-gnu && \
>> +    dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' 
>> --show > /packages.txt && \
>> +    mkdir -p /usr/libexec/ccache-wrappers && \
>> +    ln -s /usr/bin/ccache 
>> /usr/libexec/ccache-wrappers/aarch64-linux-gnu-c++ && \
>> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-cc 
>> && \
>> +    ln -s /usr/bin/ccache 
>> /usr/libexec/ccache-wrappers/aarch64-linux-gnu-g++ && \
>> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/aarch64-linux-gnu-gcc
>> +
>> +ENV ABI "aarch64-linux-gnu"
>> +ENV MESON_OPTS "--cross-file=aarch64-linux-gnu"
>> +ENV QEMU_CONFIGURE_OPTS --cross-prefix=aarch64-linux-gnu-
>> +ENV DEF_TARGET_LIST aarch64-softmmu,aarch64-linux-user
>
> This cross dockerfile is a fully self-contained image.
>
> Traditionally QEMU has had a split image for Debian cross targets,
> where there is a base with common native packages, and then a
> layer for the cross packages.
>
> lcitool is capable of generating the image in this split format
> using the arg
>
>    --layers {all,native,foreign}
>
> Personally I think it is simpler to just use the fully self
> contained image, as it would simplify our gitlab pipeline
> to only need 1 build stage for containers.  The cost is that
> we'll not be sharing layers for native packages and more wall
> clock time building since we're installing the same native
> packages over & over.
>
> I'm not saying to change your patch, I just wanted to point
> out the possibility in case someone cares strongly about
> keeping a split layer model for cross containers.

My thinking on our layered approach has evolved over the years. One of
the problems is when the two layers get out of sync and you run into
build issues due to different states of cached layers.

I think now for full cross-builds I'm fine with just going for the full
single recipe. For cross-test building there may be more argument for
having a base layer (although in the end we also ended up with
all-test-cross because we can't have containers running containers in
GitLab).

>
> Regards,
> Daniel


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]