I believe the issue is directly linked to this change:
https://github.com/golang/sys/commit/31355384c89b50e6faeffdb36f64a77a8210188e#diff-790e11cae6867313825b103954c3a3fbR1405
Please answer these questions before submitting your issue. Thanks!
go version)?go1.8.3
Uncertain, likely not
go env)?linux/amd64
Builds ran as usual this morning on timer, during go get stage they all failed on golang.org/x/sys/unix
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
get get moving onto the next dependency
golang.org/x/sys/unix/ztypes_linux_amd64.go:1405: syntax error: unexpected = in type declaration
golang.org/x/sys/unix/ztypes_linux_amd64.go:1407: syntax error: non-declaration statement outside function body
This seems to behave differently with each go version. 1.8 produces the syntax error reported by @thepauleh (because go 1.8 doesn't support type aliases), 1.9 produces a segfault in cmd/compile (see #25561) and go 1.10 builds fine (that's also why the trybots didn't catch it).
According to https://golang.org/doc/devel/release.html only the last two major releases are supported (i.e. 1.9 and 1.10), so strictly speaking we could use the type alias in golang.org/x/sys/unix and add a fix to go 1.9 as suggested in #25561. But since the type alias is not strictly necessary and there is no other in x/sys/unix I suggest we also fix this this for 1.8 by changin the type alias to a type definition, i.e.
// in linux/types.go
type Nfgenmsg C.struct_nfgenmsg
// resulting in the following in ztype_linux_amd64.go
type Nfgenmsg struct {
Nfgen_family uint8
Version uint8
Res_id uint16
}
/cc @stapelberg
Change https://golang.org/cl/114596 mentions this issue: unix: make Nfgenmsg a type definition
Most helpful comment
This seems to behave differently with each go version. 1.8 produces the syntax error reported by @thepauleh (because go 1.8 doesn't support type aliases), 1.9 produces a segfault in
cmd/compile(see #25561) and go 1.10 builds fine (that's also why the trybots didn't catch it).According to https://golang.org/doc/devel/release.html only the last two major releases are supported (i.e. 1.9 and 1.10), so strictly speaking we could use the type alias in
golang.org/x/sys/unixand add a fix to go 1.9 as suggested in #25561. But since the type alias is not strictly necessary and there is no other inx/sys/unixI suggest we also fix this this for 1.8 by changin the type alias to a type definition, i.e./cc @stapelberg