smallstep / step-kms-plugin

🔐 step plugin to manage keys and certificates on a cloud KMSs and HSMs
Apache License 2.0
47 stars 6 forks source link

go install fails due to crypto library error #105

Closed ncaq closed 10 months ago

ncaq commented 10 months ago
go install github.com/smallstep/step-kms-plugin@latest

will not proceed with the following error.

# go.step.sm/crypto/tpm/attestation
.go/pkg/mod/go.step.sm/crypto@v0.32.3/tpm/attestation/client.go:216:26: ac.baseURL.JoinPath undefined (type *url.URL has no field or method JoinPath)
.go/pkg/mod/go.step.sm/crypto@v0.32.3/tpm/attestation/client.go:260:26: ac.baseURL.JoinPath undefined (type *url.URL has no field or method JoinPath)

My env.

2023-10-27T12:11:25 [✖ USAGE  2] ⬢ [Systemd] ❯ uname -a
Linux SSD0086 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

~
2023-10-27T12:12:40 ⬢ [Systemd] ❯ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ncaq/.cache/go-build"
GOENV="/home/ncaq/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ncaq/.go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ncaq/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2420606553=/tmp/go-build -gno-record-gcc-switches"
hslatman commented 10 months ago

Hi @ncaq, thank you for reporting this issue. You can try installing a specific version by specifying @v... or use a more recent Go version to install the binary. I think the JoinPath method was added in Go 1.19.

I've opened a PR to bump the Go version in go.mod to 1.20, so that it's in line with our crypto library: https://github.com/smallstep/step-kms-plugin/pull/106.

The reason we didn't find out about this before this issue is likely due to our automated dependency upgrades, and shared Go version specification in our workflows. We likely already updated the Go version in use in our workflow, then the dependency got upgraded and built/tested. We may need to specify the minimum required Go version somewhere.