Skip to content

Instantly share code, notes, and snippets.

@Mic92
Last active August 21, 2016 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/f596ce04bce80f6ab4ce1013b9ce5f2e to your computer and use it in GitHub Desktop.
Save Mic92/f596ce04bce80f6ab4ce1013b9ce5f2e to your computer and use it in GitHub Desktop.
Howto bootstrap golang/goxc from source/git on nixos

first you need a previous version of the compiler

$ nix-env -i go

exporting this allows go's build system to find our compiler

$ GOBIN=$(dirname $(readlink -f $(which go)))
$ GOROOT_BOOTSTRAP=$GOBIN/../share/go

then you can continue to build go as usual

$ git clone https://github.com/golang/go.git
$ cd go/src
$ ./make.bash

to use it set the following

$ export GOROOT=$(readlink go)
$ export PATH=$GOROOT/bin:$PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment