diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index aac3081e2..16f32107b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -26,11 +26,23 @@ jobs: python-version: '3.9' - name: Install dependencies run: | - python -m pip install --upgrade meson PyYAML sudo apt update sudo apt install -y \ - doxygen libxcb-xkb-dev valgrind ninja-build \ - libwayland-dev wayland-protocols bison graphviz + doxygen libxcb-xkb-dev valgrind ninja-build meson \ + libwayland-dev wayland-protocols bison graphviz curl + python -m pip install --upgrade PyYAML + - name: Install xkeyboard-config + run: | + # HACK: Force xkeyboard-config version + pushd ~ + XKC_VER=2.39 + curl -O "https://www.x.org/releases/individual/data/xkeyboard-config/xkeyboard-config-$XKC_VER.tar.xz" + tar -xf "xkeyboard-config-$XKC_VER.tar.xz" + cd "xkeyboard-config-$XKC_VER" + BUILDDIR=build + meson setup $BUILDDIR -Dprefix=/usr + sudo meson install -C $BUILDDIR + popd - name: Setup run: | # -gdwarf-4 - see https://github.com/llvm/llvm-project/issues/56550. diff --git a/test/x11comp.c b/test/x11comp.c index 5fd064b36..f4ba7888a 100644 --- a/test/x11comp.c +++ b/test/x11comp.c @@ -56,7 +56,7 @@ main(void) pid_t xkbcomp_pid; char *xhost = NULL; - int xdpy_current; + int xdpy_current = 0; int xdpy_candidate; /* @@ -71,8 +71,9 @@ main(void) * 6. Kill the server & clean up. */ + // NOTE: it is OK if it fails. ret = xcb_parse_display(NULL, &xhost, &xdpy_current, NULL); - assert(ret != 0); + /* * IANA assigns TCP port numbers from 6000 through 6063 to X11 * clients. In addition, the current XCB implementaion shows @@ -85,7 +86,9 @@ main(void) if (xdpy_candidate == xdpy_current) { continue; } - snprintf(display, sizeof(display), "%s:%d", xhost, xdpy_candidate); + snprintf(display, sizeof(display), + "%s:%d", (xhost != NULL) ? xhost : "", + xdpy_candidate); ret = posix_spawnp(&xvfb_pid, "Xvfb", NULL, NULL, xvfb_argv, envp); if (ret == 0) { break;