Skip to content

Add systemd output format#107

Open
ruuda wants to merge 17 commits into
masterfrom
of-systemd
Open

Add systemd output format#107
ruuda wants to merge 17 commits into
masterfrom
of-systemd

Conversation

@ruuda

@ruuda ruuda commented May 30, 2026

Copy link
Copy Markdown
Owner

Add a systemd output format, so RCL can natively generate systemd units, and you don't have to patch them together using string formatting. This is superficially similar to the toml format, though systemd unit files are more imperative than declarative, so it ended up being a bit more involved.

  • Ensure documentation is up to date
  • Ensure changelog is up to date
  • Ensure test coverage
  • Ensure fuzzers discover new code paths
  • Ensure grammars and fuzz dictionary are up to date

ruuda added 16 commits July 11, 2026 19:38
It doesn't yet handle dicts, which would be useful for Environment=, but
we can handle that later.

It also doesn't handle repeated sections, which networkd needs, but we
can also handle that in a follow-up commit.
Because I want the rendered unit to look like one I would write by hand,
most strings unquoted. Maybe that's the same pitfall as yaml, but it's
not as prevalent in systemd, and anyway this is about output only.
It does make this format less ergonomic to use, since now you need to
add more layers of lists, and the output can be less pretty, but I'm
afraid this is required for correctness.
So long command lines remain somewhat readable in the generated files.
Also fix an error message that was still referring to TOML.
Systemd behaves quite differently than TOML here. More ad-hoc,
unfortunately.
Until now the output formats were relatively straightforward, but the
systemd output format is going to be a bit more involved, we need a
place to document it.
This tests a few more weird cases that I thought of while writing the
docs. Even though line coverage is at 100% already, there are some
boolean expressions and recursion that were not yet covered, better to
confirm it explicitly. Especially the empty string case matters,
previously it was impossible to pass an empty string in a command!
@ruuda ruuda marked this pull request as ready for review July 11, 2026 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant