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 Incremental Processing: Removing a file does not remove transitively generated files #1554

Closed
bcorso opened this issue Sep 25, 2023 · 3 comments · Fixed by #1560
Closed
Milestone

Comments

@bcorso
Copy link

bcorso commented Sep 25, 2023

This issue came up in Dagger (google/dagger#4060). Say we have a class like this:

@HiltViewModel
class ProfileScreenViewModel @Inject constructor()

On the first build, we get the following source-to-output map:

  src/main/java/com/example/testhiltviewmodel/ProfileScreenViewModel.kt:
    build/.../ProfileScreenViewModel_Factory.java
    build/.../ProfileScreenViewModel_HiltModules.java
  <This is a virtual key for removed outputs; DO NOT USE>:
  build/.../ProfileScreenViewModel_HiltModules.java:
    build/.../_..._ProfileScreenViewModel_HiltModules_KeyModule.java
    build/.../_..._ProfileScreenViewModel_HiltModules_BindsModule.java
    build/.../ProfileScreenViewModel_HiltModules_KeyModule_ProvideFactory.java

Next, if we remove the ProfileScreenViewModel.kt and rebuild we get this:

  <This is a virtual key for removed outputs; DO NOT USE>:
  build/.../ProfileScreenViewModel_HiltModules.java:
    build/.../_..._ProfileScreenViewModel_HiltModules_KeyModule.java
    build/.../_..._ProfileScreenViewModel_HiltModules_BindsModule.java
    build/.../ProfileScreenViewModel_HiltModules_KeyModule_ProvideFactory.java

In particular, the generated sources from ProfileScreenViewModel.kt are removed, but the transitively generated sources, e.g. ProfileScreenViewModel_HiltModules, are not removed.

You can find a repro of this project in google/dagger#4060.

@ansman
Copy link
Contributor

ansman commented Oct 30, 2023

@ting-yuan Do you have an ETA for a new release? This is causing some annoying issues for us as cleaning the project isn't enough due to the build cache

@ting-yuan
Copy link
Collaborator

1.0.14 will be available no later than next week.

@ansman
Copy link
Contributor

ansman commented Oct 31, 2023

Thank you, I appreciate that 🙌

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

Successfully merging a pull request may close this issue.

3 participants