PBM for ARM Architecture

I’ve tried building from source using AL2 on the AARCH64 architecture and I get a Go error during the make build:
build constraints exclude all Go files in /opt/percona-backup-mongodb/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/gssapi

Based on some Google searches, it would seem the driver C files are only usable for x86_64. Is this correct? Is there any way around this? TIA

Hi @TimSandberg !
To build PBM from sources you need to install krb5-devel package

Hi @oleksandr.havryliak !

Yes, I have that package installed. The error persists. As I mentioned, this appears to be related to the ARM architecture. Has anyone built PBM on ARM64 previously?

We did build and test PBM on aarch64 many times. Maybe the issue is the krb5 package for AL2?
Could you, please, provide us more details - golang version, krb5-devel version, full build log.

go version:
go version go1.21.4 linux/arm64

krb5-devel:
krb5-devel.aarch64 1.15.1-55.amzn2.2.6

Doing a “make build” yields this:
GO111MODULE=on GOOS=linux GOFLAGS=‘-buildvcs=false’ go build -ldflags=“-X github.com/percona/percona-backup-mongodb/version.gitCommit=3b1c2e263901cf041c6b83547f6f28ac2879911f -X github.com/percona/percona-backup-mongodb/version.gitBranch=main -X github.com/percona/percona-backup-mongodb/version.buildTime=2023-11-16_15:54_UTC -X github.com/percona/percona-backup-mongodb/version.version=” -mod=vendor -tags gssapi -o ./bin/pbm ./cmd/pbm
package github.com/percona/percona-backup-mongodb/cmd/pbm
imports github.com/percona/percona-backup-mongodb/cli
imports github.com/mongodb/mongo-tools/common/db
imports github.com/mongodb/mongo-tools/common/bsonutil
imports github.com/mongodb/mongo-tools/common/json
imports github.com/mongodb/mongo-tools/common/util
imports go.mongodb.org/mongo-driver/mongo
imports go.mongodb.org/mongo-driver/x/mongo/driver/topology
imports go.mongodb.org/mongo-driver/x/mongo/driver/auth
imports go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/gssapi: build constraints exclude all Go files in /home/ec2-user/percona-backup-mongodb/vendor/go.mongodb.org/mongo-driver/x/mongo/driver/auth/internal/gssapi
make: *** [build-pbm] Error 1

Try to build with CGO_ENABLED=1 and GOARCH=arm64

I updated the CGO_ENABLED in the Makefile and I added the GOARCH line, but make build yields the same result.

Could you, please, check if you have C compiler installed?
Or try to install all necessary software using sudo yum groupinstall “Development Tools”

The yum groupinstall cmd did the trick–I guess I was missing a module somewhere. Compiled successfully and commands verified. Thank you very much for your assistance!!!

1 Like