xgo icon indicating copy to clipboard operation
xgo copied to clipboard

$GOPATH/pkg is not mounted in the xgo container

Open tamird opened this issue 9 years ago • 2 comments

...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.

tamird avatar Mar 28 '16 19:03 tamird

The reasons I didn't allow this is

  • I wanted xgo to 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 xgo to 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 :)

karalabe avatar Mar 29 '16 08:03 karalabe

Any movement on this?

tamird avatar May 05 '16 14:05 tamird