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