Closed mschuchard closed 11 months ago
Hi @mschuchard,
It seems like the Packer SDK is internally relying on the encoding/gob
library for its wire serialization. Older versions of cty had some leftover support for gob which I added as a concession to HashiCorp Terraform before the Terraform team realized that gob wasn't going to work anyway, and so I recently removed that concession from cty because it was hampering ongoing maintenance.
It seems unfortunate that HashiCorp Packer was quietly relying on this behavior. I think the best thing to do here is first to see if there's some way that Packer can take responsibility for its own wire encoding concerns (that is: implement the gob encoding itself rather than relying on me to maintain it upstream.) If that isn't possible for some reason then I may consider adding back gob support, but if it comes to that then I'll likely have some design work to figure out how to reintroduce it in a way that doesn't make it so inconvenient to maintain other parts of this library.
I'll wait to see what the Packer team thinks before taking any action here.
I see now this overlaps with #132, which was also dual-reported on both trackers (which is how I discovered it). The chosen resolution was to downgrade to go-cty
v1.10.0 for use with the packer-sdk
.
I believe that this will probably not be acted upon in the packer-sdk
, and therefore probably the path forward will be to lock to v1.10.0 for Packer moving forward. Hopefully that is not the case though.
Dependabot update proposals to v1.11.0 score with a compatibility of 3%, see e.g. https://github.com/mkaczanowski/packer-builder-arm/pull/211 That maybe indicates lots of users relying on the packer-plugin-sdk compatibility.
I believe this is now being tracked officially at hashicorp/packer-plugin-sdk#187.
Overview of the Issue
If the package
github.com/zclconf/go-cty v1.11.0
is used with the Packer SDK, then an error is thrown. I am unsure if this is an error with Packer SDK orgo-cty
. If the error is with the other package, then please redirect me. I am opening this issue on both trackers.Reproduction Steps
Do anything with a Packer plugin built with go-cty v1.11.0 as this occurs immediately after Packer loads the plugin.
Packer Plugin SDK/go-cty versions
packer-sdk
0.3.1 and 0.3.2 both throw this error.go-cty
v1.10.0 works perfectly. v1.11.0 throws this error.Operating system and Environment details
go 1.18
Log Fragments and crash.log files
Additional Information
I suspect this is referencing the
cty.Type
from the<plugin>.hcl2spec.go
. If I attempt to regenerate that file withgo-cty
v1.11.0, then the following error is thrown: