rcrowley / goagain

Zero-downtime restarts in Go
Other
2.1k stars 144 forks source link

Make stub functions for Windows (and possibly others) #24

Closed klauspost closed 5 years ago

klauspost commented 10 years ago

Currently any project that includes goagain will be unbuildable on Windows due to syscall dependencies only present on some systems.

Would it be possible to create stubs that will be used for unsupported systems via build tags?

Of course there will not be any of the goagain functionality, but at least our developers on other platforms will be able to build projects using goagain.

PS. Thanks for an awesome project!

klauspost commented 10 years ago

Here is the current output:

go get github.com/rcrowley/goagain

# github.com/rcrowley/goagain
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:34: undefined: syscall.SIGUSR2
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:101: undefined: syscall.SIGUSR2
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:160: undefined: syscall.Wait4
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:163: undefined: syscall.Kill
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:186: cannot use int(fd) (type int) as type syscall.Handle in argument to syscall.Close
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:202: undefined: syscall.SIGUSR1
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:203: undefined: syscall.SIGUSR2
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:232: undefined: syscall.SIGUSR1
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:241: undefined: syscall.SIGUSR2
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:243: undefined: syscall.SIGUSR2
c:\GoPath\src\github.com\rcrowley\goagain\goagain.go:243: too many errors

Generally, if it possible to do a stub that doesn't import syscall, that should "fix" the build problems.

brendensoares commented 10 years ago

11 Duplicate?

rcrowley commented 10 years ago

I would merge unobtrusive support for disabling goagain on Windows but have no interest in adding it myself.