Skip to content
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

x/sys/unix: type alias Nfgenmsg breaks build on go 1.8 #25563

Closed
Paul-PSDigital opened this issue May 25, 2018 · 2 comments
Closed

x/sys/unix: type alias Nfgenmsg breaks build on go 1.8 #25563

Paul-PSDigital opened this issue May 25, 2018 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Linux
Milestone

Comments

@Paul-PSDigital
Copy link

I believe the issue is directly linked to this change:
golang/sys@3135538#diff-790e11cae6867313825b103954c3a3fbR1405

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.8.3

Does this issue reproduce with the latest release?

Uncertain, likely not

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

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.

What did you expect to see?

get get moving onto the next dependency

What did you see instead?

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

@gopherbot gopherbot added this to the Unreleased milestone May 25, 2018
@tklauser
Copy link
Member

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

@tklauser tklauser changed the title x/sys all the builds are broken x/sys/unix: type alias Nfgenmsg breaks build on go 1.8 May 25, 2018
@tklauser tklauser added NeedsFix The path to resolution is known, but the work has not been done. OS-Linux labels May 25, 2018
@gopherbot
Copy link

Change https://golang.org/cl/114596 mentions this issue: unix: make Nfgenmsg a type definition

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Linux
Projects
None yet
Development

No branches or pull requests

3 participants