All of lore.kernel.org
 help / color / mirror / Atom feed
* minimal "zero conf" build dockerfiles for fedora:latest and alpine:latest
@ 2021-01-12 22:37 John Snow
  2021-01-13  6:48 ` Thomas Huth
  2021-01-13  8:20 ` Paolo Bonzini
  0 siblings, 2 replies; 13+ messages in thread
From: John Snow @ 2021-01-12 22:37 UTC (permalink / raw)
  To: QEMU Developers
  Cc: Philippe Mathieu-Daudé, Alex Bennée, Paolo Bonzini

I wanted to know what the minimal setup required was to replicate the 
compilation instructions featured on https://www.qemu.org/download/#source

 > wget https://download.qemu.org/qemu-5.2.0.tar.xz
 > tar xvJf qemu-5.2.0.tar.xz
 > cd qemu-5.2.0
 > ./configure
 > make

For fedora:latest, I found that to be:

----

FROM fedora:latest

ENV PACKAGES \
       wget \
       xz \
       ninja-build \
       gcc \
       glib2-devel \
       pixman-devel \
       bzip2 \
       diffutils \
       perl

ENV QEMU_CONFIGURE_OPTS ""

RUN dnf install -y $PACKAGES && \
     rpm -q $PACKAGES | sort > /packages.txt

RUN wget https://download.qemu.org/qemu-5.2.0.tar.xz && \
     tar xvJf qemu-5.2.0.tar.xz

WORKDIR /qemu-5.2.0
RUN ./configure $QEMU_CONFIGURE_OPTS && \
     make -j9

----

Notes:

- our configure file suggests bzip2 is an optional dependency (It's set 
to 'auto') but meson will error out if it is not present at 
configuration time:

     ../pc-bios/meson.build:5:2: ERROR: Program 'bzip2' not found

- diffutils is required for the qapi-schema test, which runs at build time.

- early on in the build process, an error "bash: find: command not 
found" can be seen, but it doesn't seem to cause a failure otherwise.

- perl is not declared as a hard pre-requisite during configure time, 
but the build will error out if it is not present:

[254/8314] Generating texture-blit-frag.h with a meson_exe.py custom command
FAILED: ui/shader/texture-blit-frag.h
/usr/bin/python3 /qemu-5.2.0/meson/meson.py --internal exe --capture 
ui/shader/texture-blit-frag.h -- /usr/bin/env perl 
/qemu-5.2.0/scripts/shaderinclude.pl ../ui/shader/texture-blit.frag
/usr/bin/env: ‘perl’: No such file or directory



I wanted to try with alpine for the sake of a dependency audit. It isn't 
quite "zero conf", but I did get it working by disabling linux-user:

----

FROM alpine:latest

ENV PACKAGES \
     wget \
     xz \
     python3 \
     ninja \
     gcc \
     musl-dev \
     pkgconfig \
     glib-dev \
     pixman-dev \
     make \
     bash \
     perl

ENV QEMU_CONFIGURE_OPTS --disable-linux-user

RUN apk add $PACKAGES

RUN wget https://download.qemu.org/qemu-5.2.0.tar.xz && \
     tar xvJf qemu-5.2.0.tar.xz

WORKDIR /qemu-5.2.0
RUN ./configure $QEMU_CONFIGURE_OPTS && \
     make -j9

----

Notes:

- "ninja" actually installs "samurai", but it appears to work.

- musl seems to work alright, but does throw a ton of warnings. I didn't 
actually run any tests, since they require more dependencies.

- bash has to be installed explicitly. configure/meson do not check for 
it, but the build will fail if they aren't present.

- linux-user binaries can't be compiled because alpine's usage of musl; 
I didn't look much more closely.



Takeaways:

- You really don't need a lot to build a minimal QEMU. Even the alpine 
package list is pretty small.

- meson seems to be handling "absolutely everything is missing" 
environments pretty well.

- There are a scant handful of dependencies that could be added to 
configure, but you are very likely not to be missing them, so it's low 
priority.


--js



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

end of thread, other threads:[~2021-01-14 17:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-12 22:37 minimal "zero conf" build dockerfiles for fedora:latest and alpine:latest John Snow
2021-01-13  6:48 ` Thomas Huth
2021-01-13  8:26   ` Paolo Bonzini
2021-01-13 10:09     ` Gerd Hoffmann
2021-01-13 10:29       ` Philippe Mathieu-Daudé
2021-01-13 14:35         ` Paolo Bonzini
2021-01-13 18:31       ` John Snow
2021-01-14 11:10         ` Andrea Bolognani
2021-01-14 16:13           ` John Snow
2021-01-13 18:27   ` John Snow
2021-01-13  8:20 ` Paolo Bonzini
2021-01-13 18:44   ` John Snow
2021-01-14 16:51   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.