Skip to content

Commit

Permalink
bazel: update comments in BUILD.bazel, include reference to dev -h
Browse files Browse the repository at this point in the history
Most of this stuff is out-of-date at this point.

Release note: None
  • Loading branch information
rickystewart committed Jan 18, 2022
1 parent bf2697a commit 6223343
Showing 1 changed file with 4 additions and 48 deletions.
52 changes: 4 additions & 48 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "go_path", "nogo")
load("//build/bazelutil/staticcheckanalyzers:def.bzl", "STATICCHECK_CHECKS")

# Consider using `dev` to easily perform Bazel builds. Run `dev doctor` to see
# if your machine is up to snuff, and `dev -h` for a list of everything `dev`
# can do.

exports_files([
"DEPS.bzl",
"TEAMS.yaml",
Expand Down Expand Up @@ -142,54 +146,6 @@ exports_files([
# https://docs.bazel.build/versions/master/user-manual.html
# https://docs.bazel.build/versions/master/guide.html

# TODO(irfansharif): Document a few usage patterns for bazel and how to
# understand all the autogen stuff. Probably as a tech note. Here are a few
# short hands I've used so far:
#
# bazel test //pkg/kv/kvserver/concurrency/...
# bazel test //pkg/kv/kvserver:all --test_cache_results=no --test_output=all
# bazel test --features race //pkg/kv/kvserver/concurrency/... --test_output=all \
# --test_arg='-test.v' --test_arg='-show-logs' --test_filter='TestBTreeClone.*' \
# --run_under='stress -maxtime=120s' --cache_test_results=no
# bazel build //pkg/sql/opt
# bazel build //pkg/sql/opt:all
# bazel build //pkg/sql/colexec:gen-exec
# bazel build //pkg/cmd/cockroach-short
# bazel build //:libjemalloc
# bazel query //pkg/sql/colexec:all
# bazel run //:gazelle
# bazel run //pkg/cmd/cockroach-short -- demo
# bazel run //pkg/sql/opt/optgen/cmd/langgen -- -h
#
# The //<stuff> names can also be fully qualified using @cockroach, and that
# appears in certain parts of the codebase/elsewhere. Specifically it'll look
# like:
#
# bazel build @cockroach//pkg/cmd/cockroach-short
#
# TODO(irfansharif): We should define shorthands for all of the above. See
# https://docs.bazel.build/versions/master/skylark/tutorial-custom-verbs.html

# TODO(irfansharif): The way we currently generate code through bazel, that
# code is only available within the bazel sandbox. Bazel ignores all
# the pre-generated code that is already checked into the codebase (through
# `make generate`/etc.) through the exclude directives above. It's generating
# everything on the fly.
#
# As we move towards bazel, we'll want to introduce a mechanism that implants
# the generated code within the sandbox placing them "back into" the
# appropriate packages. This is to ensure we don't break existing IDEs and code
# editors which rely on files existing in the same package itself (as opposed
# to the sandbox). This way we could continue checking in auto-generated code.
# We should provide a bazel alternative for `make generate` that does this very
# same thing. See [1], this is a long standing issue for folks using using Go,
# bazel, and autogenerated code.
#
# [1]: https://github.com/bazelbuild/rules_go/issues/512.

# TODO(irfansharif): We'll need to pin toolchains somewhere to make sure
# everything below works as expected.

gazelle(
name = "gazelle",
prefix = "github.com/cockroachdb/cockroach",
Expand Down

0 comments on commit 6223343

Please sign in to comment.