flock icon indicating copy to clipboard operation
flock copied to clipboard

Cannot build on Illumos

Open francescocarzaniga opened this issue 4 years ago • 3 comments

Trying to build on Illumos results in the following error:

root@build_env:/tmp# go get -u github.com/gofrs/flock
go: downloading golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57
# github.com/gofrs/flock
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:28:22: undefined: syscall.LOCK_EX
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:39:22: undefined: syscall.LOCK_SH
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:57:12: undefined: syscall.Flock
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:67:12: undefined: syscall.Flock
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:97:12: undefined: syscall.Flock
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:97:42: undefined: syscall.LOCK_UN
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:119:21: undefined: syscall.LOCK_EX
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:131:21: undefined: syscall.LOCK_SH
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:9: undefined: syscall.Flock
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:44: undefined: syscall.LOCK_NB
/root/go/pkg/mod/github.com/gofrs/[email protected]/flock_unix.go:151:44: too many errors

This seems to present a solution.

francescocarzaniga avatar Apr 09 '21 14:04 francescocarzaniga

@francescocarzaniga I'm personally not very familiar with Illumos, so I presume it doesn't have the same system call capabilities as other systems so the symbols are missing when attempting to build.

Considering that you have a Illumos system, would you have the spare cycles to contribute support for that OS? Alternatively, do you have any personal recommendations for where I could get access to one without having to get some local VM running?

theckman avatar Jun 27 '21 20:06 theckman

@theckman I have a personal server with OmniOS where I could spin up a zone for this, it's not particularly powerful but it should do. AFAIK there are no (affordable, Joyent is quite expensive) cloud solutions.

francescocarzaniga avatar Jun 29 '21 19:06 francescocarzaniga

Hi I solved the compilation error by using the environment variable: export GOOS=illumos

so flock is compiling fine. I hope it helps someone. Paolo

marcheschi avatar Mar 23 '22 16:03 marcheschi