hashicorp / packer-plugin-sdk

Packer Plugin SDK enables building Packer plugins (builders, provisioners, or post-processors) to manage any service providers or custom in-house solutions
Mozilla Public License 2.0
34 stars 48 forks source link

[HPR-1108] Add compile time check for go-cty #186

Closed nywilken closed 1 year ago

nywilken commented 1 year ago

In v1.11.0, the go-cty package dropped support for encoding/gob. Gob support is used by the SDK to serialize HCL2 object specs over the wire. If a plugin or Packer upgrades their version of zclconf/go-cty to one that does not contain Gob support the plugin will build but crash when trying to run a build on an HCL2 template. By adding this check, a consumer of the SDK will fail to compile if they are using an unsupported version of go-cty. This check is being added as a guard to prevent Packer SDK consumers from becoming out of sync with unsupported go-cty versions.

~> go get github.com/hashicorp/go-cty v1.13.0
~> make dev
rpc/cty_encode.go:15:24 cannot use cty.Value{} (value of type cty.Value) as type gob.GobEncoder

TODO