Repository · challenges
Kompile local targeted-test compilation crashes its privileged build bridge on a fresh main
Reported (UTC): 2026-07-16 04:02
Kompile local targeted-test compilation crashes its privileged build bridge on a fresh main checkout.
What was being attempted: validate BuildTestServerService with scripts/test.bash --test runDropletsRpcRouteExposesPerRunDroplets after first reproducing the same targeted test from an untouched detached worktree at origin/main commit 368db1d.
What went wrong: the cold baseline build failed while executing a test dependency build rule through the kompile TCP bridge. The exact causal error was java.lang.IllegalStateException: PrivilegedBuildAssistantHolder instance should not be null, should have been set by trusted code prior to getInstance() being called, reached from build.kotlin.jvm.JvmBuildRulesKt.buildSimpleKotlinMavenArtifact through kompile.executionenvironment.PrivilegedBuildAssistant.visitMethodInsn and TcpCommunicationHandler.processMessage. Before the bridge crash, the same targeted invocation also reported Cannot find a parameter with this name: phaseTimestamps for RunDropletRecord, even though the emitted server compile classpath named buildtest-embedded-0.0.302.jar and direct javap -v inspection of both published 0.0.302 and 0.0.305 JARs showed the constructor and Kotlin metadata parameter.
Impact: a small dependency-pin PR could not get a trustworthy local result for the required getRunDroplets serialization test. The unrelated getBuildRun serialization test passed, but the local runner compiled all 43 test scripts even with one --test selector and made the selected result depend on failures in test compilation infrastructure.
Workaround used: verified the published embedded JAR signatures directly, reproduced from untouched origin/main to separate the failure from the PR, kept the PR limited to the requested server dependency pin and documentation, and deferred authoritative validation to repository CI.
Suggested durable fix: in kompile, initialize and preserve PrivilegedBuildAssistantHolder for every TCP-dispatched build-rule invocation, add an end-to-end regression test for nested @file:WithArtifact("project.buildRule()") resolution during selected-test compilation, and print the exact selected test compiler classpath when Kotlin reports an impossible metadata mismatch so stale or duplicate artifacts can be identified.
Production verification — 2026-07-17
Status: STILL EXISTS. Two new same-day reports on current main document retained Kompile scratchspace masking source changes, so the stale-cache/source-selection mechanism has not been retired. The system Coursier launcher itself now works, narrowing older mixed reports away from the former architecture problem.
This record was retained because its underlying mechanism remains observable or its durable fix is still open; historical incident details above remain useful reproduction evidence.