Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KSP] build cache issue #4110

Open
juliocbcotta opened this issue Oct 24, 2023 · 5 comments
Open

[KSP] build cache issue #4110

juliocbcotta opened this issue Oct 24, 2023 · 5 comments

Comments

@juliocbcotta
Copy link

Hello there, We have been trying the new dagger version in the last few weeks, but we are still suffering with failing builds.

In our project, all I did was to compile our unit tests successfully, convert a file from a "base" module in kotlin and run the same task again, however this time that task failed with the log attached.

I was able to build again using --no-build-cache, but from the reports of our developers, this issue happens in other occasions.

It seems I can reproduce it consistently in our project, but I failed to reproduce it in a small project. Sorry for that.

Our project also uses room with ksp in the module "marketplace", but I don't see any links with this issue.

log.txt

AGP Version: 8.1.2
Kotlin Version: 1.9.10
R8 Version: 8.1.68
Gradle Version: 8.3
JVM Version: 17.0.6 (BellSoft 17.0.6+10-LTS)
ksp Version : 1.9.10-1.0.13
Dagger Version: 2.48.1

Is there anything else I can offer to help investigate this issue?

@bcorso
Copy link

bcorso commented Oct 24, 2023

You can turn on KSP's incremental logging with ksp.incremental.log=true. Once that's enabled you can

  1. clean build (your successful build),
  2. make your change,
  3. build (your failed build),
  4. look in the generated /build/kspCaches/debug/logs/ and there should be two files: kspDirtySet.log and kspSourceToOutputs.log.

Those logs should give us information about which files were considered "dirty" after your change and how the generated outputs changed between the two builds.

If you can post those logs here it may help us determine where the issue is coming from.

@juliocbcotta
Copy link
Author

I couldn't find any logs in the root folder, but I found in base and marketplace modules, I uploaded the "debug" and "debugUnitTest" logs as I am running the unit test task...

base_debug_unit_test_logs.zip
base_debug_logs.zip
marketplace_debug_unit_test_logs.zip
marketplace_debug_logs.zip

@juliocbcotta
Copy link
Author

Did the files help with anything?

@bcorso
Copy link

bcorso commented Oct 29, 2023

Unfortunately not. It's kind of difficult to see the forest from the trees in those logs, especially without being able to see the code itself. I think we would need to repro this in a smaller project, preferably one where we can access the code ourselves to look into it further. Rather than trying to repro it from scratch, it might help to start with the codebase you're currently seeing the issue and start removing things and simplifying it that way you can make sure it still repros at each step along the way.

@juliocbcotta
Copy link
Author

In the module with the missing classes ,"marketplace", I reverted this module to use kapt instead of ksp for room plugin and I couldn't reproduce it anymore.

This is a bit weird as we have other room databases in other modules that don't seem to suffer from this same bug.

Anyway, I found this issue in room issue tracker https://issuetracker.google.com/issues/296337576 that seems similar to mine. So, maybe the problem is in room. It seems they got a sample project there with the reproduction if you are interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants