Skip to content

Gradle analysis fails when Gradle's configuration cache enabled #872

Description

@3flex

The configuration cache is an incubating Gradle feature that can speed up Gradle runs. I believe it will become stable in Gradle 7.5, the next feature release.

The current init script used by fossa is incompatible with the configuration cache. This causes build failures when org.gradle.unsafe.configuration-cache=true is set in gradle.properties file in a project. See failed fossa-action run: https://github.com/detekt/detekt/runs/5807165493?check_suite_focus=true#step:3:1676 and associated Gradle build scan: https://gradle.com/s/yggz7hpzmzvyi

Options:

  1. Make the script compatible with the configuration cache
  2. Disable the configuration cache when running Gradle using --no-configuration-cache. This is tricky as the flag will only be recognised when the Gradle version is one that supports configuration cache i.e. Gradle 6.6 or higher.
  3. Disable the configuration cache using --no-configuration-cache when org.gradle.unsafe.configuration-cache=true is in the gradle.properties file. This might be risky as the configuration option name might change when the feature becomes stable.
  4. Allow end users to specify flags to pass to Gradle when the fossa jsonDeps task is run. That would allow passing the flag disabling configuration cache so the task succeeds.

Option 1 is preferred.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions