Hi,

Recently, I played around with our Jenkins pipeline. In the new set-up, I 
build multiple packages in parallel. This step executes "go build" for each 
of the services that we have at the same time.
One thing I also change is that for each service, it uses the same GOPATH.

Sometimes, I see failures like this

src/go/pkg/linux_amd64_netgo/project/vendor/github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg.a"
 
already exists and is not an object file

go build project/vendor/github.com/prometheus/common/model: build output 
"/var/lib/jenkins/workspace/project/src/go/pkg/linux_amd64_netgo/project/vendor/github.com/prometheus/common/model.a"
 
already exists and is not an object file

go build project/vendor/github.com/struCoder/pidusage: build output 
"/var/lib/jenkins/workspace/project/src/go/pkg/linux_amd64_netgo/project/vendor/github.com/struCoder/pidusage.a"
 
already exists and is not an object file

go build project/thrift/gen/denormalized: build output 
"/var/lib/jenkins/workspace/project/src/go/pkg/linux_amd64_netgo/project/thrift/gen/denormalized.a"
 
already exists and is not an object file


My current guess is that this is because running multiple go build at the 
same time, but I'm not sure if this is actually the case.

If it is the case, what is the recommended way to build multiple packages 
when you have multiple Jenkins step/job that build the binary at the same 
time?

The reason that I'm using shared GOPATH for this Jenkins step/job is that 
to now download the packages in `pkg/mod`.


Cheers!

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to