github.com/cockroachdb/cockroach is no longer a buildable Go package

20 views
Skip to first unread message

Nikhil Benesch

unread,
May 30, 2018, 10:34:44 AM5/30/18
to cockroach-db
To reduce confusion for new users who attempt to run


the top-level github.com/cockroachdb/cockroach package no longer contains any Go files. 
Where previously these users would get an error like

   pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords

which they often interpreted as a bug in the build system, they'll now get this error:

    can't load package: package github.com/cockroachdb/cockroach: no Go

Hopefully that error is less scary and spurs them to look up the build documentation, where they'll learn to use 'make build' instead of 'go build'.

This will probably have no impact on your development setup, but Ben has pointed out that some Go editor plugins allow you to configure a restricted "scope" of packages to analyze, like the Emacs Guru plugin. If you're using such an editor, and your scope was previously configured to "github.com/cockroachdb/cockroach", you'll probably need to update the scope to either the new entry point, "github.com/cockroachdb/cockroach/pkg/cmd/cockroach", or add a wildcard to the end, as in "github.com/cockroachdb/cockroach/..."

You can find the PR, which is presently working its way through the Bors queue, here: https://github.com/cockroachdb/cockroach/pull/25325

Nikhil

Andrei Matei

unread,
May 31, 2018, 5:29:51 PM5/31/18
to Nikhil Benesch, cockroach-db
I believe this broke my Vim's :mak command, which used to run :!go build .
Does anyone happen to have a solution for me for building from Vim such that the quickfix list is populated with compilation errors? The vim-go plugin has a :GoBuild command, but that only builds the current file's package.

--
You received this message because you are subscribed to the Google Groups "CockroachDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cockroach-db+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cockroach-db/CAA-gNqJ_Ri9drY5JgGwSOvUyHNKCv5AuVo%2ByECQnowZy977nQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Radu Berinde

unread,
May 31, 2018, 5:35:47 PM5/31/18
to Andrei Matei, Nikhil Benesch, cockroach-db
Change it to do `go build ./pkg/cmd/cockroach`

-Radu

Andrei Matei

unread,
May 31, 2018, 5:48:54 PM5/31/18
to Radu Berinde, Nikhil Benesch, cockroach-db
Thanks. For others, I figured out that the command's behavior was coming from
autocmd Filetype go set makeprg=go\ build\ .

Reply all
Reply to author
Forward
0 new messages