Closed devashishRaj closed 1 month ago
Hey there, thanks for the bug report!
I cannot reproduce it locally - running go-global-update --dry-run
works for me.
Could you help me discover the root problem of this error?
I would appreciate it if you ran the following command and told me the output:
go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
For me, it prints v1.4.0
, which seems to be correct given https://github.com/BurntSushi/toml/releases
same
> go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
v1.4.0
That's awkward. The logs in the initial message say that this command failed previously when ran by go-global-update
.
could not introspect binary tomlv: could not get latest version of github.com/BurntSushi/toml: exit status 1
Does the problem still persist when you run go-global-update --dry-run
? If you still see the same errors (exit status 1), then please run go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
again, and then echo ?!
to also capture the last exit code so we can see if it was 1
(as when run inside go-global-update
) or 0
.
❯ go-global-update --dry-run
could not introspect binary actionlint: could not get latest version of github.com/rhysd/actionlint: exit status 1
could not introspect binary air: could not get latest version of github.com/air-verse/air: exit status 1
could not introspect binary asmfmt: could not get latest version of github.com/klauspost/asmfmt: exit status 1
could not introspect binary dlv: could not get latest version of github.com/go-delve/delve: exit status 1
could not introspect binary errcheck: could not get latest version of github.com/kisielk/errcheck: exit status 1
could not introspect binary fillstruct: could not get latest version of github.com/davidrjenni/reftools: exit status 1
could not introspect binary go-global-update: could not get latest version of github.com/Gelio/go-global-update: exit status 1
could not introspect binary go-outline: could not get latest version of github.com/ramya-rao-a/go-outline: exit status 1
could not introspect binary godef: could not get latest version of github.com/rogpeppe/godef: exit status 1
could not introspect binary goimportcycle: could not get latest version of github.com/samlitowitz/goimportcycle: exit status 1
could not introspect binary goimports: could not get latest version of golang.org/x/tools: exit status 1
could not introspect binary golangci-lint: could not get latest version of github.com/golangci/golangci-lint: exit status 1
could not introspect binary golint: could not get latest version of golang.org/x/lint: exit status 1
could not introspect binary gomodifytags: could not get latest version of github.com/fatih/gomodifytags: exit status 1
could not introspect binary gopls: could not get latest version of golang.org/x/tools/gopls: exit status 1
could not introspect binary gorename: could not get latest version of golang.org/x/tools: exit status 1
could not introspect binary gotags: could not get latest version of github.com/jstemmer/gotags: exit status 1
could not introspect binary gotestdox: could not get latest version of github.com/bitfield/gotestdox: exit status 1
could not introspect binary guru: could not get latest version of golang.org/x/tools: exit status 1
could not introspect binary iferr: could not get latest version of github.com/koron/iferr: exit status 1
could not introspect binary impl: could not get latest version of github.com/josharian/impl: exit status 1
could not introspect binary keyify: could not get latest version of honnef.co/go/tools: exit status 1
could not introspect binary ko: could not get latest version of github.com/google/ko: exit status 1
could not introspect binary motion: could not get latest version of github.com/fatih/motion: exit status 1
could not introspect binary revive: could not get latest version of github.com/mgechev/revive: exit status 1
could not introspect binary scc: could not get latest version of github.com/boyter/scc/v3: exit status 1
could not introspect binary staticcheck: could not get latest version of honnef.co/go/tools: exit status 1
could not introspect binary swag: could not get latest version of github.com/swaggo/swag: exit status 1
could not introspect binary task: could not get latest version of github.com/go-task/task/v3: exit status 1
could not introspect binary tomlv: could not get latest version of github.com/BurntSushi/toml: exit status 1
Binary Current version Status
ais (devel) cannot upgrade
❯ go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
v1.4.0
❯ echo ?!
zsh: no matches found: ?!
❯ echo $!
82420
❯ echo $!
82420
❯ echo $?
0
ignore ais one
Looks like I made a mistake. It should have been echo $?
directly after go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
to report the status code of that go list
command. Could you rerun that again?
Also, can you include the output of go version
?
> go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest echo $?
go: list -m cannot be used with GO111MODULE=off
i tried go env -w GO111MODULE=auto
but same error , it is set to auto
❯ go env | grep "GO111MODULE"
GO111MODULE='auto'
❯ go version
go version go1.23.0 darwin/arm64
oh it's go list
, ran it inside a package using that toml lib
❯ go list -m -f "{{.Version}}" github.com/BurntSushi/toml@latest
v1.4.0
❯ echo $?
0
Thanks for that information. That's really weird, since if you run the command yourself, it works just fine, but when go-global-update
runs the same command, it fails with exit code 1 😕
I am using the same go version myself and I don't have any problems with this tool.
Can you run go-global-update --dry-run --debug
and paste the output?
It will be large, so you can do that with just a single binary, like go-global-update --dry-run --debug actionlint
❯ go-global-update --dry-run --debug actionlint
2024-08-22T19:55:14.818+0530 DEBUG gocli/cmd_runner.go:28 go command output {"args": ["env", "GOBIN"], "output": "/Users/xyz/go/bin\n"}
2024-08-22T19:55:14.818+0530 DEBUG updater/updater.go:46 found GOBIN path {"GOBIN": "/Users/xyz/go/bin"}
2024-08-22T19:55:14.829+0530 DEBUG gocli/cmd_runner.go:28 go command output {"args": ["version", "-m", "/Users/xyz/go/bin/actionlint"], "output": "/Users/xyz/go/bin/actionlint: go1.22.5\n\tpath\tgithub.com/rhysd/actionlint/cmd/actionlint\n\tmod\tgithub.com/rhysd/actionlint\tv1.7.1\th1:WJaDzyT1StBWVKGSsZPYnbV0HF9Y9/vD6KFdZQL42qE=\n\tdep\tgithub.com/fatih/color\tv1.17.0\th1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4=\n\tdep\tgithub.com/mattn/go-colorable\tv0.1.13\th1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=\n\tdep\tgithub.com/mattn/go-isatty\tv0.0.20\th1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=\n\tdep\tgithub.com/mattn/go-runewidth\tv0.0.15\th1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=\n\tdep\tgithub.com/rivo/uniseg\tv0.4.7\th1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=\n\tdep\tgithub.com/robfig/cron/v3\tv3.0.1\th1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=\n\tdep\tgolang.org/x/sync\tv0.7.0\th1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=\n\tdep\tgolang.org/x/sys\tv0.20.0\th1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=\n\tdep\tgopkg.in/yaml.v3\tv3.0.1\th1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\n\tbuild\t-buildmode=exe\n\tbuild\t-compiler=gc\n\tbuild\tDefaultGODEBUG=httplaxcontentlength=1,httpmuxgo121=1,netedns0=0,panicnil=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1\n\tbuild\tCGO_ENABLED=1\n\tbuild\tCGO_CFLAGS=\n\tbuild\tCGO_CPPFLAGS=\n\tbuild\tCGO_CXXFLAGS=\n\tbuild\tCGO_LDFLAGS=\n\tbuild\tGOARCH=arm64\n\tbuild\tGOOS=darwin\n"}
2024-08-22T19:55:14.835+0530 DEBUG gocli/cmd_runner.go:28 go command output {"args": ["list", "-m", "-f", "{{.Version}}", "github.com/rhysd/actionlint@latest"], "output": "go: list -m cannot be used with GO111MODULE=off\n", "error": "exit status 1"}
could not introspect binary actionlint: could not get latest version of github.com/rhysd/actionlint: exit status 1
Binary Current version Status
2024-08-22T19:55:14.835+0530 DEBUG gocli/cmd_runner.go:28 go command output {"args": ["list", "-m", "-f", "{{.Version}}", "github.com/rhysd/actionlint@latest"], "output": "go: list -m cannot be used with GO111MODULE=off\n", "error": "exit status 1"}
"output": "go: list -m cannot be used with GO111MODULE=off\n", "error": "exit status 1"
Looks like this is the culprit. I have no clue why there is GO111MODULE=off
for you. I presume this is something related to your system configuration. You also mentioned similar problems in https://github.com/Gelio/go-global-update/issues/27#issuecomment-2303947877 and then solved it in https://github.com/Gelio/go-global-update/issues/27#issuecomment-2303955097.
I don't know how I can help further
i tried : go env -w GO111MODULE=on
and it worked . it won't work with GO111MODULE=auto (https://go.dev/ref/mod#mod-commands)
Thanks for sharing the fix, I appreciate it 👍
go version : go1.23.0 darwin/arm64
go is installed via brew