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

Building on Plan 9 fails #587

Open
sctaw opened this issue Oct 26, 2023 · 3 comments
Open

Building on Plan 9 fails #587

sctaw opened this issue Oct 26, 2023 · 3 comments

Comments

@sctaw
Copy link

sctaw commented Oct 26, 2023

What I did:

I tried to install https://github.com/anacrolix/torrent which depends on bbolt

What I expected:

to get bbolt and thus anarcolinux/torrent compiling, per 9front documentation, it has been possible to build it: http://fqa.9front.org/fqa8.html#8.4.9.2.2

What I got:

go.etcd.io/bbolt

go/pkg/mod/go.etcd.io/[email protected]/db.go:230:12: undefined: flock
go/pkg/mod/go.etcd.io/[email protected]/db.go:375:12: undefined: mmap
go/pkg/mod/go.etcd.io/[email protected]/db.go:404:12: undefined: munmap
go/pkg/mod/go.etcd.io/[email protected]/db.go:508:12: undefined: fdatasync
go/pkg/mod/go.etcd.io/[email protected]/db.go:554:14: undefined: funlock
go/pkg/mod/go.etcd.io/[email protected]/db.go:914:37: undefined: fdatasync
go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:14:17: undefined: unix.Mlock
go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:32:17: undefined: unix.Munlock
go/pkg/mod/go.etcd.io/[email protected]/tx.go:558:13: undefined: fdatasync
go/pkg/mod/go.etcd.io/[email protected]/tx.go:595:13: undefined: fdatasync
go/pkg/mod/go.etcd.io/[email protected]/tx.go:595:13: too many errors

What I tried:

Changing bbolt version to 1.3.7

Result:

go.etcd.io/bbolt

/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:242:12: undefined: flock
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:469:12: undefined: mmap
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:511:12: undefined: munmap
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:616:12: undefined: fdatasync
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:662:14: undefined: funlock
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/db.go:1035:37: undefined: fdatasync
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:15:17: undefined: unix.Mlock
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/mlock_unix.go:33:17: undefined: unix.Munlock
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/tx.go:473:13: undefined: fdatasync
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/tx.go:510:13: undefined: fdatasync
/usr/glenda/go/pkg/mod/go.etcd.io/[email protected]/tx.go:510:13: too many errors

My environment:

Plan9Front amd64 running in Qemu

go env output:

; go env
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/usr/glenda/lib/cache/go-build'
GOENV='/usr/glenda/lib/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='plan9'
GOINSECURE=''
GOMODCACHE='/usr/glenda/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='plan9'
GOPATH='/usr/glenda/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/sys/lib/go/amd64-1.21.1'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/sys/lib/go/amd64-1.21.1/pkg/tool/plan9_amd64'
GOVCS=''
GOVERSION='go1.21.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2933823274=/tmp/go-build -gno-record-gcc-switches'

@ahrtr
Copy link
Member

ahrtr commented Oct 27, 2023

Thanks for raising this. Unfortunately bbolt doesn't support plan9 so far.

But it might just need minor effort to support it,

  • Add a new file bolt_plan9.go to implement flock, funlock, mmap, munmap and fdatasync. Similar to bolt_windows.go
  • Add a new file mlock_plan9.go to implement mlock and munlock, similar to mlock_windows.go. Also change //go:build !windows to //go:build !windows && !plan9 in mlock_unix.go.

@ahrtr
Copy link
Member

ahrtr commented Dec 3, 2023

#626 (comment)

@ahrtr
Copy link
Member

ahrtr commented Jan 4, 2024

Linked to #665

@github-actions github-actions bot added the stale label Apr 16, 2024
@ahrtr ahrtr removed the stale label May 10, 2024
@github-actions github-actions bot added the stale label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants