Skip to content

Commit 7366554

Browse files
SONARIAC-2741 Isolate tree-sitter native library extraction per module
Each module gets its own tree-sitter-lib directory under build/, preventing parallel Gradle test JVMs from racing to extract the same .dll to a shared path. This fixes intermittent LinkageError on Windows caused by file locking during concurrent native library extraction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f029d6a commit 7366554

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gradle-modules/src/main/kotlin/org.sonarsource.cloud-native.java-conventions.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ tasks.withType<Javadoc> {
4545
tasks.withType<Test> {
4646
useJUnitPlatform()
4747

48+
// Each module gets its own tree-sitter native library extraction directory.
49+
// Without this, parallel Gradle test JVMs race to extract the same .dll to ${user.home}/.tree-sitter/,
50+
// which causes LinkageError on Windows due to file locking (SONARIAC-2741).
51+
systemProperty("tree-sitter-lib", layout.buildDirectory.dir("tree-sitter-native").get().asFile.absolutePath)
52+
4853
testLogging {
4954
// log the full stack trace (default is the 1st line of the stack trace)
5055
exceptionFormat = TestExceptionFormat.FULL

0 commit comments

Comments
 (0)