Closed krzema12 closed 2 years ago
Reason of failure:
exception: java.lang.IllegalStateException: FATAL ERROR: Could not find "dist/kotlinc/lib/kotlin-stdlib-py-js.klib" in [/home/runner/work/kotlin-python/kotlin-python]
Weird, it worked fine locally. I have to dig deeper.
So far only learned that some JAR is created in Python's stdlib's build
directory during dist
, and the klib is created only when calling build
task explicitly on the stdlib project. Simplest idea: we need to call a specific task from prepare/compiler/build.gradle.kts
.
~@krzema12, I've pushed a build
task invocation here as you had suggested. Works now. However, it can be improved: we don't need the whole build
but only the task that creates klib
: it can save some time.~
UPD: never mind, changed build
to assemble
, should work more performant now. Waiting for tests anyway :)
@SerVB the idea with depending on whole build
task was to get us unblocked. I found it pretty challenging to find a task which produces the file :sweat_smile: Hopefully assemble
will work fine.
One more thing to check: if the produced KLIB really contains what it should. I'll change code of one of stdlib's function and see if it's reflected in the compiled output.
Hopefully assemble will work fine.
AFAIU assemble
is a standard Gradle task, like build
, but without dependency on check
:
Probably we can specify even more specific task instead of assemble
, but indeed it requires some research which one is needed. On the other hand, using assemble
instead of build
already gives a good-enough boost, so I don't research it further.
One more thing to check: if the produced KLIB really contains what it should. I'll change code of one of stdlib's function and see if it's reflected in the compiled output.
Already checked in my local branch, seems working. Feel free to check too :)
Before this change, the Python-specific stdlib was used only in box tests. This change makes the stdlib present in
dist
directory and thus usable by e.g. end-to-end tests and GitHub workflows.