-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hashicorp/packer-plugin-sdk incompatible with zclconf/go-cty v1.11.0 #134
Comments
Hi @mschuchard, It seems like the Packer SDK is internally relying on the 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 I believe that this will probably not be acted upon in the |
Dependabot update proposals to v1.11.0 score with a compatibility of 3%, see e.g. mkaczanowski/packer-builder-arm#211 That maybe indicates lots of users relying on the packer-plugin-sdk compatibility. |
…h the packer-sdc zclconf/go-cty#134 Signed-off-by: Preslav <preslav@mondoo.com>
Scanning hcl files panics, see zclconf/go-cty#134 for context. We should avoid upgrading that specific module until it's resolved Signed-off-by: Preslav <preslav@mondoo.com>
Newer go-cty version breaks `mapstructure-to-hcl2` tool, breaking the build pipeline in the process. The current recommendation is to fall back on older go-cty version. See: - hashicorp/packer-plugin-sdk#128 - zclconf/go-cty#132 (comment) - zclconf/go-cty#134 (comment) Revert "build(deps): bump github.com/zclconf/go-cty from 1.10.0 to 1.12.1" Revert "build(deps): bump github.com/hashicorp/hcl/v2 from 2.14.1 to 2.15.0" This reverts commit 4bc5b3e. and commit 16bf32b.
- update to go 1.19 - remove dependency on external mondoo binary - switch to use inventory instead of config piping to external binary *cty dependency downgrade* Packer and Terraform use different versions of go cty. The problem is that packer does not work with the latest version of go-cty as documented here: - [hashicorp/packer-plugin-sdk incompatible with zclconf/go-cty v1.11.0 · Issue #134 · zclconf/go-cty · GitHub](zclconf/go-cty#134) - [Upgrade github.com/zclconf/go-cty to v1.11.1 · Issue #12055 · hashicorp/packer · GitHub](hashicorp/packer#12055) - [Upgrade github.com/zclconf/go-cty to v1.11.1 · Issue #135 · hashicorp/packer-plugin-sdk · GitHub](hashicorp/packer-plugin-sdk#135) There are two issues, we cannot bundle both go-cty versions due to the fact that it is not labeled a major change. Out only option to get this working for now is to downgrade cty in cnquery and cnspec. *TODOs* - [x] downgrade cty in cnquery mondoohq/cnquery#499 - [x] downgrade cty in cnspec mondoohq/cnspec#201 - [x] update readme Co-authored-by: Scott Ford <49754039+scottford-io@users.noreply.github.com>
Recent versions of the library cause Packer to crash at runtime, due to Packer's SDK relying on the `encoding/gob` library for wire serialization. See zclconf/go-cty#134 and hashicorp/packer-plugin-sdk#131 for context.
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:The text was updated successfully, but these errors were encountered: