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: pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords #23992

Closed
nim-nim opened this issue Mar 17, 2018 · 7 comments
Closed

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

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

Comments

@nim-nim
Copy link

nim-nim commented Mar 17, 2018

With:

  • go 1.9.4 x86_64
  • github.com/cockroachdb/cockroach ea5f8b2

While trying to build:

/usr/lib/golang/pkg/tool/linux_amd64/compile -o $WORK/github.com/cockroachdb/cockroach/pkg/sql/sem/types.a -trimpath $WORK -shared -goversion go1.9.4 -p github.com/cockroachdb/cockroach/pkg/sql/sem/types -complete -installsuffix shared -buildid 37fb7a082116c7a473b58359e82c82ad215
c6f08 -D _/builddir/build/BUILD/cockroach-ea5f8b22ba951799b76c84502aaab4456fe00a46/_build/src/github.com/cockroachdb/cockroach/pkg/sql/sem/types -I $WORK -I /builddir/build/BUILD/cockroach-ea5f8b22ba951799b76c84502aaab4456fe00a46/_build/pkg/linux_amd64_shared -I /usr/share/gocode
/pkg/linux_amd64_shared -pack ./oid.go ./types.go
github.com/cockroachdb/cockroach/pkg/util/tracing
# github.com/cockroachdb/cockroach/pkg/sql/lex
pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords
@jordanlewis
Copy link
Member

How are you trying to build cockroach? You need to use make build, and not go build, because we have a lot of code generators and other things that need to get run outside of the Go toolchain as the first build step.

@nim-nim
Copy link
Author

nim-nim commented Mar 17, 2018

ah, drat, I need to pass specific flags to the go parameters for the QA guys, and go flag passing is whoefully under-standardised and a PITA in general

Do you have a make target that does everything needing to be done outside the go toolchain?

@jordanlewis
Copy link
Member

Just run make build first. Then, you can run go build afterwards and it will do the right thing.

@nim-nim
Copy link
Author

nim-nim commented Mar 17, 2018

Will try it, thanks!

@salasrod
Copy link

salasrod commented Apr 10, 2018

make build does not work for me, and it fails with the exact same error.

Tools used:

go version go1.10.1 linux/amd64
cmake version 3.10.3

-- The CXX compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Compiler: 
-- Flags:  -march=native
-- Build type: RelWithDebInfo
-- The following OPTIONAL packages have been found:

 * Threads

And finally the error:

gofmt -s -w ./pkg/acceptance/cluster/testconfig.pb.go ./pkg/build/info.pb.go ./pkg/ccl/backupccl/backup.pb.go ./pkg/ccl/baseccl/encryption_options.pb.go ./pkg/ccl/storageccl/engineccl/enginepbccl/key_registry.pb.go ./pkg/ccl/utilccl/licenseccl/license.pb.go ./pkg/config/system.pb.go ./pkg/config/zone.pb.go ./pkg/gossip/gossip.pb.go ./pkg/internal/client/lease.pb.go ./pkg/roachpb/api.pb.go ./pkg/roachpb/app_stats.pb.go ./pkg/roachpb/csv.pb.go ./pkg/roachpb/data.pb.go ./pkg/roachpb/errors.pb.go ./pkg/roachpb/internal.pb.go ./pkg/roachpb/internal_raft.pb.go ./pkg/roachpb/metadata.pb.go ./pkg/rpc/heartbeat.pb.go ./pkg/server/diagnosticspb/diagnostics.pb.go ./pkg/server/serverpb/admin.pb.go ./pkg/server/serverpb/authentication.pb.go ./pkg/server/serverpb/init.pb.go ./pkg/server/serverpb/status.pb.go ./pkg/server/status/status.pb.go ./pkg/settings/cluster/cluster_version.pb.go ./pkg/sql/distsqlrun/api.pb.go ./pkg/sql/distsqlrun/data.pb.go ./pkg/sql/distsqlrun/processors.pb.go ./pkg/sql/jobs/jobs.pb.go ./pkg/sql/pgwire/pgerror/errors.pb.go ./pkg/sql/sqlbase/encoded_datum.pb.go ./pkg/sql/sqlbase/join_type.pb.go ./pkg/sql/sqlbase/privilege.pb.go ./pkg/sql/sqlbase/structured.pb.go ./pkg/sql/stats/histogram.pb.go ./pkg/storage/api.pb.go ./pkg/storage/engine/enginepb/file_registry.pb.go ./pkg/storage/engine/enginepb/mvcc.pb.go ./pkg/storage/engine/enginepb/mvcc3.pb.go ./pkg/storage/engine/enginepb/rocksdb.pb.go ./pkg/storage/lease_status.pb.go ./pkg/storage/liveness.pb.go ./pkg/storage/log.pb.go ./pkg/storage/raft.pb.go ./pkg/storage/storagebase/proposer_kv.pb.go ./pkg/storage/storagebase/state.pb.go ./pkg/ts/tspb/timeseries.pb.go ./pkg/util/hlc/legacy_timestamp.pb.go ./pkg/util/hlc/timestamp.pb.go ./pkg/util/log/log.pb.go ./pkg/util/protoutil/clone.pb.go ./pkg/util/tracing/recorded_span.pb.go ./pkg/util/unresolved_addr.pb.go
touch bin/.go_protobuf_sources
go run pkg/cmd/docgen/{main,funcs}.go functions docs/generated/sql --quiet
# github.com/cockroachdb/cockroach/pkg/sql/lex
../../cockroachdb/cockroach/pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords
make: *** [Makefile:1187: bin/.docgen_functions] Error 2

This is on release-2.0 HEAD at the moment (3e44219)

@knz
Copy link
Contributor

knz commented Apr 27, 2018

@nim-nim we have made large improvements to our build system to avoid this class of errors. Could you check again and confirm the problem has been resolved?

@knz knz added O-community Originated from the community C-investigation Further steps needed to qualify. C-label will change. labels Apr 27, 2018
@knz knz changed the title pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords build: pkg/sql/lex/predicates.go:60:14: undefined: reservedKeywords May 10, 2018
@knz
Copy link
Contributor

knz commented May 10, 2018

@benesch did your PR for this make it through?

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

5 participants