Skip to content

KSP 2.3.8 does not always generate sources #2952

@SimonMarquis

Description

@SimonMarquis

This issue appears randomly, and we are not able to reproduce consistently!

On an ephemeral CI the compileTestKotlin task does not take the ksp generated source in its javaSources input.

By looking at the kspTestKotlin build cache entries: in the failing build, the cache entry does not contain the expected files.

  • build A
cache-entry-a5b216b26ea784c150d527b4e7dd722c
├── METADATA
├── missing-tree-kspConfig.classOutputDir
├── missing-tree-kspConfig.kotlinOutputDir
├── missing-tree-kspConfig.resourceOutputDir
└── tree-kspConfig.javaOutputDir
    └── fr
        └── leboncoin
            └── repositories
                └── vehiclecashpurchase
                    ├── injection
                    │   └── DaggerTestComponent.java
                    └── VehicleCashPurchaseApiServiceTest_MembersInjector.java
  • build B
cache-entry-5b4e74b295426adec6ee0aca799d57b3
├── METADATA
├── missing-tree-kspConfig.classOutputDir
├── missing-tree-kspConfig.javaOutputDir
├── missing-tree-kspConfig.kotlinOutputDir
└── missing-tree-kspConfig.resourceOutputDir
Image

We then re-tried with a --rerun-tasks, and compileTestKotlin was successful (javaSources inputs are back).

Image

Even stranger, both build cache results for the kspTestKotlin tasks have the same key, but different contents:

  • Failing build:
Build cache result Miss (local), Hit (remote), Store (local)
Cache key 5b4e74b295426adec6ee0aca799d57b3
Cache artifact 602 B / 5 entries
  • Successful build:
Build cache result Store (local and remote)
Cache key 5b4e74b295426adec6ee0aca799d57b3
Cache artifact 1.8 KiB / 12 entries

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions