-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Drone: 'make: go: Command not found' #10084
Comments
In the long time, reference to GOPATH should be removed as we moved to modules. In the meantime, if you set GOPATH to something like /dev/null it should not call go to determine GOPATH. (?=) |
That'd be ideal. It will also bring the benefit of locking down tool versions in |
Looks like the issue was introduced very recently in #9751. |
I'm not sure I understand why go would not be found?! |
OK I see. We run the make webpack in an environment that does not have go. In which case we simply need to change it to: HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
ifeq ($(HAS_GO), GO)
GOPATH ?= $(shell $(GO) env GOPATH)
endif |
We can use a similar formation to protect the rest of the go dependent sections |
@sapk this variable isn't exported it's simply added so that we know where the go tools will be built to etc. |
@zeripath yes I know but we can get ride of call to tools (build in go) to their binary path relative to GOPATH and use module build cache via go run (and version locking via go.sum). The main goal is to be independant of GOPATH defintion and it need to be kept in PATH. This bring benifit by removing a setup step (even if it was needed and setup by everyone before). |
https://drone.gitea.io/go-gitea/gitea/20587/1/2
I think this is coming from line
GOPATH ?= $(shell $(GO) env GOPATH)
. Either we need to add go on thepre-build
step, setGOPATH
only when actually needed or maybe removeGOPATH
altogether (assuming the user has set upGOPATH/bin
in theirPATH
)?cc: @sapk
The text was updated successfully, but these errors were encountered: