caddy: AIX build is broken

Hi,

I just noticed the env vars GOOS=aix GOARCH=ppc64 will lead to a build error:

$ GOOS=aix GOARCH=ppc64 go build
# github.com/dgraph-io/badger
../../../../go/pkg/mod/github.com/dgraph-io/badger@v1.6.2/dir_unix.go:63:13: undefined: unix.Flock
# github.com/dgraph-io/badger/v2
../../../../go/pkg/mod/github.com/dgraph-io/badger/v2@v2.2007.4/dir_unix.go:62:13: undefined: unix.Flock
# github.com/google/certificate-transparency-go/x509
../../../../go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.6/x509/cert_pool.go:65:9: undefined: loadSystemRoots
../../../../go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.6/x509/root.go:21:32: undefined: loadSystemRoots
../../../../go/pkg/mod/github.com/google/certificate-transparency-go@v1.1.6/x509/verify.go:759:12: c.systemVerify undefined (type *Certificate has no field or method systemVerify)

I think this should have worked out of the box? => https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63

I found no infos about AIX not being supported. Any help is appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (22 by maintainers)

Commits related to this issue

Most upvoted comments

Woohoo thanks! Can now evaulate caddy as a reverse proxy! Many thanks! đŸ‘đŸ»

Reported upstream:

  • golang/go#64669
  • dgraph-io/badger#2035
  • google/certificate-transparency-go#1276

Thank you for your patience explaining this! 😃 I am a Java developer only, all of what you said is really helpful! đŸ‘đŸ»

Oh, you’ll have to run go get -u github.com/caddyserver/caddy/v2@master after the tidy step.

Yup than the readme is not 100% correct. Instead of making the “go get” step optional, it should mention when to use it. And if you don’t use it, you’d need go mod tidy.

The README is correct because it’s listing the typical workflow of building the latest tagged version without modification. The change in flow for you is because you’re trying to build an untagged version that has not been released yet. Once we tag a new version, you won’t need to do the go get -u ....

I just used master. Then did the following:

  • Create a new folder: mkdir caddy
  • Change into it: cd caddy
  • Copy Caddy’s main.go into the empty folder.
  • Initialize a Go module: go mod init caddy
  • Did go mod tidy

Compile: go build like above

Oh, you’ll have to run go get -u github.com/caddyserver/caddy/v2@master after the tidy step.

@bmarwell, you can use the build tag nobadger to build Caddy on AIX. We don’t use Badger anyways; we use bbolt, which works on AIX without issues.

I’ve never even heard of aix. We’re not testing for that in our crossbuild job https://github.com/caddyserver/caddy/blob/master/.github/workflows/cross-build.yml

Either way, this is a problem with upstream dependencies. You’ll probably need to get the attention of dgraph-io/badger and google/certificate-transparency-go to fix it.

Oh, I can add a PR for that! https://github.com/caddyserver/caddy/pull/5971 Let me just find and sign the CLA form. 😊

For badger, the issue is a gap further upstream in golang.org/x/sys/unix, which is missing some syscalls for AIX, notably Lock.

I’ve never even heard of aix. We’re not testing for that in our crossbuild job https://github.com/caddyserver/caddy/blob/master/.github/workflows/cross-build.yml

Either way, this is a problem with upstream dependencies. You’ll probably need to get the attention of dgraph-io/badger and google/certificate-transparency-go to fix it.