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

Don't crash compiling modules with NPM JS dependencies #725

Open
bnorm opened this issue Sep 11, 2022 · 1 comment · May be fixed by #732
Open

Don't crash compiling modules with NPM JS dependencies #725

bnorm opened this issue Sep 11, 2022 · 1 comment · May be fixed by #732

Comments

@bnorm
Copy link
Contributor

bnorm commented Sep 11, 2022

I'm getting the following build failure when trying to use kotlinx-datetime on the JS side of Zipline:

Caused by: java.lang.IllegalArgumentException: No topological ordering is possible for [./88b0986a7186d029-atomicfu-js-ir.js, ./elevated-model.js, ./elevated-worker.js, ./kotlinx-serialization-kotlinx-serialization-json-js-ir.js, ./zipline-root-zipline.js, ./kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js, ./kotlin-kotlinx-atomicfu-runtime-js-ir.js, ./Kotlin-DateTime-library-kotlinx-datetime-js-ir.js, ./kotlin-kotlin-stdlib-js-ir.js, ./kotlinx-serialization-kotlinx-serialization-core-js-ir.js]
	at app.cash.zipline.loader.internal.TopologicalSortKt.topologicalSort(topologicalSort.kt:61)
	at app.cash.zipline.loader.ZiplineManifest$Companion.create(ZiplineManifest.kt:153)
	at app.cash.zipline.loader.ZiplineManifest$Companion.create$default(ZiplineManifest.kt:143)
	at app.cash.zipline.gradle.ZiplineCompiler.writeManifest(ZiplineCompiler.kt:167)
	at app.cash.zipline.gradle.ZiplineCompiler.compile(ZiplineCompiler.kt:53)
	at app.cash.zipline.gradle.ZiplineCompileTask.task(ZiplineCompileTask.kt:101)

I ran Gradle in debug mode and the problem library seems to be kotlinx-datetime. This library depends on @js-joda/core which is not in the module map when creating the manifest. So when building the topological list, the dependencies of kotlinx-datetime are never satisfied resulting in the exception.

Is this a known limitation of Zipline? That you cannot use libraries like kotlinx-datetime because of such dependencies? I can create a small reproducing project if that is needed.

@bnorm bnorm linked a pull request Sep 17, 2022 that will close this issue
@swankjesse swankjesse changed the title No topological ordering is possible with kotlinx-datetime Don't crash compiling modules with NPM JS dependencies May 18, 2023
@Shabinder
Copy link
Contributor

+1 for support of this.

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.

3 participants