-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
can't build for wasm (go 1.21 rc) #1394
Comments
I suspect we'd just need something like this, but for wasm: https://github.com/sirupsen/logrus/blob/master/terminal_check_js.go |
Aaaaand you're already on it. 7165f5e
Thank you! 😄 |
Update 2Ok so it seems the PR #1388 is not part of the 1.9.3 release version
UpdateWith go 1.21
The /Users/user/go/pkg/mod/github.com/sirupsen/[email protected]/terminal_check_notappengine.go file // +build !appengine,!js,!windows,!nacl,!plan9
package logrus
import (
"io"
"os"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
return isTerminal(int(v.Fd()))
default:
return false
}
} OriginalHi, I am running into this issue when compiling with TinyGo for WASI target
The main.go file package main
import "github.com/sirupsen/logrus"
func main() {
logrus.Infof("start")
logrus.Infof("done")
} The go.mod file
The go.sum file
|
The upcoming Go 1.21 release includes support for compiling to Web Assembly (wasm): https://tip.golang.org/doc/go1.21#wasm
You can try out the RC:
However, I've found that anything I try to build that depends on logrus fails when building for Wasm:
(source here: https://gist.github.com/imjasonh/1ca7e1bd0d95d5c54b8550c50fb557bd)
This isn't a big deal for now, because it's still an RC, but it could be nice to figure out how to avoid this dependency for wasm builds.
The text was updated successfully, but these errors were encountered: