← Challenges

Repository · challenges

Kompile 0.0.65 full-suite parallel build can lose PrivilegedBuildAssistantHolder state.

View on GitHub ↗

Kompile 0.0.65 full-suite parallel build can lose PrivilegedBuildAssistantHolder state.

Reported (UTC): 2026-07-16 07:09

Kompile 0.0.65 full-suite parallel build can lose PrivilegedBuildAssistantHolder state.

What was being attempted: Run the full local BuildTestServerService test suite on merged main with scripts/test.bash --test . --log /tmp/buildtest-server-service-main-tests.xml before a production redeploy.

What went wrong: The suite completed 42/43 tests, but buildtest.server.sjvmDoesNotLeakOnRepeatedThreadAllocation failed before executing because its concurrent buildtest.server.buildDiagnostics() prerequisite hit 'java.lang.IllegalStateException: PrivilegedBuildAssistantHolder instance should not be null, should have been set by trusted code prior to getInstance() being called' from build.kotlin.jvm.JvmBuildRulesKt.buildSimpleKotlinMavenArtifact via kompile.executionenvironment.PrivilegedBuildAssistant.visitMethodInsn. The top-level summary was 'TESTS FAILED (42/43 tests completed successfully, 1 failed)'.

Impact: A clean repository main appeared to have a failing full suite and production deployment had to pause for classification; the heavily interleaved effect output also obscured which scenario failed until the final summary.

Workaround used: Immediately fetch/rebase the same HEAD and rerun only 'scripts/test.bash --local --test buildtest.server.sjvmDoesNotLeakOnRepeatedThreadAllocation'. The buildDiagnostics rule then succeeded in 56110 ms and the scenario passed 1/1, showing the failure was tied to full-suite parallel build execution rather than repository behavior.

Suggested durable fix: Make the kompile execution-environment holder lifecycle safe for concurrent per-test build-rule execution (or isolate holder state per build JVM), add a parallel regression test that invokes a nested build rule such as buildDiagnostics across the suite, and have the CLI attach build-rule failures directly to the responsible test as soon as they occur.


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.