-
Notifications
You must be signed in to change notification settings - Fork 570
GopherJS 1.8-wip: "warning: system calls not available" printed whenever "os" package imported. #583
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
Comments
There are multiple ways we can resolve this. Do you have preferences on this @neelance? We could override We could try to override |
What about excluding |
Btw: Thanks for pinging. |
There are multiple files, we'd have to exclude them all. For example, if someone uses GopherJS on Windows, their default |
Although, it's worth noting |
…mentation. Replace it with a not-implemented-erroring one. This fixes the issue #583 where on darwin a call to os.Getwd is made, which makes syscalls, and causes a warning to be printed to console: warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md os.Executable is documented to be unsupported on nacl: // Executable is not supported on nacl or OpenBSD (unless procfs is // mounted.) GOARCH=js is similar to nacl in many ways, so it's pretty expected os.Executable wouldn't be supported here either. Use https://github.com/golang/go/blob/990124da2a6ca5a54b38733b51018e2f8758cfae/src/os/executable_procfs.go#L21 as template for error message. Fixes #583.
This |
…mentation. Replace it with a not-implemented-erroring one. This fixes the issue #583 where on darwin a call to os.Getwd is made, which makes syscalls, and causes a warning to be printed to console: warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md os.Executable is documented to be unsupported on nacl: // Executable is not supported on nacl or OpenBSD (unless procfs is // mounted.) GOARCH=js is similar to nacl in many ways, so it's pretty expected os.Executable wouldn't be supported here either. Use https://github.com/golang/go/blob/990124da2a6ca5a54b38733b51018e2f8758cfae/src/os/executable_procfs.go#L21 as template for error message. Fixes #583.
…mentation. Replace it with a not-implemented-erroring one. This fixes the issue #583 where on darwin a call to os.Getwd is made, which makes syscalls, and causes a warning to be printed to console: warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md os.Executable is documented to be unsupported on nacl: // Executable is not supported on nacl or OpenBSD (unless procfs is // mounted.) GOARCH=js is similar to nacl in many ways, so it's pretty expected os.Executable wouldn't be supported here either. Use https://github.com/golang/go/blob/990124da2a6ca5a54b38733b51018e2f8758cfae/src/os/executable_procfs.go#L21 as template for error message. Fixes #583.
Uh oh!
There was an error while loading. Please reload this page.
I've mentioned this in #552 (comment), but I've confirmed it happens in 1.8 only now.
I've investigated it and found the root cause.
It happens with GopherJS 1.8-wip only when "os" package is imported (not necessarily directly). That package is often imported by other packages, such as "net/http", or if you're getting
os.Stdout
, etc.It happens because of
Executable()
addition toos
package in Go 1.8.As a result,
os.Getwd()
gets called as part ofos
package initialization:Source: https://github.com/golang/go/blob/09762ccff79ebf08839f8954ab99c17d41f071e2/src/os/executable_darwin.go#L9.
Calling
os.Getwd()
in browser ends up making a call toSyscall
, which causes the warning to get printed to console (note that it's actually printed as an error to console).The text was updated successfully, but these errors were encountered: