Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Reduce build matrix size #292

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ jobs:
strategy:
fail-fast: false
matrix:
CC: [ gcc, clang ]
OS: [ "alpine:edge", "archlinux:base-devel" ]
xwayland: [ true, false ]
container: ${{ matrix.OS }}
env:
CC: ${{ matrix.CC }}
steps:
- name: Checkout Cage
uses: actions/checkout@v2

- name: Install dependencies (Alpine)
if: "matrix.OS == 'alpine:edge'"
run: apk add build-base xcb-util-wm-dev libseat-dev clang git eudev-dev mesa-dev libdrm-dev libinput-dev libxkbcommon-dev pixman-dev wayland-dev meson wayland-protocols xwayland scdoc-doc hwdata
run: apk add build-base xcb-util-wm-dev libseat-dev clang git eudev-dev mesa-dev libdrm-dev libinput-dev libxkbcommon-dev pixman-dev wayland-dev meson wayland-protocols xwayland-dev scdoc-doc hwdata

- name: Install dependencies (Arch)
if: "matrix.OS == 'archlinux:base-devel'"
Expand All @@ -32,13 +28,17 @@ jobs:
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc

- name: Fetch wlroots as a subproject
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.17.0

- name: Compile Cage
run: |
meson setup build -Dxwayland=enabled
ninja -C build

# TODO: use --fatal-meson-warnings when on wlroots 0.15.0
- name: Compile Cage (XWayland=${{ matrix.xwayland }})
- name: Compile cage (no xwayland)
run: |
meson build-${{ matrix.CC }}-${{matrix.xwayland }} -Dxwayland=${{ matrix.xwayland }}
ninja -C build-${{ matrix.CC }}-${{matrix.xwayland }}
meson configure build -Dxwayland=disabled
ninja -C build

format:
runs-on: ubuntu-latest
Expand All @@ -51,10 +51,10 @@ jobs:
pacman-key --init
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata
- name: Fetch wlroots as a subproject
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.17.0
- name: Check for formatting changes
run: |
meson build-clang-format -Dxwayland=true
meson build-clang-format -Dxwayland=enabled
ninja -C build-clang-format clang-format-check

scan-build:
Expand All @@ -70,8 +70,8 @@ jobs:
pacman-key --init
pacman -Syu --noconfirm xcb-util-wm seatd git clang meson libinput libdrm mesa libxkbcommon wayland wayland-protocols xorg-server-xwayland scdoc hwdata
- name: Fetch wlroots as a subproject
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.16.0
run: git clone https://gitlab.freedesktop.org/wlroots/wlroots.git subprojects/wlroots -b 0.17.0
- name: Run scan-build
run: |
meson build-scan-build -Dxwayland=true
meson build-scan-build -Dxwayland=enabled
ninja -C build-scan-build scan-build
8 changes: 4 additions & 4 deletions cage.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_presentation_time.h>
Expand Down Expand Up @@ -293,7 +293,7 @@ main(int argc, char *argv[])
struct wl_event_source *sigterm_source =
wl_event_loop_add_signal(event_loop, SIGTERM, handle_signal, &server.wl_display);

server.backend = wlr_backend_autocreate(server.wl_display);
server.backend = wlr_backend_autocreate(server.wl_display, &server.session);
if (!server.backend) {
wlr_log(WLR_ERROR, "Unable to create the wlroots backend");
ret = 1;
Expand Down Expand Up @@ -342,7 +342,7 @@ main(int argc, char *argv[])

wlr_scene_attach_output_layout(server.scene, server.output_layout);

struct wlr_compositor *compositor = wlr_compositor_create(server.wl_display, server.renderer);
struct wlr_compositor *compositor = wlr_compositor_create(server.wl_display, 6, server.renderer);
if (!compositor) {
wlr_log(WLR_ERROR, "Unable to create the wlroots compositor");
ret = 1;
Expand Down Expand Up @@ -374,7 +374,7 @@ main(int argc, char *argv[])
goto end;
}

server.idle = wlr_idle_create(server.wl_display);
server.idle = wlr_idle_notifier_v1_create(server.wl_display);
if (!server.idle) {
wlr_log(WLR_ERROR, "Unable to create the idle tracker");
ret = 1;
Expand Down
4 changes: 2 additions & 2 deletions idle_inhibit_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <stdlib.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle_notify_v1.h>

#include "idle_inhibit_v1.h"
#include "server.h"
Expand All @@ -32,7 +32,7 @@ idle_inhibit_v1_check_active(struct cg_server *server)
Hence, we simply check for any inhibitors and inhibit
accordingly. */
bool inhibited = !wl_list_empty(&server->inhibitors);
wlr_idle_set_enabled(server->idle, NULL, !inhibited);
wlr_idle_notifier_v1_set_inhibited(server->idle, inhibited);
}

static void
Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if is_freebsd
)
endif

