Expand description
Every environment variable this crate reads, declared in one place.
An environment variable is an interface. Other repositories embed this
crate – soldr vendors it – and have to reason about what it reads, which
until now meant grepping every call site. DECLARED is that list, and
declaration_table_covers_every_variable keeps it honest: a new
RUNNING_PROCESS_* literal anywhere in the crate fails the build unless it
is declared here.
§Why booleans get two accessors rather than one
“Is this switch on?” has two defensible answers when the value is neither clearly on nor clearly off, and which one is right depends on who owns the variable – not on the call site, which is how a codebase ends up with five parsers that disagree.
flag_ownedis for switches this crate defines. Unknown means off. The value space is ours, so anything outside it is a typo, and a typo inSOMETHING_DISABLEmust not disable something.flag_foreignis for values written by someone else, where absence of a recognised falsy spelling is better read as “set”. Unknown means on. The daemon marker is this kind: a process that says it is a daemon in a spelling we did not anticipate is still a daemon, and a stray=0must never exempt it from reaping.flag_opt_outis for an escape hatch that is on until someone turns it off. Unset means on, which is the whole difference from the other two.
Both trim and lowercase before comparing, so " True " and "TRUE" agree.
§The table and the parser must agree
Writing the table turned up a switch whose declared default and whose
parser disagreed – BROKER_OWNED_BIND is documented as on by default but
was first declared with semantics that read unset as off. That is the class
of bug this module exists to end, so
an_unset_flag_matches_its_declared_default now checks the two against
each other for every declared flag.
Structs§
- EnvVar
- One environment variable this crate reads.
Enums§
- EnvKind
- What kind of value a variable carries, and how it is read.
- Owner
- Who decides what values a variable may take.
Constants§
- BROKER_
ALLOW_ PRIVILEGED - Opt out of the broker’s refusal to start as root or LocalSystem.
- BROKER_
CLIENT_ TIMEOUT_ MS - Broker client request timeout, in milliseconds.
- BROKER_
CRASH_ DUMP_ DIR - Where broker crash dumps are written.
- BROKER_
HELLO_ PERF_ GUARD - Run the broker Hello latency guard.
- BROKER_
HELLO_ TIMEOUT_ MS - Broker Hello handshake timeout, in milliseconds.
- BROKER_
HTTP_ BIND - Bind address for the broker HTTP aggregator.
- BROKER_
HTTP_ PORT - Port for the broker HTTP aggregator.
- BROKER_
LISTENER_ FD - Descriptor of a listening socket the broker already bound and passed.
- BROKER_
MAX_ INFLIGHT_ HANDLERS - Maximum broker request handlers running at once.
- BROKER_
OWNED_ BIND - Escape hatch: set falsy to fall back to spawn-then-probe.
- BROKER_
V1_ BACKEND_ NAMESPACE - Backend namespace handed to a v1 broker backend.
- BROKER_
V1_ BACKEND_ PIPE - Endpoint a v1 broker backend should serve on.
- BROKER_
V1_ INSTANCE - Instance identifier for a v1 broker backend.
- BROKER_
V1_ SERVICE_ NAME - Service name a v1 broker backend registers under.
- BROKER_
V1_ SERVICE_ VERSION - Service version a v1 broker backend reports.
- BROKER_
V1_ SESSION_ TOKEN - Session token a v1 broker backend presents to the broker.
- BROKER_
V1_ SOCKET - Broker endpoint a v1 backend dials.
- BROKER_
V1_ TRACEPARENT - W3C traceparent propagated into a v1 broker backend.
- BROKER_
V1_ TRACESTATE - W3C tracestate propagated into a v1 broker backend.
- CHILD_
PID_ LOG_ PATH - Append each spawned child PID to this file (test harness seam).
- CLIENT_
CONNECT_ TIMEOUT_ MS - Daemon client connect timeout, in milliseconds.
- CLIENT_
RPC_ TIMEOUT_ MS - Daemon client RPC timeout, in milliseconds.
- DAEMON_
SCOPE - Daemon scope selector;
devgives a CWD-scoped daemon for tests. - DAEMON_
SHADOWED - Marks a daemon already running from its shadow copy.
- DAEMON_
START_ TIMEOUT_ MS - How long a client waits for a freshly spawned daemon to bind its socket, in milliseconds.
- DECLARED
- Every environment variable this crate reads.
- DISABLE
- Canonical escape hatch: bypass the broker entirely.
- FAKE_
BACKEND - TEST-ONLY: dial this endpoint directly, skipping broker negotiation.
- GITHUB_
ACTIONS - Set by GitHub Actions; tests wait longer for a shared runner.
- INVOCATION_
ID - Set by systemd for a unit invocation; identifies the launching unit.
- IS_
DAEMON - Marks a process spawned as a daemon, for originator reaping.
- KILL_
DRAIN_ TIMEOUT_ MS - How long
kill()waits for output capture to drain, in milliseconds. - LOCALAPPDATA
- Windows per-user application data root.
- MANIFEST_
DIR - Where broker cache manifests are read and written.
- NO_
TRACKING - Disable daemon IPC and process tracking.
- ORIGINATOR
- Identifies the process that originated a spawn tree.
- PATH
- Executable search path, forwarded to the symbolization worker.
- SERVICE_
DEF_ DIR - Where service definitions are read from.
- TMPDIR
- macOS per-session temporary directory; a broker endpoint root.
- USERNAME
- Windows account name, mixed into the daemon pipe name.
- XDG_
CONFIG_ HOME - XDG per-user configuration root; where service definitions are read.
- XDG_
DATA_ HOME - XDG per-user data root, used by the daemon runtime collector.
- XDG_
RUNTIME_ DIR - XDG per-user runtime root; where broker sockets are placed.
Functions§
- flag_
foreign - Read a switch someone else writes: off only for a recognised negative.
- flag_
opt_ out - Read an escape hatch that is on unless turned off.
- flag_
owned - Read a switch this crate owns: on only for a recognised affirmative.
- value_
is_ affirmative_ foreign - Whether a value already in hand reads as a foreign switch being on.