joefitzgerald / go-plus

An Enhanced Go Experience For The Atom Editor
https://atom.io/packages/go-plus
Other
1.51k stars 128 forks source link

go-plus attempts to update tools/packages every time it is launched #1020

Open dhazeghi opened 4 years ago

dhazeghi commented 4 years ago

Prerequisites

Description

[Description of the bug or feature]

Output from atom -v && apm -v

Atom : 1.45.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0 apm 2.4.3 npm 6.2.0 node 10.2.1 x64 atom 1.45.0 python 2.7.16 git 2.20.1

Output From go env

$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/dara/Library/Caches/go-build" GOENV="/Users/dara/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/dara/Desktop/test" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/43/s55553mj4fxbxtd4jws4fqtw0000gn/T/go-build424140330=/tmp/go-build -gno-record-gcc-switches -fno-common"

Steps to Reproduce

  1. Open Atom
  2. Open .go file
  3. go-plus console shows it updating a whole bunch of packages:

$ go get -u golang.org/x/tools/cmd/goimports $ go get -u golang.org/x/tools/cmd/gorename $ go get -u github.com/sqs/goreturns $ go get -u github.com/mdempsky/gocode $ go get -u github.com/alecthomas/gometalinter $ go get -u github.com/mgechev/revive $ go get -u github.com/golangci/golangci-lint/cmd/golangci-lint $ go get -u github.com/zmb3/gogetdoc $ go get -u github.com/zmb3/goaddimport $ go get -u github.com/rogpeppe/godef $ go get -u golang.org/x/tools/cmd/guru $ go get -u github.com/fatih/gomodifytags $ go get -u github.com/tpng/gopkgs $ go get -u github.com/ramya-rao-a/go-outline

Expected Behavior

After the first launch, I don't expect go-plus to retry updating the same packages every time Atom comes up.

Actual Behavior

Every single time, it updates the same set of packages. Takes 2-3 minutes.

Screen Shot 2020-04-24 at 4 45 36 PM

ibmboy19 commented 4 years ago

I meet the same issue.

ghost commented 4 years ago

I cannot figure out where the break happened. I recently hopped distro on my laptop and ran into this problem on Fedora 32 with Atom 1.46, but I didn't have this problem on Debian 10 at the time.

Since Atom isn't in the repo on Debian, I am not 100% of the version I had installed but I tested as far back as I certain the version I was using on Debian; back to Atom 1.44. I did a fresh install of Debian and Atom with a new user and the issue exists in all.

I also tried different Go versions 1.14 and 1.13.

thanhphuoc95 commented 4 years ago

Same issue. I had to switch to vscode cause this issue :( Any answer, pls ?

CJK-Regan commented 4 years ago

Same issue.

dkotik commented 4 years ago

If you uninstall go-plus and try to re-install it, it will fail saying "core-js" is outdated - this issue seems to be related to the other one with the failing installation. I got a fork from from that ticket. Also removed the following line from /home/fray/Desktop/go-plus/lib/package-manager.js:

['golangci-lint', 'github.com/golangci/golangci-lint/cmd/golangci-lint'],

There appears to be a fluke in a vendored package used by "golangci-link" linter. It failed to install every time, forcing atom to attemp re-installing on every launch. Pick a different linter in the options, remove the line as I did and it stops trying to re-install everything on launch.

darfux commented 4 years ago

I solved similar issue by adding disableToolCheck: true manually to the go-plus config in .atom/config.cson:

  "go-plus":
    disableToolCheck: true

The related code is https://github.com/joefitzgerald/go-plus/blob/0b21c70e219bbe199d7d7b09e8c995ee7839184b/lib/package-manager.js#L62-L70

ghost commented 4 years ago

If you uninstall go-plus and try to re-install it, it will fail saying "core-js" is outdated - this issue seems to be related to the other one with the failing installation. I got a fork from from that ticket. Also removed the following line from /home/fray/Desktop/go-plus/lib/package-manager.js:

['golangci-lint', 'github.com/golangci/golangci-lint/cmd/golangci-lint'],

There appears to be a fluke in a vendored package used by "golangci-link" linter. It failed to install every time, forcing atom to attemp re-installing on every launch. Pick a different linter in the options, remove the line as I did and it stops trying to re-install everything on launch.

I had seen this error when I did a reinstall but I am way too ignorant of how packages in Atom work to actually trace the error. I like commenting out a misbehaving package over disabling checks personally.

vsile commented 4 years ago

I have the same issue.

xsubject commented 4 years ago

I also suffer because of this

xsubject commented 4 years ago

image And nothing works ... (gopath is correct)

damz commented 4 years ago

I am seeing this issue too. go-plus runs go get on all the tools (which is a no-op, but is still not extremely fast) unconditionally.