Skip to content

[BUG]: compilation fails with GOOS=aix (Unix) #2035

Open
@mohammed90

Description

@mohammed90

What version of Badger are you using?

  • github.com/dgraph-io/badger v1.6.2
  • github.com/dgraph-io/badger/v2 v2.2007.4

What version of Go are you using?

Go1.21.5

Have you tried reproducing the issue with the latest release?

Yes

What is the hardware spec (RAM, CPU, OS)?

RAM & CPU: Not sure, whatever Github Actions uses (reproduced here).

OS: AIX

What steps will reproduce the bug?

Build with: GOOS=aix GOARCH=ppc64 go build

Expected behavior and actual result.

Expectation:

Successful compilation

Actual result:

# github.com/dgraph-io/badger
dir_unix.go:63:13: undefined: unix.Flock
# github.com/dgraph-io/badger/v2
dir_unix.go:62:13: undefined: unix.Flock

Additional information

The issue is that Badger uses unix.Flock from the golang.org/x/sys/unix, but the referenced function is not available in the referenced dependency for AIX. The syscall exists in AIX, but not exposed/available in the x/sys/unix package. This has been reported upstream (golang/go#64669).

Badger v1 and v2 is an indirect dependency for Caddy, which is how we come across this issue. This was reported by one of the users who was attempting to compile Caddy for AIX (see caddyserver/caddy#5970). This isn't directly an error of badger. We've already reported it upstream (see golang/go#64669). I don't know if you're interested in figuring out a workaround (haven't personally tried any) or prefer to just wait for the Go ticket to be resolved by upstream.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething is broken.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions