Commit Graph

85 Commits

Author SHA1 Message Date
Daniel Stone ec1ce9fc26 ci: Add clang build jobs
Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone 7c8b15256f ci: Work around PipeWire build warning with Clang
When building with Clang, PipeWire throws a warning we should trivially
work around:
    https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/858

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 18:42:25 +01:00
Daniel Stone 3530c522f8 CI: Add full AArch64 KVM support
Build a kernel for AArch64 and run it under virtme just like we do for
x86-64.

This requires adding support for the AArch64 defconfig variant, and
accommodating for the fact that it builds DRM as a module by default
rather than built in. The virtme branch we are using has also been
rebased on top of newer virtme upstream which unbreaks AArch64.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone daaa518b0e CI: Add initial AArch64 support
This only runs a single build job, to build without GL and not run any
tests, as KVM support is not yet included.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 20bb260f7d CI: Parameterise kernel build a bit more
AArch64 needs different names and paths to x86-64, so let's allow for
that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone d28aa36563 CI: Use Meson to build Wayland
autotools has already been removed, so we should be doing this.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone ca08c495ad ci: Bump Meson to 0.57.1
0.57.0 has a bug where the whole test harness crashes when using TAP and
failing tests, cf. https://github.com/mesonbuild/meson/pull/8385

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 50c83bf6c8 CI: Split OS-independent section from debian-install.sh
When we build our base-OS container, we run debian-install.sh to install
packages and compile our build dependencies. Since the latter is mostly
OS-independent, split debian-install.sh into two scripts: one to install
and cleanup packages, and another just to compile stuff.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 2cf3730f4f CI: Consolidate kernel/Mesa dependency installation
This makes it easier to split our scripts into OS-independent and
OS-dependent sections.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone ebca36da66 CI: Document the build and container process
Explain what we do within our CI and why, with links as required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone 29c1087b7b CI: Don't rebuild when running tests
Just cosmetic for now, but tell Meson to just run our tests rather than
trying to rebuild them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone dd6e88dc5c CI: Build wayland-protocols in container
Keep this as part of our container image; there's no reason to pull it
for every single build.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
Daniel Stone d98e3dadd4 CI: Use appropriate parallelism for container builds
The shared runners export ${FDO_CI_CONCURRENT} for the appropriate
number of CPUs we should use during our builds.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-08-03 11:13:23 +00:00
James Hilliard d6dcd9bcd9 Update gitlab-ci pipewire to version 0.3.31
Updating PipeWire to the latest version lets us check that everything
still works well, and shows users that they are able to use it.

[daniels: Updated to 0.3.31, use symbolic ref tags rather than SHAs.
          0.3.32 is released, but doesn't build in our Debian
          environment; this is fixed upstream but there is no release
	  for it yet.]

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2021-07-31 15:49:09 +00:00
Pekka Paalanen 6ae243f91e Add leak sanitizer suppressions
ASan will detect leaks also outside of the code we build, and sometimes
that external code leaks and we cannot work around it. Then we need to
suppress the leak reports to make our own ASan testing succeed. This
commit only introduces the suppressions file, making use of it CI is for
another time. This file is useful for manual targeted testing as below.

Start by suppressing two functions what weston-keyboard client ends up
calling, suppressing leak reports like these:

Indirect leak of 96 byte(s) in 3 object(s) allocated from:
    #0 0x7fc109c3d518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7fc109083d18  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d18)
    #2 0x7fc1090849a7 in FcPatternDuplicate (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x219a7)
    #3 0x7fc109adf93e  (/lib/x86_64-linux-gnu/libcairo.so.2+0xbb93e)
    #4 0x7fc109adfc8d  (/lib/x86_64-linux-gnu/libcairo.so.2+0xbbc8d)
    #5 0x7fc109aa02e7 in cairo_toy_font_face_create (/lib/x86_64-linux-gnu/libcairo.so.2+0x7c2e7)
    #6 0x7fc109aa856c in cairo_select_font_face (/lib/x86_64-linux-gnu/libcairo.so.2+0x8456c)
    #7 0x5603cb49a06a in redraw_handler ../../git/weston/clients/keyboard.c:378
    #8 0x5603cb4b506b in widget_redraw ../../git/weston/clients/window.c:4520
    #9 0x5603cb4b55da in surface_redraw ../../git/weston/clients/window.c:4578
    #10 0x5603cb4b5750 in idle_redraw ../../git/weston/clients/window.c:4607
    #11 0x5603cb4bebe3 in display_run ../../git/weston/clients/window.c:6525
    #12 0x5603cb49e55d in main ../../git/weston/clients/keyboard.c:1054
    #13 0x7fc1092a709a in __libc_start_main ../csu/libc-start.c:308
    #14 0x5603cb499019 in _start (/home/pq/build/weston-meson/clients/weston-keyboard+0x19019)

