Skip to content

Commit

Permalink
Add explicit hsm build tag (#942)
Browse files Browse the repository at this point in the history
Using an implicit CGO tag means that the PKCS#11 build must succeed on
musl (which it likely won't); move it to an explicit tag and let the
build fail with a rather cryptic error if CGO is not specified but the
hsm build tag is:

   ==> Building bao...
   # github.com/openbao/go-kms-wrapping/wrappers/pkcs11/v2
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:55:22: undefined: pkcs11.Ctx
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:278:53: undefined: pkcs11.SessionHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:278:79: undefined: pkcs11.ObjectHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:309:54: undefined: pkcs11.SessionHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:309:80: undefined: pkcs11.ObjectHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:364:53: undefined: pkcs11.SessionHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:364:79: undefined: pkcs11.ObjectHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:381:54: undefined: pkcs11.SessionHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:381:80: undefined: pkcs11.ObjectHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:442:45: undefined: pkcs11.SessionHandle
   ../../../go/pkg/mod/github.com/openbao/go-kms-wrapping/wrappers/pkcs11/[email protected]/pkcs11_client.go:442:45: too many errors

Signed-off-by: Alexander Scheel <[email protected]>
  • Loading branch information
cipherboy authored Jan 26, 2025
1 parent d4a1c72 commit 9b9074b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internalshared/configutil/no_pkcs11.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !cgo || !linux
//go:build !hsm || !linux

package configutil

Expand Down
2 changes: 1 addition & 1 deletion internalshared/configutil/pkcs11.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build cgo && linux
//go:build hsm && linux

package configutil

Expand Down

0 comments on commit 9b9074b

Please sign in to comment.