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

Cannot go install github.com/air-verse/air@latest #605

Open
nevinsm opened this issue Jun 3, 2024 · 14 comments
Open

Cannot go install github.com/air-verse/air@latest #605

nevinsm opened this issue Jun 3, 2024 · 14 comments

Comments

@nevinsm
Copy link

nevinsm commented Jun 3, 2024

It looks like a new tag hasn't been added yet so when go grabs latest it is the old version and it errors out.

Error message:

go: downloading github.com/air-verse/air v1.52.1
go: github.com/air-verse/air@latest: version constraints conflict:
        github.com/air-verse/air@v1.52.1: parsing go.mod:
        module declares its path as: github.com/cosmtrek/air
                but was required as: github.com/air-verse/air
@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

I just release a new version, should be fixed

@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

still have issue , so i revert the PR

@raymondjacobson
Copy link

+1 seeing this as well

@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

+1 seeing this as well

I just revert the PR, still have issue?

@fadiinho
Copy link

fadiinho commented Jun 4, 2024

+1 seeing this as well

I just revert the PR, still have issue?

Yep, I'm still having the same error.
The error disappears if use go install github.com/air-verse/air@latest instead of go install github.com/cosmtrek/air@latest as in the documentation.

@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

just use the document one. at end of the day, i will update the document.

@kz23szk
Copy link

kz23szk commented Jun 4, 2024

Currently, I can't install github.com/cosmtrek/air、 but will the module name be github.com/air-verse/air in the end?
I want to know which one it will be.

@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

will be github.com/air-verse/air in the end.

@xiantang
Copy link
Collaborator

xiantang commented Jun 4, 2024

image
should be fixed. I've tested in docker container.

PLS use go install github.com/air-verse/air@latest
I'll let this issue open, if u have any problem.

@franckffv
Copy link

For me, I had to replace github.com/cosmtrek/air@latest with github.com/air-verse/air@latest in my Docker Compose, as the URL github.com/cosmtrek/air redirects to github.com/air-verse/air

@silverwind
Copy link
Contributor

silverwind commented Jun 4, 2024

This change broke all past versions of air as it's no longer possible to go install anything but the latest version where module path matches repo path. Go module system is broken by design 🤮.

@nevinsm
Copy link
Author

nevinsm commented Jun 4, 2024

A proper fix for this will require some git history rewriting. The go module system is designed to be stable so changing the name like this will cause these expected integrity issues. You will need to rewrite references in all the commits so that all tags have the new github.com/air-verse/air instead of github.com/cosmtrek/air for module references. The same with the runner references and any other submodules.

e.g.
v1.49.0 https://github.com/air-verse/air/blob/v1.49.0/go.mod#L1

should look like v1.52.2 https://github.com/air-verse/air/blob/v1.52.2/go.mod

Should be doable with git filter-repo --replace-text <(echo 'github.com/cosmtrek/air==>github.com/air-verse/air'). Be aware that rewriting git history can have seriously bad side effects.

It might be better to leave v1 up at github.com/cosmtrek/air and make air-verse/air the v2 release with the original repo archived instead of redirecting. Either way the git history will need some love and the project overall will be in a messy state until this is resolved.

@nevinsm
Copy link
Author

nevinsm commented Jun 4, 2024

FWIW My personal preference for how to handle this would be to archive and leave up the original repository with a note that it is deprecated and moved here. Start this one fresh with a commit that changes the names and then tag it as v2.0.0 to reflect the breaking change. You lose the old git history, but then the bifurcation is clean at least. If you want to keep the history, delete the old tags off of this repo.

@jarielbalberona
Copy link

I got this error. Any update?

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

No branches or pull requests

8 participants