Indirect leak of 528 byte(s) in 51 object(s) allocated from:
    #0 0x7fc109b8e810 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x7fc109082fc4 in FcValueSave (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x1ffc4)
    #2 0x7fc109083d2e  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x20d2e)
    #3 0x7fc1090852c7  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x222c7)
    #4 0x7fc10908c28b  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2928b)
    #5 0x7fc108603a15  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba15)
    #6 0x7fc1086044bb  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4bb)
    #7 0x7fc108601f8a  (/lib/x86_64-linux-gnu/libexpat.so.1+0x9f8a)
    #8 0x7fc108602e7a  (/lib/x86_64-linux-gnu/libexpat.so.1+0xae7a)
    #9 0x7fc108606a37 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xea37)
    #10 0x7fc10908a0fa  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x270fa)
    #11 0x7fc10908a519  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27519)
    #12 0x7fc10908a73a  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2773a)
    #13 0x7fc10908b48f  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x2848f)
    #14 0x7fc108603a15  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba15)
    #15 0x7fc1086044bb  (/lib/x86_64-linux-gnu/libexpat.so.1+0xc4bb)
    #16 0x7fc108601f8a  (/lib/x86_64-linux-gnu/libexpat.so.1+0x9f8a)
    #17 0x7fc108602e7a  (/lib/x86_64-linux-gnu/libexpat.so.1+0xae7a)
    #18 0x7fc108606a37 in XML_ParseBuffer (/lib/x86_64-linux-gnu/libexpat.so.1+0xea37)
    #19 0x7fc10908a0fa  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x270fa)
    #20 0x7fc10908a519  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x27519)
    #21 0x7fc10907c4b3  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x194b3)
    #22 0x7fc10907c715  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0x19715)
    #23 0x7fc10906e8e6  (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xb8e6)
    #24 0x7fc109070928 in FcConfigSubstituteWithPat (/lib/x86_64-linux-gnu/libfontconfig.so.1+0xd928)
    #25 0x7fc109ae2d6b  (/lib/x86_64-linux-gnu/libcairo.so.2+0xbed6b)
    #26 0x7fc109a8aba2 in cairo_scaled_font_create (/lib/x86_64-linux-gnu/libcairo.so.2+0x66ba2)
    #27 0x7fc109a50d1d  (/lib/x86_64-linux-gnu/libcairo.so.2+0x2cd1d)
    #28 0x7fc109a53be0  (/lib/x86_64-linux-gnu/libcairo.so.2+0x2fbe0)
    #29 0x7fc109a4c1df  (/lib/x86_64-linux-gnu/libcairo.so.2+0x281df)
    #30 0x7fc109aa8dab in cairo_text_extents (/lib/x86_64-linux-gnu/libcairo.so.2+0x84dab)
    #31 0x5603cb499af3 in draw_key ../../git/weston/clients/keyboard.c:329
    #32 0x5603cb49a30c in redraw_handler ../../git/weston/clients/keyboard.c:392
    #33 0x5603cb4b506b in widget_redraw ../../git/weston/clients/window.c:4520
    #34 0x5603cb4b55da in surface_redraw ../../git/weston/clients/window.c:4578
    #35 0x5603cb4b5750 in idle_redraw ../../git/weston/clients/window.c:4607
    #36 0x5603cb4bebe3 in display_run ../../git/weston/clients/window.c:6525
    #37 0x5603cb49e55d in main ../../git/weston/clients/keyboard.c:1054
    #38 0x7fc1092a709a in __libc_start_main ../csu/libc-start.c:308
    #39 0x5603cb499019 in _start (/home/pq/build/weston-meson/clients/weston-keyboard+0x19019)

