ci: add FreeBSD

In order to merge FreeBSD support patches, we want to have a working
CI, to make sure we don't regress FreeBSD. Several options were
considered to add FreeBSD CI.

The first one is to use an external CI service, such as
However, a GitLab bug [1] prevents third-party CI services from
properly integrating with merge requests. Additionally, we'd prefer not
to depend on a third-party service.

The second one is to use a cross-build file [2], ie. build FreeBSD
executables and libraries from a Linux host. However, it's impossible to
run tests with this setup. Additionally, the cross-build logic needs to
be maintained and is a different environment from a real FreeBSD system.

The third one, and the approach used here, is to run the build and tests
in a FreeBSD VM under qemu. While this is a little bit slower, KVM should
allow us to get reasonable performance, and FreeBSD can be a first-class
citizen. FreeBSD provides an official pre-configured image for CI, so the
maintenance burden isn't too high. SSH is used to provide a reliable way
to interact with the guest.

The container-prep step downloads the image, extracts it, converts it into
the compressed QCOW2 format to save disk space, then fires up the VM and
installs the packages required by Wayland in the VM.

The new build-freebsd step copies the Wayland source to the VM via scp,
then builds Wayland and run tests in the VM.


Signed-off-by: Simon Ser <>
References: wayland/wayland#72
4 jobs for freebsd-ci in 3 minutes and 24 seconds (queued for 1 second)
Status Job ID Name Coverage
passed #10519166


passed #10519167


failed #10519169
kvm allowed to fail


passed #10519168


Name Stage Failure
build-freebsd Build
A full log can be found at /root/wayland/build/meson-logs/meson-log.txt
+ cleanup
+ [ -e /tmp/ ]
+ cat /tmp/
+ kill 10
+ rm -f /tmp/
qemu-system-x86_64: terminating on signal 15 from pid 9 (sh)
Cleaning up file based variables
ERROR: Job failed: exit code 1