[bug #67726] Jobserver specification restricts FIFO implementations
Sam James <[email protected]> Sat, 22 Nov 2025 07:26:32 -0500 (EST)
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <[email protected]> |
URL:
<https://savannah.gnu.org/bugs/?67726>
Summary: Jobserver specification restricts FIFO
implementations
Group: make
Submitter: thesamesam
Submitted: Sat 22 Nov 2025 12:26:29 PM UTC
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Documentation
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Component Version: None
Operating System: None
Fixed Release: None
Triage Status: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 22 Nov 2025 12:26:29 PM UTC By: Sam James <thesamesam>
The jobserver specification [0] currently suggests that the FIFO must be
genuine FIFO and we've seen clients like LLVM [1] actually check this with
S_ISFIFO.
For some work we're doing [2][3], we're emulating a FIFO using CUSE/FUSE to
allow tracking when consumers disappear to avoid lost tokens. nixos had a
similar idea in the past too [4].
Would it be possible to tweak the specification to indicate that such a strong
check should not be done, and it must merely "appear" to be a FIFO? Another
tweak would help us out as well wrt closing the FIFO. More specifically..
In chapter 13.1.1 POSIX Jobserver Interaction, add in the end (suggested
phrasing by Alexander Monakov):
"""
Consider interoperability with independent jobservers that perform accounting
of tokens to avoid permanently lost tokens when multiple project can be built
simultaneously, and some projects can be killed without a chance to write back
their tokens. In such implementations, file indicated via
--jobserver-auth=fifo:PATH may be an emulated FIFO (for instance, a device
node), and as such might not appear to be a FIFO if examined with the stat
syscall. After you open the FIFO and consume the token, do not close it until
after you've written the token back: if you close the FIFO prematurely, the
jobserver that watches the FIFO may consider that you have finished (without
returning the token), and reintroduce the token into the pool.
"""
[0] https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html
[1] https://github.com/llvm/llvm-project/pull/169154
[2] https://codeberg.org/amonakov/guildmaster
[3] https://gitweb.gentoo.org/proj/steve.git/
[4] https://github.com/NixOS/nixpkgs/pull/314888
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67726>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaSGr+AAKCRCqLAuaBUf3 TkJpAP4pd3/aPZmIexRIlVczz3QTr0NFnfG1khHbnMKsiYuVFQD+NN2BQNqAyckl g/pJcwQtIuLy0m1p7WMsKkQLykVeZgY= =/b2x -----END PGP SIGNATURE-----