wlroots = dependency('wlroots', version: '>= 0.16.0', fallback: ['wlroots', 'wlroots'])
wlroots = dependency('wlroots', version: '>= 0.17.0', fallback: ['wlroots', 'wlroots'])
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
wayland_server = dependency('wayland-server')
xkbcommon = dependency('xkbcommon')
Expand Down Expand Up @@ -64,9 +64,9 @@ server_protos = declare_dependency(
sources: server_protos_headers,
)

if get_option('xwayland')
if not get_option('xwayland').disabled()
wlroots_has_xwayland = wlroots.get_variable(pkgconfig: 'have_xwayland', internal: 'have_xwayland') == 'true'
if not wlroots_has_xwayland
if get_option('xwayland').enabled() and not wlroots_has_xwayland
error('Cannot build Cage with XWayland support: wlroots has been built without it')
endif
have_xwayland = true
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')
option('xwayland', type: 'boolean', value: false, description: 'Enable support for X11 applications')
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications')
30 changes: 6 additions & 24 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_damage.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_output_management_v1.h>
#include <wlr/types/wlr_scene.h>
Expand Down Expand Up @@ -71,24 +70,21 @@ update_output_manager_config(struct cg_server *server)
static inline void
output_layout_add_auto(struct cg_output *output)
{
wlr_output_layout_add_auto(output->server->output_layout, output->wlr_output);
output->scene_output = wlr_scene_get_scene_output(output->server->scene, output->wlr_output);
assert(output->scene_output != NULL);
wlr_output_layout_add_auto(output->server->output_layout, output->wlr_output);
}

static inline void
output_layout_add(struct cg_output *output, int32_t x, int32_t y)
{
wlr_output_layout_add(output->server->output_layout, output->wlr_output, x, y);
output->scene_output = wlr_scene_get_scene_output(output->server->scene, output->wlr_output);
assert(output->scene_output != NULL);
wlr_output_layout_add(output->server->output_layout, output->wlr_output, x, y);
}

static inline void
output_layout_remove(struct cg_output *output)
{
wlr_output_layout_remove(output->server->output_layout, output->wlr_output);
output->scene_output = NULL;
}

static void
Expand Down Expand Up @@ -173,7 +169,7 @@ handle_output_frame(struct wl_listener *listener, void *data)
return;
}

wlr_scene_output_commit(output->scene_output);
wlr_scene_output_commit(output->scene_output, NULL);

struct timespec now = {0};
clock_gettime(CLOCK_MONOTONIC, &now);
Expand All @@ -190,24 +186,11 @@ handle_output_commit(struct wl_listener *listener, void *data)
* - output layout change will also be called if needed to position the views
* - always update output manager configuration even if the output is now disabled */

if (event->committed & OUTPUT_CONFIG_UPDATED) {
if (event->state->committed & OUTPUT_CONFIG_UPDATED) {
update_output_manager_config(output->server);
}
}

static void
handle_output_mode(struct wl_listener *listener, void *data)
{
struct cg_output *output = wl_container_of(listener, output, mode);

if (!output->wlr_output->enabled) {
return;
}

view_position_all(output->server);
update_output_manager_config(output->server);
}

void
handle_output_layout_change(struct wl_listener *listener, void *data)
{
Expand Down Expand Up @@ -241,7 +224,6 @@ output_destroy(struct cg_output *output)

wl_list_remove(&output->destroy.link);
wl_list_remove(&output->commit.link);
wl_list_remove(&output->mode.link);
wl_list_remove(&output->frame.link);
wl_list_remove(&output->link);

Expand Down Expand Up @@ -290,13 +272,13 @@ handle_new_output(struct wl_listener *listener, void *data)

output->commit.notify = handle_output_commit;
wl_signal_add(&wlr_output->events.commit, &output->commit);
output->mode.notify = handle_output_mode;
wl_signal_add(&wlr_output->events.mode, &output->mode);
output->destroy.notify = handle_output_destroy;
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
output->frame.notify = handle_output_frame;
wl_signal_add(&wlr_output->events.frame, &output->frame);

output->scene_output = wlr_scene_output_create(server->scene, wlr_output);

if (!wl_list_empty(&wlr_output->modes)) {
/* Ensure the output is marked as enabled before trying to set mode */
wlr_output_enable(wlr_output, true);
Expand Down
2 changes: 0 additions & 2 deletions output.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <wayland-server-core.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_damage.h>

#include "server.h"
#include "view.h"
Expand All @@ -14,7 +13,6 @@ struct cg_output {
struct wlr_scene_output *scene_output;

struct wl_listener commit;
struct wl_listener mode;
struct wl_listener destroy;
struct wl_listener frame;

Expand Down
Loading
Loading