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

Execution optimizations are disabled because of undeclared dependency on kspCommonMainKotlinMetadata #975

Closed
eygraber opened this issue May 3, 2022 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@eygraber
Copy link

eygraber commented May 3, 2022

Using ksp 1.6.21-1.0.5 I get a warning in my kotlin compile tasks:

Execution optimizations have been disabled for task ':core:compileDebugKotlinAndroid' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/home/eli/workspace/galgal/core/build/generated/ksp/metadata/commonMain/kotlin'. Reason: Task ':core:compileDebugKotlinAndroid' uses this output of task ':core:kspCommonMainKotlinMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

I can work around it by doing:

tasks.withType<KotlinCompile>().configureEach {
  if(name != "kspCommonMainKotlinMetadata") {
    dependsOn("kspCommonMainKotlinMetadata")
  }
}
@neetopia neetopia added the bug Something isn't working label May 6, 2022
@neetopia neetopia added this to the 1.0.7 milestone Jun 9, 2022
@neetopia
Copy link
Contributor

neetopia commented Jun 9, 2022

I wonder if this is actually breaking anything other than producing a warning?

@eygraber
Copy link
Author

eygraber commented Aug 5, 2022

It doesn't break anything in the sense that it can't build, but I believe it executes in a non optimal way (as the warning indicates)

@ting-yuan ting-yuan self-assigned this Aug 16, 2022
@ting-yuan
Copy link
Collaborator

Looks like the output of kspCommonMainKotlinMetadata is wired to the target source set manually by user. This use case will be supported by a new project model in 1.0.8.

@ting-yuan ting-yuan modified the milestones: 1.0.7, 1.0.8 Sep 27, 2022
@ting-yuan ting-yuan modified the milestones: 1.0.8, 1.0.9 Nov 2, 2022
@ting-yuan
Copy link
Collaborator

Fixed in e81d01f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants