Skip to content

Gradle: indexing fails with "Failed to query the value of property 'freeCompilerArgs'" on Kotlin DSL build logic #1054

Closed

Description

@altugbozkurt07

Indexing any Gradle build with Kotlin DSL precompiled script plugins in buildSrc or an included build (a common convention-plugin setup) fails during configuration, before anything compiles. This is the error from #633, which was closed as not planned without comment; it still happens on the latest release.

Reproduce

scip-java 0.13.2, Gradle 8.14.4 (the project's wrapper), Linux aarch64:

git clone --depth 1 https://github.com/Kotlin/kotlinx.coroutines.git && cd kotlinx.coroutines
scip-java index
* What went wrong:
Could not determine the dependencies of task ':buildSrc:jar'.
> Could not create task ':buildSrc:compileKotlin'.
   > Failed to query the value of property 'freeCompilerArgs'.
      > Querying the mapped value of map(flatmap(provider(task 'generatePrecompiledScriptPluginAccessors', class org.gradle.kotlin.dsl.provider.plugins.precompiled.tasks.GeneratePrecompiledScriptPluginAccessors))) before task ':buildSrc:generatePrecompiledScriptPluginAccessors' has completed is not supported

square/okhttp fails with the same error on :build-logic:compileKotlin (scip-java 0.13.1, Gradle 9.8.2), once its Isolated Projects setting is turned off with -Dorg.gradle.unsafe.isolated-projects=false. Without scip-java, that OkHttp build's :okhttp:compileKotlinJvm succeeds.

Likely cause

ScipGradlePlugin.configureKotlinCompileTask runs inside tasks.configureEach and calls getFreeCompilerArgs() to copy the current list before appending its own arguments:

https://github.com/scip-code/scip-java/blob/main/scip-gradle-plugin/src/main/java/org/scip_code/scip_java/gradle/ScipGradlePlugin.java#L175-L204

Reading it resolves the property at configuration time. For these modules its value depends on the output of generatePrecompiledScriptPluginAccessors, which has not run yet, so Gradle refuses.

Possible fix

Append without reading the current value, for example with compilerOptions.freeCompilerArgs.addAll(...) on Kotlin versions that have it, or apply the arguments in a doFirst action. I have not tested either. Skipping the plugin for build-logic modules would also avoid it, since their code is rarely what's being indexed.

Impact

The whole index fails, so the project gets no symbols at all, including for its Java and for modules that have nothing to do with build logic.

Activity

  1. christoph-sg commented on Nov 4, 2026

    @christoph-sg
    Member

    Thank you for the report. This was fixed in #1044 and released as 0.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions