Open benjaminjkraft opened 3 years ago
I tried on the latest revision of Yaegi (da27c4fbc25f1023295585b8c818e3b34e6149b9) and the import of golang.org/x/sys/unix
is still failing.
The error message has changed though. Now Yaegi fails with error "incomplete type ifreq".
$ export GOPATH=/tmp/bar
$ env GO111MODULE=off go get golang.org/x/sys/unix
$ yaegi -i -unsafe -syscall -unrestricted
> import "golang.org/x/sys/unix"
/tmp/bar/src/golang.org/x/sys/unix/ifreq_linux.go:132:9: CFG post-order panic: /tmp/bar/src/golang.org/x/sys/unix/ifreq_linux.go:26:24: incomplete type ifreq
goroutine 34 [running]:
runtime/debug.Stack()
/usr/lib/go/src/runtime/debug/stack.go:24 +0x65
github.com/traefik/yaegi/interp.(*Interpreter).EvalWithContext.func1.1()
/home/u/Desktop/yaegi_new/interp/interp.go:588 +0x99
panic({0xeae3c0, 0xc000013f80})
The ifreq
type is present however in golang.org/x/sys/unix/ztypes_linux_amd64.go
(extract below):
//go:build amd64 && linux
// +build amd64,linux
package unix
type ifreq struct {
Ifrn [16]byte
Ifru [24]byte
}
This prevents importing
x/sys/unix
(thus any package which uses it -- for me relevantly logrus).