# The guest programs the session checks need, packaged with the interpreters # they actually require. # # Separate from `test-tools.nix` because these need things that one does not: # `hhs-ipc-watch` imports the shipped `hhstreamd.ipc` (so it needs the package # on PYTHONPATH -- it is the client under test, not a reimplementation of it), # and the two targets are Wayland clients (so they need pywayland, and the # keyboard one also xkbcommon). # # All three are self-tested at build time, for the same reason test-tools.nix # does it: a broken helper otherwise surfaces as a baffling VM failure three # layers away, long after the thing that would have explained it scrolled past. # # ─── NO HEREDOC HERE, AND THAT IS NOT A STYLE PREFERENCE ───────────────────── # This file used to write the `hhs-ipc-watch` shim with `cat > $out/bin/... < /dev/null $out/bin/hhs-pointer-target --help > /dev/null $out/bin/hhs-keyboard-target --help > /dev/null ${waylandPython}/bin/python3 -c 'from pywayland.protocol.xdg_shell import XdgWmBase' # xkbcommon, and a keymap that really compiles: the keyboard target decodes # every symbol through this, so a broken binding would show up in the guest # as every key arriving with an undecodable symbol and no explanation. ${keyboardPython}/bin/python3 -c 'from xkbcommon import xkb; k = xkb.Context().keymap_new_from_names(rules="evdev", model="pc105", layout="us"); assert xkb.keysym_get_name(k.state_new().key_get_one_sym(38)) == "a"' # Both targets refuse to guess an app id, and the checks depend on that # refusal being exit 2 rather than a window with somebody else's class. for target in hhs-pointer-target hhs-keyboard-target; do if $out/bin/$target; then echo "$target started with no app id; it must refuse" >&2 exit 1 fi done ''