natefinch / npipe

A Windows named pipe implementation written in pure Go.
MIT License
297 stars 73 forks source link

Building on Windows ARM fails #33

Open kkrypt0nn opened 1 year ago

kkrypt0nn commented 1 year ago

Hey there!

When building a project that uses this package as dependency it works on windows/amd64 but not windows/arm64 and windows/arm, the error when building is:

+ go build -o build-artifacts-1678304161/project.exe ''
# gopkg.in/natefinch/npipe.v2
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:171:16: undefined: createEvent
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:187:8: undefined: getOverlappedResult
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:204:12: undefined: waitNamedPipe
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:309:8: undefined: connectNamedPipe
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:351:10: undefined: disconnectNamedPipe
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:364:13: undefined: cancelIoEx
/go/pkg/mod/gopkg.in/natefinch/npipe.v2@v2.0.0-20160621034901-c1b8fa8bdcce/npipe_windows.go:519:9: undefined: createNamedPipe

Currently using go-release-binaries with the example at the bottom, with both the Windows ARM not excluded, to build the project.

Is there anything special to run prior the build to make sure it works?

ph4r05 commented 1 month ago

I tried copying znpipe_windows_amd64.go to znpipe_windows_arm64.go and it worked.

go install golang.org/x/sys/windows/mkwinsyscall@latest
GOOS=windows GOARCH=arm64 ~/go/bin/mkwinsyscall.exe npipe_windows.go > znpipe_windows_arm64.go

Turns out, znpipe_windows_arm64.go is the same as znpipe_windows_amd64.go