Skip to content

[LSP-PREREQUISITE] Require a compiler consumer in language-tooling CI - #679

Merged
lagergren merged 1 commit into
masterfrom
errs/i3-compiler-consumer-tests-20261008
Oct 8, 2026
Merged

lagergren merged 1 commit into
masterfrom
errs/i3-compiler-consumer-tests-20261008

Conversation

@lagergren

Copy link
Copy Markdown
Contributor

Summary

Why?

  • Compiler and library changes need an executable language-tooling consumer so integration failures cannot hide behind a successful build of the producer alone.
  • A green test task is insufficient if the required consumer is missing, empty, or skipped because its compiled modules were unavailable.

How?

  • Resolve compiled module variants as declared test inputs and compile a small module through the existing embedding API.
  • Include compiler inputs in the shared core-check classification and fingerprint, and require a nonempty successful consumer result before recording the CI success marker.
  • Detach optional IDE packaging from the default language-tooling lifecycle while retaining explicit plugin tasks and opt-in attachment.
flowchart LR
    C[Java compiler API] --> T[CompilerConsumerTest]
    M[Gradle compiled module variants] --> T
    T --> X[JUnit XML result]
    X --> G[Required-result gate]
    G --> S[Core checks success marker]
Loading

Implications

includeBuildAttachIntellijPlugin and includeBuildAttachVsCodeExtension default to false for language-tooling lifecycle attachment. Explicit IDE tasks remain available, clean still covers the included projects, and root composite-inclusion defaults are unchanged. The compiler dependency is test-only; this PR does not ship a compiler-backed language server.

Changes

  • CompilerConsumerTest.kt and CompilerTestSupport.kt: an embedding smoke test with mandatory bootstrap/system modules.
  • lang/lsp-server/build.gradle.kts: variant-based module inputs and a configuration-cache-compatible JVM argument provider.
  • lang/build.gradle.kts and the LSP README: optional IDE lifecycle attachment and its usage.
  • .github/scripts/ci-changes.py and .github/workflows/commit.yml: compiler-aware core invalidation and the required-result gate.

Known follow-ups

This initial gate requires one smoke-test suite in the existing Ubuntu core lane. Later compiler-consumer suites must extend the required coverage; this is not an IDE acceptance suite or a new cross-platform test matrix.

@lagergren
lagergren force-pushed the errs/i3-compiler-consumer-tests-20261008 branch from 21e8d6b to fc41345 Compare October 8, 2026 20:20
@lagergren

Copy link
Copy Markdown
Contributor Author

Design rationale: make the producer/consumer boundary executable

Building javatools proves that the compiler itself builds; it does not prove that a language-tooling consumer can resolve its runtime modules and use its embedding API. This foundation adds a small required consumer on the existing master API, before introducing the much larger compiler adapter. It compiles module Consumer { Int answer() = 42; } and checks that compilation reports no errors and returns the expected module.

Modules are Gradle inputs

The test consumes the composite build's compiled xtc library variants through a resolvable compilerTestModules configuration. Dependencies on Ecstasy and the native bridge provide the required module graph, including the bootstrap module. A CommandLineArgumentProvider passes their directories as xtc.test.modules; its file collection is declared with @InputFiles and relative path sensitivity. This lets Gradle model producer dependencies and invalidate test outputs when module content changes while preserving configuration-cache support. There is no distribution extraction, hard-coded developer installation path, or task action capturing a project/script object.

CompilerTestSupport creates a linked repository with a mutable BuildRepository first, followed by read-only repositories for the resolved module directories. The first repository supports caching loaded modules; the input directories remain read-only. Setup requires ecstasy.xtclang.org, mack.xtclang.org (turtle/bootstrap), and _native.xtclang.org. Missing directories or modules are failures, not assumptions that silently skip the test.

Keep the core lane usable

