No description
  • C 77.4%
  • Meson 17.1%
  • Makefile 3.7%
  • Shell 1.8%
Find a file
2025-12-02 10:39:43 +03:00
etc meson: move auxiliary files to etc/ 2025-12-01 22:53:46 +03:00
.gitignore gm: rename to guildmaster 2025-12-01 22:53:46 +03:00
gm-run.c gm-run: do not add -j to MAKEFLAGS 2025-11-22 18:15:32 +03:00
guildmaster.c gm: rename to guildmaster 2025-12-01 22:53:46 +03:00
LICENSE LICENSE: s/ISC/THE AUTHOR/ in disclaimer 2025-11-17 22:14:12 +03:00
Makefile Makefile: simplify 2025-12-02 00:53:51 +03:00
meson.build meson: move dependency lookups under get_option checks 2025-12-02 10:39:43 +03:00
meson.options meson.options: add default values, reformat 2025-12-01 12:43:30 +03:00
README.md gm: rename to guildmaster 2025-12-01 22:53:46 +03:00

guildmaster

GNU Make jobserver protocol does not have provisions for implicitly returning job tokens when a client is terminated without a chance to write its tokens back. This poses a problem if you want to have just one jobserver FIFO per machine, intended to be shared by all build jobs.

guildmaster implements a FIFO-like jobserver node via CUSE (character device in userspace, a subsystem of FUSE) and keeps account of retrieved and returned tokens per each open file description. When the node is closed with non-zero balance (i.e. a client returned fewer tokens that it retrieved), it assumes that the client is about to terminate without fulfilling the protocol, and replenishes the token pool.

See Also

Usage

guildmaster

guildmaster is a CUSE server providing /dev/guild FIFO-like jobserver node, intended to be run as a service. Can be run unprivileged, provided it has access to /dev/cuse, but /dev/guild is limited to root by default (udev rules can be used to grant wider permissions).

gm-run

gm-run <command> opens /dev/guild, retrieves one token, and runs <command> with --jobserver-auth=fifo:/dev/guild appended to MAKEFLAGS. Hence, it is a wrapper for jobserver-aware tools such as GNU Make and Ninja.