cockroachdb / homebrew-tap

`brew install cockroachdb/tap/cockroach`

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble Running `brew install cockroachdb/cockroach/cockroach`

dominiquecharlebois opened this issue · comments

Dev Environment:

  • Mac (Version 10.11.6)
  • OS X El Capitan

Error Message:

🐈 dominiquecharlebois ~ $ brew install cockroachdb/cockroach/cockroach
Warning: You are using a pre-release version of Xcode.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing cockroach from cockroachdb/cockroach
==> Cloning https://github.com/cockroachdb/cockroach.git
Updating /Users/dominiquecharlebois/Library/Caches/Homebrew/cockroach--git
==> Checking out tag beta-20170309
==> xcrun make GOFLAGS=-v -C src/github.com/cockroachdb/cockroach build
Last 15 lines from /Users/dominiquecharlebois/Library/Logs/Homebrew/cockroach/01.xcrun:
Makefile:283: .bootstrap: No such file or directory
installing githooks/post-checkout
installing githooks/post-rewrite
installing githooks/post-merge
git submodule update --init
go1\.7|go1\.8.* required (see CONTRIBUTING.md): go version go1.6.3 darwin/amd64
make: *** [.go-version] Error 1
make: *** Waiting for unfinished jobs....
go install ./vendor/github.com/robfig/glock
cmd ./pkg/cmd/github-post                                      	[error exit status 1]
pkg/cmd/github-post/main.go:21:2: cannot find package "context" in any of:
	/private/tmp/cockroach-20170318-37625-irau1h/src/github.com/cockroachdb/cockroach/vendor/context (vendor tree)
	/usr/local/Cellar/go/1.6.3/libexec/src/context (from $GOROOT)
	/private/tmp/cockroach-20170318-37625-irau1h/src/context (from $GOPATH)
make: *** [.bootstrap] Error 1

READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/cockroachdb/homebrew-cockroach/issues

Might be bug, might be ENV related.

Hi @dominiquecharlebois, thanks for reporting—and glad you're giving CockroachDB a spin!

If you look real close at the above logs, you can just make out the error: you're running Go 1.6, but you need Go 1.7 or Go 1.8. I'd recommend upgrading to Go 1.8, since next week's beta release will drop support for Go 1.7. Would you mind to give Go 1.8 a try and report back?

Meanwhile I'll look into making this error message more obvious. Right now, it's getting buried because Homebrew runs several make tasks in parallel.

@benesch, are there prerequisites we should be listing on Install CockroachDB > Use Homebrew?

Removing/Updating GoLang is a nightmare. I'll report back when it finally works.

go version
go version go1.8 darwin/amd64

But brew install still uses an old version of GoLang.

@jseldess, Homebrew should be managing the version constraint for us automatically. It's a bug in our formula that I'll address shortly!

@dominiquecharlebois, are you installing Go through Homebrew? If so, brew update && brew upgrade go || brew install go will get you Go 1.8 in a way that Homebrew is guaranteed to find and use. It also should be fast, since you're on a version of MacOS that Homebrew bottles binaries for.

If you're installing Go into a nonstandard location, like $HOME/bin, Homebrew won't pick it up. Cockroach will, though, if you install from source without Homebrew. See our installation instructions if you want to give this approach a shot: https://www.cockroachlabs.com/docs/install-cockroachdb.html. Keep in mind we also ship binaries for macOS 10.9 onwards, if that'd be easier for you.

@benesch, so I uninstalled go, and re-installed it with brew, but it still installs go1.6.3, so I'm going to assume it's my env.

I've already downloaded it via ZIP File, so I've got cockroach working, just not through brew.

I guess we can close this issue for now. 🐤

Happy to help you keep debugging, if you're interested! If you're having this problem, it's likely someone else is too.

My suspicion is that you're just running a very outdated version of Homebrew. Sorry if I'm asking the obvious, but have you run brew update recently? I'd also be curious to know what brew --version reports.

@benesch

I have been running brew update , but for some reason it wasn't updating and I didn't think twice about it. Running bew --version gave me this:

Homebrew 0.9.9 (git revision 06fe; last commit 2016-08-10)
Homebrew/homebrew-core (git revision b163b; last commit 2016-08-10)

Which is really old ahaha.

I ended finding how to force update brew using cd $(brew --repo); git fetch; git reset --hard origin/master; brew update and brew --version returned:

Homebrew 1.1.11-108-g09a926f
Homebrew/homebrew-core (git revision 133e; last commit 2017-03-19)

Which is much better.

Hah, mystery solved! Glad you got it sorted.

Just in case you didn't turn up the cause in your Googling: Homebrew was subject to a bug that broke updates for anyone who had the misfortune of updating on August 10 or 11 of last year. You got very unlucky, it seems.

FYI I also landed a patch upstream (cockroachdb/cockroach#14252) to make Go version errors more obvious for anyone else in a similar situation. It'll be in the next beta release, so I'm going to mark this issue as resolved. Please don't hesitate to post on the forum if you have any questions—or file issues if you find any bugs!