kotlinx-benchmark icon indicating copy to clipboard operation
kotlinx-benchmark copied to clipboard

Multiple issues when running on K/JS

Open lppedd opened this issue 1 year ago • 6 comments

Attached is a sample project to reproduce two issues. benchmark-js-repro.zip

  1. Re-declaration of dependencies.
    In the benchmarks module you're forced to re-declare all core dependencies and transitive dependencies.

  2. Having files under commonMain/resources in benchmarks will block the entire build, with an error like:

    Cause: e: Could not find "...\benchmark-js-repro\benchmarks\build\processedResources\js\main" in [...\benchmark-js-repro]`
    

lppedd avatar Jan 29 '24 09:01 lppedd

Same issues for the wasmJs target.

lppedd avatar Jan 31 '24 22:01 lppedd

Hi @lppedd Thanks for the feedback!

We will try to fix the issues ASAP.

qurbonzoda avatar Feb 05 '24 22:02 qurbonzoda

Thanks @qurbonzoda! FYI, same issues for native targets.

e: Could not find "C:\Users\edoardo.luppi\IdeaProjects\antlr-kotlin\antlr-kotlin-benchmarks\build\processedResources\mingwX64\main" in [C:\Users\edoardo.luppi\IdeaProjects\antlr-kotlin, C:\Users\edoardo.luppi\.konan\klib, C:\Users\edoardo.luppi\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\common, C:\Users\edoardo.luppi\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\platform\mingw_x64]

lppedd avatar Feb 09 '24 17:02 lppedd

Hey @qurbonzoda, any news on this? Right now I'm only running stuff on JVM, but I'd like to standardize the benchmarking for all supported platforms.

lppedd avatar May 28 '24 12:05 lppedd

Hi, I am also facing this issue - have to duplicate dependencies for the JS target.

kotlinx-benchmark: 0.4.11

The error:

Execution failed for task ':snake-kmp-benchmarks:jsBenchmarkGenerate'.
> e: KLIB resolver: Could not find "net.thauvin.erik.urlencoder:urlencoder-lib" in [.../snakeyaml-engine-kmp]
Stacktrace
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':snake-kmp-benchmarks:jsBenchmarkGenerate'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:130)
        ....
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: java.lang.IllegalStateException: e: KLIB resolver: Could not find "net.thauvin.erik.urlencoder:urlencoder-lib" in [/home/oleg.smirnov/Projects/private/snakeyaml-engine-kmp]
        at kotlinx.benchmark.gradle.KlibResolverKt$libraryResolver$logger$1.fatal(KlibResolver.kt:76)
        at org.jetbrains.kotlin.library.KotlinLibrarySearchPathResolver.resolve(SearchPathResolver.kt:281)
        at org.jetbrains.kotlin.library.SearchPathResolver.resolve$default(SearchPathResolver.kt:111)
        at org.jetbrains.kotlin.library.SearchPathResolverKt.resolve(SearchPathResolver.kt:120)
        at org.jetbrains.kotlin.library.metadata.resolver.impl.KotlinLibraryResolverImpl.resolveDependencies$lambda$15$lambda$13(KotlinLibraryResolverImpl.kt:119)
        at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
        at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
        at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
        at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
        at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
        at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
        at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:809)
        at org.jetbrains.kotlin.library.metadata.resolver.impl.KotlinLibraryResolverImpl.resolveDependencies(KotlinLibraryResolverImpl.kt:132)
        at org.jetbrains.kotlin.library.metadata.resolver.KotlinLibraryResolver.resolveWithDependencies(KotlinLibraryResolver.kt:27)
        at kotlinx.benchmark.gradle.KlibResolverKt.createModuleDescriptor(KlibResolver.kt:38)
        at kotlinx.benchmark.gradle.JsSourceGeneratorTask.loadIr(JsSourceGeneratorTask.kt:67)
        at kotlinx.benchmark.gradle.JsSourceGeneratorTask.generateSources(JsSourceGeneratorTask.kt:51)
        at kotlinx.benchmark.gradle.JsSourceGeneratorTask.generate(JsSourceGeneratorTask.kt:46)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        ...
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)

OptimumCode avatar Jul 01 '24 12:07 OptimumCode

I believe this is the issue. I think you need to use runtime dependencies

OptimumCode avatar Jul 01 '24 12:07 OptimumCode