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

Bug, Build fails to kover on just compile #485

Closed
Pluu opened this issue Aug 15, 2024 · 4 comments · Fixed by #742
Closed

Bug, Build fails to kover on just compile #485

Pluu opened this issue Aug 15, 2024 · 4 comments · Fixed by #742

Comments

@Pluu
Copy link
Contributor

Pluu commented Aug 15, 2024

This appears to be a configuration issue with “kover”.
Running is fine, but builds like “Make Project” fail.

a

I don't know kover, so I'm hoping someone can help me with this.

Build file '/Users/pluu/SampleProject/conference-app-2024/app-android/build.gradle.kts' line: 4

An exception occurred applying plugin request [id: 'droidkaigi.primitive.kover.entrypoint']
> Failed to apply plugin 'org.jetbrains.kotlinx.kover'.
   > Cannot run Project.afterEvaluate(Action) when the project is already evaluated.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 3s
5 actionable tasks: 1 executed, 4 up-to-date
Configuration cache entry stored.
@Corvus400
Copy link
Contributor

Even if Kover is commented out, it seems that there are other problems that are not related to Kover that need to be addressed as well. 🤔

e: file:///Users/todayamar/Repository/conference-app-2024/core/ui/src/iosMain/kotlin/io/github/droidkaigi/confsched/ui/IosComposeAdapter.kt:62:5 Cannot access class 'androidx.compose.ui.Modifier'. Check your module classpath for missing or conflicting dependencies.

スクリーンショット 2024-08-22 10 56 55

@Corvus400
Copy link
Contributor

Corvus400 commented Aug 22, 2024

Incidentally, even in last year's project, if Kover was not commented out, Build failed immediately.
So I commented out Kover and Rebuild Project and eventually Build Failed.
Is it sufficient to solve only the Kover issue in this Issue? 🤔
(Of course, “commenting out Kover” does not = “solution to the problem”.)
Or is the same situation as last year (i.e., Build Failed at the end) the solution? 🤔

スクリーンショット 2024-08-22 11 56 23

@Aniokrait
Copy link
Contributor

I found three problems related to “Make Project” failure.
The first two problems are as @Pluu and @Corvus400 said.
The third one is gradle caching error.
It shows error below.

3 problems were found storing the configuration cache.
- Task `:core:data:kspKotlinIosArm64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:core:data:kspKotlinIosSimulatorArm64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
- Task `:core:data:kspKotlinIosX64` of type `com.google.devtools.ksp.gradle.KspTaskNative`: invocation of 'Task.project' at execution time is unsupported.
  See https://docs.gradle.org/8.9/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution

Each one of them results in build failure, but the cause looks like independent respectively.
So, how about that we create other issues for "cannot access Modifier problem" and "gradle cache problem"?

Note

I have investigated proposed solution, I could have not verified thoroughly though.

  1. Kover problem could be solved by fixing KoverEntryPointPlugin like this.
[email protected] { // wrap with beforeEvaluate
    [email protected](koverPlugin)
}

Though Kover doesn't output report when project is built, ./gradlew koverHtmlReportDevDebug makes report.

  1. Modifier problem could be solved by changing module name of core:ui like core:droidkaigiui
    It seems to be kotlin bug (KT-66568).

  2. Gradle cache problem could be solved fixing KmpKtorfitPlugin.
    I've checked these code suppress gradle cache error.
    (The reason message was brought from KmpPlugin, so it might be reconsidered to proper one.)

tasks.withType<KspTaskNative>().configureEach {
    notCompatibleWithConfigurationCache("Configuration chache not supported for a system property read at configuration time")

 }
tasks.withType<KotlinNativeLink>().configureEach {
    notCompatibleWithConfigurationCache("Configuration chache not supported for a system property read at configuration time")

}

@Corvus400
Copy link
Contributor

Corvus400 commented Aug 22, 2024

@Aniokrait
Thank you for even including a specific solution! 🙇

So, how about creating separate issues for the “Modifier inaccessibility issue” and the “Gradle cache issue”?

Yes, let's address them with that policy!

@Pluu @takahirom
I think it's an urgent issue, so I'll create an Issue to deal with it now! 🫡

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

Successfully merging a pull request may close this issue.

4 participants