Skip to content

Conversation

@lbajolet-hashicorp
Copy link
Contributor

Release 0.5.0 of the SDK was borked as the replace statement for go-cty in the go.mod makes it incompatible with go install, which is how dependents of the SDK install packer-sdc.

To fix this, we remove this statement from the go.mod, and amend the test action so that it adds that statement before testing.

The way we install the SDK and its dependencies in plugins, using
go install, is incompatible with replace statements.

Therefore, we remove that statement from the go.mod, and leave the
responsibility of including that replace to plugins that import the SDK.
Before this commit, `packer-sdc fix' would only work on plugins that
import the SDK, but we also need to make `packer-sdc fix' compatible
with the SDK itself, so we add an extra check to packer-sdc so it
doesn't ignore the SDK when applying the replace fix.
@lbajolet-hashicorp lbajolet-hashicorp requested a review from a team as a code owner July 31, 2023 14:48
@lbajolet-hashicorp lbajolet-hashicorp force-pushed the fix_replace_go_mod branch 7 times, most recently from 6fcb0ac to 8f99171 Compare July 31, 2023 15:24
@lbajolet-hashicorp lbajolet-hashicorp force-pushed the fix_replace_go_mod branch 3 times, most recently from aeeb2c2 to b820020 Compare July 31, 2023 17:58
@nywilken nywilken added the bug Something isn't working label Jul 31, 2023
Since we remove the `replace' statement from the go.mod, tests will fail
as the updated version of go-cty does not support gob, and some tests
rely on that by default as we init RPC to work with gob-encoded
payloads.

To avoid this failure in CI, we add an extra step to the go-test
workflow so that it amends the go.mod, tidies it to resolve missing
sums, and continues with testing afterwards
Copy link
Contributor

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Can we rebase the commits before merging.

@lbajolet-hashicorp lbajolet-hashicorp merged commit 5c50987 into main Aug 1, 2023
@lbajolet-hashicorp lbajolet-hashicorp deleted the fix_replace_go_mod branch August 1, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants