Skip to content

Declared targets are proven at build; resolve by floor (target versions step 3) - #95

Merged
Kinflou merged 1 commit into
mainfrom
feat/target-versions
Oct 24, 2026
Merged

Kinflou merged 1 commit into
mainfrom
feat/target-versions

Conversation

@Kinflou

@Kinflou Kinflou commented Oct 24, 2026

Copy link
Copy Markdown
Member

Step 3 of target versions (generation#76, proposal docs#76). It moves the cli off the removed Registry::support and onto Registry::resolve, and makes a declared target a promise that comline build proves.

comline build proves every declared target

Before anything is frozen, core#137's build_with runs a check on each code_generation.languages entry (new src/lang_targets.rs). Every problem is listed at once:

  • A generator handles the version: not below its floor ("rust#1.70.0 is older than the rust generator handles: it needs rust#1.85.0 or later"), and dotted numbers.
  • No dependency declares more: dependencies' declarations are read from core#137's dependency_configs, transitively. A dependency's minimum raises the package's, so building below it fails and names the dependency.
  • Every feature the schemas use is supported at that version. The message is the generator's own refusal.
  • Past the verified range, a warning under generation::unverified-version. A package raises it with settings = { diagnostics = { generation::unverified-version = { level = "error" } } }, through core's normal severity overrides.
  • A language this binary has no generator for fails the build, as decided: the declaration can't be proven.

comline generate

  • It resolves by floor, with the same dependency and unverified rules.
  • The "no generator" message, with its only = [...] hint, now appears only when the language is really missing. A version below the floor gets the floor error.
  • comline.toml may raise lang_version, never lower it: "target rust sets lang_version = "1.85.0", below config.idp's rust#1.88.0 - comline.toml can raise a target's version, never lower it".
  • The ignored-feature warnings use support at the target's version.

comline targets and comline new

  • targets: each line keeps name#floor first, then the range, e.g. rust#1.85.0 (1.85.0 or later; verified up to 1.99, and newer toolchains build its output). --features shows a feature's gate, and --json carries versions.
  • new: scaffolds the Rust generator's floor from the registry, not a literal.

Fixtures

rust#1.70.0 → rust#1.85.0 everywhere, and the lib-mode assertion now expects edition 2024 (comline-rust#70).

Pins

core a3f9eef (core#137), generation bbfadb2 (generation#79), comline-rust 577bdb2 (#72), comline-typescript c72d14e (#67). Merge after those.

Tests

New tests:

  • build refuses a version below the floor and freezes nothing;
  • build refuses an unknown language;
  • build refuses an unsupported feature (a union);
  • the unverified version warns, and is an error once settings raise it;
  • build refuses a version below a dependency's declaration;
  • comline.toml may raise a version but not lower it;
  • targets prints the range;
  • the scaffold uses the floor.

All 120 pass, and fmt and clippy -D warnings are clean.

comline build checks each language config.idp declares before freezing
(core's build_with): a generator handles the version, no dependency
declares a higher one, every feature the schemas use is supported there,
and past the verified range it warns under generation::unverified-version,
which settings can raise to an error. A language this binary has no
generator for fails the build.

generate resolves through Registry::resolve with the same rules;
comline.toml may raise lang_version, never lower it; targets prints each
floor with its range; new scaffolds the Rust generator's floor. Fixtures
and docs move to rust#1.85.0.
@Kinflou
Kinflou merged commit a856f6e into main Oct 24, 2026
2 checks passed
@Kinflou
Kinflou deleted the feat/target-versions branch October 24, 2026 15:53
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