diff --git a/AGENTS.template.md b/AGENTS.template.md index 85a92b7..a78394f 100644 --- a/AGENTS.template.md +++ b/AGENTS.template.md @@ -215,6 +215,7 @@ Local builds are two scripts in `project.cpp`. Run them with the native binary: - `RunCommandWithTimeout` runs its command under `timeout`, which can only start programs, so a shell builtin such as `command -v` fails there wherever no program of that name is on PATH, as on Arch and in the Sdk: a probe built on it reports the tool missing, and whatever it guards is skipped without a word. Probe through `RunCommandChecked`, which goes through `sh`, or `std::system` in a test. - A std module source only compiles against the headers of its own libc++ release, and a sysroot does not always ship one (Alpine). The Flatpak therefore carries the sources of the release next to the bundled one under `share/crafter-build/libc++-modules//`, one `libcxx--modules` manifest module each. When the bundled LLVM is bumped, keep the release it leaves behind as such a module: sysroots on the stable distro stay on it for months. The native loop has no such directory; stage one by hand under `share/crafter-build/` to test against a foreign sysroot. - The Flatpak carries the debugging tools for what it builds, because those programs run in its sandbox: lldb is a project of the `llvm` module, with `LLDB_ENABLE_PYTHON`, `LIBEDIT`, `CURSES`, `LIBXML2` and `LZMA` set ON so that a missing dependency fails the configure step (SWIG through Python, which needs it), and the `swig` and `libedit` modules come before it. The Khronos validation layer is the `vulkan-validation-layers` module plus four modules before it, build-only except for SPIRV-Tools' programs (`spirv-val` and the rest), all after the LLVM and WASI modules, so that bumping them reuses the cached LLVM and WASI builds. The layer follows the Sdk's Vulkan loader: when `runtime-version` moves to a runtime with a newer loader, move the layer to the Vulkan SDK release of that loader and take the other four revisions from that release's `scripts/known_good.json`. +- The Flatpak carries weston for the tests that set `Test::wayland`: the `libevdev`, `libinput`, `libdisplay-info` and `weston` modules, just before `crafter-build`, so that bumping them rebuilds only them and crafter-build. weston's frontend links the first three whatever the backend, so they ship. weston is configured with its headless backend, its GL renderer and its desktop shell, and with none of its other backends or shells and no Vulkan renderer. libinput is a `git` source pinned by commit, since its 1.32.0 release has no tarball attached. `tests/HeadlessCompositor` stands in a fake compositor, so the suite needs no weston: only a project's own tests that set `Test::wayland` run the real one. - The wasm compile flags live in one place, `WasmBaselineFlags` in `Crafter.Build-Clang.cppm`: the std module and every unit have to agree on them, and `VariantId()` and the std PCM directory hash them, so a change rebuilds instead of mixing old and new BMIs. They enable C++ exceptions, so the link takes the exception-enabled libc++ and libunwind from the sysroot's `lib//eh/` (wasi-sdk 33 and later). The Flatpak's sysroot has them and a distro's may not; where they are missing the wasm tests skip, so run those through the Flatpak. A browser page checks the engine with the `WasmBaselineProbes` named in `variants.json`. - `WasiBrowserRuntimeExit` runs `wasi-runtime/runtime.js` under node and skips where there is none. The Flatpak has no node, so CI never runs it: after touching `runtime.js`, run the suite in the native loop with node on `PATH`. - `CudaCompile` builds with a real CUDA toolkit whose `lib64` beside `bin/nvcc` holds `libcudart_static.a`, and skips everywhere else, and nothing in CI installs one: after touching how `cfg.cuda` is compiled, or how the CUDA runtime is linked and handed on through `BuildResult::runtimeLibs`, run it in the native loop on a machine with such a toolkit, as Arch's `/opt/cuda` is. Where nvcc is looked for, `/run/host` and its links included, is `ToolchainResolve`'s to check, on staged directories, so that one runs everywhere, and so is whether the `lib64` beside it holds the static runtime. `CudaMissing` checks what a build with a `.cu` says when no nvcc is found, and needs no toolkit either. diff --git a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml index 6915b89..d3086ad 100644 --- a/packaging/flatpak/net.catcrafts.CrafterBuild.yaml +++ b/packaging/flatpak/net.catcrafts.CrafterBuild.yaml @@ -378,6 +378,114 @@ modules: url: https://github.com/KhronosGroup/Vulkan-ValidationLayers/archive/refs/tags/vulkan-sdk-1.4.357.0.tar.gz sha256: 73180b11992a3554e97ebc18e6bf2b45ff9790ded9d87fc526c7bab865d1303f + # weston on its headless backend, the compositor `crafter-build test` starts + # for each test that sets Test::wayland (README, "Tests that open windows"): + # built with the headless backend, the GL renderer, which imports the + # dmabufs a GPU's Vulkan driver presents, and the desktop shell, and with + # none of its other backends or shells and no Vulkan renderer. weston's frontend + # links libinput, libevdev and libdisplay-info whatever the backend, and the + # Sdk has none of them, so they come first; the headless backend never opens + # an input device, so libinput ships without its quirks, udev helpers and + # tools. + - name: libevdev + buildsystem: meson + config-opts: + - -Dtests=disabled + - -Dtools=disabled + - -Ddocumentation=disabled + cleanup: + - /include + - /lib/pkgconfig + sources: + - type: archive + url: https://www.freedesktop.org/software/libevdev/libevdev-1.14.0.tar.xz + sha256: 5a0966c7110648665983848bad696c7acba614a2160d2865d535397101007332 + + - name: libinput + buildsystem: meson + config-opts: + - -Dlibwacom=false + - -Dmtdev=false + - -Ddebug-gui=false + - -Dtests=false + - -Ddocumentation=false + - -Dlua-plugins=disabled + - -Dudev-dir=/app/lib/udev + - -Dzshcompletiondir=no + cleanup: + - /bin + - /include + - /lib/pkgconfig + - /lib/udev + - /libexec + - /share/libinput + sources: + # libinput publishes no release tarball, only the tag. + - type: git + url: https://gitlab.freedesktop.org/libinput/libinput.git + tag: 1.32.0 + commit: 5cf833b572f5a33663888da321dce0ba1abd82a2 + + - name: libdisplay-info + buildsystem: meson + cleanup: + - /bin + - /include + - /lib/pkgconfig + sources: + - type: archive + url: https://gitlab.freedesktop.org/emersion/libdisplay-info/-/releases/0.4.0/downloads/libdisplay-info-0.4.0.tar.xz + sha256: 43b180baa143e2035654759d84e2b2f5ee77d5fe817c423838c7fe59c0d68459 + + - name: weston + buildsystem: meson + config-opts: + # The modules above, never a subproject meson would download. + - --wrap-mode=nodownload + - -Dbackend-drm=false + - -Dbackend-headless=true + - -Dbackend-pipewire=false + - -Dbackend-rdp=false + - -Dbackend-vnc=false + - -Dbackend-wayland=false + - -Dbackend-x11=false + - -Dbackend-default=headless + - -Drenderer-gl=true + - -Drenderer-vulkan=false + - -Dxwayland=false + - -Dsystemd=false + - -Ddeprecated-remoting=false + - -Ddeprecated-pipewire=false + - -Dshell-desktop=true + - -Dshell-ivi=false + - -Dshell-kiosk=false + - -Dshell-lua=false + - -Dcolor-management-lcms=false + - -Dimage-jpeg=false + - -Dimage-webp=false + - -Dtools=[] + - -Ddemo-clients=false + - -Dsimple-clients=[] + - -Dtests=false + - -Ddoc=false + - -Dperfetto=false + cleanup: + - /bin/weston-screenshooter + - /include + - /lib/pkgconfig + - /share/libweston-16 + - /share/man + - /share/pkgconfig + - /share/wayland-sessions + post-install: + - weston --version + - test -f /app/lib/libweston-16/headless-backend.so + - test -f /app/lib/libweston-16/gl-renderer.so + sources: + - type: archive + url: https://gitlab.freedesktop.org/wayland/weston/-/releases/16.0.2/downloads/weston-16.0.2.tar.xz + sha256: 49dd87d18cb229384264d2f69cb5a51f14f61a111e9227bfedb91b3ca8c39643 + - name: crafter-build buildsystem: simple build-options: