定期编译GO源代码

I have a GO compiler available (i.e. installed in a dir ~/xxxx/bin/go).

Suppose to call this version GO.1

I now clone the GO repository from GitHub (ex. into ~/yyyy/)

Setting $GOROOT_BOOTSTRAP=~/xxxx/ I can compile it as cd ~/yyyy/src && ./all.bash obtaining the GO binary in ~/yyyy/bin (Suppose to call this GO.2)

I'd like now to use this new GO.2 binary ~/yyyy/bin/go to recompile its new source (~/yyyy/src) having a final 'good' GO.3

I cannot just set $GOROOT_BOOTSTRAP to ~/yyyy/ or play with some others env vars (at least I tried many attempts with no success).

The only way I've found to do this is:

  1. copy ~/yyyy/ (about 800MB!) onto ~/xxxx/ (so that GO.2 overwrites GO.1 and the $GOROOT_BOOTSTRAP is unchanged)

  2. redo cd ~/yyyy/src && ./all.bash

This cannot be the expected behaviour. I'd like to have the most up-to-date binary GO.x just with a git pull && cd ./src && ./all.bash and no much more than this.

Any hint is welcome.