Repository navigation
fix(codegen): emit host clients and i18n tables only for shipped platforms - #337
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure mode
A single-platform product (e.g. a Windows-only internal tool) removes
macos-host/andlinux/from its tree. The nextraco rivet buildandraco rivet i18nthen resurrect the removed directories with a fresh generated file inside: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 passraco rivet doctor --releasewithout committing Swift and Linux files nothing consumes.Root cause
In
client-outputsandi18n-outputsthe macOS and Windows outputs are unconditional, while the linux output already guards ondirectory-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: deletemacos-host/andlinux/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) andraco test rivet/tests/i18n.rkt(23 passed), plus an end-to-end check on a real windows-only product —raco rivet i18nnow reportswrote 1 embedded tableandraco rivet buildno longer recreatesmacos-host/.CHANGELOG
Added an entry under Unreleased.