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

runNative does not complete due to bootstrap.kt generated source file annotation requirement #353

Closed
exertionriver opened this issue Mar 22, 2021 · 1 comment

Comments

@exertionriver
Copy link

Actual behavior:

Attempting to exec task runNative for Korge-enabled project koboldQueue, exception is thrown during compileKotlinLinux64:

/build/platforms/native-desktop/bootstrap.kt: (5, 98): This declaration is experimental and its usage must be marked with '@kotlin.time.ExperimentalTime' or '@OptIn(kotlin.time.ExperimentalTime::class)'

opening bootstrap.kt, main() within fun runMain(args: Array<String>): Unit = com.soywiz.korio.Korio { main() } suggests adding @ExperimentalTime annotation, likely due to koboldQueue using the same annotation in its top-level suspend fun main() function.

After adding the annotation to main() in bootstrap.kt, IntelliJ warns Generated source files should not be edited. The changes will be lost when sources are regenerated, and sure enough, the annotations disappear upon re-running runNative, creating a state where runNative cannot complete successfully due to overwriting the required annotations.

Expected behavior:

Korge build process would scan top-level project main() function and apply found annotations to wrapper objects / functions as needed, such as RootGameMain as found in bootstrap.kt

@soywiz
Copy link
Member

soywiz commented Mar 25, 2021

If you search in issues This declaration is experimental you can find this one: #284

You have to use @OptIn(kotlin.time.ExperimentalTime::class) instead of @ExperimentalTime

I think I will reference this in the documentation

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