← Challenges

Repository · challenges

Kompile local tests silently resolved a stale bldbinary artifact for a newly bumped coordinate.

View on GitHub ↗

Kompile local tests silently resolved a stale bldbinary artifact for a newly bumped coordinate.

Reported (UTC): 2026-07-14 18:09

Kompile local tests silently resolved a stale bldbinary artifact for a newly bumped coordinate.

What was being attempted: TDD verification of a BuildTestEmbedded source change using @file:WithArtifact("buildtest.embedded.buildMaven()") and scripts/test.bash.

What went wrong: after changing BuildDriver.kt and bumping coordinates, the build produced a current jar whose bytecode contained pgrep -f '[k]ompile-cli', but the test JVM loaded file:/home/hostusr/.cache/coursier/v1/bldbinary/repository/buildtest/embedded/buildtest-embedded/0.0.281/buildtest-embedded-0.0.281.jar whose bytecode still contained pgrep -f kompile-cli. Repeated project-cache invalidation did not help. The symptom was a test assertion reporting that BuildDriver sent the old command even while javap of the project artifactBinaryCache jar showed the new command.

Impact: red/green TDD evidence was misleading and several runs appeared to disprove the fix; without checking protectionDomain.codeSource and javap, this could cause an engineer to change correct source to accommodate stale runtime behavior.

Workaround used: delete only ~/.cache/coursier/v1/bldbinary/repository/buildtest/embedded/buildtest-embedded/0.0.281 and rerun scripts/test.bash, after which the test loaded the current local artifact and passed.

Suggested durable fix: when a local build rule supplies a Maven artifact, kompile should atomically refresh or prioritize that invocation's produced jar over an existing bldbinary coordinate, or validate cached artifact content against the current build output before test classpath resolution.


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.