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

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

Open
mohammed90 opened this issue Dec 12, 2023 · 5 comments
Open

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

mohammed90 opened this issue Dec 12, 2023 · 5 comments
Labels
kind/bug Something is broken.

Comments

@mohammed90
Copy link

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.

@mohammed90 mohammed90 added the kind/bug Something is broken. label Dec 12, 2023
@mohammed90 mohammed90 changed the title [BUG]: not usable with GOOS=aix (Unix) [BUG]: compilation fails with GOOS=aix (Unix) Dec 12, 2023
@mohammed90
Copy link
Author

Per the codebase, this issue affects all versions of Badger, including v4. The recommendation is use the mechanism used in this internal package (godoc) of Go cmd: https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/cmd/go/internal/lockedfile/internal/filelock/.

Or you could use rogepeppe package: https://pkg.go.dev/github.com/rogpeppe/go-internal/lockedfile.

Copy link

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Jul 14, 2024
@mohammed90
Copy link
Author

Keep. This issue is easily solvable and affects downstream.

Copy link

This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.

@github-actions github-actions bot added the Stale label Sep 13, 2024
@mohammed90
Copy link
Author

Keep

@github-actions github-actions bot removed the Stale label Sep 13, 2024
pmur pushed a commit to pmur/badger that referenced this issue Sep 26, 2024
AIX doesn't support a proper flock like linux, but it seems
to have enough support for process level file locking using
fcntl.

For dgraph-io#2035
mangalaman93 pushed a commit to pmur/badger that referenced this issue Oct 14, 2024
AIX doesn't support a proper flock like linux, but it seems
to have enough support for process level file locking using
fcntl.

For dgraph-io#2035
mangalaman93 pushed a commit to pmur/badger that referenced this issue Oct 18, 2024
AIX doesn't support a proper flock like linux, but it seems
to have enough support for process level file locking using
fcntl.

For dgraph-io#2035
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

1 participant