Hi there,
I'm working on a project where I'm cross compiling on every build (for linux amd64 and linux arm6, while working on a mac), and I've noticed compilation times are much much longer when cross-compiling than when building for my native platform. On my project, they go from ~3 seconds to ~25 seconds. I'm using go 1.5 from git, downloaded 2 days ago (go version output: "go version devel +f06795d Sat Apr 18 05:29:19 2015 +0000 darwin/amd64")
Example:
$ time go build -o rasp rasp_server.go
real 0m3.065s
user 0m2.222s
sys 0m0.611s
$ time GOOS=linux go build -o rasp rasp_server.go
real 0m24.909s
user 0m29.414s
sys 0m5.629s
$ time GOOS=linux go build -o rasp rasp_server.go
real 0m25.119s
user 0m29.788s
sys 0m5.566s
After using "go build -v", I noticed a big list of standard library packages is being recompiled on each "go build" call, but only when cross-compiling. Is this the expected behavior? I would have expected cross-compiled packages to be cached just like native ones are?
Thanks in advance!
Kind regards,
Jon Valdes