Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

get undefined: syscall.Stat_t when use quic in the windows environment #82

Closed
wenchaopeng opened this issue Nov 12, 2019 · 3 comments · Fixed by #83
Closed

get undefined: syscall.Stat_t when use quic in the windows environment #82

wenchaopeng opened this issue Nov 12, 2019 · 3 comments · Fixed by #83
Assignees
Labels
P1 High: Likely tackled by core team if no one steps up

Comments

@wenchaopeng
Copy link

I have a problem with quic in the windows environment
my code is like this:

        sourceMultiAddr, _ := ma.NewMultiaddr(node.cfg.P2P.Listen)
	q,err:=quic.NewTransport(node.privateKey)
	if err!=nil{
		return err
	}
	host, err := libp2p.New(
		node.ctx,
		libp2p.ListenAddrs(sourceMultiAddr),
		libp2p.Identity(node.privateKey),
		libp2p.BandwidthReporter(node.reporter),
		libp2p.Ping(false),
		libp2p.Transport(q),
	)
	if err != nil {
		return err
	}

the error log is like this:

# github.com/vishvananda/netns
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:27:13: undefined: syscall.Stat_t
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:28:12: undefined: syscall.Fstat
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:31:12: undefined: syscall.Fstat
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:39:8: undefined: syscall.Stat_t
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:43:12: undefined: syscall.Fstat
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:52:8: undefined: syscall.Stat_t
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:56:12: undefined: syscall.Fstat
D:\goproject\pkg\mod\github.com\vishvananda\netns@v0.0.0-20190625233234-7109fa855b0f\netns.go:70:29: cannot use int(*ns) (type int) as type syscall.Handle in argument to syscall.Close

pls help me,thanks you!

@marten-seemann marten-seemann self-assigned this Nov 12, 2019
@marten-seemann
Copy link
Collaborator

It seems like netlink doesn't support Windows, there's even a (three years old) issue for that: vishvananda/netlink#146. I confirmed that it's not possible to build it on Windows.

The only fix for this I can think of is to not even import netlink on Windows. This won't be a trivial thing though, since reuse contains a netlink.Handle, and it's expected to be nil on non-Linux systems, it will still pull in netlink and cause the build error.
So we'd probably have to refactor reuse in a base struct that works on all OSes, and extend this struct with the netlink capabilities in a struct that's only built on Linux on OSX.

I'm quite busy at the moment and won't have time to work on this any time soon, but I'd be happy to review a PR.

@marten-seemann marten-seemann removed their assignment Nov 13, 2019
@marten-seemann marten-seemann added the help wanted Seeking public contribution on this issue label Nov 13, 2019
@wenchaopeng
Copy link
Author

Roger that

@Stebalien
Copy link
Member

This is making it impossible to update QUIC in libp2p/go-ipfs which is preventing us from deploying it to infra.

@marten-seemann marten-seemann self-assigned this Nov 15, 2019
@marten-seemann marten-seemann added P1 High: Likely tackled by core team if no one steps up and removed help wanted Seeking public contribution on this issue labels Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P1 High: Likely tackled by core team if no one steps up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants