Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build on Illumos/Solaris #1632

Open
francescocarzaniga opened this issue Apr 9, 2021 · 5 comments
Open

Cannot build on Illumos/Solaris #1632

francescocarzaniga opened this issue Apr 9, 2021 · 5 comments

Comments

@francescocarzaniga
Copy link

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.

@ishank011
Copy link
Contributor

@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.

@francescocarzaniga
Copy link
Author

francescocarzaniga commented Apr 13, 2021

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.

@ishank011
Copy link
Contributor

We have a PR ready for that #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?

@francescocarzaniga
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants