Skip to content

syscall: cannot use go generate to invoke mksyscall_windows.go on linux #16368

@alexbrainman

Description

@alexbrainman

Before go1.7 I could use go generate to generate $GOROOT\src\syscall\zsyscall_windows.go on my Linux computer. Not anymore:

# cd $GOROOT/src/syscall                                                 
# go version                                                             
go version devel +a1110c3 Tue Jul 12 19:18:08 2016 +0000 linux/386                   
# GOOS=windows go generate                                               
fork/exec /tmp/go-build001548608/command-line-arguments/_obj/exe/mksyscall_windows.exe: exec format error                                                                 
syscall_windows.go:17: running "go": exit status 1                                   
#                                                                        

This is because go generate command respect GOOS and GOARCH now. I tried running go generate without GOOS=windows, but it does nothing because //go:generate is in syscall_windows.go (windows only file).

Ian suggested (#16120 (comment)) we should move //go:generate line into syscall.go.

We have other packags std and x/... that use mksyscall_windows.go in a similar fashion. This issue is to make sure everything is fixed.

Alex

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions