Open Pretexts opened 2 years ago
Same error encountered in GitHub Actions.
I had to downgrade to go 1.17.x for it to work
Interesting - I see the error message on only a few other projects. Can you provide more details on how to reproduce please?
Hello @josephspurrier! We faced the same issue, let me share some steps to reproduce.
https://github.com/newrelic/infrastructure-agent/runs/6113650941?check_suite_focus=true https://github.com/newrelic/infrastructure-agent/blob/ci_test_go1-18/.github/workflows/prerelease_windows.yml#L63-L65 https://github.com/newrelic/infrastructure-agent/blob/ci_test_go1-18/build/windows/build.ps1#L41
Could you help us to understand what went wrong?
Thank you 🙂
@brushknight Ah, it may be related to this change in the Go language: https://go.dev/doc/go-get-install-deprecation. Can you change this line to go install? https://github.com/newrelic/infrastructure-agent/blob/master/build/windows/build.ps1#L41
Same issue here, on Go 1.19.2: exec: "goversioninfo": executable file not found in $PATH
Same issue here, on Go 1.19.2: exec: "goversioninfo": executable file not found in $PATH
Can you try the fix in: https://github.com/josephspurrier/goversioninfo/issues/57#issuecomment-1105319291?
That worked for Windows, but not for cross-compilation...so looks like it's just the instruction page perhaps that needs updating for Windows. Cross-compilation, at least on an M1 Mac, can't find the goversioninfo executable it seems.
That worked for Windows, but not for cross-compilation...so looks like it's just the instruction page perhaps that needs updating for Windows. Cross-compilation, at least on an M1 Mac, can't find the goversioninfo executable it seems.
Are you able to post examples? Cross-compilation has its own challenges (different PATH variables, different Go versions, etc.) so I want to make sure it doesn't confuse the initial problem that Go changed how it works in newer versions which is not a bug with goversioninfo.
To add to the discussion, we recently encountered the same problem in our project which uses cross-compile to build a Windows binary on Linux. goversioninfo was not found in PATH for Go version 1.18 and up. We finally fixed it with go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
command. This is what we are doing:
fhcat@ECS-053990d6:~/garasign/repos/garasign$ go_img='docker.io/golang:1.19.3-buster'
fhcat@ECS-053990d6:~/garasign/repos/garasign$ docker run -v $HOME/garasign/repos/garasign2:/garasign -t ${go_img} /bin/bash -c 'cd /garasign; go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest; which goversioninfo'
go: downloading github.com/josephspurrier/goversioninfo v1.4.0
go: downloading github.com/akavel/rsrc v0.10.2
/go/bin/goversioninfo
2022/03/21 14:58:13 Error when extracting compiler information: no goversion found