Repository navigation
fix: a target block configures a language, it doesn't replace the set - #59
Merged
Merged
Conversation
added 2 commits
October 13, 2026 04:00
A congregation declaring `rust#1.70.0` and `typescript#5.0` generated rust
only, said nothing about typescript, and exited 0.
One line did it:
let base = if cfg.generate.targets.is_empty() { declared } else { targets };
An all-or-nothing switch. The moment one `[[generate.target]]` block existed -
and the reported case had exactly one, there only to redirect rust's output to
a sibling directory - every declared language without its own block was
dropped. Silently: no warning, no mention in the output, nothing.
This contradicted the documentation, which already described the intended
behaviour: the guide introduces the block as "one block per target you want to
pin or override" and `lang_version` as "defaults to what config.idp declared".
A block is described throughout as *settings for a language*, never as the
thing that decides whether that language is generated. The code had diverged
from its own docs.
It also conflated two files with different owners. `config.idp` is committed
and says which languages the package is generated for; `comline.toml` is
consumer-owned and says where and how each one lands. Deciding *whether* is
the congregation's call.
So the declared set is the base, and blocks configure it by language
(case-insensitively). A language with no block takes the `[generate]`
defaults. Several blocks for one language still give several outputs. A block
naming a language the congregation doesn't declare is an error that names the
fix - silently ignoring a block someone wrote would be the same footgun
inverted. With nothing declared at all, the blocks are the set, so a
`comline.toml`-only project still works.
`[generate] only = ["rust"]` narrows persistently, for a checkout that wants
fewer languages than the package offers; `--target` still narrows per run. A
name the congregation doesn't declare is an error there too, so a typo can't
quietly stop generating something.
That makes the declared set reachable on every run, so the missing-generator
error now says what to do about it: this build has no such generator, install
one that does or narrow with `only`. The `gen-*` Cargo features are optional,
so a binary lacking one is a normal build - but declaring a language means
meaning it, and `only` is the way to say otherwise on purpose.
No existing `gen_config` test combined a declared language with a block, so
none encoded the old behaviour and none needed changing. Two integration tests
configured a `python` block against a fixture declaring only rust; they now
declare it, which is what a block requires.
The `lib` mode work (#58) landed unformatted, turning CI's Lint job red on main; this branch added more of the same. `cargo fmt --all` over the four files it touched, no behaviour change.
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.
A congregation declaring
rust#1.70.0andtypescript#5.0generated rustonly, said nothing about typescript, and exited 0.
One line did it (
gen_config.rs:255):An all-or-nothing switch. The moment one
[[generate.target]]block existed —and the reported case had exactly one, there only to redirect rust's output to
a sibling directory — every declared language without its own block was
dropped. Silently.
This contradicted the documentation.
guide/codegen/generating-code.mdintroduces the block as "one block per target you want to pin or override"
and
lang_versionas "defaults to what config.idp declared" — a block isdescribed throughout as settings for a language, never as the thing deciding
whether that language is generated. The code had diverged from its own docs,
so this is a bug fix, not a design change.
It also conflated two files with different owners:
config.idpis committedand says which languages the package is generated for;
comline.tomlisconsumer-owned and says where and how each lands.
The rule
(case-insensitive). A language with no block takes the
[generate]defaults.ignoring a block someone wrote would be the same footgun inverted.
comline.toml-onlyproject still works.
[generate] only = ["rust"]narrows persistently;--targetstill narrowsper run. An undeclared name in
onlyis an error, so a typo can't quietlystop generating something.
Missing generators
The declared set is now reached on every run, so the missing-generator error
says what to do:
The
gen-*Cargo features are optional, so a binary lacking one is a normalbuild — but declaring a language means meaning it, and
onlyis how aconsumer says otherwise on purpose.
Verified on the reported project
config.idpdeclaring rust + typescript, with a rust-only block:Tests
No existing
gen_configtest combined a declared language with a block, sonone encoded the old behaviour and none needed changing — worth stating,
since it means the old semantics were never deliberately pinned down. Two
integration tests configured a
pythonblock against a fixture declaring onlyrust; they now declare it, which is what a block requires.
clionly — no core, no generators, no cascade.