spire icon indicating copy to clipboard operation
spire copied to clipboard

[ bug ] Fails to build on FreeBSD: undefined: OpenDevice

Open yonas opened this issue 1 month ago • 4 comments

gmake build-static
Building bin/static/spire-server…
Building bin/static/spire-agent…
# github.com/google/go-tdx-guest/client
/home/yonas/go/pkg/mod/github.com/google/[email protected]/client/client.go:147:17: undefined: OpenDevice
gmake: *** [Makefile:291: bin/static/spire-agent] Error 1

OS: FreeBSD 14 go: 1.25.4 freebsd/amd64 commit: 9e5e3ab

yonas avatar Nov 12 '25 14:11 yonas

Thank you @yonas for raising this. Unfortunately, we haven't done a good job at documenting what are the supported platforms of the project. We officially support linux-amd64, linux-arm64 and windows-amd64 platforms, not FreeBSD.

github.com/google/go-tdx-guest is an indirect dependency for the tpmdevid agent node attestor plugin. If you don't need this plugin, we could likely make SPIRE support building on FreeBSD. We will be happy to take a contribution that makes SPIRE build on FreeBSD, probably acknowledging that the tpmdevid agent node attestor plugin will not be available.

amartinezfayo avatar Nov 13 '25 20:11 amartinezfayo

Thanks @amartinezfayo , I don't know if github.com/google/go-tdx-guest is required.

Unfortunately I don't know enough about these components to be suggesting to remove it, although my guess would be it isn't needed.

yonas avatar Nov 20 '25 22:11 yonas

Looks like go-tdx-guest already has some support for building on platforms that it doesn't already support. Would it be possible for you to add something similar there for FreeBSD or make that macOS implementation be something that applies to any non-linux system. That project might be open to this since they already do something similar for Mac and Windows.

As long as you're not using the TPM plugin this shouldn't affect you in any way. We don't officially support FreeBSD, so we can't guarantee that it works there. If there are any other fixes needed on our side, we'd be open to fixing them if they don't involve too many OS specific changes.

sorindumitru avatar Dec 02 '25 19:12 sorindumitru

Thanks, I'll let you know how it goes.

yonas avatar Dec 02 '25 20:12 yonas