-
Notifications
You must be signed in to change notification settings - Fork 918
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
Wasi target command flag vs environment variables #4439
Comments
The problem here is the file extension, which apparently overrides the environment variables. That's a bug. Lines 1569 to 1571 in ef4f46f
Maybe we should just remove this special case? It means that people that currently rely on the extension will have to provide some explicit flags or environment variables, but it's certainly more explicit and less "magic". |
Currently this overrides GOOS/GOARCH, which are also used for wasm. This will break people who rely on a command like this: tinygo build -o foo.wasm path/to/package They will need to update to explicitly set the target, for example: tinygo build -o foo.wasm -target=wasm path/to/package Fixes: #4439
Currently this overrides GOOS/GOARCH, which are also used for wasm. This will break people who rely on a command like this: tinygo build -o foo.wasm path/to/package They will need to update to explicitly set the target, for example: tinygo build -o foo.wasm -target=wasm path/to/package Fixes: #4439
Note that until this is fixed, the docs are wrong. |
My understanding is that setting
GOOS=wasip1 GOARCH=wasm
should produce identical output as passing the-target wasi
command line flag, but it doesn't. Rather, it seem to match-target wasm
.Repro:
You'll need
wasm2wat
from The WebAssembly Binary Toolkit.Then:
Open each wat file in a text editor. Imports are near the top, exports are near the bottom.
test1.wat
test2.wat / test3.wat
They should be identical, but test3 is importing from
gojs
, and is also exportinggo_scheduler
. It's identical to test2, whereas I would expect it to match test1.The text was updated successfully, but these errors were encountered: