project-mahiwa / mahiwa-frontend-go

mahiwaのGo言語向けフロントエンド
https://pkg.go.dev/github.com/project-mahiwa/mahiwa-frontend-go
MIT License
0 stars 0 forks source link

[🐛Bug]:生成されたwasmにwasi_preview_1のimportが入る #25

Closed usuyuki closed 10 months ago

usuyuki commented 10 months ago

🐛 概要

内部で明示的に使って無くても

  (import "serial" "print" (func $print (type 3)))
  (import "wasi_snapshot_preview1" "fd_write" (func $runtime.fd_write (type 2)))
  (import "arduino" "randomSeed" (func $randomSeed (type 7)))
  (import "serial" "printLong" (func $printLong (type 7)))
  (import "arduino" "delay" (func $delay (type 1)))

こういうことになる.(エラー用で使われてるっぽいので,デバッグオプション消して対処できない?)

原因

備考

usuyuki commented 10 months ago

tinygo/0.30.0/targetsを見る限り,wasm系は

wasm32-unknown-unknownにしたい.

usuyuki commented 10 months ago

https://github.com/tinygo-org/tinygo/issues/3068

同じこと考えている人がやっぱりいた

usuyuki commented 10 months ago

-wasm-abi=genericを指定したいが,このオプションがなぜか消えている.

usuyuki commented 10 months ago

https://github.com/tinygo-org/tinygo/pull/3265 これだ

-wasm-abi=genericがwasiにさせない機能はなさそう.

usuyuki commented 10 months ago

Mahiwa側だけでの修正では対応できないし,TinyGoにはIssueとDraft PRが上がっているので,実装が終わるのを待つ.