xgo
xgo copied to clipboard
$GOPATH/pkg is not mounted in the xgo container
...preventing any reuse of previous build artefacts.
I'm not sure if you want to do something implicit like what's currently done with GOPATH/src or something explicit like passing a flag that points to the shared pkg directory on the host machine.
Either way, this would save us about 10 minutes in our CI build.
The reasons I didn't allow this is
- I wanted
xgoto be sandboxed from the operating system so it doesn't overwrite something on your real GOPATH unexpectedly. E.g. building a different branch of a package in xgo would overwrite your workspace, and introduce weird anomalies in your dev environment. - I wanted
xgoto be stateless in that it only operates on the source code. If I were to allow reusing previous artifacts, it would open up a whole new can of worms with potentially linking in objects that were build from a different source. Currently I have reproducibility guarantees, albeit indeed at the cost of extra compilation time.
However I do feel your pain, and I think having an explicit flag to use some host side build cache could be a viable and clean enough solution. I'll think about the implications a bit and if I don't find anything too serious I'll try to add it as a feature :)
Any movement on this?