[oi-dev] GOCACHE for Jenkins jobs

Till Wegmüller toasterson at gmail.com
Mon Jan 27 08:37:52 UTC 2020


Hi Aurelien

Yes you must define GOCACHE. Go modules requires this path to download
and unpack/compile Build dependencies. It will also speed up any
subsequent runs if this Cache is globally.

Here is my Jenkins config for go 1.11+

    environment {
         GOCACHE = "${WORKSPACE}/gocache"
         GO111MODULE = "on"
         GOPATH = "${WORKSPACE}/../gopath"
    }

GO111MODULE might not be necessary depending on the Software you are
building but they have to include a note if they do not support go
modules yet. Acording to the Go community it is advised to file a
upstream bug of Go modules are not yet supported.

If you need any Help with Go let me know. I Programm with it as my Day
Job and maintain the OpenIndiana Packages. Chances are I have come
accross an issue before :)

Greetings
Till


On 26.01.20 23:49, Aurélien Larcher wrote:
> Hi,
> it seems that MongoDB 3.4 fails to build on Jenkins because Go 1.12
> requires a path used for caching files.
> 
> "build cache is required, but could not be located: GOCACHE is not
> defined and neither $XDG_CACHE_HOME nor $HOME are defined Error building
> bsondump"
> 
> As a workaround I defined a GOCACHE variable in the Jenkins
> configuration but that is probably not suitable in the long run.
> 
> Kind regards,
> 
> Aurelien
> 
> -- 
> ---
> Praise the Caffeine embeddings
> 
> _______________________________________________
> oi-dev mailing list
> oi-dev at openindiana.org
> https://openindiana.org/mailman/listinfo/oi-dev
> 




More information about the oi-dev mailing list