Use build tags to allow building without tspi
josephlr opened this issue · 1 comments
josephlr commented
Right now, a user of go-attestation must download and install libtspi-dev even if they only wish to use TPM2 (such as with GCE). This can be problematic as this library is not distributed with all Linux distros.
Go supports build constraints to allow for conditional compilation. Similar to how we don't require tspi on Windows builds, we could use a notspi
build constraint to allow:
go build -notspi windows ./attest/attest-tool
to build without tspi.
We could also invert the semantics, having the tspi
build flag enable support for TPM 1.2 on Linux, depending on what we want to be the default.
vinaykotak commented
@josephlr Do you have an ETA on when the PR for this issue is expected to merge?