Repository navigation
Keep Kotlin compile configs of composite builds apart - #1065
Merged
Merged
Conversation
christoph-sg
force-pushed
the
fix-kotlin-config-collisions
branch
from
November 4, 2026 14:09
2300070 to
494855c
Compare
chrapkowski-sg
approved these changes
Nov 4, 2026
The Gradle plugin named each Kotlin config file after the sanitized task path. Task paths are only unique within one build, so the root build and an included build both wrote -compileKotlin.txt and the later one replaced the earlier, dropping its sources from the index. Sanitizing also mapped :a-b:compileKotlin and🅰️ b:compileKotlin to the same name. Name the file after a hash of the build's root directory and the task path instead. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a6a2-f2b0-775c-a192-e5d11290c493 Co-authored-by: Christoph Hegemann <christoph.hegemann@sourcegraph.com>
christoph-sg
force-pushed
the
fix-kotlin-config-collisions
branch
from
November 4, 2026 14:18
494855c to
8483da7
Compare
christoph-sg
enabled auto-merge (squash)
November 4, 2026 14:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After the Kotlin compile tasks, the Gradle plugin writes each task's sources and classpath to
<targetroot>/kotlin-configs/for the CLI to index. The file was named after the sanitized task path, which collided in two ways::compileKotlin, both wrote-compileKotlin.txt, and the later one replaced the earlier, so the included build's sources were missing from the index.:a-b:compileKotlinand:a:b:compileKotlinboth became-a-b-compileKotlin.txt.The file is now named
<task name>-<hash>.txt, where the hash covers the build's root directory and the task path. The CLI reads every*.txtin the directory, so it needs no change.Test
The new
kotlin-compositefixture has Kotlin sources in the root build, an included build, and subprojects:a-band:a:b, and expects all four in the index. Before the fix, running the CLI on it produced two configs and indexed onlyRoot.ktandNested.kt. All 24 tests inGradleBuildToolTestpass.