Skip to content

Update generate dependencies to fix Go 1.18 packer-sec cmd install#108

Merged
nywilken merged 2 commits intomainfrom
nywilken/update-gen-deps
May 11, 2022
Merged

Update generate dependencies to fix Go 1.18 packer-sec cmd install#108
nywilken merged 2 commits intomainfrom
nywilken/update-gen-deps

Conversation

@nywilken
Copy link
Copy Markdown
Contributor

@nywilken nywilken commented May 9, 2022

These changes update the golang.org/x/tools pkg to fix code generation issue with Go 1.18+, and update the projects Makefile to use go install over the deprecated go get installation command.

Closes #103

* Update x/tools package to latest version to fix code generation error

```
 go get golang.org/x/tools
 go mod tidy
```

Closes #103
@nywilken nywilken requested a review from a team as a code owner May 9, 2022 22:21
Copy link
Copy Markdown

@sylviamoss sylviamoss left a comment

Choose a reason for hiding this comment

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

Nice!

Comment thread Makefile
@(cd $(TEMPDIR) && GO111MODULE=on go get github.com/mna/pigeon@master)
@(cd $(TEMPDIR) && GO111MODULE=on go get github.com/alvaroloes/enumer@master)
@go install github.com/mna/pigeon@v1.1.0
@go install github.com/alvaroloes/enumer@master
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why not pin this also?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah let me leave a comment on that one. The latest release is outdated. So keeping it at master for now.

Copy link
Copy Markdown
Contributor

@rgl rgl May 10, 2022

Choose a reason for hiding this comment

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

does it allow for a @commit-id?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe it does. But TBH a tag would be preferred. Seeing as it was set to master before, and the code has not changed, I will keep it as it is. There appears to be a few forks that have since been updated, which we may want to look into.

I'm going to merge this change but please continue the conversation as we can iterate on the change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm generally worried about these loose dependencies, because they generally mean the build has less chances of being reproducible in the future. And being non-reproducible has a tendency to break, not only this upstream project, but also downstream clients. Downstream clients generally seem to a have a tendency to be "stuck" until upstream fixes these kind of problems, or they themselves try to fix it (if they even known how) with(out) upstream help, but until a fix is ready, someone might be "stuck".

Please note that I understand this is a fine balance between practicality and maintainability, and I'm not trying to push anything, I'm just expressing my opinion.

FWIW, I was a tiny bit impacted by this; mind you, by my own doing! I though I was pinning the go version, but I was not really doing that, so this was an enlightenment moment for me! and at the end, I was graceful that this has happened!

* Replaces the deprecated `go get` calls with `go install`.

* Add version to pigeon install command
The v1.1.0 release of pigeon was released back in March of 2021 points
to the latest change in the master branch, which was committed over two
years ago. Instead of pulling from master we will pull in the latest
release and update dependenbot to check for this dependency.

* Add github.com/mna/pigeon to dependebot tracking file

Related to: #103
@nywilken nywilken force-pushed the nywilken/update-gen-deps branch from 29449d2 to db3a2b9 Compare May 10, 2022 11:43
@nywilken nywilken merged commit 3ef8de5 into main May 11, 2022
@nywilken nywilken deleted the nywilken/update-gen-deps branch May 11, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packer sdc generation commands fails when executed using Go 1.18

3 participants