Skip to content

Instantly share code, notes, and snippets.

@cuixin
Created October 31, 2017 02:42
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 cuixin/f7d17becd28ba5b4f0e6e5c87f5f9dc5 to your computer and use it in GitHub Desktop.
Save cuixin/f7d17becd28ba5b4f0e6e5c87f5f9dc5 to your computer and use it in GitHub Desktop.
make minimal go build bootstrap files to build go again.
#!/bin/bash
# Ensure that you have compiled the entire go source.
# set -x
set -e
[ ! -d go ] && { echo "There is no go source code here."; exit 1; }
[ -d go_bootstrap ] && { echo "You have had go_bootstrap directory."; exit 1;}
mkdir -p go_bootstrap/pkg
echo "Create go_bootstrap directory successful"
cp -r go/{bin,src} go_bootstrap/
cp -r go/pkg/{include,linux_amd64,tool} go_bootstrap/pkg/
echo "Well done, you can compile your go source code now."
echo "Run the next code manually:"
echo "cd go/src"
echo "GOROOT_BOOTSTRAP=$(pwd)/go_bootstrap ./all.bash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment