qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] coverity: unify Fedora dockerfiles


From: Daniel P . Berrangé
Subject: Re: [PATCH] coverity: unify Fedora dockerfiles
Date: Tue, 18 Apr 2023 16:15:42 +0100
User-agent: Mutt/2.2.9 (2022-11-12)

On Fri, Mar 31, 2023 at 01:48:44PM -0400, Paolo Bonzini wrote:
> The Fedora CI and coverity runs are using a slightly different set of
> packages.  Copy most of the content over from tests/docker while
> keeping the commands at the end that unpack the tools.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  scripts/coverity-scan/coverity-scan.docker | 250 ++++++++++++---------
>  1 file changed, 145 insertions(+), 105 deletions(-)
> 
> diff --git a/scripts/coverity-scan/coverity-scan.docker 
> b/scripts/coverity-scan/coverity-scan.docker
> index 6f60a52d23..a349578526 100644
> --- a/scripts/coverity-scan/coverity-scan.docker
> +++ b/scripts/coverity-scan/coverity-scan.docker
> @@ -15,112 +15,152 @@
>  # The work of actually doing the build is handled by the
>  # run-coverity-scan script.

snip

> +               zstd && \
> +    nosync dnf autoremove -y && \
> +    nosync dnf clean all -y && \
> +    rpm -qa | sort > /packages.txt && \
> +    mkdir -p /usr/libexec/ccache-wrappers && \
> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \
> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \
> +    ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
> +
> +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"
> +ENV LANG "en_US.UTF-8"
> +ENV MAKE "/usr/bin/make"
> +ENV NINJA "/usr/bin/ninja"
> +ENV PYTHON "/usr/bin/python3"
> +ENV QEMU_CONFIGURE_OPTS --meson=internal
> +
> +RUN dnf install -y curl wget

Note this leaves the dnf cache since it doesn't remove 'clean all',
and thus bloats the container layer.

>  ENV COVERITY_TOOL_BASE=/coverity-tools
>  COPY coverity_tool.tgz coverity_tool.tgz
>  RUN mkdir -p /coverity-tools/coverity_tool && cd 
> /coverity-tools/coverity_tool && tar xf /coverity_tool.tgz

We could actually make this entire thing be generated by the
tests/lcitool/refresh script

Create  tests/lcitool/projects/coverity.yml with

--
packages:
  - curl
  - wget

And then pass *both*  'qemu' and 'coverity' as project names when
generating the container, so it'll create a dockerfile that installs
both sets of packages in one command.

The ENV/COPY/RUN commands can be put in the refersh script


coverity_extras = [
 "ENV COVERITY_TOOL_BASE=/coverity-tools"
 "COPY coverity_tool.tgz coverity_tool.tgz"
 "RUN mkdir -p /coverity-tools/coverity_tool && cd 
/coverity-tools/coverity_tool && tar xf /coverity_tool.tgz"
]

and adding  trailer="".join(coverity_extras)

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




reply via email to

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