Requiring a compiler consumer should not make every core language-tooling lifecycle run package both IDE plugins. The new attachment flags keep those packaging lifecycles opt-in, while explicit IDE tasks remain callable. This is a task-lifecycle boundary, not a claim that Gradle never configures or resolves anything associated with an included IDE project. Root inclusion switches and the existing IDE-specific CI lanes retain their roles.

Invalidation and the success marker

The shared CI classifier now includes compiler, utility, bootstrap/native bridge, library, XDK, and plugin inputs in the core fingerprint. Relevant version-catalog references also invalidate the consumer. Shared build/workflow changes retain broad invalidation; existing documentation and IDE-specific classification remain selective. This is integrated into the current classifier rather than adding a second path-filter implementation.

The existing Ubuntu core job runs :lang:lsp-server:test, which discovers the consumer. Before writing its successful-core-check marker, a new gate parses that suite's exact JUnit XML and requires tests > 0, with zero failures, errors, or skips. Missing or malformed output also fails the step. Consequently, a missing or skipped consumer cannot establish a new successful core-check marker.

The normal Gradle and CI caching policies still apply. Valid cached test outputs may be reused; an XML check alone is not evidence of a newly launched test JVM. The local acceptance below deliberately forced actual test execution. Future required suites need corresponding coverage in the gate; the initial single-suite gate does not promise that every possible compiler interaction is tested.

Validation performed

The following invocation ran twice at the pinned commit. Each run executed the consumer with one test, zero failures/errors/skips; the first stored the configuration cache and the second reused it. Both formatting checks passed.

./gradlew :lang:lsp-server:test \
  --tests org.xvm.lsp.adapter.CompilerConsumerTest \
  --rerun-tasks --no-build-cache \
  spotlessCheck :lang:lsp-server:spotlessCheck \
  -PincludeBuildLang=true -PincludeBuildAttachLang=true \
  --console=plain --info

Eleven local synthetic-repository controls checked classification and fingerprint changes, including compiler inputs, shared build logic, the workflow, version catalog, IDE-only edits, and a documentation-only edit. Six result-gate controls accepted valid XML and rejected missing, empty, skipped, failing, and errored results. actionlint reported the same 80 existing findings on the base and candidate, with zero new findings; the workflow is not being described as globally lint-clean. These are local checks, not a claim that GitHub Actions has already run this PR.

This foundation uses the existing embedding/listener API and is independent of I1 and I2. The later breaking API work remains planned for 0.5.0.

Review and validation boundary

Tested commit: 21e8d6b2c. Independent base: f442aced6. The recorded validation ran locally on October 8, 2026. Master has since advanced with the Gradle 9.8.1 upgrade (#676), which does not overlap these seven changed files. The results above describe the pinned branch; current CI must validate its combination with the newer master.

Foundation PRs: I1: diagnostic identity, I2: ambient-pool fallback, and this I3 compiler-consumer gate. All three target master independently. I3 exercises the existing embedding API and does not require I1, I2, or the later listener changes.

Resolve compiled module variants for an embedding smoke test, detach optional IDE packaging from language-tooling lifecycle tasks, and include compiler inputs in the shared core-check fingerprint. Reject missing, empty, skipped, or failing consumer results before recording a successful CI marker.

Re-extracted on master f442ace. The consumer passes with configuration-cache storage and reuse, formatting checks pass, 11 classifier/fingerprint controls and six result-gate controls pass, and actionlint adds no findings against the base.
@lagergren
lagergren force-pushed the errs/i3-compiler-consumer-tests-20261008 branch from fc41345 to 0dab6b6 Compare October 8, 2026 20:36
@lagergren
lagergren enabled auto-merge (squash) October 8, 2026 20:36
@lagergren
lagergren merged commit 7f9e2ae into master Oct 8, 2026
5 checks passed
@lagergren
lagergren deleted the errs/i3-compiler-consumer-tests-20261008 branch October 8, 2026 20:48
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.

2 participants