Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: undefined: reservedKeywords #23583

Closed
nicolasStevenin opened this issue Mar 8, 2018 · 2 comments
Closed

build: undefined: reservedKeywords #23583

nicolasStevenin opened this issue Mar 8, 2018 · 2 comments
Assignees
Labels
C-investigation Further steps needed to qualify. C-label will change. O-community Originated from the community

Comments

@nicolasStevenin
Copy link

nicolasStevenin commented Mar 8, 2018

Hi,

I try to build and test your project and it fails with :

Testing: "/builddir/build/BUILD/cockroach-2.0-beta.20180305/_build/src/github.com/cockroachdb/cockroach/pkg/sql/opt/opt"

  • GOPATH=/builddir/build/BUILD/cockroach-2.0-beta.20180305/_build:/usr/share/gocode
  • go test -buildmode pie -compiler gc -ldflags '-extldflags '''-Wl,-z,relro ''''

github.com/cockroachdb/cockroach/pkg/sql/lex

../../lex/predicates.go:60:14: undefined: reservedKeywords
FAIL github.com/cockroachdb/cockroach/pkg/sql/opt/opt [build failed]

Could you help me please ?

Thanks

@dt
Copy link
Member

dt commented Mar 8, 2018

@nicolasStevenin we use a non-trivial amount of code-generation in our build process, including, in the case of the error you hit, generating code based on our yacc-defined SQL grammar. The generated files are maintained by our Makefile, so you need to run make in the project root before you'll be able to use go test in individual packages.

@knz knz changed the title undefined: reservedKeywords build: undefined: reservedKeywords Apr 27, 2018
@knz knz added the O-community Originated from the community label Apr 27, 2018
@knz
Copy link
Contributor

knz commented Apr 27, 2018

@nicolasStevenin as David explained, CockroachDB does not support go get - then-import directly. However, after you've run go get -d and run make build at least once in the CockroachDB source directory, you should be able to use it from your project.

Can you report on the status of this issue on your side? We'd love to know how we can help further.

@knz knz added the C-investigation Further steps needed to qualify. C-label will change. label Apr 27, 2018
benesch added a commit to benesch/cockroach that referenced this issue May 11, 2018
The root package, github.com/cockroachdb/cockroach, previously served as
the main entry point for the default CCL binary. This meant that naively
running

    $ go get github.com/cockroachdb/cockroach

would fail with cryptic errors about missing "reserved keywords", as our
build requires generating some Go code via Make. Our documentation
suggests that users instead run

    $ go get -d github.com/cockroachdb/cockroach
    $ make

but many users, somewhat understandably, fail to read that
documentation.

Move the main entry point to ./pkg/cmd/cockroach. Running 'go get
github.com/cockroachdb/cockroach' will now produce a less confusing
error that reads:

    can't load package: package github.com/cockroachdb/cockroach: no Go
    files in GOPATH/src/github.com/cockroachdb/cockroach

Hopefully this spurs users to read the build instructions.

(Running 'go get github.com/cockroachdb/cockroach/pkg/cmd/cockroach'
still produces the same cryptic error messages as before, but users are
far less likely to construct that 'go get' invocation.)

Fix cockroachdb#23583.

Release note: None
craig bot pushed a commit that referenced this issue May 30, 2018
25325: build: make 'go get github.com/cockroachdb/cockroach' fail r=bdarnell a=benesch

The root package, github.com/cockroachdb/cockroach, previously served as
the main entry point for the default CCL binary. This meant that naively
running

    $ go get github.com/cockroachdb/cockroach

would fail with cryptic errors about missing "reserved keywords", as our
build requires generating some Go code via Make. Our documentation
suggests that users instead run

    $ go get -d github.com/cockroachdb/cockroach
    $ make

but many users, somewhat understandably, fail to read that
documentation.

Move the main entry point to ./pkg/cmd/cockroach. Running 'go get
github.com/cockroachdb/cockroach' will now produce a less confusing
error that reads:

    can't load package: package github.com/cockroachdb/cockroach: no Go
    files in GOPATH/src/github.com/cockroachdb/cockroach

Hopefully this spurs users to read the build instructions.

(Running 'go get github.com/cockroachdb/cockroach/pkg/cmd/cockroach'
still produces the same cryptic error messages as before, but users are
far less likely to construct that 'go get' invocation.)

Fix #23583.
Fix #23992.

Release note: None

Co-authored-by: Nikhil Benesch <[email protected]>
@craig craig bot closed this as completed in #25325 May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-investigation Further steps needed to qualify. C-label will change. O-community Originated from the community
Projects
None yet
Development

No branches or pull requests

4 participants