Skip to content

fix(codegen): emit host clients and i18n tables only for shipped platforms - #337

Merged
turinglambdaai merged 1 commit into
mainfrom
fix/removed-platform-hosts
Oct 27, 2026
Merged

turinglambdaai merged 1 commit into
mainfrom
fix/removed-platform-hosts

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Failure mode

A single-platform product (e.g. a Windows-only internal tool) removes macos-host/ and linux/ from its tree. The next raco rivet build and raco rivet i18n then resurrect the removed directories with a fresh generated file inside:

$ raco rivet i18n
rivet: i18n: 31 keys across zh/en; wrote 3 embedded tables   # but only windows/ exists
$ git status
?? macos-host/Sources/RivetHost/GeneratedI18n.swift

Worse, the release freshness gate (check-generated-clients / check-generated-i18n) then reports the resurrected-required files as missing whenever they are absent, so a windows-only product can never pass raco rivet doctor --release without committing Swift and Linux files nothing consumes.

Root cause

In client-outputs and i18n-outputs the macOS and Windows outputs are unconditional, while the linux output already guards on directory-exists? and the Kotlin client already guards on declared device RPCs — the precedent from #311 («a file nobody consumes must not be a required part of the fresh tree»). macOS and Windows just never got the same treatment.

Fix

Guard the macOS and Windows outputs on host-directory existence in both plans. The freshness gates derive from the same plans, so they stop demanding removed platforms too. Scaffolds and projects that keep all three hosts are unaffected (their directories exist, generation proceeds as before).

Tests

  • rivet/tests/codegen.rkt: delete macos-host/ and linux/ from a scaffolded project, regenerate, assert the directories are not recreated, the output plan contains no macOS entry, and the freshness gate reports nothing missing/stale.
  • rivet/tests/i18n.rkt: same for the embedded i18n tables (2 tables remain, no resurrection, gate clean).

Local: raco test rivet/tests/codegen.rkt (172 passed) and raco test rivet/tests/i18n.rkt (23 passed), plus an end-to-end check on a real windows-only product — raco rivet i18n now reports wrote 1 embedded table and raco rivet build no longer recreates macos-host/.

CHANGELOG

Added an entry under Unreleased.

…forms

Windows and macOS typed clients and embedded i18n tables were emitted
unconditionally, while linux already guarded on its host directory and
the Kotlin client already guarded on declared device RPCs (issue #311).
A single-platform product that removes macos-host/ or windows/ therefore
got those directories resurrected — with a generated file inside — by
every `raco rivet build` and `raco rivet i18n`, and the release
freshness gate then demanded files nobody consumes.

Guard the macOS and Windows outputs on host-directory existence in both
client-outputs and i18n-outputs; the freshness gates use the same plans,
so they stop demanding removed platforms too. Scaffolds and any project
that keeps all three hosts are unaffected.

Regression tests: delete macos-host (and linux) from scaffolded projects
and assert generation neither recreates the directories nor reports the
missing clients as freshness findings.
@turinglambdaai
turinglambdaai merged commit 455b87b into main Oct 27, 2026
27 of 29 checks passed
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