Skip to content
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

Failure on Go v1.24 #105

Closed
gabe565 opened this issue Feb 12, 2025 · 8 comments · Fixed by #106
Closed

Failure on Go v1.24 #105

gabe565 opened this issue Feb 12, 2025 · 8 comments · Fixed by #106

Comments

@gabe565
Copy link
Contributor

gabe565 commented Feb 12, 2025

As of Go v1.24, enumer fails with import errors like:

enumer: internal error: package "os" without types was imported from "..."

These errors look similar to #55, so I suspect the golang.org/x/tools version needs to be updated.

@janpfeifer
Copy link

Btw, while we wait for the PR to be merged, do you know how to get enumer tool with commit of the PR ?

What I would expect go get -tool -u github.com/dmarkham/enumer@4f01b0828dc231b2ce8a6b51c91481b8340c8fbe doesn't seem to work. And I wanted to avoid forking myself a copy.

(The AI doesn't seem to know either)

@dsseng
Copy link

dsseng commented Feb 15, 2025

Go cannot fetch the fork commit it seems, and if I point it to gabe565's fork then go.mod module name is wrong. If the PR doesn't land by Monday or shortly after I'll fork to modify go.mod on top of the change.

Maybe a better option exists.

Btw, while we wait for the PR to be merged, do you know how to get enumer tool with commit of the PR ?

What I would expect go get -tool -u github.com/dmarkham/enumer@4f01b0828dc231b2ce8a6b51c91481b8340c8fbe doesn't seem to work. And I wanted to avoid forking myself a copy.

(The AI doesn't seem to know either)

@janpfeifer
Copy link

Thanks for the reply @dsseng , I bumped into the exact same issues, and thought I was doing something wrong.

For the time being, I checked out the 1.23.6 version of Go, did a go install github.com/dmarkham/enumer@latest using that, and generated my files with that Go version (without using go tool to generate them yet). Just in case this is useful for someone else.

@gabe565
Copy link
Contributor Author

gabe565 commented Feb 15, 2025

You could replace the dependency by adding this to go.mod:

replace github.com/dmarkham/enumer => github.com/gabe565/enumer 4f01b0828dc231b2ce8a6b51c91481b8340c8fbe

Then running go mod tidy to properly format the version.

Just be aware that this will prevent go install github.com/... from working for your repo, and don't forget to remove it whenever the PR eventually gets merged!

@dsseng
Copy link

dsseng commented Feb 17, 2025

I forked and fixed up go.mod on top of @gabe565's branch, so go install github.com/dsseng/enumer@v1.5.11-0.20250217145611-d1015c2bde3f should work to get the PR built

@gabe565
Copy link
Contributor Author

gabe565 commented Feb 17, 2025

@dsseng I also did that on my main branch, so you can run go install github.com/gabe565/enumerv@0.0.0-20250213064945-3a8c3dbc8f61. I just didn't mention it because I didn't want anybody to change to my fork and forget to change back. I guess using replace is about the same though. Either way works!

@samiam2013
Copy link
Collaborator

samiam2013 commented Feb 18, 2025

1.5.11 just released with this change. Thank you @gabe565!

@janpfeifer
Copy link

+1 thank you @gabe565 and @samiam2013 for the release!

dsseng added a commit to dsseng/talos that referenced this issue Feb 18, 2025
Go back to upstream releases after dmarkham/enumer#105 has been fixed

Signed-off-by: Dmitrii Sharshakov <dmitry.sharshakov@siderolabs.com>
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 a pull request may close this issue.

4 participants