Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-12 Thread shaun
Yes, that was the problem. We were building with CGO_ENABLED=0, which was meaning that built-in packages like "os/user" were always stale and causing rebuilds of almost every other package. Putting this in my dockerfile (along with mounting the pkg directory as a volume shared between each

Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-09 Thread shaun
Thanks, that's given me a great thread to pull on. All the rebuilds track back to os/user being stale due to build ID mismatch. Probably an issue with the specific configuration we've set up for our build being different to the pre-build os/user (I think we disable CGO, for one). Should be

Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-08 Thread Ian Lance Taylor
On Thu, Dec 8, 2016 at 10:13 AM, wrote: > I've started with a clean pkg dir. > > It's odd; the mtimes look correct (same inside/outside container). the > "buildid" to the compile commands s the same on each run too. > > Does anyone know if there's a way to print out the

Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-08 Thread shaun
I've started with a clean pkg dir. It's odd; the mtimes look correct (same inside/outside container). the "buildid" to the compile commands s the same on each run too. Does anyone know if there's a way to print out the "StaleReason" that the code collects, that might help me find out what

Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-07 Thread Dave Cheney
s/go build -i/go install. On Thu, Dec 8, 2016 at 8:07 AM, andrey mirtchovski wrote: > it's also possible that you need to do "go build -i" just in case your > dependencies are outdated. i had the same issue today with a windows > piece of code that rebuilt sqlite3 every

Re: [go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-07 Thread andrey mirtchovski
it's also possible that you need to do "go build -i" just in case your dependencies are outdated. i had the same issue today with a windows piece of code that rebuilt sqlite3 every time. On Wed, Dec 7, 2016 at 2:57 PM, Dave Cheney wrote: > Docker add, or whatever is pushing

[go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-07 Thread Dave Cheney
Docker add, or whatever is pushing files into your container is probably not respecting timestamps so the .a files are older with respect to .go files (pkg sorts above src) Why do you want to build inside a container, is that just adding an extra level of indirection to what is a simple

[go-nuts] go install seems to do a lot of rebuilding in a container

2016-12-07 Thread Shaun Crampton
Hi, I'm trying to optimize the build of my app. Our build times have crept up to ~60s as we've added more dependencies and it's starting to become a problem. The primary problem seems to be that we're building in a container, so we're losing the $GOPATH/pkg cache of build artefacts between