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

Can not build with GOARCH=arm64 #26

Open
Harikesh00 opened this issue Nov 1, 2023 · 0 comments
Open

Can not build with GOARCH=arm64 #26

Harikesh00 opened this issue Nov 1, 2023 · 0 comments

Comments

@Harikesh00
Copy link

We are building the go binary using MakeFile which runs the below command present in the .Dockerfile
I want to build on GOARCH=arm64

RUN GOARCH=arm64 GOOS=linux go build -mod vendor -tags "static netgo" -ldflags '-s -extldflags "-static"' -o bin/upgrade ./cmd/upgrade && \
        GOARCH=arm64 GOOS=linux go build -mod vendor -tags "static netgo" -ldflags '-s -extldflags "-static"' -o bin/onboard ./cmd/onboarding && \
        GOARCH=arm64 GOOS=linux go build -mod vendor -tags "static netgo" -ldflags '-s -extldflags "-static"' -o bin/restserver ./cmd/restserver/main.go && \
        GOARCH=arm64 GOOS=linux go build -mod vendor -tags "static netgo" -ldflags '-s -extldflags "-static"' -o bin/restlambda ./cmd/restlambda/main.go && \
  cd cmd/upgrade && rice append --exec ../../bin/upgrade

but I getting the error

pkg/saml/sign_static.go:31:23: undefined: xmlsec.Sign
pkg/saml/sign_static.go:31:112: undefined: xmlsec.SignatureOptions
pkg/saml/sign_static.go:32:19: undefined: xmlsec.XMLIDOption

sign_static.go file contains the below code

func sign(xml string, privateKeyPath string, id string) (string, error) {

	var (
		output, key []byte
		err         error
	)
	key, err = ioutil.ReadFile(privateKeyPath)
	if err != nil {
		return "", errors.New(err.Error())
	}
	output, err = xmlsec.Sign(key, []byte(fmt.Sprintf("<?xml version='1.0' encoding='UTF-8'?>\n%s", xml)), xmlsec.SignatureOptions{
		XMLID: []xmlsec.XMLIDOption{
			{
				ElementName:      "Response",
				ElementNamespace: "urn:oasis:names:tc:SAML:2.0:protocol",
				AttributeName:    "ID",
			},
		},
	})

	if err != nil {
		return "", errors.New(err.Error() + " : " + string(output))
	}

	return string(output), nil
}

It works with the GOARCH=amd64 but with GOARCH=arm64 it gave an error. I want help here, is this really an issue with the library or am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant