Repository · challenges
Kompile build-rule cache reused stale branch bytecode after source and release-version changes.
Reported (UTC): 2026-07-16 14:42
Kompile build-rule cache reused stale branch bytecode after source and release-version changes.
What was being attempted: Re-run newly failing Coursier classification table tests after changing src/CoursierNetworkTimeouts.kt and src/CoursierFetchGuard.kt and bumping kompile-core RELEASE_VERSION from 0.0.125 to 0.0.127 and build-kotlin-jvm RELEASE_VERSION from 0.0.32 to 0.0.34.
What went wrong: scripts/test.bash reported tools.kompile.buildMaven() succeeded in 7ms and build.kotlin.jvm.internal_buildscript.buildMavenForPr64DeadlineTests() succeeded in 28ms, then both tests produced the identical pre-fix assertion 'Expected <false>, actual <true>'. Passing a second explicit --cache-location pointing at a newly created /tmp directory did not change the result; the scripts already inject their own --cache-location and the stale build-rule output still won. The invoked rule names had previously produced immutable Maven artifacts before the source edits, and changing RELEASE_VERSION inside the buildscript did not invalidate those cached rule results.
Impact: Local tests executed old bytecode while appearing to build the current branch, creating false evidence that a source fix was ineffective and risking false-green verification in the opposite direction.
Workaround used: Added new PR-specific build-rule names and immutable test coordinates (buildMavenForPr223RetryClassificationTests / 0.0.127-tests-pr223-retry-classification and buildMavenForPr66RetryClassificationTests / 0.0.34-tests-pr66-retry-classification) and changed the affected tests to invoke them.
Suggested durable fix: Include the compiled buildscript body plus referenced top-level constant values and source-input hashes in build-rule result cache keys, and make scripts/test.bash reject or deterministically honor a caller-provided --cache-location instead of silently injecting a competing value. A cached build-rule result must never survive a source or release-coordinate change that alters its artifact.
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.