reva icon indicating copy to clipboard operation
reva copied to clipboard

Cannot build on Illumos/Solaris

Open francescocarzaniga opened this issue 3 years ago • 5 comments

Trying to build from source on Illumos results in the following error:

# 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
gmake: *** [Makefile:75: deps] Error 2

gofrs/flock apparently is not compatible with Solaris, so I opened an issue but the repo hasn't seen any activity in months.

francescocarzaniga avatar Apr 09 '21 14:04 francescocarzaniga

@francescocarzaniga I think this dependency is introduced by golangci-lint, which is not an essential utility and not required by reva itself. Can you try running make build? That will generate the reva binaries, but won't start a lint check.

ishank011 avatar Apr 13 '21 13:04 ishank011

Still does't work:

root@build_env:/tmp/reva# gmake build
GOPROXY=off
echo BUILD_DATE=`date +%FT%T%z`
BUILD_DATE=2021-04-13T14:05:22+0000
echo GIT_COMMIT=`git rev-parse --short HEAD`
GIT_COMMIT=1765ae8d
echo GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
GIT_DIRTY=dirty-
echo VERSION=`git describe --always`
VERSION=v1.6.0-79-g1765ae8d
echo GO_VERSION=`go version | awk '{print $3}'`
GO_VERSION=go1.16.2
`go env GOPATH`/bin/goimports -w tools pkg internal cmd
go build -ldflags "-X main.gitCommit=`git rev-parse --short HEAD` -X main.version=`git describe --always` -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad
# github.com/cs3org/reva/pkg/storage/utils/localfs
pkg/storage/utils/localfs/localfs_unix.go:72:10: undefined: syscall.Statfs_t
pkg/storage/utils/localfs/localfs_unix.go:73:9: undefined: syscall.Statfs
# github.com/cs3org/reva/pkg/storage/utils/decomposedfs
pkg/storage/utils/decomposedfs/decomposedfs_unix.go:26:10: undefined: syscall.Statfs_t
pkg/storage/utils/decomposedfs/decomposedfs_unix.go:27:9: undefined: syscall.Statfs
gmake: *** [Makefile:32: build] Error 2

The problem is that syscall just will not work on Solaris, it's probably necessary to use something like x/sys/unix to make Reva compatible.

francescocarzaniga avatar Apr 13 '21 14:04 francescocarzaniga

We have a PR ready for that https://github.com/cs3org/reva/pull/1499, but it also requires go-prompt to be upgraded, which causes issues with the CLI utility. I'll take a look at resolving that tomorrow. In the meantime, can you check if the PR works for you?

ishank011 avatar Apr 13 '21 14:04 ishank011

Sorry but no, different but still errors out:

root@build_env:/tmp/reva# gmake build
GOPROXY=off
echo BUILD_DATE=`date +%FT%T%z`
BUILD_DATE=2021-04-13T15:09:56+0000
echo GIT_COMMIT=`git rev-parse --short HEAD`
GIT_COMMIT=dfd9276c
echo GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"`
GIT_DIRTY=
echo VERSION=`git describe --always`
VERSION=v1.6.0-80-gdfd9276c
echo GO_VERSION=`go version | awk '{print $3}'`
GO_VERSION=go1.16.2
`go env GOPATH`/bin/goimports -w tools pkg internal cmd
go build -ldflags "-X main.gitCommit=`git rev-parse --short HEAD` -X main.version=`git describe --always` -X main.goVersion=`go version | awk '{print $3}'` -X main.buildDate=`date +%FT%T%z`" -o ./cmd/revad/revad ./cmd/revad
# github.com/cs3org/reva/pkg/storage/utils/localfs
pkg/storage/utils/localfs/quota_unix.go:33:10: undefined: unix.Statfs_t
pkg/storage/utils/localfs/quota_unix.go:34:9: undefined: unix.Statfs
# github.com/cs3org/reva/pkg/storage/utils/decomposedfs
pkg/storage/utils/decomposedfs/decomposedfs_unix.go:26:10: undefined: unix.Statfs_t
pkg/storage/utils/decomposedfs/decomposedfs_unix.go:27:9: undefined: unix.Statfs
gmake: *** [Makefile:32: build] Error 2

I think you need Statvfs instead of Statfs.

francescocarzaniga avatar Apr 13 '21 15:04 francescocarzaniga

There is now a problem with nats-server, see nats-io/nats-server#3018.

francescocarzaniga avatar Jun 04 '22 16:06 francescocarzaniga