sdeleuze
12/25/2023, 9:47 AMompileError: WebAssembly.Module(): supertype count of 1705 exceeds internal limit of 1 @+366
when runing ./gradlew wasmWasiNodeTest
. What did I miss?
It looks like there is no wasmWasiNodeRun
task, why?Svyatoslav Kuzmich [JB]
12/25/2023, 10:00 AM1.9.20-Beta
uses old pre-standard Wasm GC opcodes. Bumping Kotlin version to the latest stable 1.9.22
fixes wasmWasiNodeTest
.sdeleuze
12/25/2023, 10:04 AM1.9.22
fixed both issues.Svyatoslav Kuzmich [JB]
12/25/2023, 10:04 AMwasmWasiNodeRun
is there toosdeleuze
12/25/2023, 10:04 AMSvyatoslav Kuzmich [JB]
12/25/2023, 10:27 AM2.0.0-Beta2
allows for applyBinaryen()
in wasmWasi
target.sdeleuze
12/25/2023, 10:31 AMsdeleuze
12/25/2023, 10:31 AMsdeleuze
12/25/2023, 10:32 AMsdeleuze
12/25/2023, 10:33 AMsdeleuze
12/25/2023, 10:34 AMSvyatoslav Kuzmich [JB]
12/25/2023, 10:38 AMsdeleuze
12/25/2023, 10:39 AMSvyatoslav Kuzmich [JB]
12/25/2023, 10:45 AMsdeleuze
12/26/2023, 3:57 PM1.9.22
and 2.0.0-Beta2
do not work work with Node 21.5.0?
CompileError: WebAssembly.Module(): supertype count of 1360 exceeds internal limit of 1 @+360
at file:///home/seb/workspace/wasm-footprint/kotlin/build/compileSync/wasmWasi/main/developmentExecutable/kotlin/add-wasm-wasi.mjs:15:20
Node.js v21.5.0
If yes, do you plan to update Kotlin 2.0.0
upcoming beta/RC to fix that?
I am a bit surprised since I thought WasmGC opcodes were final.sdeleuze
12/26/2023, 4:08 PMwasm
"abstract" architecture and I need to use common
if I want to share code between wasmJs
and wasmWasi
?sdeleuze
12/26/2023, 4:14 PMid("org.jetbrains.compose")
am I expected to use with Kotlin 1.9.22
?sdeleuze
12/26/2023, 4:42 PMwasmJs
, I get breakage on bitwise OR with or
on a type alias for Short
(Long
seems ok), is it expected? What should be used instead?sdeleuze
12/26/2023, 4:44 PMType Number cannot be used in external function parameter. Only external, primitive, string and function types are supported in Kotlin/Wasm JS interop.
, any guideline on how to handle that?Svyatoslav Kuzmich [JB]
12/27/2023, 3:01 AM1.9.22
and 2.0.0-Beta2
do not work work with Node 21.5.0?
Yes
> If yes, do you plan to update Kotlin 2.0.0
upcoming beta/RC to fix that?
Kotlin is fine. Stable node needs to update to a recent v8.
$ node --version
v21.5.0
$ node -p process.versions.v8
11.8.172.17-node.18
$ node --version
v21.0.0-v8-canary202309143a48826a08
$ node -p process.versions.v8
11.9.85-node.5
Svyatoslav Kuzmich [JB]
12/27/2023, 3:09 AMWhich version ofBased on https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility it seems that the latest supported Kotlin version isam I expected to use with Kotlinid("org.jetbrains.compose")
?1.9.22
1.9.21
Svyatoslav Kuzmich [JB]
12/27/2023, 3:15 AMI try to upgrade KoWasm to Kotlin 1.9.22 (WIP branch) using for nowIt is expected. Add, I get breakage on bitwise OR withwasmJs
on a type alias foror
(Short
seems ok), is it expected? What should be used instead?Long
import kotlin.experimental.or
Svyatoslav Kuzmich [JB]
12/27/2023, 3:18 AMI also see errors likeUse concrete, any guideline on how to handle that?Type Number cannot be used in external function parameter. Only external, primitive, string and function types are supported in Kotlin/Wasm JS interop.
Double
or Int
instead.sdeleuze
12/27/2023, 7:13 AMsdeleuze
12/27/2023, 10:07 AMsdeleuze
12/27/2023, 10:07 AMnode --experimental-wasi-unstable-preview1 --experimental-wasm-gc runner.mjs
with
import { instantiate } from "./build/compileSync/wasmJs/main/productionExecutable/kotlin/kowasm-samples-wasi-sample-wasm-js.uninstantiated.mjs";
import { WASI } from "wasi";
export const wasi = new WASI({
args: ["argument1", "argument2"],
env: {
"PATH" : "/usr/local/bin:/usr/bin",
"HOME": "/home/seb"
},
preopens: {
'/sandbox': process.cwd() + '/build/'
}
});
const { exports, instance } = await instantiate({ wasi_snapshot_preview1 : wasi.wasiImport }, false);
wasi.initialize(instance);
exports.__init()
I get:
node:internal/errors:496
ErrorCaptureStackTrace(err);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "options.version" property must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at new WASI (node:wasi:51:5)
at file:///home/seb/workspace/kowasm/samples/wasi-sample/runner.mjs:4:21
at ModuleJob.run (node:internal/modules/esm/module_job:217:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:308:24)
at async loadESM (node:internal/process/esm_loader:42:7)
at async handleMainPromise (node:internal/modules/run_main:66:12) {
code: 'ERR_INVALID_ARG_TYPE'
}
Node.js v21.0.0-v8-canary202309143a48826a08
Any idea of the cause?Svyatoslav Kuzmich [JB]
12/27/2023, 10:09 AMversion: 'preview1'
now. See https://nodejs.org/api/wasi.htmlSvyatoslav Kuzmich [JB]
12/27/2023, 10:29 AM:samples:fullstack-sample:common
is not exposing these dependencies transitively, see implementation deps. Looks like a false-negative bug in the past.Svyatoslav Kuzmich [JB]
12/27/2023, 10:47 AMsdeleuze
12/27/2023, 1:53 PMDo you suspect 1.9.22 behaviour to be wrong?No should be good, it was likely related to the fact Kotlin 1.9 enforces more strictly visibility based in Gradle dependencies, all good with
api
.sdeleuze
12/27/2023, 1:55 PMwasmWasi
target
• kowasm#25 Leverage uvwasi
sock_accept()
instead of Node.js HTTP APIRobert Jaros
12/27/2023, 2:06 PMsdeleuze
12/27/2023, 2:07 PMsdeleuze
12/27/2023, 2:33 PMsdeleuze
12/27/2023, 2:38 PM