Repository navigation
02 building and installing compile polo
Polo is built with Meson and Ninja. Polo also fetch and compile a patched libweston 16.0.1 rather than the system's libweston. You can compile and run Polo from the build tree without installing it.
Install development packages for your distribution. See Build prerequisites for the full Fedora and Debian/Ubuntu package commands.
The project requires at least:
| Component | Minimum version |
|---|---|
| Meson | 1.4.0 |
Vala (valac) |
0.56 |
| GLib | 2.80 |
wayland-protocols |
1.46 |
The build also uses a C11-capable compiler, Ninja, Git, pkg-config, and wayland-scanner.
Configure the build directory:
meson setup buildCompile:
meson compile -C buildNinja normally recompiles only targets affected by the changes.
Use separate build directories when you need different compiler or feature settings. They can coexist in the same source checkout.
meson setup build-release --buildtype=release
meson compile -C build-releaseTo prepare a release build for system-wide installation under /usr:
meson setup build-install --prefix=/usr --buildtype=release \
-Dtests=false \
-Dtest-protocol=false \
-Ddebug-protocol=false \
-Ddebug-kill=false \
-Dfuzz=false
meson compile -C build-installThe test and development-only protocol options must remain disabled for release builds. See Install Polo for meson install, paths, and the display-manager session entry.
meson setup build-strict -Dstrict=true
meson compile -C build-strict
meson test -C build-strict --print-errorlogs-Dstrict=true enables C -Werror and Vala --fatal-warnings. Polo also checks several generated-C/VAPI type mismatches as fatal compilation errors even when strict mode is off.
meson setup build-asan \
-Db_sanitize=address,undefined \
-Db_lundef=false
meson compile -C build-asan
meson test -C build-asan --print-errorlogsKeep it in a separate directory from your normal build.
Many of Polo's protocol integration tests are registered only when the test-protocol option is enabled:
meson setup build-test -Dtest-protocol=true
meson compile -C build-test
meson test -C build-test --print-errorlogsDo not use this configuration for a release installation. The polo_test_v1 protocol is intended for tests, not normal user sessions.
The options below are defined in meson_options.txt:
| Option | Default | Purpose |
|---|---|---|
-Dxwayland=true |
true |
Build Polo's vendored XWayland window-manager integration (libpolo-xwm). |
-Dshell-ui=true |
true |
Build polo-shell-ui, the GTK helper for switcher, menus, dialogs, and on-screen displays. |
-Dtests=true |
true |
Build and register test suites. |
-Dsystemd=true |
true |
Enable systemd user integration. |
-Dstrict=true |
false |
Make C and Vala warnings fatal. |
-Dtest-protocol=true |
false |
Build the development-only polo_test_v1 protocol and its integration tests. |
-Ddebug-protocol=true |
false |
Expose the Weston debug protocol to trusted clients; not for releases. |
-Ddebug-kill=true |
false |
Build support for the development --debug-kill shortcut. |
-Dfuzz=true |
false |
Build libFuzzer protocol fuzzers; requires Clang and is not for releases. |
-Dxdg-desktop-portal-wlr=PATH |
Empty | Set the screen-sharing portal executable explicitly; otherwise Polo searches known locations. |
To inspect the options configured in an existing build:
meson configure buildTo change an option without creating another build directory:
meson configure build -Dstrict=true
meson compile -C buildYou can also reconfigure a build with meson setup build --reconfigure when needed.
Polo's subprojects/weston.wrap points to Weston 16.0.1 and lists Polo-specific patches in subprojects/packagefiles/weston/.
During setup, Meson prepares this subproject and builds a reduced libweston configuration with:
- DRM, Wayland, and headless backends;
- the OpenGL renderer;
- a private library/module directory;
- Polo's own XWayland window manager, rather than Weston's standalone XWayland integration.
Polo does not need the distribution's development package for libweston. The repository still requires the underlying system development libraries specified in Build prerequisites.
The installed private libweston libraries live under the configured libdir in a polo subdirectory. They are intentionally kept separate from the distribution's Weston installation.
Polo's meson.build declares a Meson development environment that sets WESTON_MODULE_MAP and paths to the build-tree executables, data, shell helper, and renderer/backend modules. Use meson devenv when invoking an uninstalled build.
meson devenv -C build polo \
--exec gtk3-demo \
--exec gtk3-widget-factoryThis starts a nested compositor in a window within the existing Wayland session.
meson devenv -C build polo \
--backend=headless \
--renderer=pixmanThis is useful for automated tests and investigations that do not need a physical display.
The parent Weston requires its own X11 backend; this is separate from the DRM/Wayland/headless backends built into Polo's private libweston.
weston --backend=x11 --shell=kiosk \
--width=1280 --height=800 --socket=polo-parent &
WAYLAND_DISPLAY=polo-parent \
meson devenv -C build polo --fullscreen --exec gtk3-demoLog in on an active Linux virtual console and run:
./start-polo.shThe launcher uses the repository's build directory by default, compiles it if necessary, and starts Polo in DRM session mode. To select another build directory:
POLO_BUILD=build-strict ./start-polo.shOr to use an already compiled build without rebuilding:
POLO_NO_BUILD=1 ./start-polo.shstart-polo.sh uses meson devenv if its chosen build directory exists, even when Polo has also been installed system-wide. It writes logs to ~/polo-logs/.
See Start a session for TTY, logind, DRM, and display-manager instructions.
Polo registers its automated tests through Meson. Some tests are available in any build with -Dtests=true; additional protocol tests require -Dtest-protocol=true.
# Full registered suite
meson test -C build-test --print-errorlogs
# VAPI coverage and C/Vala boundary checks
meson test -C build-test --suite vapi --print-errorlogs
# Session management and watchdog checks
meson test -C build-test --suite session --print-errorlogs
# Protocol integration tests
meson test -C build-test --suite protocol --print-errorlogs
# Formatting and Vala linting, when the tools are installed
meson test -C build-test --suite lint --print-errorlogsFor a specific named test, such as the watchdog:
meson test -C build-test watchdog --print-errorlogsThe lint suite only registers clang-format and vala-lint tests when the corresponding executables were available at configuration time. Test results can be inspected through Meson's testlog.txt in the build directory's meson-logs/ subdirectory.
Performance integration tests are also registered by the protocol test definitions when their build conditions are met. See the Testing Polo wiki section for test scope and performance budgets.
Check the package lists under Build prerequisites. The Meson setup summary lists optional runtime helpers separately; a warning about a missing screenshot or portal helper does not necessarily prevent compilation.
Verify the tool and library versions:
valac --version
meson --version
pkg-config --modversion glib-2.0
pkg-config --modversion wayland-protocolsPolo requires the minimum versions listed at the beginning of this page.
Inspect subprojects/weston.wrap, the Weston directory under subprojects/, and the error emitted during meson setup. The build depends on the specified Weston revision and Polo's patch queue. Do not replace it with an unpatched system libweston.
Inspect the current settings and explicitly reconfigure:
meson configure build
meson setup build --reconfigure
meson compile -C buildUse the Meson development environment instead of invoking the binary directly:
meson devenv -C build polo --backend=headless --renderer=pixmanThis supplies build-tree module paths, including WESTON_MODULE_MAP.
This is intentional in -Dstrict=true builds. Review the compiler output for the first error. The C/Vala boundary checks are designed to catch incompatible declarations early.
- Build prerequisites < You are here> Install Polo