upvote
Aren’t both wayland and X11 protocols? Sure there are toolkits, but they’re not hard requirements (based on the little I know).
reply
I also don't know a whole lot, but yes, they both are ultimately implemented as families of client-server protocols over Unix domain sockets (X11 also supports TCP). Inasmuch as you are content with targeting a single version-set of those protocols, then that is sufficient to enable static compilation.

However, the real issue I'm getting at is the ability to run the same statically compiled binary many years later. That requires a dedication to compatibility (in this case, protocol compatibility). X11 was a bit all over the place on this, though it is probably stable enough now by dint of not getting much attention anymore. It seems like Wayland takes protocol compatibility pretty seriously [1] but there's an important caveat:

  [W]hen a protocol transitions from unstable to stable, one last breaking change is permitted.
  [ ... ]
  Note that many useful protocols are still unstable at the time of writing.
Though this itself may be out of date by now (I can't find a date of authorship in that book).

[1]: https://wayland-book.com/protocol-design/design-patterns.htm...

reply
X11 and Wayland are not the problem as those do indeed have stable binary interfaces.

Most games however need GPU access and that is only possible by either dynamically loading libraries or shipping the code for all the hardware you want to support with your binary (not an option).

That said, you don't really need a fully static binary but "just" target the oldest Glibc you want to support and minimize your imports as much as possible to avoid any unexpected compatibility problems. I put "just" in quotes because the toolchains on Linux don't make that easy if you also want modern programming language support, but it is viable.

reply