4

I install golang with brew install go in my mac osx 10.10.4, when I run go build I got:

go build runtime: darwin/amd64 must be bootstrapped using make.bash

then refer to the question Cross compile Go on OSX?

first I tried:

brew install go --with-cc-all

but question remain, then I tried:

cd /usr/local/go/src
sudo GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 ./make.bash --no-clean

but the question still remains. So how can I fix this?

System Version: OS X 10.10.4 (14E46)
Kernel Version: Darwin 14.4.0
Go Version: go version go1.4.2 darwin/amd64
Community
  • 1
  • 1
roger
  • 9,063
  • 20
  • 72
  • 119
  • That's odd. Try `brew uninstall go && brew clean` and then `go install` again. Homebrew should handle the build process itself. – elithrar Jul 23 '15 at 12:34
  • @elithrar the problems remain. But one thing needs pay attention: I copy the `GOROOT` and `GOPATH` directory to Mac, so is this a problem? – roger Jul 24 '15 at 06:56
  • Of course it is! You must be copying them from a different architecture. Definitely don't do that. – elithrar Jul 24 '15 at 07:22
  • @elithrar so I should recompile them all? – roger Jul 24 '15 at 08:34
  • Just install them using `brew install go` (after deleting what you copied). Don't "copy" anything over from elsewhere. – elithrar Jul 24 '15 at 08:35

2 Answers2

2

I built it from source. This is what I've done:

From the checkout source, in src:

src $ GOOS=darwin GOARCH=amd64 ./bootstrap.bash
#### Copying to ../../go-darwin-amd64-bootstrap
...
----
Bootstrap toolchain for darwin/amd64 installed in XXX/go-darwin-amd64-bootstrap.
Building tbz.
-rw-r--r--  1 hvn  staff  48149988 Aug 21 10:48 XXX/go-darwin-amd64-bootstrap.tbz

Then I unarchive the tbz and build it as normal:

$ tar xzf XXX/go-darwin-amd64-bootstrap.tbz

cd to that extracted dir. Then

$ ./all.bash
##### Building Go bootstrap tool.
cmd/dist
...

ALL TESTS PASSED

---
Installed Go for darwin/amd64...

$ go-darwin-amd64-bootstrap/bin/go version
go version go1.5 darwin/amd64

Hope that help.

HVNSweeting
  • 2,859
  • 2
  • 35
  • 30
1

Got the same problem.

What I did was reinstall Go since I have an existing brew installation

brew reinstall go --with-cc-all

When I tried goax command, the problem was fixed

jhnferraris
  • 1,361
  • 1
  • 12
  • 34