With the command line

	ASAN_OPTIONS=fast_unwind_on_malloc=0,malloc_context_size=50 \
	LSAN_OPTIONS=suppressions=/home/pq/git/weston/.gitlab-ci/leak-sanitizer.supp \
	./tests/test-viewporter test_viewporter_double_create

Suppressions used:
  count      bytes template
      5        357 cairo_select_font_face
    130       9104 cairo_text_extents

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-05-31 12:35:01 +03:00
Daniel Stone e649c12316 CI: Use larger timeout multiplier for ASan tests
Running under ASan introduces a good amount of overhead. Using the Meson
test wrapper rather than invoking a Ninja target lets us set a timeout
multiplier, which we smash up pretty high to account for this overhead
and prevent some of the larger tests from hitting timeout.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2021-05-17 12:27:03 +01:00
Pekka Paalanen 5de3b047b7 CI: use address sanitizer without leak checks
Use address sanitizer to catch use-after-free and other errors when
running the test suite.

Leak detection is disabled, because currently there are too many leaks,
making almost all tests fail otherwise.

The atexit=1 is for verifying that ASan was actually used.

The default 128 MB of RAM in the qemu machine leads to oom-killer
killing most tests, so bump the memory size to 1 GB.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-05-12 14:23:21 +03:00
Kenny Levinsen 2995f77bd0 ci: Test using seatd instead of direct launcher
While the commonly used Weston launchers are weston-launch and launcher-logind,
the direct backend was used in CI out of convenience, and due to logind being a
bit cumbersome to get to work in a CI environment.

The new libseat launcher can be used with seatd as well as logind. seatd is easy
to start in a CI environment, allowing us to test the libseat launcher codepath
instead of the less user relevant direct launcher.

This also prepares us for the future intended removal of non-libseat launchers.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
2021-04-27 13:38:31 +00:00
Kenny Levinsen 0db9176cbd ci: Build with libseat enabled
This installs libseat in the debian image build from source in order to enable,
build and test weston with libseat support.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
2021-04-15 22:35:48 +02:00
Pekka Paalanen e72119f1ee CI: add test coverage results
This runs the coverage tools to produce HTML pages listing the code lines /
functions / branches hit/totalled by the test suite.

Nowadays Gitlab has some Cobertura support itself:
https://docs.gitlab.com/ee/user/project/merge_requests/test_coverage_visualization.html

lcov is needed for the HTML report, gcovr is needed for the Cobertura
report. 'ninja clean' must be removed, otherwise it deletes the coverage
files before they are analysed.

Seeing the test suite code coverage is really interesting. It can guide
designing tests. If Gitlab MRs show the coverage in diff view, it shows
if new code actually gets executed in CI.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-03-08 15:55:14 +02:00
Pekka Paalanen 30104bd89a gl-renderer: support XYUV8888 wl_shm format
This support is added so that the XYUV shader variant can be tested with
wl_shm from the test suite.

Libwayland version requirement is bumped to get WL_SHM_FORMAT_XYUV8888.
Libwayland is bumped to 1.18 too in the CI image. libwayland-dev package
is dropped, because we build wayland anyway.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 14:36:24 +02:00
Pekka Paalanen a3b68c29f9 CI: bump Mesa to 20.3.1
The version we used does not advertise GL_EXT_color_buffer_half_float
with llvmpipe even though the functionality seems to work.

If the extension is not advertised, the future commit
"tests: extend output-damage to GL shadow framebuffer"
will result in a test failure.

Upgrade Mesa, this gets the extension advertised and the test is happy.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-25 13:20:15 +02:00
Pekka Paalanen bcf37c937a CI: expose test results as junit
This allows Gitlab to show a detailed test report in a human friendly
manner on a merge request page.

The junit output depends on Meson 0.55, but Meson in CI is bumped to the
latest release on Feb 15th. It is beneficial to use the newest
possible Meson in CI even if we do not require it, so that we benefit
from fixes, e.g. new warnings about accidentally using more recent
Meson features than our minimum Meson version supports.

Meson 0.57 is required for proper test names in the Gitlab report after
switching the tests to TAP. See:
https://github.com/mesonbuild/meson/issues/8316

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2021-02-15 11:16:15 +02:00
David Fort e3f447eee8 rdp-backend: require FreeRDP >= 2.2 to remove all the version hacks
The stable FreeRDP 2.x branch has been released, so let's rely on that maintained
version and drop all the hacks for older versions. That makes the code and build
cleaner.

Signed-off-by: David Fort <contact@hardening-consulting.com>
2020-10-01 18:15:42 +02:00
James Hilliard 80b585f8d2 pipewire: add support for 0.3 API
Fixes: #369

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-09-04 10:39:15 +00:00
Leandro Ribeiro a12ba0b30a gitlab CI: add support for DRM-backend tests
In order to run DRM-backend tests, a DRM-device is needed. As we
do not necessarily have control of the hardware that is going to
run our tests in GitLab CI, DRM-backend tests were being skipped.
This patch add support to run the tests using VKMS (virtual KMS).
To achieve this, virtualization is needed, as we need to run a
custom kernel during the CI job. We've decided to go with virtme,
as it is simpler to setup and works good for our use case.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-25 10:17:31 +00:00
Pekka Paalanen 8bd46c75f9 CI: build a Mesa shapshot for getImage/putImage on pbuffer swrast
c7617d8908
is necessary for running GL-renderer with llvmpipe in Gitlab CI.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-02-18 15:24:38 +02:00
Pekka Paalanen aaf8bfc0d3 gitlab-ci: install xwayland
The reason the Xwayland test skips is that Xwayland was not installed. We
should exercise Xwayland as well in CI, so install it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-12-13 11:37:40 +02:00
Pekka Paalanen 2db20b1027 gitlab-ci: wrap and alphabetize apt-get line
This line is far too long, it makes it really had to see in a diff what
changed. Wrap it into multiple lines and sort them alphabetically. If a piece
of it changes in the future, it will be easy to see in a diff.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-12-13 11:34:38 +02:00
Pekka Paalanen 44c39d06b2 gitlab-ci: image build should fail on failed commands
Ensure that no command in the script fails silently. If any command fails, the
image is likely broken.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-12-12 14:08:33 +02:00
Sebastian Wick a3cf7c6e7f CI: build wayland from source
The next commit bumps the required Wayland version beyond what the repo
version supports.

Build wayland 1.17 into the docker image.

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
2019-11-04 15:08:42 +01:00
Michael Olbrich d5d5aa91a2 Add pipewire plugin
It is quite similar to the remoting plugin. It just exports the frames via
pipewire instead of the builtin GStreamer pipeline.
It implements the same virtual output API. Virtual outputs can be created
by adding 'pipewire-output' sections to weston.ini.

The generated frames can be accessed with any pipewire client. e.g. with
GStreamer:

gst-launch-1.0 pipewiresrc ! video/x-raw,format=BGRx ! ...

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2019-07-19 08:01:55 +02:00
Michael Olbrich 8a171adca6 gitlab-ci: switch to buster
This is needed for pipewire.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2019-07-19 03:58:57 +00:00
Marius Vlad 08e1d42a36 gitlab-ci: Install doxygen/sphinx/breathe and enable building documentation
Pinned down sphinx to 2.1.0 and breathe to 4.13.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Benjamin Tissoires f6d2760627 CI: containerize the CI
Reuse the templates from wayland/ci-templates:
whenever DEBIAN_TAG is changed, this will rebuild a new container.

This adds two things:
- better reliability (we do not randomly pull packages whenever the CI
  runs and we can reproduce with this particular environment)
- faster builds, as we do not need to pull the universe at each run

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
[Pekka: bump DEBIAN_TAG]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-03-28 09:59:03 +00:00