GradleUp / GradleUp/tapmoc

Configuration cache failure in presence of libraries that have no JARs

Open
#100 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Kotlin
Stars
109
Forks
6
Avg merge
11m
Merged PRs (30d)
3

Description

Expected and Results

When I run a build, I get:

* What went wrong:
Configuration cache state could not be cached: field `provider` of `org.gradle.internal.serialize.codecs.core.ProviderBackedFileCollectionSpec` bean found in field `__jarFiles__` of task `:tapmocCheckClassFileVersions` of type `tapmoc.task.TapmocCheckClassFileVersionsTask`: error writing value of type 'org.gradle.api.internal.provider.DefaultProvider'
> Could not resolve all files for configuration ':tapmocRuntimeDependencies'.
   > No variants of org.codehaus.groovy:groovy-all:3.0.22 match the consumer attributes:
       - Adhoc variant for org.codehaus.groovy:groovy-all:3.0.22:
           - Incompatible because this component declares a component, as well as attribute 'artifactType' with value 'pom' and the consumer needed a component, as well as attribute 'artifactType' with value 'jar'
           - Other compatible attributes:
               - Doesn't say anything about com.android.build.gradle.internal.attributes.VariantAttr (required 'release')
               - Doesn't say anything about its usage (required runtime)

The root cause is that org.codehaus.groovy:groovy-all:3.0.22 does not have a JAR.

Libraries that have no JARs, for example org.codehaus.groovy:groovy-all:3.0.22, should be ignored.

Related environment and versions
  • Gradle 9.4.1
  • Tapmoc 0.4.2
Reproduction steps

build.gradle.kts:

plugins {
    java
    id("com.gradleup.tapmoc") version "0.4.2"
}

// groovy-all 3.x is a POM-only artifact (no JAR published, only a BOM POM).
// The @pom suffix forces Gradle to resolve it as a POM-type artifact, reproducing
// how dev.gradleplugins:gradle-test-kit:8.11.1 declares it in its Maven POM:
//
//   <dependency>
//     <groupId>org.codehaus.groovy</groupId>
//     <artifactId>groovy-all</artifactId>
//     <version>3.0.22</version>
//     <type>pom</type>         <-- this
//     <scope>runtime</scope>
//   </dependency>
//
// Without @pom, Gradle treats the POM packaging as a BOM import and does not add
// groovy-all itself to the dependency graph. With @pom, Gradle creates an adhoc
// component with a single variant: artifactType=pom.
dependencies {
    runtimeOnly("org.codehaus.groovy:groovy-all:3.0.22@pom")
}

tapmoc {
    java(11)
    // checkDependencies() enables tapmocCheckClassFileVersions.
    // With it: fails at task execution (both with and without --no-configuration-cache).
    // Without it: task is disabled (SKIPPED), but still fails at configuration cache
    //             serialization because Gradle eagerly resolves task inputs.
    checkDependencies()
}

gradle.properties:

org.gradle.configuration-cache=true

Run ./gradlew build and you will get the error.

Anything else?

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducer in build.gradle.kts and gradle.properties, then run ./gradlew build with the tapmocCheckClassFileVersions task enabled and the POM-only groovy-all dependency. Trace how that task resolves its inputs and confirm that a dependency with no JAR is ignored without configuration-cache serialization or task-execution failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.