mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.78k stars 279 forks source link

Cannot install 1.3.5 #956

Closed kaimast closed 9 months ago

kaimast commented 9 months ago

Describe the bug I get the following error when installing 1.3.5. 1.3.4 works fine.

> go install github.com/mgechev/revive@latest  
go: downloading github.com/mgechev/revive v1.3.5
go: github.com/mgechev/revive@latest (in github.com/mgechev/revive@v1.3.5):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

This happens on my local machine (Arch Linux) and on GitHub actions (Ubuntu 22.04). Both systems have go 1.21.

matikrk commented 9 months ago

same on MacOs, go1.21.5 darwin/arm64

EXHades commented 9 months ago

same on Gitlab CI

Using Docker executor with image golang:1.21.5-alpine
...
$ go run github.com/mgechev/revive@latest ./...
go: downloading github.com/mgechev/revive v1.3.5
go: github.com/mgechev/revive@latest (in github.com/mgechev/revive@v1.3.5):
    The go.mod file for the module providing named packages contains one or
    more replace directives. It must not contain directives that would cause
    it to be interpreted differently than if it were the main module.
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
denisvmedia commented 9 months ago

There is this thread: https://github.com/golang/go/issues/44840. It seems like the community feels different than the go devs. I will inspect, why we have replace directive here. But for now, the only way is to clone the repo and build it from the source.

gemcdaniel commented 9 months ago

Would it be possible to create a new tag/release for this as 1.3.5 (latest) is broken with go install?

morphy2k commented 9 months ago

Would it be possible to create a new tag/release for this as 1.3.5 (latest) is broken with go install?

That would be great!

Due to this, I cannot ship the new version together with revive-action without changes to the build process.

denisvmedia commented 9 months ago

I'm reopening the issue, because although the fix was merged, the release wasn't updated and thus, people keep coming to complain.

cc @mgechev I think need another release to fix the issue. go install doesn't like the replace directive (which anyway was put by mistake I guess).

shaunco commented 9 months ago

Please release tag v1.3.6 with the fix for the install issue

nvuillam commented 9 months ago

Same in MegaLinter build :( (Dockerfile alpine-based)

 > [revive 2/2] RUN GOBIN=/usr/bin go install github.com/mgechev/revive@latest:
0.456 go: downloading github.com/mgechev/revive v1.3.5
0.776 go: github.com/mgechev/revive@latest (in github.com/mgechev/revive@v1.3.5):
0.776   The go.mod file for the module providing named packages contains one or
0.776   more replace directives. It must not contain directives that would cause
0.776   it to be interpreted differently than if it were the main module.
denisvmedia commented 9 months ago

The problem should be fixed now.

$ go install github.com/mgechev/revive@latest
go: downloading github.com/mgechev/revive v1.3.6