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

Caddy Build Fails for Solaris/Illumos and Plan9 #3615

Closed
mohammed90 opened this issue Jul 28, 2020 · 8 comments · Fixed by #6268
Closed

Caddy Build Fails for Solaris/Illumos and Plan9 #3615

mohammed90 opened this issue Jul 28, 2020 · 8 comments · Fixed by #6268
Labels
help wanted 🆘 Extra attention is needed upstream ⬆️ Relates to some dependency of this project

Comments

@mohammed90
Copy link
Member

mohammed90 commented Jul 28, 2020

Initially reported by @Toasterson

The main issue is that [email protected] uses golangs internal syscall library and that does not support many operatingsystems notably openbsd, netbsd, and illumos. Badger uses a constant for MADVISE and that only came into the go for these Unixes after the internal syscall library got frozen. Right now the internal syscall library only really works for linux and every software that wants to support something else than linux and uses the syscall library directly must use x/sys/unix instead. I've personally changed quite a few direct dependencies and pushed people to use x/sys/unix instead of syscall so that today this is mostly happening due the dependency chain. I could not upgrade badger to 1.6.1 as there where api changes but nosql bump worked. So until that is resolved caddy cannot be built on quite a few unix versions I suppose. I know it won't build for illumos right now. Are you monitoring cross-builds?

Also here the exact error for documentation

# github.com/dgraph-io/badger/y
../../../pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:57:30: undefined: syscall.SYS_MADVISE

Originally posted by @Toasterson in #3602 (comment)

Build errors:

  • Solaris/Illumos
$ GOOS=solaris go build
# github.com/dgraph-io/badger/y
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:57:30: undefined: syscall.SYS_MADVISE
  • plan9:
$ GOOS=plan9 go build
# github.com/dgraph-io/badger/y
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/file_dsync.go:24:21: undefined: unix.O_DSYNC
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:32:11: undefined: unix.PROT_READ
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:34:12: undefined: unix.PROT_WRITE
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:36:9: undefined: unix.Mmap
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:36:54: undefined: unix.MAP_SHARED
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:41:9: undefined: unix.Munmap
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:48:11: undefined: unix.MADV_NORMAL
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:50:11: undefined: unix.MADV_RANDOM
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:57:30: undefined: syscall.SYS_MADVISE
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:59:8: cannot use 0 (type untyped int) as type syscall.ErrorString
../../../../../go/pkg/mod/github.com/dgraph-io/[email protected]/y/mmap_unix.go:59:8: too many errors
# github.com/caddyserver/caddy/v2/cmd
../proc_posix.go:28:9: undefined: syscall.Kill
# go.etcd.io/bbolt
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:217:12: undefined: flock
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:354:12: undefined: mmap
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:376:12: undefined: munmap
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:456:12: undefined: fdatasync
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:501:14: undefined: funlock
../../../../../go/pkg/mod/go.etcd.io/[email protected]/db.go:861:37: undefined: fdatasync
../../../../../go/pkg/mod/go.etcd.io/[email protected]/tx.go:542:13: undefined: fdatasync
../../../../../go/pkg/mod/go.etcd.io/[email protected]/tx.go:579:13: undefined: fdatasync
# github.com/dgraph-io/badger/v2/y
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/file_dsync.go:24:21: undefined: unix.O_DSYNC
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:30:11: undefined: unix.PROT_READ
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:32:12: undefined: unix.PROT_WRITE
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:34:9: undefined: unix.Mmap
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:34:54: undefined: unix.MAP_SHARED
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:39:9: undefined: unix.Munmap
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:46:11: undefined: unix.MADV_NORMAL
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:48:11: undefined: unix.MADV_RANDOM
../../../../../go/pkg/mod/github.com/dgraph-io/badger/[email protected]/y/mmap_unix.go:50:9: undefined: unix.Madvise
# github.com/chzyer/readline
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/operation.go:234:4: undefined: ClearScreen
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/readline.go:129:20: undefined: GetScreenWidth
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/readline.go:132:22: undefined: DefaultIsTerminal
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/readline.go:142:26: undefined: DefaultOnWidthChanged
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/remote.go:324:2: undefined: DefaultOnWidthChanged
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/remote.go:346:17: undefined: GetScreenWidth
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/remote.go:362:16: undefined: DefaultIsTerminal
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:51:2: undefined: SuspendMe
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/utils.go:81:29: undefined: State
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/utils.go:241:9: undefined: State
../../../../../go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:51:2: too many errors

Known as of v2.1.1, but issue could be extending back in history. Exact version/commit is pretty much irrelevant.

@mholt
Copy link
Member

mholt commented Jul 31, 2020

I have opened issues upstream:

I've also removed those platforms from our download page for the time being. Too bad. :(

@mholt mholt added the upstream ⬆️ Relates to some dependency of this project label Jul 31, 2020
@mholt mholt added this to the 2.x milestone Jul 31, 2020
@mohammed90
Copy link
Member Author

I have opened issues upstream:

* https://discuss.dgraph.io/t/build-failure-for-goos-solaris-illumos-plan9/9145?u=mholt

* [etcd-io/bbolt#231](https://github.com/etcd-io/bbolt/issues/231)

* [chzyer/readline#188](https://github.com/chzyer/readline/issues/188)

I've also removed those platforms from our download page for the time being. Too bad. :(

There's one item in this stream 🙂

# github.com/caddyserver/caddy/v2/cmd
../proc_posix.go:28:9: undefined: syscall.Kill

It's a thoughie because there's no equivalent to syscall.Kill on Plan9. If all upstream issues are resolved, we might need to resort to shell command to issue kill command.

@mholt
Copy link
Member

mholt commented Jul 31, 2020

There's one item in this stream 🙂

Yeah, but that one won't be too hard -- like you said, a shell command or something: https://en.wikipedia.org/wiki/Kill_(command)#Plan_9_from_Bell_Labs kill caddy | rc

Tbh I'm skeptical that the upstream ones will be resolved though.

@mholt
Copy link
Member

mholt commented Aug 5, 2020

Dgraph fixing builds for Plan9; looking into Solaris: https://discuss.dgraph.io/t/build-failure-for-goos-solaris-illumos-plan9/9145/3?u=mholt

@lispstudent
Copy link

Joyent's pkgsrc somehow manages to compile caddy on illumos, but it is with no packages.

@francislavoie
Copy link
Member

francislavoie commented Aug 23, 2021

Looks like it's working everywhere except plan9 now! https://github.com/caddyserver/caddy/actions/runs/1152172382

Errors I see from trying to build it locally:

# go.etcd.io/bbolt
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:223:12: undefined: flock
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:360:12: undefined: mmap
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:382:12: undefined: munmap
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:462:12: undefined: fdatasync
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:507:14: undefined: funlock
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\db.go:867:37: undefined: fdatasync
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\tx.go:559:13: undefined: fdatasync
..\..\..\..\go\pkg\mod\go.etcd.io\[email protected]\tx.go:596:13: undefined: fdatasync
# github.com/chzyer/readline
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\operation.go:234:4: undefined: ClearScreen
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\readline.go:129:20: undefined: GetScreenWidth
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\readline.go:132:22: undefined: DefaultIsTerminal
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\readline.go:142:26: undefined: DefaultOnWidthChanged
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\remote.go:324:2: undefined: DefaultOnWidthChanged
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\remote.go:346:17: undefined: GetScreenWidth
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\remote.go:362:16: undefined: DefaultIsTerminal
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\terminal.go:51:2: undefined: SuspendMe
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\utils.go:81:29: undefined: State
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\utils.go:241:9: undefined: State
..\..\..\..\go\pkg\mod\github.com\chzyer\[email protected]\terminal.go:51:2: too many errors
# github.com/dgraph-io/badger/v2/y
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\file_dsync.go:24:21: undefined: unix.O_DSYNC
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:30:11: undefined: unix.PROT_READ
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:32:12: undefined: unix.PROT_WRITE
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:34:9: undefined: unix.Mmap
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:34:54: undefined: unix.MAP_SHARED
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:39:9: undefined: unix.Munmap
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:46:11: undefined: unix.MADV_NORMAL
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:48:11: undefined: unix.MADV_RANDOM
..\..\..\..\go\pkg\mod\github.com\dgraph-io\badger\[email protected]\y\mmap_unix.go:50:9: undefined: unix.Madvise

Asked badger if they can backport their fixes for plan9 to their v2 branch: hypermodeinc/badger#1451 (comment)

github.com\chzyer\readline Looks essentially abandoned so we shouldn't hold our breath on that one.

francislavoie added a commit that referenced this issue Aug 31, 2021
This generated way too many test jobs, which weren't really that useful. Cross-build is just to keep us posted on which architectures are building okay, so it's not necessary to do it twice. Only plan9 is not working at this point (see #3615)
mholt pushed a commit that referenced this issue Aug 31, 2021
This generated way too many test jobs, which weren't really that useful. Cross-build is just to keep us posted on which architectures are building okay, so it's not necessary to do it twice. Only plan9 is not working at this point (see #3615)
@mholt
Copy link
Member

mholt commented Sep 14, 2022

Getting closer, sort of. Still builds for solaris OK, latest attempt at plan9 is now failing with:

$ GOOS=plan9 go build
# go.etcd.io/bbolt
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:230:12: undefined: flock
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:375:12: undefined: mmap
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:404:12: undefined: munmap
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:508:12: undefined: fdatasync
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:554:14: undefined: funlock
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/db.go:914:37: undefined: fdatasync
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:14:17: undefined: unix.Mlock
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:32:17: undefined: unix.Munlock
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/tx.go:558:13: undefined: fdatasync
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/tx.go:595:13: undefined: fdatasync
/home/matt/go/pkg/mod/go.etcd.io/[email protected]/tx.go:595:13: too many errors
# github.com/chzyer/readline
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/utils.go:81:29: undefined: State
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/utils.go:241:9: undefined: State
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/operation.go:234:4: undefined: ClearScreen
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/readline.go:129:20: undefined: GetScreenWidth
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/readline.go:132:22: undefined: DefaultIsTerminal
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/readline.go:142:26: undefined: DefaultOnWidthChanged
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/remote.go:324:2: undefined: DefaultOnWidthChanged
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/remote.go:346:17: undefined: GetScreenWidth
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/remote.go:362:16: undefined: DefaultIsTerminal
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:51:2: undefined: SuspendMe
/home/matt/go/pkg/mod/github.com/chzyer/[email protected]/terminal.go:51:2: too many errors
# github.com/tailscale/tscert/internal/paths
/home/matt/go/pkg/mod/github.com/tailscale/[email protected]/internal/paths/paths_unix.go:44:15: undefined: unix.Access
/home/matt/go/pkg/mod/github.com/tailscale/[email protected]/internal/paths/paths_unix.go:44:32: undefined: unix.O_RDWR

@mholt mholt added the help wanted 🆘 Extra attention is needed label Sep 14, 2022
@mholt
Copy link
Member

mholt commented Apr 24, 2024

Welp, still the same result 2 years later. I don't think there's any hope of getting Caddy to build on Plan9 until the listed dependencies also support it. We could be more proactive about getting this done, but I think we'll only prioritize this if there's a real need and/or sponsorship to do so.

@mholt mholt closed this as not planned Won't fix, can't repro, duplicate, stale Apr 24, 2024
@mholt mholt removed this from the 2.x milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🆘 Extra attention is needed upstream ⬆️ Relates to some dependency of this project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants