From e5438d950b861148735654c356f92f5956585c44 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Mon, 19 Oct 2020 09:28:06 -0400 Subject: [PATCH 1/5] c-deps: pick up jemalloc changes needed for bazel We'll need these changes in future commits. jemalloc: fix JEMALLOC_MUTEX_INIT_CB to only be set if OSS_PINLOCK is false Release note: None --- c-deps/jemalloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c-deps/jemalloc b/c-deps/jemalloc index 80ddaec3ed29..fd00c883c119 160000 --- a/c-deps/jemalloc +++ b/c-deps/jemalloc @@ -1 +1 @@ -Subproject commit 80ddaec3ed2915c8c3b7490ec2f0a0e4d723cc71 +Subproject commit fd00c883c119539844b3ffd5ad8640968e0cb1a3 From b91f19915d4fc283abde161057cdddc73dd3c00a Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Fri, 23 Oct 2020 11:20:31 -0400 Subject: [PATCH 2/5] vendor: refer to bazel-ified go-libedit Specifically pick up Oliver's changes in otan-cockroach/go-libedit@gazelle_it_2: go mod edit -replace=github.com/knz/go-libedit=github.com/otan-cockroach/go-libedit@gazelle_it_2 make vendor_rebuild Release note: None --- go.mod | 4 +++- go.sum | 5 +++-- vendor | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 21c1843094ee..fc5faa50fdf5 100644 --- a/go.mod +++ b/go.mod @@ -96,7 +96,7 @@ require ( github.com/kevinburke/go-bindata v3.13.0+incompatible github.com/kisielk/errcheck v1.2.0 github.com/kisielk/gotool v1.0.0 - github.com/knz/go-libedit v1.10.1 + github.com/knz/go-libedit v0.0.0-00010101000000-000000000000 github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9 github.com/kr/pretty v0.2.1 github.com/kr/text v0.2.0 @@ -183,3 +183,5 @@ replace vitess.io/vitess => github.com/cockroachdb/vitess v2.2.0-rc.1.0.20180830 replace gopkg.in/yaml.v2 => github.com/cockroachdb/yaml v0.0.0-20180705215940-0e2822948641 replace go.etcd.io/etcd => github.com/cockroachdb/etcd v0.4.7-0.20200615211340-a17df30d5955 + +replace github.com/knz/go-libedit => github.com/otan-cockroach/go-libedit v1.10.2-0.20201016212517-2c66cfe9603c diff --git a/go.sum b/go.sum index f1ce5956409b..8da6d7914376 100644 --- a/go.sum +++ b/go.sum @@ -491,8 +491,6 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/knz/go-libedit v1.10.1 h1:0pHpWtx9vcvC0xGZqEQlQdfSQs7WRlAjuPvk3fOZDCo= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9 h1:GQE1iatYDRrIidq4Zf/9ZzKWyrTk2sXOYc1JADbkAjQ= github.com/knz/strtime v0.0.0-20200318182718-be999391ffa9/go.mod h1:4ZxfWkxwtc7dBeifERVVWRy9F9rTU9p0yCDgeCtlius= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -611,8 +609,11 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5 h1:82Tnq9OJpn+h5xgGps github.com/openzipkin-contrib/zipkin-go-opentracing v0.3.5/go.mod h1:uVHyebswE1cCXr2A73cRM2frx5ld1RJUCJkFNZ90ZiI= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/ory/dockertest/v3 v3.6.0/go.mod h1:4ZOpj8qBUmh8fcBSVzkH2bws2s91JdGvHUqan4GHEuQ= +github.com/otan-cockroach/go-libedit v1.10.2-0.20201016212517-2c66cfe9603c h1:JZt/IahREIv11tegg2OoWEpTr/Zk8gtny+4EKMQqGEU= +github.com/otan-cockroach/go-libedit v1.10.2-0.20201016212517-2c66cfe9603c/go.mod h1:X8+oa2glxe4aJyviH7x8FG5AoSdqZ0VJYOxt83gh6m8= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk= github.com/peterbourgon/g2s v0.0.0-20170223122336-d4e7ad98afea/go.mod h1:1VcHEd3ro4QMoHfiNl/j7Jkln9+KQuorp0PItHMJYNg= diff --git a/vendor b/vendor index 9fd6e475efc6..66b499b93b5d 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 9fd6e475efc6a1780b1670b1902aa173da8249f0 +Subproject commit 66b499b93b5d5e2a6e0750b5e6e4a364bfebb587 From 52c5f51b81214f55606c43b049df142224cdd0e6 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Fri, 23 Oct 2020 13:39:10 -0400 Subject: [PATCH 3/5] colexec: specify the superset of all go dependencies in templates The changes to the _tmpl.go files are needed for bazel to compile auto-generated code in its sandbox. We currently rely on goimports to fill in the dependencies in the eg.go files, as needed, but that does not do the right thing in bazel. This diff may ultimately turn out to be unnecessary, but was quicker to do it this way than to figure out why goimports in the bazel sandbox doesn't fill in dependencies appropriately. Hopefully the diff is uncontroversial. Release note: None --- pkg/sql/colexec/cast.eg.go | 4 ++++ pkg/sql/colexec/cast_tmpl.go | 5 +++++ pkg/sql/colexec/const.eg.go | 7 +++++++ pkg/sql/colexec/const_tmpl.go | 9 +++++++++ pkg/sql/colexec/distinct.eg.go | 9 +++++++++ pkg/sql/colexec/distinct_tmpl.go | 13 +++++++++++++ pkg/sql/colexec/hash_utils.eg.go | 7 +++++++ pkg/sql/colexec/hash_utils_tmpl.go | 9 +++++++++ pkg/sql/colexec/hashtable_distinct.eg.go | 8 ++++++++ pkg/sql/colexec/hashtable_full_default.eg.go | 8 ++++++++ pkg/sql/colexec/hashtable_full_deleting.eg.go | 8 ++++++++ pkg/sql/colexec/hashtable_tmpl.go | 11 +++++++++++ pkg/sql/colexec/mergejoinbase.eg.go | 8 ++++++++ pkg/sql/colexec/mergejoinbase_tmpl.go | 11 +++++++++++ pkg/sql/colexec/mergejoiner_exceptall.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_fullouter.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_inner.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_intersectall.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_leftanti.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_leftouter.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_leftsemi.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_rightouter.eg.go | 10 ++++++++++ pkg/sql/colexec/mergejoiner_tmpl.go | 15 +++++++++++++++ pkg/sql/colexec/proj_const_left_ops.eg.go | 9 +++++++++ pkg/sql/colexec/proj_const_ops_tmpl.go | 13 +++++++++++++ pkg/sql/colexec/proj_const_right_ops.eg.go | 9 +++++++++ pkg/sql/colexec/proj_non_const_ops.eg.go | 9 +++++++++ pkg/sql/colexec/proj_non_const_ops_tmpl.go | 13 +++++++++++++ pkg/sql/colexec/rowstovec.eg.go | 9 +++++++++ pkg/sql/colexec/rowstovec_tmpl.go | 13 +++++++++++++ pkg/sql/colexec/select_in.eg.go | 8 ++++++++ pkg/sql/colexec/select_in_tmpl.go | 11 +++++++++++ pkg/sql/colexec/selection_ops.eg.go | 8 ++++++++ pkg/sql/colexec/selection_ops_tmpl.go | 11 +++++++++++ pkg/sql/colexec/sort.eg.go | 7 +++++++ pkg/sql/colexec/sort_tmpl.go | 9 +++++++++ pkg/sql/colexec/values_differ.eg.go | 8 ++++++++ pkg/sql/colexec/values_differ_tmpl.go | 11 +++++++++++ pkg/sql/colexec/vec_comparators.eg.go | 7 +++++++ pkg/sql/colexec/vec_comparators_tmpl.go | 9 +++++++++ 40 files changed, 376 insertions(+) diff --git a/pkg/sql/colexec/cast.eg.go b/pkg/sql/colexec/cast.eg.go index 42ad621a9500..550e17558222 100644 --- a/pkg/sql/colexec/cast.eg.go +++ b/pkg/sql/colexec/cast.eg.go @@ -26,6 +26,10 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var _ coldataext.Datum + func GetCastOperator( allocator *colmem.Allocator, input colexecbase.Operator, diff --git a/pkg/sql/colexec/cast_tmpl.go b/pkg/sql/colexec/cast_tmpl.go index 9ce0eb942d8e..b616fe653c5b 100644 --- a/pkg/sql/colexec/cast_tmpl.go +++ b/pkg/sql/colexec/cast_tmpl.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" @@ -35,6 +36,10 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var _ coldataext.Datum + // {{/* type _R_GO_TYPE interface{} diff --git a/pkg/sql/colexec/const.eg.go b/pkg/sql/colexec/const.eg.go index 6078292915fe..d702e9e2d738 100644 --- a/pkg/sql/colexec/const.eg.go +++ b/pkg/sql/colexec/const.eg.go @@ -23,6 +23,13 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration +) + // NewConstOp creates a new operator that produces a constant value constVal of // type t at index outputIdx. func NewConstOp( diff --git a/pkg/sql/colexec/const_tmpl.go b/pkg/sql/colexec/const_tmpl.go index b9791b0f13ce..7f38bffb24dd 100644 --- a/pkg/sql/colexec/const_tmpl.go +++ b/pkg/sql/colexec/const_tmpl.go @@ -22,15 +22,24 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/distinct.eg.go b/pkg/sql/colexec/distinct.eg.go index db32411e2d48..3ccf747acbc5 100644 --- a/pkg/sql/colexec/distinct.eg.go +++ b/pkg/sql/colexec/distinct.eg.go @@ -27,6 +27,15 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + // OrderedDistinctColsToOperators is a utility function that given an input and // a slice of columns, creates a chain of distinct operators and returns the // last distinct operator in that chain as well as its output column. diff --git a/pkg/sql/colexec/distinct_tmpl.go b/pkg/sql/colexec/distinct_tmpl.go index 1e3dd23acd23..36df5a956759 100644 --- a/pkg/sql/colexec/distinct_tmpl.go +++ b/pkg/sql/colexec/distinct_tmpl.go @@ -22,15 +22,28 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + // OrderedDistinctColsToOperators is a utility function that given an input and // a slice of columns, creates a chain of distinct operators and returns the // last distinct operator in that chain as well as its output column. diff --git a/pkg/sql/colexec/hash_utils.eg.go b/pkg/sql/colexec/hash_utils.eg.go index d01335cf2832..2e53e4c8baec 100644 --- a/pkg/sql/colexec/hash_utils.eg.go +++ b/pkg/sql/colexec/hash_utils.eg.go @@ -25,6 +25,13 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum +) + // rehash takes an element of a key (tuple representing a row of equality // column values) at a given column and computes a new hash by applying a // transformation to the existing hash. diff --git a/pkg/sql/colexec/hash_utils_tmpl.go b/pkg/sql/colexec/hash_utils_tmpl.go index 2f82a5a93774..89d927b79052 100644 --- a/pkg/sql/colexec/hash_utils_tmpl.go +++ b/pkg/sql/colexec/hash_utils_tmpl.go @@ -23,6 +23,8 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" @@ -30,6 +32,13 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum +) + // {{/* // _GOTYPESLICE is a template Go type slice variable. diff --git a/pkg/sql/colexec/hashtable_distinct.eg.go b/pkg/sql/colexec/hashtable_distinct.eg.go index bac6ffb9ccf0..d604bccc4e30 100644 --- a/pkg/sql/colexec/hashtable_distinct.eg.go +++ b/pkg/sql/colexec/hashtable_distinct.eg.go @@ -20,6 +20,14 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/types" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // checkColAgainstItself is similar to checkCol, but it probes the vector // against itself. func (ht *hashTable) checkColAgainstItself(vec coldata.Vec, nToCheck uint64, sel []int) { diff --git a/pkg/sql/colexec/hashtable_full_default.eg.go b/pkg/sql/colexec/hashtable_full_default.eg.go index 49ac673c8127..8c14122e312e 100644 --- a/pkg/sql/colexec/hashtable_full_default.eg.go +++ b/pkg/sql/colexec/hashtable_full_default.eg.go @@ -20,6 +20,14 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/types" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // checkCol determines if the current key column in the groupID buckets matches // the specified equality column key. If there is no match, then the key is // added to differs. If the bucket has reached the end, the key is rejected. If diff --git a/pkg/sql/colexec/hashtable_full_deleting.eg.go b/pkg/sql/colexec/hashtable_full_deleting.eg.go index 33b115f348fb..ca1255f46ac0 100644 --- a/pkg/sql/colexec/hashtable_full_deleting.eg.go +++ b/pkg/sql/colexec/hashtable_full_deleting.eg.go @@ -22,6 +22,14 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // checkColDeleting determines if the current key column in the groupID buckets // matches the specified equality column key. If there is no match *or* the key // has been already used, then the key is added to differs. If the bucket has diff --git a/pkg/sql/colexec/hashtable_tmpl.go b/pkg/sql/colexec/hashtable_tmpl.go index 4ea034bd235a..fdef027db1b4 100644 --- a/pkg/sql/colexec/hashtable_tmpl.go +++ b/pkg/sql/colexec/hashtable_tmpl.go @@ -21,11 +21,22 @@ package colexec import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // {{/* // _LEFT_CANONICAL_TYPE_FAMILY is the template variable. diff --git a/pkg/sql/colexec/mergejoinbase.eg.go b/pkg/sql/colexec/mergejoinbase.eg.go index cd47dcfa5dbe..03c32639747f 100644 --- a/pkg/sql/colexec/mergejoinbase.eg.go +++ b/pkg/sql/colexec/mergejoinbase.eg.go @@ -22,6 +22,14 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // isBufferedGroupFinished checks to see whether or not the buffered group // corresponding to input continues in batch. func (o *mergeJoinBase) isBufferedGroupFinished( diff --git a/pkg/sql/colexec/mergejoinbase_tmpl.go b/pkg/sql/colexec/mergejoinbase_tmpl.go index 5818b81fb8d3..f63be9b21529 100644 --- a/pkg/sql/colexec/mergejoinbase_tmpl.go +++ b/pkg/sql/colexec/mergejoinbase_tmpl.go @@ -21,11 +21,22 @@ package colexec import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/mergejoiner_exceptall.eg.go b/pkg/sql/colexec/mergejoiner_exceptall.eg.go index 0acb67c1ae6d..6f5a15ef87fa 100644 --- a/pkg/sql/colexec/mergejoiner_exceptall.eg.go +++ b/pkg/sql/colexec/mergejoiner_exceptall.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinExceptAllOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_fullouter.eg.go b/pkg/sql/colexec/mergejoiner_fullouter.eg.go index 323c94533868..fb9d71cb645a 100644 --- a/pkg/sql/colexec/mergejoiner_fullouter.eg.go +++ b/pkg/sql/colexec/mergejoiner_fullouter.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinFullOuterOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_inner.eg.go b/pkg/sql/colexec/mergejoiner_inner.eg.go index 7b103bea8e59..38a0a48efa56 100644 --- a/pkg/sql/colexec/mergejoiner_inner.eg.go +++ b/pkg/sql/colexec/mergejoiner_inner.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinInnerOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_intersectall.eg.go b/pkg/sql/colexec/mergejoiner_intersectall.eg.go index 7b1804a06515..ee2fa9e90e6b 100644 --- a/pkg/sql/colexec/mergejoiner_intersectall.eg.go +++ b/pkg/sql/colexec/mergejoiner_intersectall.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinIntersectAllOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_leftanti.eg.go b/pkg/sql/colexec/mergejoiner_leftanti.eg.go index 05e4645db4e5..bba873f84958 100644 --- a/pkg/sql/colexec/mergejoiner_leftanti.eg.go +++ b/pkg/sql/colexec/mergejoiner_leftanti.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinLeftAntiOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_leftouter.eg.go b/pkg/sql/colexec/mergejoiner_leftouter.eg.go index d14b1f582fe1..3c567aba0030 100644 --- a/pkg/sql/colexec/mergejoiner_leftouter.eg.go +++ b/pkg/sql/colexec/mergejoiner_leftouter.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinLeftOuterOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_leftsemi.eg.go b/pkg/sql/colexec/mergejoiner_leftsemi.eg.go index 94d0b788d18c..07e5edb025aa 100644 --- a/pkg/sql/colexec/mergejoiner_leftsemi.eg.go +++ b/pkg/sql/colexec/mergejoiner_leftsemi.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinLeftSemiOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_rightouter.eg.go b/pkg/sql/colexec/mergejoiner_rightouter.eg.go index 1e815de781e7..d94a2a85cc0b 100644 --- a/pkg/sql/colexec/mergejoiner_rightouter.eg.go +++ b/pkg/sql/colexec/mergejoiner_rightouter.eg.go @@ -27,6 +27,16 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + type mergeJoinRightOuterOp struct { *mergeJoinBase } diff --git a/pkg/sql/colexec/mergejoiner_tmpl.go b/pkg/sql/colexec/mergejoiner_tmpl.go index dbce11a18744..ac946ff96442 100644 --- a/pkg/sql/colexec/mergejoiner_tmpl.go +++ b/pkg/sql/colexec/mergejoiner_tmpl.go @@ -22,14 +22,29 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ coldataext.Datum + _ duration.Duration + _ tree.AggType +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/proj_const_left_ops.eg.go b/pkg/sql/colexec/proj_const_left_ops.eg.go index dd56ef577a94..8989b3492611 100644 --- a/pkg/sql/colexec/proj_const_left_ops.eg.go +++ b/pkg/sql/colexec/proj_const_left_ops.eg.go @@ -31,6 +31,15 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ sqltelemetry.EnumTelemetryType + _ telemetry.Counter +) + type projBitandInt16ConstInt16Op struct { projConstOpBase constArg int16 diff --git a/pkg/sql/colexec/proj_const_ops_tmpl.go b/pkg/sql/colexec/proj_const_ops_tmpl.go index 899fb9729251..ec7a3c5f2816 100644 --- a/pkg/sql/colexec/proj_const_ops_tmpl.go +++ b/pkg/sql/colexec/proj_const_ops_tmpl.go @@ -22,19 +22,32 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" + "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ sqltelemetry.EnumTelemetryType + _ telemetry.Counter +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/proj_const_right_ops.eg.go b/pkg/sql/colexec/proj_const_right_ops.eg.go index 3a1a82fa05fc..6e7212fe983e 100644 --- a/pkg/sql/colexec/proj_const_right_ops.eg.go +++ b/pkg/sql/colexec/proj_const_right_ops.eg.go @@ -32,6 +32,15 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ sqltelemetry.EnumTelemetryType + _ telemetry.Counter +) + type projBitandInt16Int16ConstOp struct { projConstOpBase constArg int16 diff --git a/pkg/sql/colexec/proj_non_const_ops.eg.go b/pkg/sql/colexec/proj_non_const_ops.eg.go index 0b7f65789c6c..700744800f6a 100644 --- a/pkg/sql/colexec/proj_non_const_ops.eg.go +++ b/pkg/sql/colexec/proj_non_const_ops.eg.go @@ -30,6 +30,15 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ duration.Duration + _ coldataext.Datum + _ sqltelemetry.EnumTelemetryType + _ telemetry.Counter +) + // projConstOpBase contains all of the fields for projections with a constant, // except for the constant itself. // NOTE: this struct should be declared in proj_const_ops_tmpl.go, but if we do diff --git a/pkg/sql/colexec/proj_non_const_ops_tmpl.go b/pkg/sql/colexec/proj_non_const_ops_tmpl.go index 1c17685365fd..d3fcb6ba88e4 100644 --- a/pkg/sql/colexec/proj_non_const_ops_tmpl.go +++ b/pkg/sql/colexec/proj_non_const_ops_tmpl.go @@ -23,17 +23,30 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" + "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" + "github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ duration.Duration + _ coldataext.Datum + _ sqltelemetry.EnumTelemetryType + _ telemetry.Counter +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/rowstovec.eg.go b/pkg/sql/colexec/rowstovec.eg.go index 8cea723bef8c..36b7c00ce104 100644 --- a/pkg/sql/colexec/rowstovec.eg.go +++ b/pkg/sql/colexec/rowstovec.eg.go @@ -23,6 +23,15 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/encoding" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ duration.Duration + _ encoding.Direction +) + // EncDatumRowsToColVec converts one column from EncDatumRows to a column // vector. columnIdx is the 0-based index of the column in the EncDatumRows. func EncDatumRowsToColVec( diff --git a/pkg/sql/colexec/rowstovec_tmpl.go b/pkg/sql/colexec/rowstovec_tmpl.go index 26c4fb0247c3..f448539a0211 100644 --- a/pkg/sql/colexec/rowstovec_tmpl.go +++ b/pkg/sql/colexec/rowstovec_tmpl.go @@ -20,11 +20,24 @@ package colexec import ( + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" + "github.com/cockroachdb/cockroach/pkg/util/encoding" +) + +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ apd.Context + _ duration.Duration + _ encoding.Direction ) // {{/* diff --git a/pkg/sql/colexec/select_in.eg.go b/pkg/sql/colexec/select_in.eg.go index 4008d37c7f3f..48252b5be9c0 100644 --- a/pkg/sql/colexec/select_in.eg.go +++ b/pkg/sql/colexec/select_in.eg.go @@ -29,6 +29,14 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ coldataext.Datum +) + // Remove unused warnings. var ( _ = colexecerror.InternalError diff --git a/pkg/sql/colexec/select_in_tmpl.go b/pkg/sql/colexec/select_in_tmpl.go index b6b4407a5d53..aaa56807bd2e 100644 --- a/pkg/sql/colexec/select_in_tmpl.go +++ b/pkg/sql/colexec/select_in_tmpl.go @@ -22,7 +22,9 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" @@ -31,9 +33,18 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ coldataext.Datum +) + // Remove unused warnings. var ( _ = colexecerror.InternalError diff --git a/pkg/sql/colexec/selection_ops.eg.go b/pkg/sql/colexec/selection_ops.eg.go index dcae6cf26322..50d7b3000819 100644 --- a/pkg/sql/colexec/selection_ops.eg.go +++ b/pkg/sql/colexec/selection_ops.eg.go @@ -28,6 +28,14 @@ import ( "github.com/cockroachdb/cockroach/pkg/util/duration" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ coldataext.Datum +) + // selConstOpBase contains all of the fields for binary selections with a // constant, except for the constant itself. type selConstOpBase struct { diff --git a/pkg/sql/colexec/selection_ops_tmpl.go b/pkg/sql/colexec/selection_ops_tmpl.go index 282ee965eda9..2837eef14dfe 100644 --- a/pkg/sql/colexec/selection_ops_tmpl.go +++ b/pkg/sql/colexec/selection_ops_tmpl.go @@ -22,7 +22,9 @@ package colexec import ( "context" + "github.com/cockroachdb/apd/v2" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" @@ -30,9 +32,18 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/cockroach/pkg/util/duration" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ apd.Context + _ duration.Duration + _ coldataext.Datum +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/sort.eg.go b/pkg/sql/colexec/sort.eg.go index fda51770b526..3fcd9c5744ef 100644 --- a/pkg/sql/colexec/sort.eg.go +++ b/pkg/sql/colexec/sort.eg.go @@ -24,6 +24,13 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ coldataext.Datum + _ tree.AggType +) + func isSorterSupported(t *types.T, dir execinfrapb.Ordering_Column_Direction) bool { switch dir { case execinfrapb.Ordering_Column_ASC: diff --git a/pkg/sql/colexec/sort_tmpl.go b/pkg/sql/colexec/sort_tmpl.go index a65639535716..4910372dffea 100644 --- a/pkg/sql/colexec/sort_tmpl.go +++ b/pkg/sql/colexec/sort_tmpl.go @@ -23,13 +23,22 @@ import ( "context" "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ coldataext.Datum + _ tree.AggType +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/values_differ.eg.go b/pkg/sql/colexec/values_differ.eg.go index b8abe99ab361..7c1d0057625f 100644 --- a/pkg/sql/colexec/values_differ.eg.go +++ b/pkg/sql/colexec/values_differ.eg.go @@ -22,6 +22,14 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // valuesDiffer takes in two ColVecs as well as values indices to check whether // the values differ. This function pays attention to NULLs, and two NULL // values do *not* differ. diff --git a/pkg/sql/colexec/values_differ_tmpl.go b/pkg/sql/colexec/values_differ_tmpl.go index 9cfd0bc8479f..998858077d6e 100644 --- a/pkg/sql/colexec/values_differ_tmpl.go +++ b/pkg/sql/colexec/values_differ_tmpl.go @@ -21,11 +21,22 @@ package colexec import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" + "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ = typeconv.DatumVecCanonicalTypeFamily + _ coldataext.Datum + _ tree.AggType +) + // {{/* // Declarations to make the template compile properly. diff --git a/pkg/sql/colexec/vec_comparators.eg.go b/pkg/sql/colexec/vec_comparators.eg.go index 9c656c942230..28cc4ec6fa3b 100644 --- a/pkg/sql/colexec/vec_comparators.eg.go +++ b/pkg/sql/colexec/vec_comparators.eg.go @@ -22,6 +22,13 @@ import ( "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ coldataext.Datum + _ tree.AggType +) + // vecComparator is a helper for the ordered synchronizer. It stores multiple // column vectors of a single type and facilitates comparing values between // them. diff --git a/pkg/sql/colexec/vec_comparators_tmpl.go b/pkg/sql/colexec/vec_comparators_tmpl.go index 13643b8ffbef..7cfe4eda3cca 100644 --- a/pkg/sql/colexec/vec_comparators_tmpl.go +++ b/pkg/sql/colexec/vec_comparators_tmpl.go @@ -21,13 +21,22 @@ package colexec import ( "github.com/cockroachdb/cockroach/pkg/col/coldata" + "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen" "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/errors" ) +// Workaround for bazel auto-generated code. goimports does not automatically +// pick up the right packages when run within the bazel sandbox. +var ( + _ coldataext.Datum + _ tree.AggType +) + // {{/* // Declarations to make the template compile properly. From a67b8158306e1ad03007deea3d9411cbbdf3702f Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Fri, 23 Oct 2020 14:05:01 -0400 Subject: [PATCH 4/5] parser: include errors dep in grammar file We need this diff to get bazel to compile auto-generated sql.go in its sandbox. We currently rely on goimports to fill in the dependency as needed, but bazel is unable to resolve it as expected. This is in the same spirit as the last commit, this diff may ultimately turn out to be unnecessary, but was quicker to do it this way than to figure out why goimports in the bazel sandbox doesn't fill in dependencies appropriately. Release note: None --- pkg/sql/parser/sql.y | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index 2d7d16a83ccf..964def668dd5 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -36,6 +36,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/roleoption" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" + "github.com/cockroachdb/errors" "github.com/lib/pq/oid" ) From 1cd90b0b75b97639e20712d9c63ca3cf8e537ed5 Mon Sep 17 00:00:00 2001 From: irfan sharif Date: Fri, 23 Oct 2020 14:04:26 -0400 Subject: [PATCH 5/5] *: bazel-ify cockroachdb This commit introduces a new build system to cockroachdb: Bazel. The hope here is to eventually replace our current Makefile. It sets the foundation for introducing Bazel in our CI systems for parallelized builds/test runs, artifact caching, remote builds, and many other such profits (literally, it could reduce infra spend). We originally prototyped a pseudo bazel-ified cockroachdb in #52824, which resulted in a week long effort (with otan@, jamesl@, and myself) to wrap it up in earnest in #55258. This is the polished version of the resulting work, the write up for which can be found at go.crdb.dev/bazel-hackweek. --- Most of the BUILD files here were auto-generated through Gazelle (see doc). Some of these auto-generated files required further manual tweaking to get just right (see doc). These were mostly around the packages that link into c-dependencies, but also the few packages that rely on auto-generated code (again, see doc). These specific files are the ones intended for review (they're also the ones responsible for auto-generation), among a few others. I've listed them out here: ``` modified: .gitattributes modified: Makefile new file: BUILD.bazel new file: DEPS.bzl new file: WORKSPACE new file: pkg/ccl/gssapiccl/BUILD.bazel new file: pkg/cli/BUILD.bazel new file: pkg/cmd/cockroach-oss/BUILD.bazel new file: pkg/cmd/cockroach-short/BUILD.bazel new file: pkg/cmd/cockroach/BUILD.bazel new file: pkg/col/coldata/BUILD.bazel new file: pkg/geo/geoproj/BUILD.bazel new file: pkg/geo/geos/BUILD.bazel new file: pkg/sql/colconv/BUILD.bazel new file: pkg/sql/colexec/BUILD.bazel new file: pkg/sql/colexec/COLEXEC.bzl new file: pkg/sql/colexec/colbuilder/BUILD.bazel new file: pkg/sql/colexec/colexec.go new file: pkg/sql/colexec/colexecagg/BUILD.bazel new file: pkg/sql/colflow/BUILD.bazel new file: pkg/sql/opt/BUILD.bazel new file: pkg/sql/opt/exec/BUILD.bazel new file: pkg/sql/opt/exec/execbuilder/BUILD.bazel new file: pkg/sql/opt/exec/explain/BUILD.bazel new file: pkg/sql/opt/memo/BUILD.bazel new file: pkg/sql/opt/norm/BUILD.bazel new file: pkg/sql/opt/optgen/lang/BUILD.bazel new file: pkg/sql/opt/xform/BUILD.bazel new file: pkg/sql/parser/BUILD.bazel new file: pkg/sql/parser/sql-gen.sh new file: pkg/storage/BUILD.bazel modified: vendor ``` The changes to all the _tmpl.go files were needed to include necessary import analysis/compilation for bazel when generating the .eg.go files (also summarized in doc up above), and should be uncontroversial. I think it's easiest to pull the branch down locally and to click around to see what works, and what doesn't. I would start at the top-level BUILD.bazel and WORSPACE file. I've added comments to explain what most of added machinery does. Release note: None --- .bazelrc | 9 + .gitattributes | 1 + BUILD.bazel | 215 ++ DEPS.bzl | 2993 +++++++++++++++++ Makefile | 16 + WORKSPACE | 115 + pkg/acceptance/BUILD.bazel | 44 + pkg/acceptance/cluster/BUILD.bazel | 40 + pkg/acceptance/compose/gss/psql/BUILD.bazel | 8 + pkg/acceptance/localcluster/BUILD.bazel | 33 + pkg/acceptance/localcluster/tc/BUILD.bazel | 9 + pkg/base/BUILD.bazel | 65 + pkg/bench/BUILD.bazel | 46 + pkg/bench/cmd/pgbenchsetup/BUILD.bazel | 18 + pkg/bench/ddl_analysis/BUILD.bazel | 41 + pkg/blobs/BUILD.bazel | 50 + pkg/blobs/blobspb/BUILD.bazel | 12 + pkg/build/BUILD.bazel | 19 + pkg/ccl/BUILD.bazel | 23 + pkg/ccl/backupccl/BUILD.bazel | 196 ++ pkg/ccl/baseccl/BUILD.bazel | 26 + pkg/ccl/buildccl/BUILD.bazel | 9 + pkg/ccl/changefeedccl/BUILD.bazel | 182 + pkg/ccl/changefeedccl/cdctest/BUILD.bazel | 56 + .../changefeedccl/changefeedbase/BUILD.bazel | 21 + pkg/ccl/changefeedccl/kvfeed/BUILD.bazel | 68 + pkg/ccl/changefeedccl/schemafeed/BUILD.bazel | 52 + .../schemafeed/schematestutils/BUILD.bazel | 15 + pkg/ccl/cliccl/BUILD.bazel | 56 + pkg/ccl/cliccl/cliflagsccl/BUILD.bazel | 9 + pkg/ccl/cmdccl/enc_utils/BUILD.bazel | 21 + pkg/ccl/gssapiccl/BUILD.bazel | 12 + pkg/ccl/importccl/BUILD.bazel | 185 + pkg/ccl/kvccl/BUILD.bazel | 12 + pkg/ccl/kvccl/kvfollowerreadsccl/BUILD.bazel | 67 + pkg/ccl/kvccl/kvtenantccl/BUILD.bazel | 53 + pkg/ccl/logictestccl/BUILD.bazel | 30 + pkg/ccl/oidcccl/BUILD.bazel | 57 + pkg/ccl/partitionccl/BUILD.bazel | 77 + pkg/ccl/serverccl/BUILD.bazel | 43 + pkg/ccl/sqlproxyccl/BUILD.bazel | 40 + pkg/ccl/storageccl/BUILD.bazel | 89 + pkg/ccl/storageccl/engineccl/BUILD.bazel | 64 + .../engineccl/enginepbccl/BUILD.bazel | 15 + pkg/ccl/utilccl/BUILD.bazel | 41 + pkg/ccl/utilccl/licenseccl/BUILD.bazel | 17 + pkg/ccl/utilccl/sampledataccl/BUILD.bazel | 29 + pkg/ccl/workloadccl/BUILD.bazel | 54 + pkg/ccl/workloadccl/allccl/BUILD.bazel | 67 + pkg/ccl/workloadccl/cliccl/BUILD.bazel | 22 + pkg/ccl/workloadccl/format/BUILD.bazel | 23 + pkg/ccl/workloadccl/roachmartccl/BUILD.bazel | 16 + pkg/cli/BUILD.bazel | 340 ++ pkg/cli/cliflags/BUILD.bazel | 16 + pkg/cli/syncbench/BUILD.bazel | 20 + pkg/cli/systembench/BUILD.bazel | 28 + pkg/cli/systembench/systembenchpb/BUILD.bazel | 12 + pkg/clusterversion/BUILD.bazel | 39 + pkg/cmd/allocsim/BUILD.bazel | 26 + pkg/cmd/cmdutil/BUILD.bazel | 8 + pkg/cmd/cmp-protocol/BUILD.bazel | 23 + pkg/cmd/cmp-protocol/pgconnect/BUILD.bazel | 14 + pkg/cmd/cmp-sql/BUILD.bazel | 20 + pkg/cmd/cmpconn/BUILD.bazel | 31 + pkg/cmd/cockroach-oss/BUILD.bazel | 28 + pkg/cmd/cockroach-short/BUILD.bazel | 18 + pkg/cmd/cockroach/BUILD.bazel | 20 + pkg/cmd/compile-build/BUILD.bazel | 15 + pkg/cmd/cr2pg/BUILD.bazel | 20 + pkg/cmd/cr2pg/sqlstream/BUILD.bazel | 14 + pkg/cmd/docgen/BUILD.bazel | 28 + pkg/cmd/docgen/extract/BUILD.bazel | 24 + pkg/cmd/fuzz/BUILD.bazel | 15 + pkg/cmd/generate-binary/BUILD.bazel | 18 + pkg/cmd/generate-spatial-ref-sys/BUILD.bazel | 22 + pkg/cmd/geoviz/BUILD.bazel | 23 + pkg/cmd/github-post/BUILD.bazel | 25 + pkg/cmd/github-pull-request-make/BUILD.bazel | 30 + pkg/cmd/gossipsim/BUILD.bazel | 24 + pkg/cmd/internal/issues/BUILD.bazel | 33 + pkg/cmd/prereqs/BUILD.bazel | 23 + pkg/cmd/protoc-gen-gogoroach/BUILD.bazel | 19 + pkg/cmd/publish-artifacts/BUILD.bazel | 33 + .../publish-provisional-artifacts/BUILD.bazel | 35 + pkg/cmd/reduce/BUILD.bazel | 19 + pkg/cmd/returncheck/BUILD.bazel | 18 + pkg/cmd/roachprod-stress/BUILD.bazel | 18 + pkg/cmd/roachprod/BUILD.bazel | 35 + pkg/cmd/roachprod/cloud/BUILD.bazel | 18 + pkg/cmd/roachprod/config/BUILD.bazel | 8 + pkg/cmd/roachprod/errors/BUILD.bazel | 9 + pkg/cmd/roachprod/install/BUILD.bazel | 33 + pkg/cmd/roachprod/ssh/BUILD.bazel | 19 + pkg/cmd/roachprod/ui/BUILD.bazel | 11 + pkg/cmd/roachprod/vm/BUILD.bazel | 21 + pkg/cmd/roachprod/vm/aws/BUILD.bazel | 24 + .../roachprod/vm/aws/terraformgen/BUILD.bazel | 15 + pkg/cmd/roachprod/vm/azure/BUILD.bazel | 31 + pkg/cmd/roachprod/vm/flagstub/BUILD.bazel | 12 + pkg/cmd/roachprod/vm/gce/BUILD.bazel | 19 + pkg/cmd/roachprod/vm/local/BUILD.bazel | 16 + pkg/cmd/roachtest/BUILD.bazel | 211 ++ pkg/cmd/roachvet/BUILD.bazel | 48 + pkg/cmd/skip-test/BUILD.bazel | 22 + pkg/cmd/skiperrs/BUILD.bazel | 18 + pkg/cmd/skipped-tests/BUILD.bazel | 19 + pkg/cmd/smithcmp/BUILD.bazel | 25 + pkg/cmd/smithtest/BUILD.bazel | 25 + pkg/cmd/teamcity-trigger/BUILD.bazel | 25 + pkg/cmd/testfilter/BUILD.bazel | 26 + pkg/cmd/uptodate/BUILD.bazel | 18 + pkg/cmd/urlcheck/BUILD.bazel | 15 + pkg/cmd/urlcheck/lib/urlcheck/BUILD.bazel | 12 + pkg/cmd/whoownsit/BUILD.bazel | 15 + pkg/cmd/workload/BUILD.bazel | 19 + pkg/cmd/wraprules/BUILD.bazel | 19 + pkg/cmd/zerosum/BUILD.bazel | 24 + pkg/col/coldata/BUILD.bazel | 51 + pkg/col/coldataext/BUILD.bazel | 36 + pkg/col/coldatatestutils/BUILD.bazel | 23 + pkg/col/colserde/BUILD.bazel | 61 + pkg/col/colserde/arrowserde/BUILD.bazel | 15 + pkg/col/typeconv/BUILD.bazel | 13 + pkg/compose/BUILD.bazel | 8 + pkg/compose/compare/compare/BUILD.bazel | 8 + pkg/config/BUILD.bazel | 51 + pkg/config/zonepb/BUILD.bazel | 38 + pkg/docs/BUILD.bazel | 9 + pkg/geo/BUILD.bazel | 64 + pkg/geo/geodist/BUILD.bazel | 13 + pkg/geo/geogen/BUILD.bazel | 27 + pkg/geo/geogfn/BUILD.bazel | 58 + pkg/geo/geographiclib/BUILD.bazel | 32 + pkg/geo/geoindex/BUILD.bazel | 49 + pkg/geo/geomfn/BUILD.bazel | 91 + pkg/geo/geopb/BUILD.bazel | 13 + pkg/geo/geoproj/BUILD.bazel | 49 + pkg/geo/geoprojbase/BUILD.bazel | 22 + pkg/geo/geos/BUILD.bazel | 73 + pkg/geo/geosegmentize/BUILD.bazel | 12 + pkg/geo/geotransform/BUILD.bazel | 28 + pkg/gossip/BUILD.bazel | 95 + pkg/gossip/resolver/BUILD.bazel | 29 + pkg/gossip/simulation/BUILD.bazel | 27 + .../client/requestbatcher/BUILD.bazel | 31 + pkg/internal/codeowners/BUILD.bazel | 24 + pkg/internal/gopath/BUILD.bazel | 9 + pkg/internal/rsg/BUILD.bazel | 21 + pkg/internal/rsg/yacc/BUILD.bazel | 20 + pkg/internal/sqlsmith/BUILD.bazel | 58 + pkg/internal/team/BUILD.bazel | 19 + pkg/jobs/BUILD.bazel | 136 + pkg/jobs/jobspb/BUILD.bazel | 25 + pkg/jobs/jobsprotectedts/BUILD.bazel | 51 + pkg/jobs/jobstest/BUILD.bazel | 13 + pkg/keys/BUILD.bazel | 44 + pkg/kv/BUILD.bazel | 78 + pkg/kv/bulk/BUILD.bazel | 64 + pkg/kv/kvbase/BUILD.bazel | 12 + pkg/kv/kvclient/BUILD.bazel | 8 + pkg/kv/kvclient/kvcoord/BUILD.bazel | 159 + pkg/kv/kvclient/kvtenant/BUILD.bazel | 20 + pkg/kv/kvnemesis/BUILD.bazel | 75 + pkg/kv/kvserver/BUILD.bazel | 386 +++ pkg/kv/kvserver/abortspan/BUILD.bazel | 35 + pkg/kv/kvserver/apply/BUILD.bazel | 30 + pkg/kv/kvserver/batcheval/BUILD.bazel | 130 + pkg/kv/kvserver/batcheval/result/BUILD.bazel | 31 + pkg/kv/kvserver/closedts/BUILD.bazel | 18 + .../kvserver/closedts/container/BUILD.bazel | 47 + pkg/kv/kvserver/closedts/ctpb/BUILD.bazel | 21 + pkg/kv/kvserver/closedts/minprop/BUILD.bazel | 39 + pkg/kv/kvserver/closedts/provider/BUILD.bazel | 42 + .../closedts/provider/testutils/BUILD.bazel | 19 + pkg/kv/kvserver/closedts/storage/BUILD.bazel | 34 + .../kvserver/closedts/transport/BUILD.bazel | 45 + .../closedts/transport/testutils/BUILD.bazel | 14 + pkg/kv/kvserver/compactor/BUILD.bazel | 48 + pkg/kv/kvserver/concurrency/BUILD.bazel | 79 + pkg/kv/kvserver/concurrency/lock/BUILD.bazel | 12 + pkg/kv/kvserver/constraint/BUILD.bazel | 12 + pkg/kv/kvserver/diskmap/BUILD.bazel | 8 + pkg/kv/kvserver/gc/BUILD.bazel | 57 + pkg/kv/kvserver/idalloc/BUILD.bazel | 42 + pkg/kv/kvserver/intentresolver/BUILD.bazel | 54 + pkg/kv/kvserver/kvserverbase/BUILD.bazel | 20 + pkg/kv/kvserver/kvserverpb/BUILD.bazel | 29 + pkg/kv/kvserver/protectedts/BUILD.bazel | 27 + .../kvserver/protectedts/ptcache/BUILD.bazel | 58 + pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel | 14 + .../protectedts/ptprovider/BUILD.bazel | 21 + .../protectedts/ptreconcile/BUILD.bazel | 59 + .../protectedts/ptstorage/BUILD.bazel | 67 + .../protectedts/ptverifier/BUILD.bazel | 47 + pkg/kv/kvserver/raftentry/BUILD.bazel | 30 + pkg/kv/kvserver/rangefeed/BUILD.bazel | 62 + pkg/kv/kvserver/rditer/BUILD.bazel | 34 + pkg/kv/kvserver/reports/BUILD.bazel | 87 + pkg/kv/kvserver/spanlatch/BUILD.bazel | 46 + pkg/kv/kvserver/spanset/BUILD.bazel | 36 + pkg/kv/kvserver/split/BUILD.bazel | 35 + pkg/kv/kvserver/stateloader/BUILD.bazel | 38 + pkg/kv/kvserver/tenantrate/BUILD.bazel | 48 + pkg/kv/kvserver/tscache/BUILD.bazel | 51 + pkg/kv/kvserver/txnrecovery/BUILD.bazel | 38 + pkg/kv/kvserver/txnwait/BUILD.bazel | 43 + pkg/release/BUILD.bazel | 12 + pkg/roachpb/BUILD.bazel | 112 + pkg/rpc/BUILD.bazel | 116 + pkg/rpc/nodedialer/BUILD.bazel | 45 + pkg/scheduledjobs/BUILD.bazel | 15 + pkg/security/BUILD.bazel | 114 + pkg/security/securitytest/BUILD.bazel | 15 + pkg/server/BUILD.bazel | 321 ++ pkg/server/debug/BUILD.bazel | 44 + pkg/server/debug/goroutineui/BUILD.bazel | 22 + pkg/server/debug/pprofui/BUILD.bazel | 31 + pkg/server/diagnosticspb/BUILD.bazel | 31 + pkg/server/dumpstore/BUILD.bazel | 23 + pkg/server/goroutinedumper/BUILD.bazel | 29 + pkg/server/heapprofiler/BUILD.bazel | 37 + pkg/server/serverpb/BUILD.bazel | 55 + pkg/server/status/BUILD.bazel | 142 + pkg/server/status/statuspb/BUILD.bazel | 14 + pkg/server/telemetry/BUILD.bazel | 27 + pkg/settings/BUILD.bazel | 39 + pkg/settings/cluster/BUILD.bazel | 17 + pkg/sql/BUILD.bazel | 571 ++++ pkg/sql/backfill/BUILD.bazel | 27 + pkg/sql/catalog/BUILD.bazel | 49 + pkg/sql/catalog/accessors/BUILD.bazel | 26 + pkg/sql/catalog/bootstrap/BUILD.bazel | 22 + pkg/sql/catalog/catalogkeys/BUILD.bazel | 28 + pkg/sql/catalog/catalogkv/BUILD.bazel | 38 + pkg/sql/catalog/catconstants/BUILD.bazel | 8 + pkg/sql/catalog/colinfo/BUILD.bazel | 38 + pkg/sql/catalog/database/BUILD.bazel | 0 pkg/sql/catalog/dbdesc/BUILD.bazel | 34 + pkg/sql/catalog/descpb/BUILD.bazel | 56 + pkg/sql/catalog/descs/BUILD.bazel | 71 + pkg/sql/catalog/hydratedtables/BUILD.bazel | 44 + pkg/sql/catalog/lease/BUILD.bazel | 94 + pkg/sql/catalog/resolver/BUILD.bazel | 25 + pkg/sql/catalog/schemadesc/BUILD.bazel | 33 + pkg/sql/catalog/systemschema/BUILD.bazel | 36 + pkg/sql/catalog/tabledesc/BUILD.bazel | 77 + pkg/sql/catalog/typedesc/BUILD.bazel | 57 + pkg/sql/colcontainer/BUILD.bazel | 52 + pkg/sql/colconv/BUILD.bazel | 32 + pkg/sql/colencoding/BUILD.bazel | 43 + pkg/sql/colexec/BUILD.bazel | 255 ++ pkg/sql/colexec/COLEXEC.bzl | 43 + pkg/sql/colexec/colbuilder/BUILD.bazel | 34 + pkg/sql/colexec/colexecagg/BUILD.bazel | 51 + pkg/sql/colexec/execgen/BUILD.bazel | 43 + .../colexec/execgen/cmd/execgen/BUILD.bazel | 72 + pkg/sql/colexec/execpb/BUILD.bazel | 18 + pkg/sql/colexecbase/BUILD.bazel | 31 + pkg/sql/colexecbase/colexecerror/BUILD.bazel | 14 + pkg/sql/colfetcher/BUILD.bazel | 40 + pkg/sql/colflow/BUILD.bazel | 101 + pkg/sql/colflow/colrpc/BUILD.bazel | 63 + pkg/sql/colmem/BUILD.bazel | 19 + pkg/sql/covering/BUILD.bazel | 23 + pkg/sql/delegate/BUILD.bazel | 54 + pkg/sql/distsql/BUILD.bazel | 90 + pkg/sql/doctor/BUILD.bazel | 41 + pkg/sql/enum/BUILD.bazel | 19 + pkg/sql/execinfra/BUILD.bazel | 89 + pkg/sql/execinfrapb/BUILD.bazel | 83 + pkg/sql/faketreeeval/BUILD.bazel | 20 + pkg/sql/flowinfra/BUILD.bazel | 106 + pkg/sql/gcjob/BUILD.bazel | 39 + pkg/sql/gcjob/gcjobnotifier/BUILD.bazel | 36 + pkg/sql/gcjob_test/BUILD.bazel | 33 + pkg/sql/lex/BUILD.bazel | 34 + pkg/sql/logictest/BUILD.bazel | 74 + pkg/sql/mutations/BUILD.bazel | 28 + pkg/sql/oidext/BUILD.bazel | 19 + pkg/sql/opt/BUILD.bazel | 116 + pkg/sql/opt/bench/BUILD.bazel | 38 + pkg/sql/opt/cat/BUILD.bazel | 45 + pkg/sql/opt/constraint/BUILD.bazel | 45 + pkg/sql/opt/exec/BUILD.bazel | 45 + pkg/sql/opt/exec/execbuilder/BUILD.bazel | 66 + pkg/sql/opt/exec/explain/BUILD.bazel | 68 + pkg/sql/opt/idxconstraint/BUILD.bazel | 40 + pkg/sql/opt/invertedexpr/BUILD.bazel | 41 + pkg/sql/opt/invertedidx/BUILD.bazel | 56 + pkg/sql/opt/memo/BUILD.bazel | 99 + pkg/sql/opt/norm/BUILD.bazel | 103 + pkg/sql/opt/opbench/BUILD.bazel | 29 + pkg/sql/opt/optbuilder/BUILD.bazel | 100 + pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel | 22 + pkg/sql/opt/optgen/cmd/optfmt/BUILD.bazel | 27 + pkg/sql/opt/optgen/cmd/optgen/BUILD.bazel | 44 + pkg/sql/opt/optgen/exprgen/BUILD.bazel | 40 + pkg/sql/opt/optgen/lang/BUILD.bazel | 35 + pkg/sql/opt/ordering/BUILD.bazel | 61 + pkg/sql/opt/partialidx/BUILD.bazel | 38 + pkg/sql/opt/props/BUILD.bazel | 54 + pkg/sql/opt/props/physical/BUILD.bazel | 30 + pkg/sql/opt/testutils/BUILD.bazel | 31 + pkg/sql/opt/testutils/opttester/BUILD.bazel | 54 + pkg/sql/opt/testutils/testcat/BUILD.bazel | 55 + pkg/sql/opt/testutils/testexpr/BUILD.bazel | 14 + pkg/sql/opt/xform/BUILD.bazel | 103 + pkg/sql/optionalnodeliveness/BUILD.bazel | 13 + pkg/sql/paramparse/BUILD.bazel | 22 + pkg/sql/parser/BUILD.bazel | 91 + pkg/sql/parser/fuzz/BUILD.bazel | 8 + pkg/sql/parser/sql-gen.sh | 23 + pkg/sql/pgwire/BUILD.bazel | 121 + pkg/sql/pgwire/hba/BUILD.bazel | 34 + pkg/sql/pgwire/pgcode/BUILD.bazel | 11 + pkg/sql/pgwire/pgerror/BUILD.bazel | 53 + pkg/sql/pgwire/pgnotice/BUILD.bazel | 16 + pkg/sql/pgwire/pgwirebase/BUILD.bazel | 41 + pkg/sql/physicalplan/BUILD.bazel | 80 + .../physicalplan/replicaoracle/BUILD.bazel | 34 + pkg/sql/privilege/BUILD.bazel | 29 + pkg/sql/protoreflect/BUILD.bazel | 37 + pkg/sql/querycache/BUILD.bazel | 32 + pkg/sql/roleoption/BUILD.bazel | 17 + pkg/sql/row/BUILD.bazel | 96 + pkg/sql/rowcontainer/BUILD.bazel | 65 + pkg/sql/rowenc/BUILD.bazel | 95 + pkg/sql/rowexec/BUILD.bazel | 188 ++ pkg/sql/rowflow/BUILD.bazel | 65 + pkg/sql/schemachange/BUILD.bazel | 44 + pkg/sql/schemaexpr/BUILD.bazel | 59 + pkg/sql/scrub/BUILD.bazel | 9 + pkg/sql/sem/builtins/BUILD.bazel | 122 + pkg/sql/sem/transform/BUILD.bazel | 15 + pkg/sql/sem/tree/BUILD.bazel | 223 ++ pkg/sql/sem/tree/eval_test/BUILD.bazel | 34 + pkg/sql/sessiondata/BUILD.bazel | 29 + pkg/sql/sessiondatapb/BUILD.bazel | 12 + pkg/sql/span/BUILD.bazel | 22 + pkg/sql/sqlerrors/BUILD.bazel | 16 + pkg/sql/sqlliveness/BUILD.bazel | 16 + pkg/sql/sqlliveness/slinstance/BUILD.bazel | 40 + pkg/sql/sqlliveness/slprovider/BUILD.bazel | 19 + pkg/sql/sqlliveness/slstorage/BUILD.bazel | 66 + pkg/sql/sqltelemetry/BUILD.bazel | 36 + pkg/sql/sqltestutils/BUILD.bazel | 14 + pkg/sql/sqlutil/BUILD.bazel | 14 + pkg/sql/stats/BUILD.bazel | 107 + pkg/sql/stmtdiagnostics/BUILD.bazel | 54 + pkg/sql/tests/BUILD.bazel | 94 + pkg/sql/types/BUILD.bazel | 39 + pkg/sql/vtable/BUILD.bazel | 11 + pkg/sqlmigrations/BUILD.bazel | 80 + pkg/sqlmigrations/leasemanager/BUILD.bazel | 40 + pkg/storage/BUILD.bazel | 174 + pkg/storage/cloud/BUILD.bazel | 17 + pkg/storage/cloudimpl/BUILD.bazel | 51 + .../cloudimpl/cloudimpltests/BUILD.bazel | 46 + pkg/storage/cloudimpl/filetable/BUILD.bazel | 18 + .../filetable/filetabletest/BUILD.bazel | 23 + pkg/storage/enginepb/BUILD.bazel | 42 + pkg/storage/fs/BUILD.bazel | 8 + pkg/storage/metamorphic/BUILD.bazel | 41 + pkg/testutils/BUILD.bazel | 50 + pkg/testutils/buildutil/BUILD.bazel | 12 + pkg/testutils/colcontainerutils/BUILD.bazel | 15 + pkg/testutils/diagutils/BUILD.bazel | 13 + pkg/testutils/distsqlutils/BUILD.bazel | 16 + pkg/testutils/gossiputil/BUILD.bazel | 13 + pkg/testutils/jobutils/BUILD.bazel | 21 + pkg/testutils/keysutils/BUILD.bazel | 28 + pkg/testutils/kvclientutils/BUILD.bazel | 18 + pkg/testutils/lint/BUILD.bazel | 8 + .../lint/passes/descriptormarshal/BUILD.bazel | 24 + .../testdata/src/a/BUILD.bazel | 9 + .../pkg/sql/catalog/descpb/BUILD.bazel | 8 + pkg/testutils/lint/passes/errcmp/BUILD.bazel | 13 + pkg/testutils/lint/passes/fmtsafe/BUILD.bazel | 28 + .../passes/fmtsafe/testdata/src/a/BUILD.bazel | 20 + .../cockroach/pkg/util/log/BUILD.bazel | 8 + .../github.com/cockroachdb/errors/BUILD.bazel | 8 + .../src/go.etcd.io/etcd/raft/BUILD.bazel | 8 + pkg/testutils/lint/passes/hash/BUILD.bazel | 22 + .../passes/hash/testdata/src/a/BUILD.bazel | 8 + pkg/testutils/lint/passes/nocopy/BUILD.bazel | 23 + .../passes/nocopy/testdata/src/a/BUILD.bazel | 9 + .../cockroach/pkg/util/BUILD.bazel | 8 + .../lint/passes/passesutil/BUILD.bazel | 24 + .../lint/passes/returnerrcheck/BUILD.bazel | 25 + .../returnerrcheck/testdata/src/a/BUILD.bazel | 8 + pkg/testutils/lint/passes/timer/BUILD.bazel | 23 + .../passes/timer/testdata/src/a/BUILD.bazel | 9 + .../cockroach/pkg/util/timeutil/BUILD.bazel | 8 + .../lint/passes/unconvert/BUILD.bazel | 24 + .../unconvert/testdata/src/a/BUILD.bazel | 8 + pkg/testutils/localtestcluster/BUILD.bazel | 29 + pkg/testutils/pgtest/BUILD.bazel | 17 + pkg/testutils/physicalplanutils/BUILD.bazel | 14 + pkg/testutils/reduce/BUILD.bazel | 25 + pkg/testutils/reduce/reducesql/BUILD.bazel | 29 + pkg/testutils/serverutils/BUILD.bazel | 25 + pkg/testutils/skip/BUILD.bazel | 15 + pkg/testutils/sqlutils/BUILD.bazel | 50 + pkg/testutils/storageutils/BUILD.bazel | 14 + pkg/testutils/testcluster/BUILD.bazel | 55 + pkg/testutils/zerofields/BUILD.bazel | 16 + pkg/ts/BUILD.bazel | 91 + pkg/ts/catalog/BUILD.bazel | 19 + pkg/ts/testmodel/BUILD.bazel | 24 + pkg/ts/tspb/BUILD.bazel | 24 + pkg/ui/BUILD.bazel | 15 + pkg/util/BUILD.bazel | 54 + pkg/util/arith/BUILD.bazel | 8 + pkg/util/binfetcher/BUILD.bazel | 26 + pkg/util/bitarray/BUILD.bazel | 20 + pkg/util/bufalloc/BUILD.bazel | 8 + pkg/util/cache/BUILD.bazel | 23 + pkg/util/caller/BUILD.bazel | 19 + pkg/util/cancelchecker/BUILD.bazel | 12 + pkg/util/cgroups/BUILD.bazel | 19 + pkg/util/cloudinfo/BUILD.bazel | 19 + pkg/util/contextutil/BUILD.bazel | 22 + pkg/util/ctxgroup/BUILD.bazel | 20 + pkg/util/duration/BUILD.bazel | 21 + pkg/util/encoding/BUILD.bazel | 59 + pkg/util/encoding/csv/BUILD.bazel | 26 + pkg/util/envutil/BUILD.bazel | 18 + pkg/util/errorutil/BUILD.bazel | 25 + pkg/util/errorutil/unimplemented/BUILD.bazel | 19 + pkg/util/fileutil/BUILD.bazel | 16 + pkg/util/flagutil/BUILD.bazel | 24 + pkg/util/fsm/BUILD.bazel | 24 + pkg/util/growstack/BUILD.bazel | 11 + pkg/util/grpcutil/BUILD.bazel | 41 + pkg/util/hlc/BUILD.bazel | 38 + pkg/util/httputil/BUILD.bazel | 16 + pkg/util/humanizeutil/BUILD.bazel | 21 + pkg/util/interval/BUILD.bazel | 35 + pkg/util/interval/generic/BUILD.bazel | 25 + .../interval/generic/internal/BUILD.bazel | 8 + pkg/util/ipaddr/BUILD.bazel | 21 + pkg/util/iterutil/BUILD.bazel | 9 + pkg/util/json/BUILD.bazel | 46 + pkg/util/keysutil/BUILD.bazel | 13 + pkg/util/leaktest/BUILD.bazel | 13 + pkg/util/limit/BUILD.bazel | 32 + pkg/util/log/BUILD.bazel | 196 ++ pkg/util/log/logflags/BUILD.bazel | 9 + pkg/util/log/testshout/BUILD.bazel | 10 + pkg/util/metric/BUILD.bazel | 45 + pkg/util/metric/aggmetric/BUILD.bazel | 32 + pkg/util/mon/BUILD.bazel | 35 + pkg/util/netutil/BUILD.bazel | 29 + pkg/util/pretty/BUILD.bazel | 18 + pkg/util/protoutil/BUILD.bazel | 37 + pkg/util/quotapool/BUILD.bazel | 43 + pkg/util/randutil/BUILD.bazel | 18 + pkg/util/retry/BUILD.bazel | 27 + pkg/util/ring/BUILD.bazel | 15 + pkg/util/sdnotify/BUILD.bazel | 69 + pkg/util/search/BUILD.bazel | 19 + pkg/util/sequence/BUILD.bazel | 15 + pkg/util/shuffle/BUILD.bazel | 15 + pkg/util/sort/BUILD.bazel | 9 + pkg/util/span/BUILD.bazel | 27 + pkg/util/stop/BUILD.bazel | 39 + pkg/util/stringarena/BUILD.bazel | 15 + pkg/util/stringencoding/BUILD.bazel | 8 + pkg/util/syncutil/BUILD.bazel | 26 + pkg/util/syncutil/singleflight/BUILD.bazel | 16 + pkg/util/sysutil/BUILD.bazel | 118 + pkg/util/timeofday/BUILD.bazel | 19 + pkg/util/timetz/BUILD.bazel | 27 + pkg/util/timeutil/BUILD.bazel | 49 + pkg/util/timeutil/pgdate/BUILD.bazel | 42 + pkg/util/tracing/BUILD.bazel | 56 + pkg/util/tracing/tracingpb/BUILD.bazel | 16 + pkg/util/treeprinter/BUILD.bazel | 14 + pkg/util/uint128/BUILD.bazel | 15 + pkg/util/unaccent/BUILD.bazel | 8 + pkg/util/unique/BUILD.bazel | 14 + pkg/util/uuid/BUILD.bazel | 38 + pkg/util/version/BUILD.bazel | 15 + pkg/workload/BUILD.bazel | 66 + pkg/workload/bank/BUILD.bazel | 40 + pkg/workload/bulkingest/BUILD.bazel | 19 + pkg/workload/cli/BUILD.bazel | 86 + pkg/workload/debug/BUILD.bazel | 18 + pkg/workload/examples/BUILD.bazel | 15 + pkg/workload/faker/BUILD.bazel | 25 + pkg/workload/geospatial/BUILD.bazel | 12 + pkg/workload/histogram/BUILD.bazel | 13 + pkg/workload/indexes/BUILD.bazel | 17 + pkg/workload/interleavebench/BUILD.bazel | 15 + .../interleavedpartitioned/BUILD.bazel | 21 + pkg/workload/jsonload/BUILD.bazel | 16 + pkg/workload/kv/BUILD.bazel | 18 + pkg/workload/ledger/BUILD.bazel | 31 + pkg/workload/movr/BUILD.bazel | 29 + pkg/workload/querybench/BUILD.bazel | 15 + pkg/workload/querylog/BUILD.bazel | 23 + pkg/workload/queue/BUILD.bazel | 14 + pkg/workload/rand/BUILD.bazel | 20 + pkg/workload/schemachange/BUILD.bazel | 29 + pkg/workload/sqlsmith/BUILD.bazel | 18 + pkg/workload/tpcc/BUILD.bazel | 57 + pkg/workload/tpccchecks/BUILD.bazel | 16 + pkg/workload/tpcds/BUILD.bazel | 19 + pkg/workload/tpch/BUILD.bazel | 29 + pkg/workload/workloadimpl/BUILD.bazel | 27 + pkg/workload/workloadsql/BUILD.bazel | 46 + pkg/workload/ycsb/BUILD.bazel | 42 + vendor | 2 +- 513 files changed, 23738 insertions(+), 1 deletion(-) create mode 100644 .bazelrc create mode 100644 BUILD.bazel create mode 100644 DEPS.bzl create mode 100644 WORKSPACE create mode 100644 pkg/acceptance/BUILD.bazel create mode 100644 pkg/acceptance/cluster/BUILD.bazel create mode 100644 pkg/acceptance/compose/gss/psql/BUILD.bazel create mode 100644 pkg/acceptance/localcluster/BUILD.bazel create mode 100644 pkg/acceptance/localcluster/tc/BUILD.bazel create mode 100644 pkg/base/BUILD.bazel create mode 100644 pkg/bench/BUILD.bazel create mode 100644 pkg/bench/cmd/pgbenchsetup/BUILD.bazel create mode 100644 pkg/bench/ddl_analysis/BUILD.bazel create mode 100644 pkg/blobs/BUILD.bazel create mode 100644 pkg/blobs/blobspb/BUILD.bazel create mode 100644 pkg/build/BUILD.bazel create mode 100644 pkg/ccl/BUILD.bazel create mode 100644 pkg/ccl/backupccl/BUILD.bazel create mode 100644 pkg/ccl/baseccl/BUILD.bazel create mode 100644 pkg/ccl/buildccl/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/cdctest/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/changefeedbase/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/kvfeed/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/schemafeed/BUILD.bazel create mode 100644 pkg/ccl/changefeedccl/schemafeed/schematestutils/BUILD.bazel create mode 100644 pkg/ccl/cliccl/BUILD.bazel create mode 100644 pkg/ccl/cliccl/cliflagsccl/BUILD.bazel create mode 100644 pkg/ccl/cmdccl/enc_utils/BUILD.bazel create mode 100644 pkg/ccl/gssapiccl/BUILD.bazel create mode 100644 pkg/ccl/importccl/BUILD.bazel create mode 100644 pkg/ccl/kvccl/BUILD.bazel create mode 100644 pkg/ccl/kvccl/kvfollowerreadsccl/BUILD.bazel create mode 100644 pkg/ccl/kvccl/kvtenantccl/BUILD.bazel create mode 100644 pkg/ccl/logictestccl/BUILD.bazel create mode 100644 pkg/ccl/oidcccl/BUILD.bazel create mode 100644 pkg/ccl/partitionccl/BUILD.bazel create mode 100644 pkg/ccl/serverccl/BUILD.bazel create mode 100644 pkg/ccl/sqlproxyccl/BUILD.bazel create mode 100644 pkg/ccl/storageccl/BUILD.bazel create mode 100644 pkg/ccl/storageccl/engineccl/BUILD.bazel create mode 100644 pkg/ccl/storageccl/engineccl/enginepbccl/BUILD.bazel create mode 100644 pkg/ccl/utilccl/BUILD.bazel create mode 100644 pkg/ccl/utilccl/licenseccl/BUILD.bazel create mode 100644 pkg/ccl/utilccl/sampledataccl/BUILD.bazel create mode 100644 pkg/ccl/workloadccl/BUILD.bazel create mode 100644 pkg/ccl/workloadccl/allccl/BUILD.bazel create mode 100644 pkg/ccl/workloadccl/cliccl/BUILD.bazel create mode 100644 pkg/ccl/workloadccl/format/BUILD.bazel create mode 100644 pkg/ccl/workloadccl/roachmartccl/BUILD.bazel create mode 100644 pkg/cli/BUILD.bazel create mode 100644 pkg/cli/cliflags/BUILD.bazel create mode 100644 pkg/cli/syncbench/BUILD.bazel create mode 100644 pkg/cli/systembench/BUILD.bazel create mode 100644 pkg/cli/systembench/systembenchpb/BUILD.bazel create mode 100644 pkg/clusterversion/BUILD.bazel create mode 100644 pkg/cmd/allocsim/BUILD.bazel create mode 100644 pkg/cmd/cmdutil/BUILD.bazel create mode 100644 pkg/cmd/cmp-protocol/BUILD.bazel create mode 100644 pkg/cmd/cmp-protocol/pgconnect/BUILD.bazel create mode 100644 pkg/cmd/cmp-sql/BUILD.bazel create mode 100644 pkg/cmd/cmpconn/BUILD.bazel create mode 100644 pkg/cmd/cockroach-oss/BUILD.bazel create mode 100644 pkg/cmd/cockroach-short/BUILD.bazel create mode 100644 pkg/cmd/cockroach/BUILD.bazel create mode 100644 pkg/cmd/compile-build/BUILD.bazel create mode 100644 pkg/cmd/cr2pg/BUILD.bazel create mode 100644 pkg/cmd/cr2pg/sqlstream/BUILD.bazel create mode 100644 pkg/cmd/docgen/BUILD.bazel create mode 100644 pkg/cmd/docgen/extract/BUILD.bazel create mode 100644 pkg/cmd/fuzz/BUILD.bazel create mode 100644 pkg/cmd/generate-binary/BUILD.bazel create mode 100644 pkg/cmd/generate-spatial-ref-sys/BUILD.bazel create mode 100644 pkg/cmd/geoviz/BUILD.bazel create mode 100644 pkg/cmd/github-post/BUILD.bazel create mode 100644 pkg/cmd/github-pull-request-make/BUILD.bazel create mode 100644 pkg/cmd/gossipsim/BUILD.bazel create mode 100644 pkg/cmd/internal/issues/BUILD.bazel create mode 100644 pkg/cmd/prereqs/BUILD.bazel create mode 100644 pkg/cmd/protoc-gen-gogoroach/BUILD.bazel create mode 100644 pkg/cmd/publish-artifacts/BUILD.bazel create mode 100644 pkg/cmd/publish-provisional-artifacts/BUILD.bazel create mode 100644 pkg/cmd/reduce/BUILD.bazel create mode 100644 pkg/cmd/returncheck/BUILD.bazel create mode 100644 pkg/cmd/roachprod-stress/BUILD.bazel create mode 100644 pkg/cmd/roachprod/BUILD.bazel create mode 100644 pkg/cmd/roachprod/cloud/BUILD.bazel create mode 100644 pkg/cmd/roachprod/config/BUILD.bazel create mode 100644 pkg/cmd/roachprod/errors/BUILD.bazel create mode 100644 pkg/cmd/roachprod/install/BUILD.bazel create mode 100644 pkg/cmd/roachprod/ssh/BUILD.bazel create mode 100644 pkg/cmd/roachprod/ui/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/aws/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/aws/terraformgen/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/azure/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/flagstub/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/gce/BUILD.bazel create mode 100644 pkg/cmd/roachprod/vm/local/BUILD.bazel create mode 100644 pkg/cmd/roachtest/BUILD.bazel create mode 100644 pkg/cmd/roachvet/BUILD.bazel create mode 100644 pkg/cmd/skip-test/BUILD.bazel create mode 100644 pkg/cmd/skiperrs/BUILD.bazel create mode 100644 pkg/cmd/skipped-tests/BUILD.bazel create mode 100644 pkg/cmd/smithcmp/BUILD.bazel create mode 100644 pkg/cmd/smithtest/BUILD.bazel create mode 100644 pkg/cmd/teamcity-trigger/BUILD.bazel create mode 100644 pkg/cmd/testfilter/BUILD.bazel create mode 100644 pkg/cmd/uptodate/BUILD.bazel create mode 100644 pkg/cmd/urlcheck/BUILD.bazel create mode 100644 pkg/cmd/urlcheck/lib/urlcheck/BUILD.bazel create mode 100644 pkg/cmd/whoownsit/BUILD.bazel create mode 100644 pkg/cmd/workload/BUILD.bazel create mode 100644 pkg/cmd/wraprules/BUILD.bazel create mode 100644 pkg/cmd/zerosum/BUILD.bazel create mode 100644 pkg/col/coldata/BUILD.bazel create mode 100644 pkg/col/coldataext/BUILD.bazel create mode 100644 pkg/col/coldatatestutils/BUILD.bazel create mode 100644 pkg/col/colserde/BUILD.bazel create mode 100644 pkg/col/colserde/arrowserde/BUILD.bazel create mode 100644 pkg/col/typeconv/BUILD.bazel create mode 100644 pkg/compose/BUILD.bazel create mode 100644 pkg/compose/compare/compare/BUILD.bazel create mode 100644 pkg/config/BUILD.bazel create mode 100644 pkg/config/zonepb/BUILD.bazel create mode 100644 pkg/docs/BUILD.bazel create mode 100644 pkg/geo/BUILD.bazel create mode 100644 pkg/geo/geodist/BUILD.bazel create mode 100644 pkg/geo/geogen/BUILD.bazel create mode 100644 pkg/geo/geogfn/BUILD.bazel create mode 100644 pkg/geo/geographiclib/BUILD.bazel create mode 100644 pkg/geo/geoindex/BUILD.bazel create mode 100644 pkg/geo/geomfn/BUILD.bazel create mode 100644 pkg/geo/geopb/BUILD.bazel create mode 100644 pkg/geo/geoproj/BUILD.bazel create mode 100644 pkg/geo/geoprojbase/BUILD.bazel create mode 100644 pkg/geo/geos/BUILD.bazel create mode 100644 pkg/geo/geosegmentize/BUILD.bazel create mode 100644 pkg/geo/geotransform/BUILD.bazel create mode 100644 pkg/gossip/BUILD.bazel create mode 100644 pkg/gossip/resolver/BUILD.bazel create mode 100644 pkg/gossip/simulation/BUILD.bazel create mode 100644 pkg/internal/client/requestbatcher/BUILD.bazel create mode 100644 pkg/internal/codeowners/BUILD.bazel create mode 100644 pkg/internal/gopath/BUILD.bazel create mode 100644 pkg/internal/rsg/BUILD.bazel create mode 100644 pkg/internal/rsg/yacc/BUILD.bazel create mode 100644 pkg/internal/sqlsmith/BUILD.bazel create mode 100644 pkg/internal/team/BUILD.bazel create mode 100644 pkg/jobs/BUILD.bazel create mode 100644 pkg/jobs/jobspb/BUILD.bazel create mode 100644 pkg/jobs/jobsprotectedts/BUILD.bazel create mode 100644 pkg/jobs/jobstest/BUILD.bazel create mode 100644 pkg/keys/BUILD.bazel create mode 100644 pkg/kv/BUILD.bazel create mode 100644 pkg/kv/bulk/BUILD.bazel create mode 100644 pkg/kv/kvbase/BUILD.bazel create mode 100644 pkg/kv/kvclient/BUILD.bazel create mode 100644 pkg/kv/kvclient/kvcoord/BUILD.bazel create mode 100644 pkg/kv/kvclient/kvtenant/BUILD.bazel create mode 100644 pkg/kv/kvnemesis/BUILD.bazel create mode 100644 pkg/kv/kvserver/BUILD.bazel create mode 100644 pkg/kv/kvserver/abortspan/BUILD.bazel create mode 100644 pkg/kv/kvserver/apply/BUILD.bazel create mode 100644 pkg/kv/kvserver/batcheval/BUILD.bazel create mode 100644 pkg/kv/kvserver/batcheval/result/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/container/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/ctpb/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/minprop/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/provider/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/provider/testutils/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/storage/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/transport/BUILD.bazel create mode 100644 pkg/kv/kvserver/closedts/transport/testutils/BUILD.bazel create mode 100644 pkg/kv/kvserver/compactor/BUILD.bazel create mode 100644 pkg/kv/kvserver/concurrency/BUILD.bazel create mode 100644 pkg/kv/kvserver/concurrency/lock/BUILD.bazel create mode 100644 pkg/kv/kvserver/constraint/BUILD.bazel create mode 100644 pkg/kv/kvserver/diskmap/BUILD.bazel create mode 100644 pkg/kv/kvserver/gc/BUILD.bazel create mode 100644 pkg/kv/kvserver/idalloc/BUILD.bazel create mode 100644 pkg/kv/kvserver/intentresolver/BUILD.bazel create mode 100644 pkg/kv/kvserver/kvserverbase/BUILD.bazel create mode 100644 pkg/kv/kvserver/kvserverpb/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptcache/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptprovider/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptreconcile/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptstorage/BUILD.bazel create mode 100644 pkg/kv/kvserver/protectedts/ptverifier/BUILD.bazel create mode 100644 pkg/kv/kvserver/raftentry/BUILD.bazel create mode 100644 pkg/kv/kvserver/rangefeed/BUILD.bazel create mode 100644 pkg/kv/kvserver/rditer/BUILD.bazel create mode 100644 pkg/kv/kvserver/reports/BUILD.bazel create mode 100644 pkg/kv/kvserver/spanlatch/BUILD.bazel create mode 100644 pkg/kv/kvserver/spanset/BUILD.bazel create mode 100644 pkg/kv/kvserver/split/BUILD.bazel create mode 100644 pkg/kv/kvserver/stateloader/BUILD.bazel create mode 100644 pkg/kv/kvserver/tenantrate/BUILD.bazel create mode 100644 pkg/kv/kvserver/tscache/BUILD.bazel create mode 100644 pkg/kv/kvserver/txnrecovery/BUILD.bazel create mode 100644 pkg/kv/kvserver/txnwait/BUILD.bazel create mode 100644 pkg/release/BUILD.bazel create mode 100644 pkg/roachpb/BUILD.bazel create mode 100644 pkg/rpc/BUILD.bazel create mode 100644 pkg/rpc/nodedialer/BUILD.bazel create mode 100644 pkg/scheduledjobs/BUILD.bazel create mode 100644 pkg/security/BUILD.bazel create mode 100644 pkg/security/securitytest/BUILD.bazel create mode 100644 pkg/server/BUILD.bazel create mode 100644 pkg/server/debug/BUILD.bazel create mode 100644 pkg/server/debug/goroutineui/BUILD.bazel create mode 100644 pkg/server/debug/pprofui/BUILD.bazel create mode 100644 pkg/server/diagnosticspb/BUILD.bazel create mode 100644 pkg/server/dumpstore/BUILD.bazel create mode 100644 pkg/server/goroutinedumper/BUILD.bazel create mode 100644 pkg/server/heapprofiler/BUILD.bazel create mode 100644 pkg/server/serverpb/BUILD.bazel create mode 100644 pkg/server/status/BUILD.bazel create mode 100644 pkg/server/status/statuspb/BUILD.bazel create mode 100644 pkg/server/telemetry/BUILD.bazel create mode 100644 pkg/settings/BUILD.bazel create mode 100644 pkg/settings/cluster/BUILD.bazel create mode 100644 pkg/sql/BUILD.bazel create mode 100644 pkg/sql/backfill/BUILD.bazel create mode 100644 pkg/sql/catalog/BUILD.bazel create mode 100644 pkg/sql/catalog/accessors/BUILD.bazel create mode 100644 pkg/sql/catalog/bootstrap/BUILD.bazel create mode 100644 pkg/sql/catalog/catalogkeys/BUILD.bazel create mode 100644 pkg/sql/catalog/catalogkv/BUILD.bazel create mode 100644 pkg/sql/catalog/catconstants/BUILD.bazel create mode 100644 pkg/sql/catalog/colinfo/BUILD.bazel create mode 100644 pkg/sql/catalog/database/BUILD.bazel create mode 100644 pkg/sql/catalog/dbdesc/BUILD.bazel create mode 100644 pkg/sql/catalog/descpb/BUILD.bazel create mode 100644 pkg/sql/catalog/descs/BUILD.bazel create mode 100644 pkg/sql/catalog/hydratedtables/BUILD.bazel create mode 100644 pkg/sql/catalog/lease/BUILD.bazel create mode 100644 pkg/sql/catalog/resolver/BUILD.bazel create mode 100644 pkg/sql/catalog/schemadesc/BUILD.bazel create mode 100644 pkg/sql/catalog/systemschema/BUILD.bazel create mode 100644 pkg/sql/catalog/tabledesc/BUILD.bazel create mode 100644 pkg/sql/catalog/typedesc/BUILD.bazel create mode 100644 pkg/sql/colcontainer/BUILD.bazel create mode 100644 pkg/sql/colconv/BUILD.bazel create mode 100644 pkg/sql/colencoding/BUILD.bazel create mode 100644 pkg/sql/colexec/BUILD.bazel create mode 100644 pkg/sql/colexec/COLEXEC.bzl create mode 100644 pkg/sql/colexec/colbuilder/BUILD.bazel create mode 100644 pkg/sql/colexec/colexecagg/BUILD.bazel create mode 100644 pkg/sql/colexec/execgen/BUILD.bazel create mode 100644 pkg/sql/colexec/execgen/cmd/execgen/BUILD.bazel create mode 100644 pkg/sql/colexec/execpb/BUILD.bazel create mode 100644 pkg/sql/colexecbase/BUILD.bazel create mode 100644 pkg/sql/colexecbase/colexecerror/BUILD.bazel create mode 100644 pkg/sql/colfetcher/BUILD.bazel create mode 100644 pkg/sql/colflow/BUILD.bazel create mode 100644 pkg/sql/colflow/colrpc/BUILD.bazel create mode 100644 pkg/sql/colmem/BUILD.bazel create mode 100644 pkg/sql/covering/BUILD.bazel create mode 100644 pkg/sql/delegate/BUILD.bazel create mode 100644 pkg/sql/distsql/BUILD.bazel create mode 100644 pkg/sql/doctor/BUILD.bazel create mode 100644 pkg/sql/enum/BUILD.bazel create mode 100644 pkg/sql/execinfra/BUILD.bazel create mode 100644 pkg/sql/execinfrapb/BUILD.bazel create mode 100644 pkg/sql/faketreeeval/BUILD.bazel create mode 100644 pkg/sql/flowinfra/BUILD.bazel create mode 100644 pkg/sql/gcjob/BUILD.bazel create mode 100644 pkg/sql/gcjob/gcjobnotifier/BUILD.bazel create mode 100644 pkg/sql/gcjob_test/BUILD.bazel create mode 100644 pkg/sql/lex/BUILD.bazel create mode 100644 pkg/sql/logictest/BUILD.bazel create mode 100644 pkg/sql/mutations/BUILD.bazel create mode 100644 pkg/sql/oidext/BUILD.bazel create mode 100644 pkg/sql/opt/BUILD.bazel create mode 100644 pkg/sql/opt/bench/BUILD.bazel create mode 100644 pkg/sql/opt/cat/BUILD.bazel create mode 100644 pkg/sql/opt/constraint/BUILD.bazel create mode 100644 pkg/sql/opt/exec/BUILD.bazel create mode 100644 pkg/sql/opt/exec/execbuilder/BUILD.bazel create mode 100644 pkg/sql/opt/exec/explain/BUILD.bazel create mode 100644 pkg/sql/opt/idxconstraint/BUILD.bazel create mode 100644 pkg/sql/opt/invertedexpr/BUILD.bazel create mode 100644 pkg/sql/opt/invertedidx/BUILD.bazel create mode 100644 pkg/sql/opt/memo/BUILD.bazel create mode 100644 pkg/sql/opt/norm/BUILD.bazel create mode 100644 pkg/sql/opt/opbench/BUILD.bazel create mode 100644 pkg/sql/opt/optbuilder/BUILD.bazel create mode 100644 pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel create mode 100644 pkg/sql/opt/optgen/cmd/optfmt/BUILD.bazel create mode 100644 pkg/sql/opt/optgen/cmd/optgen/BUILD.bazel create mode 100644 pkg/sql/opt/optgen/exprgen/BUILD.bazel create mode 100644 pkg/sql/opt/optgen/lang/BUILD.bazel create mode 100644 pkg/sql/opt/ordering/BUILD.bazel create mode 100644 pkg/sql/opt/partialidx/BUILD.bazel create mode 100644 pkg/sql/opt/props/BUILD.bazel create mode 100644 pkg/sql/opt/props/physical/BUILD.bazel create mode 100644 pkg/sql/opt/testutils/BUILD.bazel create mode 100644 pkg/sql/opt/testutils/opttester/BUILD.bazel create mode 100644 pkg/sql/opt/testutils/testcat/BUILD.bazel create mode 100644 pkg/sql/opt/testutils/testexpr/BUILD.bazel create mode 100644 pkg/sql/opt/xform/BUILD.bazel create mode 100644 pkg/sql/optionalnodeliveness/BUILD.bazel create mode 100644 pkg/sql/paramparse/BUILD.bazel create mode 100644 pkg/sql/parser/BUILD.bazel create mode 100644 pkg/sql/parser/fuzz/BUILD.bazel create mode 100755 pkg/sql/parser/sql-gen.sh create mode 100644 pkg/sql/pgwire/BUILD.bazel create mode 100644 pkg/sql/pgwire/hba/BUILD.bazel create mode 100644 pkg/sql/pgwire/pgcode/BUILD.bazel create mode 100644 pkg/sql/pgwire/pgerror/BUILD.bazel create mode 100644 pkg/sql/pgwire/pgnotice/BUILD.bazel create mode 100644 pkg/sql/pgwire/pgwirebase/BUILD.bazel create mode 100644 pkg/sql/physicalplan/BUILD.bazel create mode 100644 pkg/sql/physicalplan/replicaoracle/BUILD.bazel create mode 100644 pkg/sql/privilege/BUILD.bazel create mode 100644 pkg/sql/protoreflect/BUILD.bazel create mode 100644 pkg/sql/querycache/BUILD.bazel create mode 100644 pkg/sql/roleoption/BUILD.bazel create mode 100644 pkg/sql/row/BUILD.bazel create mode 100644 pkg/sql/rowcontainer/BUILD.bazel create mode 100644 pkg/sql/rowenc/BUILD.bazel create mode 100644 pkg/sql/rowexec/BUILD.bazel create mode 100644 pkg/sql/rowflow/BUILD.bazel create mode 100644 pkg/sql/schemachange/BUILD.bazel create mode 100644 pkg/sql/schemaexpr/BUILD.bazel create mode 100644 pkg/sql/scrub/BUILD.bazel create mode 100644 pkg/sql/sem/builtins/BUILD.bazel create mode 100644 pkg/sql/sem/transform/BUILD.bazel create mode 100644 pkg/sql/sem/tree/BUILD.bazel create mode 100644 pkg/sql/sem/tree/eval_test/BUILD.bazel create mode 100644 pkg/sql/sessiondata/BUILD.bazel create mode 100644 pkg/sql/sessiondatapb/BUILD.bazel create mode 100644 pkg/sql/span/BUILD.bazel create mode 100644 pkg/sql/sqlerrors/BUILD.bazel create mode 100644 pkg/sql/sqlliveness/BUILD.bazel create mode 100644 pkg/sql/sqlliveness/slinstance/BUILD.bazel create mode 100644 pkg/sql/sqlliveness/slprovider/BUILD.bazel create mode 100644 pkg/sql/sqlliveness/slstorage/BUILD.bazel create mode 100644 pkg/sql/sqltelemetry/BUILD.bazel create mode 100644 pkg/sql/sqltestutils/BUILD.bazel create mode 100644 pkg/sql/sqlutil/BUILD.bazel create mode 100644 pkg/sql/stats/BUILD.bazel create mode 100644 pkg/sql/stmtdiagnostics/BUILD.bazel create mode 100644 pkg/sql/tests/BUILD.bazel create mode 100644 pkg/sql/types/BUILD.bazel create mode 100644 pkg/sql/vtable/BUILD.bazel create mode 100644 pkg/sqlmigrations/BUILD.bazel create mode 100644 pkg/sqlmigrations/leasemanager/BUILD.bazel create mode 100644 pkg/storage/BUILD.bazel create mode 100644 pkg/storage/cloud/BUILD.bazel create mode 100644 pkg/storage/cloudimpl/BUILD.bazel create mode 100644 pkg/storage/cloudimpl/cloudimpltests/BUILD.bazel create mode 100644 pkg/storage/cloudimpl/filetable/BUILD.bazel create mode 100644 pkg/storage/cloudimpl/filetable/filetabletest/BUILD.bazel create mode 100644 pkg/storage/enginepb/BUILD.bazel create mode 100644 pkg/storage/fs/BUILD.bazel create mode 100644 pkg/storage/metamorphic/BUILD.bazel create mode 100644 pkg/testutils/BUILD.bazel create mode 100644 pkg/testutils/buildutil/BUILD.bazel create mode 100644 pkg/testutils/colcontainerutils/BUILD.bazel create mode 100644 pkg/testutils/diagutils/BUILD.bazel create mode 100644 pkg/testutils/distsqlutils/BUILD.bazel create mode 100644 pkg/testutils/gossiputil/BUILD.bazel create mode 100644 pkg/testutils/jobutils/BUILD.bazel create mode 100644 pkg/testutils/keysutils/BUILD.bazel create mode 100644 pkg/testutils/kvclientutils/BUILD.bazel create mode 100644 pkg/testutils/lint/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/descriptormarshal/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/descriptormarshal/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/descriptormarshal/testdata/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/errcmp/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/fmtsafe/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/fmtsafe/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/cockroach/pkg/util/log/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/errors/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/fmtsafe/testdata/src/go.etcd.io/etcd/raft/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/hash/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/hash/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/nocopy/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/nocopy/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/nocopy/testdata/src/github.com/cockroachdb/cockroach/pkg/util/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/passesutil/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/returnerrcheck/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/returnerrcheck/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/timer/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/timer/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/timer/testdata/src/github.com/cockroachdb/cockroach/pkg/util/timeutil/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/unconvert/BUILD.bazel create mode 100644 pkg/testutils/lint/passes/unconvert/testdata/src/a/BUILD.bazel create mode 100644 pkg/testutils/localtestcluster/BUILD.bazel create mode 100644 pkg/testutils/pgtest/BUILD.bazel create mode 100644 pkg/testutils/physicalplanutils/BUILD.bazel create mode 100644 pkg/testutils/reduce/BUILD.bazel create mode 100644 pkg/testutils/reduce/reducesql/BUILD.bazel create mode 100644 pkg/testutils/serverutils/BUILD.bazel create mode 100644 pkg/testutils/skip/BUILD.bazel create mode 100644 pkg/testutils/sqlutils/BUILD.bazel create mode 100644 pkg/testutils/storageutils/BUILD.bazel create mode 100644 pkg/testutils/testcluster/BUILD.bazel create mode 100644 pkg/testutils/zerofields/BUILD.bazel create mode 100644 pkg/ts/BUILD.bazel create mode 100644 pkg/ts/catalog/BUILD.bazel create mode 100644 pkg/ts/testmodel/BUILD.bazel create mode 100644 pkg/ts/tspb/BUILD.bazel create mode 100644 pkg/ui/BUILD.bazel create mode 100644 pkg/util/BUILD.bazel create mode 100644 pkg/util/arith/BUILD.bazel create mode 100644 pkg/util/binfetcher/BUILD.bazel create mode 100644 pkg/util/bitarray/BUILD.bazel create mode 100644 pkg/util/bufalloc/BUILD.bazel create mode 100644 pkg/util/cache/BUILD.bazel create mode 100644 pkg/util/caller/BUILD.bazel create mode 100644 pkg/util/cancelchecker/BUILD.bazel create mode 100644 pkg/util/cgroups/BUILD.bazel create mode 100644 pkg/util/cloudinfo/BUILD.bazel create mode 100644 pkg/util/contextutil/BUILD.bazel create mode 100644 pkg/util/ctxgroup/BUILD.bazel create mode 100644 pkg/util/duration/BUILD.bazel create mode 100644 pkg/util/encoding/BUILD.bazel create mode 100644 pkg/util/encoding/csv/BUILD.bazel create mode 100644 pkg/util/envutil/BUILD.bazel create mode 100644 pkg/util/errorutil/BUILD.bazel create mode 100644 pkg/util/errorutil/unimplemented/BUILD.bazel create mode 100644 pkg/util/fileutil/BUILD.bazel create mode 100644 pkg/util/flagutil/BUILD.bazel create mode 100644 pkg/util/fsm/BUILD.bazel create mode 100644 pkg/util/growstack/BUILD.bazel create mode 100644 pkg/util/grpcutil/BUILD.bazel create mode 100644 pkg/util/hlc/BUILD.bazel create mode 100644 pkg/util/httputil/BUILD.bazel create mode 100644 pkg/util/humanizeutil/BUILD.bazel create mode 100644 pkg/util/interval/BUILD.bazel create mode 100644 pkg/util/interval/generic/BUILD.bazel create mode 100644 pkg/util/interval/generic/internal/BUILD.bazel create mode 100644 pkg/util/ipaddr/BUILD.bazel create mode 100644 pkg/util/iterutil/BUILD.bazel create mode 100644 pkg/util/json/BUILD.bazel create mode 100644 pkg/util/keysutil/BUILD.bazel create mode 100644 pkg/util/leaktest/BUILD.bazel create mode 100644 pkg/util/limit/BUILD.bazel create mode 100644 pkg/util/log/BUILD.bazel create mode 100644 pkg/util/log/logflags/BUILD.bazel create mode 100644 pkg/util/log/testshout/BUILD.bazel create mode 100644 pkg/util/metric/BUILD.bazel create mode 100644 pkg/util/metric/aggmetric/BUILD.bazel create mode 100644 pkg/util/mon/BUILD.bazel create mode 100644 pkg/util/netutil/BUILD.bazel create mode 100644 pkg/util/pretty/BUILD.bazel create mode 100644 pkg/util/protoutil/BUILD.bazel create mode 100644 pkg/util/quotapool/BUILD.bazel create mode 100644 pkg/util/randutil/BUILD.bazel create mode 100644 pkg/util/retry/BUILD.bazel create mode 100644 pkg/util/ring/BUILD.bazel create mode 100644 pkg/util/sdnotify/BUILD.bazel create mode 100644 pkg/util/search/BUILD.bazel create mode 100644 pkg/util/sequence/BUILD.bazel create mode 100644 pkg/util/shuffle/BUILD.bazel create mode 100644 pkg/util/sort/BUILD.bazel create mode 100644 pkg/util/span/BUILD.bazel create mode 100644 pkg/util/stop/BUILD.bazel create mode 100644 pkg/util/stringarena/BUILD.bazel create mode 100644 pkg/util/stringencoding/BUILD.bazel create mode 100644 pkg/util/syncutil/BUILD.bazel create mode 100644 pkg/util/syncutil/singleflight/BUILD.bazel create mode 100644 pkg/util/sysutil/BUILD.bazel create mode 100644 pkg/util/timeofday/BUILD.bazel create mode 100644 pkg/util/timetz/BUILD.bazel create mode 100644 pkg/util/timeutil/BUILD.bazel create mode 100644 pkg/util/timeutil/pgdate/BUILD.bazel create mode 100644 pkg/util/tracing/BUILD.bazel create mode 100644 pkg/util/tracing/tracingpb/BUILD.bazel create mode 100644 pkg/util/treeprinter/BUILD.bazel create mode 100644 pkg/util/uint128/BUILD.bazel create mode 100644 pkg/util/unaccent/BUILD.bazel create mode 100644 pkg/util/unique/BUILD.bazel create mode 100644 pkg/util/uuid/BUILD.bazel create mode 100644 pkg/util/version/BUILD.bazel create mode 100644 pkg/workload/BUILD.bazel create mode 100644 pkg/workload/bank/BUILD.bazel create mode 100644 pkg/workload/bulkingest/BUILD.bazel create mode 100644 pkg/workload/cli/BUILD.bazel create mode 100644 pkg/workload/debug/BUILD.bazel create mode 100644 pkg/workload/examples/BUILD.bazel create mode 100644 pkg/workload/faker/BUILD.bazel create mode 100644 pkg/workload/geospatial/BUILD.bazel create mode 100644 pkg/workload/histogram/BUILD.bazel create mode 100644 pkg/workload/indexes/BUILD.bazel create mode 100644 pkg/workload/interleavebench/BUILD.bazel create mode 100644 pkg/workload/interleavedpartitioned/BUILD.bazel create mode 100644 pkg/workload/jsonload/BUILD.bazel create mode 100644 pkg/workload/kv/BUILD.bazel create mode 100644 pkg/workload/ledger/BUILD.bazel create mode 100644 pkg/workload/movr/BUILD.bazel create mode 100644 pkg/workload/querybench/BUILD.bazel create mode 100644 pkg/workload/querylog/BUILD.bazel create mode 100644 pkg/workload/queue/BUILD.bazel create mode 100644 pkg/workload/rand/BUILD.bazel create mode 100644 pkg/workload/schemachange/BUILD.bazel create mode 100644 pkg/workload/sqlsmith/BUILD.bazel create mode 100644 pkg/workload/tpcc/BUILD.bazel create mode 100644 pkg/workload/tpccchecks/BUILD.bazel create mode 100644 pkg/workload/tpcds/BUILD.bazel create mode 100644 pkg/workload/tpch/BUILD.bazel create mode 100644 pkg/workload/workloadimpl/BUILD.bazel create mode 100644 pkg/workload/workloadsql/BUILD.bazel create mode 100644 pkg/workload/ycsb/BUILD.bazel diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000000..413fc6611db2 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,9 @@ +# Bazel's usual sandboxing does not try to protect against accidental +# dependencies on # files from the host filesystem. See [1]. This is a problem +# for us, for when users have `proj` installed locally. They can run into +# issues where bazel tries to use `/usr/local/include/proj_api.h` instead of +# `bazel-build/.../c-deps/proj/lib`. The work around here, suggested by [1], is +# to ensure the sandbox does not read /usr/local/include. +# +# [1]: https://github.com/bazelbuild/bazel/issues/8053. +build --sandbox_block_path=/usr/local/include diff --git a/.gitattributes b/.gitattributes index 1c8136ec7b7e..1ef581317b2e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.pb.* -diff *.eg.go -diff +DEPS.bzl -diff diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000000..9f3908656fe8 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,215 @@ +load("@bazel_gazelle//:def.bzl", "gazelle") + +# The following directives inform gazelle how to auto-generate BUILD.bazel +# files throughout the repo. By including them here, we can run gazelle using +# `bazel run //:gazelle` instead of invoking gazelle directly. +# +# NB: Be sure to re-generate BUILD.bazel files if any of the directives below +# are changed. + +# Define the gazelle prefix and what the autogenerated BUILD files should be +# named as. +# +# gazelle:prefix github.com/cockroachdb/cockroach +# gazelle:build_file_name BUILD.bazel + +# We disable protobuf generation for our dependencies +# +# gazelle:proto disable_global + +# Gazelle is unable to resolve this specific package. +# +# TODO(irfansharif): I'm not sure why this is. Is it because it's a proto only +# package? +# +# gazelle:resolve go github.com/grpc-ecosystem/grpc-gateway/internal //vendor/github.com/grpc-ecosystem/grpc-gateway/internal + +# We exclude a few things from gazelle consideration: +# - The protobuf C dependency, it's are already bazel-ified, lest we overwrite +# those build files. +# - The artifacts directory +# - All checked-in autogenerated files (they'll get autogenerated on the fly +# through bazel). +# - A testdata "repo" that looks like a go package, but isn't +# (testdata/src/example.com) +# +# gazelle:exclude c-deps/protobuf +# gazelle:exclude artifacts +# gazelle:exclude **/zcgo_flags.go +# gazelle:exclude **/zcgo_flags_*.go +# gazelle:exclude **/*.og.go +# gazelle:exclude **/*.eg.go +# gazelle:exclude pkg/sql/parser/sql.go +# gazelle:exclude pkg/sql/opt/rule_name_string.go +# gazelle:exclude pkg/sql/opt/rule_name_string.go +# gazelle:exclude pkg/cmd/prereqs/testdata + +# TODO(irfansharif): Today we let bazel take over the vendor directory and +# define each vendored dependency as a bazel target. We should be able to have +# bazel ignore all of vendor/ and create those dependencies on the fly. +# Deleting the vendor directory and running `bazel run //:gazelle` shows what +# that would look like (though that doesn't quite work yet). + +# 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 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 +# bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=DEPS.bzl%go_deps +# +# The // 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 probably define shorthands for the more common +# ones from up above. + +# 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", +) + +# Load the components that lets us use cmake/make in third party deps. +load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external") +load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make") + +# TODO(irfansharif): All the cmake cache entries below were cargo-culted from +# the Makefile. We may need to programatically set them depending on the +# machine bazel is being run on. For now the only tested variant are Macbooks. + +# Define the build target for libjemalloc. +configure_make( + name = "libjemalloc", + autoconf = True, + configure_env_vars = { + "AR": "", + }, + configure_in_place = True, + configure_options = [ + "--enable-prof", + ], + lib_source = "@jemalloc//:all", + make_commands = [ + "make build_lib_static", + "mkdir -p libjemalloc/lib", + "cp lib/libjemalloc.a libjemalloc/lib", + "cp -r include libjemalloc", + ], + static_libraries = ["libjemalloc.a"], + visibility = ["//visibility:public"], +) + +# Define the build targets for libprotobuf and protoc. +cmake_external( + name = "libprotobuf", + binaries = ["protoc"], + cache_entries = { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_TARGET_MESSAGES": "OFF", + "protobuf_BUILD_TESTS": "OFF", + }, + lib_source = "@protobuf//:all", + static_libraries = ["libprotobuf.a"], + visibility = ["//visibility:public"], + working_directory = "cmake", +) + +# Define the build target for libproj. +cmake_external( + name = "libproj", + cache_entries = { + "CMAKE_BUILD_TYPE": "Release", + "BUILD_LIBPROJ_SHARED": "OFF", + }, + lib_source = "@proj//:all", + static_libraries = ["libproj.a"], + visibility = ["//visibility:public"], +) + +# TODO(irfansharif): libgeos has not been worked out yet. We'll need to +# similarly ensure the lib/libgeos.so and lib/libegeos_c.so are in the right +# place. + +# Define the build target for libroach. +# +# Bazel also expects the library archive and the include headers to be placed +# in a certain path, so we fix it all up accordingly within make_commands. +cmake_external( + name = "libroach", + cache_entries = { + "CMAKE_TARGET_MESSAGES": "OFF", + "CMAKE_BUILD_TYPE": "Release", + }, + lib_source = "@libroach//:all", + make_commands = [ + "make roach", + "mkdir -p libroach/lib", + "cp libroach.a libroach/lib/libroach.a", + "cp -r $EXT_BUILD_ROOT/external/libroach/include libroach", + ], + static_libraries = ["libroach.a"], + tools_deps = [ + "@libroach//:all", + ], + visibility = ["//visibility:public"], + deps = [], +) + +# Define the build target for kerberos. +# +# TODO(irfansharif): Kerboros is not used for anything other than Linux. +# The following has not been tested as yet. +configure_make( + name = "libkrb5", + autoreconf = True, + configure_command = "src/configure", + configure_env_vars = { + "CPFLAGS": "", + "CXXFLAGS": "", + }, + configure_options = [ + "--enable-static", + "--disable-shared", + ] + select({ + "//conditions:default": ["AR=/usr/bin/ar"], + }), + lib_source = "@krb5//:all", + make_commands = [ + "make", + "mkdir -p libkrb5/lib", + "cp libkrb5/libgssapi_krb5.a libkrb5/lib", + ], + static_libraries = ["libgssapi_krb5.a"], + visibility = ["//visibility:public"], +) diff --git a/DEPS.bzl b/DEPS.bzl new file mode 100644 index 000000000000..f2f1fc51c979 --- /dev/null +++ b/DEPS.bzl @@ -0,0 +1,2993 @@ +load("@bazel_gazelle//:deps.bzl", "go_repository") + +def go_deps(): + go_repository( + name = "co_honnef_go_tools", + build_file_proto_mode = "disable_global", + importpath = "honnef.co/go/tools", + sum = "h1:RFEMAhc9/Ej5KcaFZooS1PGYAhVl+CUxVj2gyKYGxKQ=", + version = "v0.0.0-20190530104931-1f0868a609b7", + ) + go_repository( + name = "com_github_abourget_teamcity", + build_file_proto_mode = "disable_global", + importpath = "github.com/abourget/teamcity", + replace = "github.com/cockroachdb/teamcity", + sum = "h1:UAqRo5xPCyTtZznAJ9iPVpDUFxGI0a6QWtQ8E+zwJRg=", + version = "v0.0.0-20180905144921-8ca25c33eb11", + ) + go_repository( + name = "com_github_ajg_form", + build_file_proto_mode = "disable_global", + importpath = "github.com/ajg/form", + sum = "h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_alecthomas_template", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/template", + sum = "h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=", + version = "v0.0.0-20190718012654-fb15b899a751", + ) + go_repository( + name = "com_github_alecthomas_units", + build_file_proto_mode = "disable_global", + importpath = "github.com/alecthomas/units", + sum = "h1:Hs82Z41s6SdL1CELW+XaDYmOH4hkBN4/N9og/AsOv7E=", + version = "v0.0.0-20190717042225-c3de453c63f4", + ) + go_repository( + name = "com_github_alexbrainman_sspi", + build_file_proto_mode = "disable_global", + importpath = "github.com/alexbrainman/sspi", + sum = "h1:P5U+E4x5OkVEKQDklVPmzs71WM56RTTRqV4OrDC//Y4=", + version = "v0.0.0-20180613141037-e580b900e9f5", + ) + go_repository( + name = "com_github_andreasbriese_bbloom", + build_file_proto_mode = "disable_global", + importpath = "github.com/AndreasBriese/bbloom", + sum = "h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4=", + version = "v0.0.0-20190306092124-e2d15f34fcf9", + ) + go_repository( + name = "com_github_andy_kimball_arenaskl", + build_file_proto_mode = "disable_global", + importpath = "github.com/andy-kimball/arenaskl", + sum = "h1:vCvyXiLsgAs7qgclk56iBTJQ+gdfiVuzfe5T6sVBL+w=", + version = "v0.0.0-20200617143215-f701008588b9", + ) + go_repository( + name = "com_github_andybalholm_cascadia", + build_file_proto_mode = "disable_global", + importpath = "github.com/andybalholm/cascadia", + sum = "h1:vuRCkM5Ozh/BfmsaTm26kbjm0mIOM3yS5Ek/F5h18aE=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_antihax_optional", + build_file_proto_mode = "disable_global", + importpath = "github.com/antihax/optional", + sum = "h1:uZuxRZCz65cG1o6K/xUqImNcYKtmk9ylqaH0itMSvzA=", + version = "v0.0.0-20180407024304-ca021399b1a6", + ) + go_repository( + name = "com_github_aokoli_goutils", + build_file_proto_mode = "disable_global", + importpath = "github.com/aokoli/goutils", + sum = "h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_apache_arrow_go_arrow", + build_file_proto_mode = "disable_global", + importpath = "github.com/apache/arrow/go/arrow", + sum = "h1:kLPoYgtEyqP5M5o1H+oAe5ZjOrL4LLo7jwF9W4hnNq8=", + version = "v0.0.0-20200610220642-670890229854", + ) + go_repository( + name = "com_github_apache_thrift", + build_file_proto_mode = "disable_global", + importpath = "github.com/apache/thrift", + sum = "h1:v7Gpsj71uh9fOCX0v9mS7thFJdguCgV11wTv0wMe4pE=", + version = "v0.0.0-20181211084444-2b7365c54f82", + ) + go_repository( + name = "com_github_armon_circbuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/circbuf", + sum = "h1:QEF07wC0T1rKkctt1RINW/+RMTVmiwxETico2l3gxJA=", + version = "v0.0.0-20150827004946-bbbad097214e", + ) + go_repository( + name = "com_github_armon_consul_api", + build_file_proto_mode = "disable_global", + importpath = "github.com/armon/consul-api", + sum = "h1:G1bPvciwNyF7IUmKXNt9Ak3m6u9DE1rF+RmtIkBpVdA=", + version = "v0.0.0-20180202201655-eb2c6b5be1b6", + ) + go_repository( + name = "com_github_aws_aws_sdk_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/aws/aws-sdk-go", + sum = "h1:2/sOfb9oPHTRZ0lxinoaTPDcYwNa1H/SpKP4nVRBwmg=", + version = "v1.33.8", + ) + go_repository( + name = "com_github_axiomhq_hyperloglog", + build_file_proto_mode = "disable_global", + importpath = "github.com/axiomhq/hyperloglog", + sum = "h1:190ugM9MsyFauTkR/UqcHG/mn5nmFe6SvHJqEHIrtrA=", + version = "v0.0.0-20181223111420-4b99d0c2c99e", + ) + go_repository( + name = "com_github_aymerick_raymond", + build_file_proto_mode = "disable_global", + importpath = "github.com/aymerick/raymond", + sum = "h1:Ppm0npCCsmuR9oQaBtRuZcmILVE74aXE+AmrJj8L2ns=", + version = "v2.0.3-0.20180322193309-b565731e1464+incompatible", + ) + go_repository( + name = "com_github_azure_azure_pipeline_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-pipeline-go", + sum = "h1:KmVRa8oFMaargVesEuuEoiLCQ4zCCwQ8QX/xg++KS20=", + version = "v0.1.8", + ) + go_repository( + name = "com_github_azure_azure_sdk_for_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-sdk-for-go", + sum = "h1:yzJKzcKTX0WwDdZC8kAqxiGVZz66uqpajhgphstEUN0=", + version = "v33.4.0+incompatible", + ) + go_repository( + name = "com_github_azure_azure_storage_blob_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/azure-storage-blob-go", + sum = "h1:/xcR+zx0sJ4viF6JHLbEObtCw8edFtY6cCEqZqV+vA0=", + version = "v0.0.0-20190104215108-45d0c5e3638e", + ) + go_repository( + name = "com_github_azure_go_ansiterm", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-ansiterm", + sum = "h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8=", + version = "v0.0.0-20170929234023-d6e3b3328b78", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest", + sum = "h1:NuSF3gXetiHyUbVdneJMEVyPUYAe5wh+aN08JYAf1tI=", + version = "v0.10.2", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_adal", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/adal", + sum = "h1:O1X4oexUxnZCaEUGsvMnr8ZGj8HI37tNezwY4npRqA0=", + version = "v0.8.2", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_azure_auth", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/azure/auth", + sum = "h1:iM6UAvjR97ZIeR93qTcwpKNMpV+/FTWjwEbuPD495Tk=", + version = "v0.4.2", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_azure_cli", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/azure/cli", + sum = "h1:LXl088ZQlP0SBppGFsRZonW6hSvwgL5gRByMbvUbx8U=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_date", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/date", + sum = "h1:yW+Zlqf26583pE43KhfnhFcdmSWlm5Ew6bxipnr/tbM=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_mocks", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/mocks", + sum = "h1:qJumjCaCudz+OcqE9/XtEPfvtOjOmKaui4EOpFI6zZc=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_to", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/to", + sum = "h1:zebkZaadz7+wIQYgC7GXaz3Wb28yKYfVkkBKwc38VF8=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_azure_go_autorest_autorest_validation", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/autorest/validation", + sum = "h1:15vMO4y76dehZSq7pAaOLQxC6dZYsSrj2GQpflyM/L4=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_azure_go_autorest_logger", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/logger", + sum = "h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_azure_go_autorest_tracing", + build_file_proto_mode = "disable_global", + importpath = "github.com/Azure/go-autorest/tracing", + sum = "h1:TRn4WjSnkcSy5AEG3pnbtFSwNtwzjr4VYyQflFE619k=", + version = "v0.5.0", + ) + go_repository( + name = "com_github_bazelbuild_bazel_gazelle", + build_file_proto_mode = "disable_global", + importpath = "github.com/bazelbuild/bazel-gazelle", + sum = "h1:buszGdD9d/Z691sxFDgOdcEUWli0ZT2tBXUxfbLMrb4=", + version = "v0.21.1", + ) + go_repository( + name = "com_github_bazelbuild_buildtools", + build_file_proto_mode = "disable_global", + importpath = "github.com/bazelbuild/buildtools", + sum = "h1:OfyUN/Msd8yqJww6deQ9vayJWw+Jrbe6Qp9giv51QQI=", + version = "v0.0.0-20190731111112-f720930ceb60", + ) + go_repository( + name = "com_github_bazelbuild_rules_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/bazelbuild/rules_go", + sum = "h1:wzbawlkLtl2ze9w/312NHZ84c7kpUCtlkD8HgFY27sw=", + version = "v0.0.0-20190719190356-6dae44dc5cab", + ) + go_repository( + name = "com_github_benesch_cgosymbolizer", + build_file_proto_mode = "disable_global", + importpath = "github.com/benesch/cgosymbolizer", + sum = "h1:Llg88pHOiUbcFOFhr009G8fOBQL6gaVDnxUUeWZuLog=", + version = "v0.0.0-20180702220239-70e1ee2b39d3", + ) + go_repository( + name = "com_github_beorn7_perks", + build_file_proto_mode = "disable_global", + importpath = "github.com/beorn7/perks", + sum = "h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_bgentry_speakeasy", + build_file_proto_mode = "disable_global", + importpath = "github.com/bgentry/speakeasy", + sum = "h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_biogo_store", + build_file_proto_mode = "disable_global", + importpath = "github.com/biogo/store", + sum = "h1:tYoz1OeRpx3dJZlh9T4dQt4kAndcmpl+VNdzbSgFC/0=", + version = "v0.0.0-20160505134755-913427a1d5e8", + ) + go_repository( + name = "com_github_bmatcuk_doublestar", + build_file_proto_mode = "disable_global", + importpath = "github.com/bmatcuk/doublestar", + sum = "h1:oC24CykoSAB8zd7XgruHo33E0cHJf/WhQA/7BeXj+x0=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_broady_gogeohash", + build_file_proto_mode = "disable_global", + importpath = "github.com/broady/gogeohash", + sum = "h1:iEdmkrNMLXbM7ecffOAtZJQOQUTE4iMonxrb5opUgE4=", + version = "v0.0.0-20120525094510-7b2c40d64042", + ) + go_repository( + name = "com_github_burntsushi_toml", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/toml", + sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=", + version = "v0.3.1", + ) + go_repository( + name = "com_github_burntsushi_xgb", + build_file_proto_mode = "disable_global", + importpath = "github.com/BurntSushi/xgb", + sum = "h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc=", + version = "v0.0.0-20160522181843-27f122750802", + ) + go_repository( + name = "com_github_cenkalti_backoff", + build_file_proto_mode = "disable_global", + importpath = "github.com/cenkalti/backoff", + sum = "h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY=", + version = "v2.1.1+incompatible", + ) + go_repository( + name = "com_github_cenkalti_backoff_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/cenkalti/backoff/v3", + sum = "h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c=", + version = "v3.0.0", + ) + go_repository( + name = "com_github_census_instrumentation_opencensus_proto", + build_file_proto_mode = "disable_global", + importpath = "github.com/census-instrumentation/opencensus-proto", + sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_certifi_gocertifi", + build_file_proto_mode = "disable_global", + importpath = "github.com/certifi/gocertifi", + sum = "h1:JLaf/iINcLyjwbtTsCJjc6rtlASgHeIJPrB6QmwURnA=", + version = "v0.0.0-20200211180108-c7c1fbc02894", + ) + go_repository( + name = "com_github_client9_misspell", + build_file_proto_mode = "disable_global", + importpath = "github.com/client9/misspell", + sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=", + version = "v0.3.4", + ) + go_repository( + name = "com_github_cloudykit_fastprinter", + build_file_proto_mode = "disable_global", + importpath = "github.com/CloudyKit/fastprinter", + sum = "h1:3SgJcK9l5uPdBC/X17wanyJAMxM33+4ZhEIV96MIH8U=", + version = "v0.0.0-20170127035650-74b38d55f37a", + ) + go_repository( + name = "com_github_cloudykit_jet", + build_file_proto_mode = "disable_global", + importpath = "github.com/CloudyKit/jet", + sum = "h1:rZgFj+Gtf3NMi/U5FvCvhzaxzW/TaPYgUYx3bAPz9DE=", + version = "v2.1.3-0.20180809161101-62edd43e4f88+incompatible", + ) + go_repository( + name = "com_github_cncf_udpa_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cncf/udpa/go", + sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=", + version = "v0.0.0-20191209042840-269d4d468f6f", + ) + go_repository( + name = "com_github_cockroachdb_apd", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/apd", + sum = "h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_cockroachdb_apd_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/apd/v2", + sum = "h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=", + version = "v2.0.2", + ) + go_repository( + name = "com_github_cockroachdb_circuitbreaker", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/circuitbreaker", + sum = "h1:u3uQ4oAKM5g2eODBAsDdDSrTs7zRWXtvu+nvSDA9098=", + version = "v2.2.2-0.20190114160014-a614b14ccf63+incompatible", + ) + go_repository( + name = "com_github_cockroachdb_cmux", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/cmux", + sum = "h1:dzj1/xcivGjNPwwifh/dWTczkwcuqsXXFHY1X/TZMtw=", + version = "v0.0.0-20170110192607-30d10be49292", + ) + go_repository( + name = "com_github_cockroachdb_cockroach_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/cockroach-go", + sum = "h1:eqJbq0A8ev6101p/zV72eOM+Z3WZkgb66S7PVJQR9wI=", + version = "v0.0.0-20200504194139-73ffeee90b62", + ) + go_repository( + name = "com_github_cockroachdb_crlfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/crlfmt", + sum = "h1:O4yb+RtkmDaXFlHSBpZodXaghfTd3Prdea0nk0eZCT4=", + version = "v0.0.0-20200116191136-a78e1c207bc0", + ) + go_repository( + name = "com_github_cockroachdb_datadriven", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/datadriven", + sum = "h1:KQqSlwJmTr7NmxtVOl6nPNSZQEk8XuLoLyNDYcmniBo=", + version = "v1.0.1-0.20200826112548-92602d883b11", + ) + go_repository( + name = "com_github_cockroachdb_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/errors", + sum = "h1:ptyO1BLW+sBxwBTSKJfS6kGzYCVKhI7MyBhoXAnPIKM=", + version = "v1.7.5", + ) + go_repository( + name = "com_github_cockroachdb_go_test_teamcity", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/go-test-teamcity", + sum = "h1:YqzBA7tf8Gv8Oz0BbBsPenqkyjiohS7EUIwi7p1QJCU=", + version = "v0.0.0-20191211140407-cff980ad0a55", + ) + go_repository( + name = "com_github_cockroachdb_gostdlib", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/gostdlib", + sum = "h1:TzSEPYgkKDNei3gbLc0rrHu4iHyBp7/+NxPOFmcXGaw=", + version = "v1.13.0", + ) + go_repository( + name = "com_github_cockroachdb_logtags", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/logtags", + sum = "h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY=", + version = "v0.0.0-20190617123548-eb05cc24525f", + ) + go_repository( + name = "com_github_cockroachdb_pebble", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/pebble", + sum = "h1:gGjhleKSWZCZFrhQSesjg8spRD+/p8vjwdNEGUv8Ovg=", + version = "v0.0.0-20201023120638-f1224da22976", + ) + go_repository( + name = "com_github_cockroachdb_redact", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/redact", + sum = "h1:7cjFsEgqTuNh+72+gtpnVTCqTiG0vT86ffETvTxyvUo=", + version = "v1.0.7", + ) + go_repository( + name = "com_github_cockroachdb_returncheck", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/returncheck", + sum = "h1:KFOt5I9nEKZgCnOSmy8r4Oykh8BYQO8bFOTgHDS8YZA=", + version = "v0.0.0-20200612231554-92cdbca611dd", + ) + go_repository( + name = "com_github_cockroachdb_sentry_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/sentry-go", + sum = "h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM=", + version = "v0.6.1-cockroachdb.2", + ) + go_repository( + name = "com_github_cockroachdb_stress", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/stress", + sum = "h1:7bnDlMxIJCg3o3vIILG2COsbNZpiYHgI4UkCYmeAWnQ=", + version = "v0.0.0-20170808184505-29b5d31b4c3a", + ) + go_repository( + name = "com_github_cockroachdb_ttycolor", + build_file_proto_mode = "disable_global", + importpath = "github.com/cockroachdb/ttycolor", + sum = "h1:TNsiMS1Ij2aleP/05UNSPzsOu9eJm9mfUGLm7Ylt7Dg=", + version = "v0.0.0-20180709150743-a1d5aaeb377d", + ) + go_repository( + name = "com_github_codahale_hdrhistogram", + build_file_proto_mode = "disable_global", + importpath = "github.com/codahale/hdrhistogram", + sum = "h1:qMd81Ts1T2OTKmB4acZcyKaMtRnY5Y44NuXGX2GFJ1w=", + version = "v0.0.0-20161010025455-3a0bb77429bd", + ) + go_repository( + name = "com_github_codefor_geohash", + build_file_proto_mode = "disable_global", + importpath = "github.com/Codefor/geohash", + sum = "h1:iG9B49Q218F/XxXNRM7k/vWf7MKmLIS8AcJV9cGN4nA=", + version = "v0.0.0-20140723084247-1b41c28e3a9d", + ) + go_repository( + name = "com_github_codegangsta_inject", + build_file_proto_mode = "disable_global", + importpath = "github.com/codegangsta/inject", + sum = "h1:sDMmm+q/3+BukdIpxwO365v/Rbspp2Nt5XntgQRXq8Q=", + version = "v0.0.0-20150114235600-33e0aa1cb7c0", + ) + go_repository( + name = "com_github_containerd_continuity", + build_file_proto_mode = "disable_global", + importpath = "github.com/containerd/continuity", + sum = "h1:NmTXa/uVnDyp0TY5MKi197+3HWcnYWfnHGyaFthlnGw=", + version = "v0.0.0-20190827140505-75bee3e2ccb6", + ) + go_repository( + name = "com_github_coreos_etcd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/etcd", + sum = "h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04=", + version = "v3.3.10+incompatible", + ) + go_repository( + name = "com_github_coreos_go_etcd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-etcd", + sum = "h1:bXhRBIXoTm9BYHS3gE0TtQuyNZyeEMux2sDi4oo5YOo=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_coreos_go_oidc", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-oidc", + sum = "h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk=", + version = "v2.2.1+incompatible", + ) + go_repository( + name = "com_github_coreos_go_semver", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-semver", + sum = "h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_coreos_go_systemd", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/go-systemd", + sum = "h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c=", + version = "v0.0.0-20190719114852-fd7a80b32e1f", + ) + go_repository( + name = "com_github_coreos_pkg", + build_file_proto_mode = "disable_global", + importpath = "github.com/coreos/pkg", + sum = "h1:CAKfRE2YtTUIjjh1bkBtyYFaUT/WmOqsJjgtihT0vMI=", + version = "v0.0.0-20160727233714-3ac0863d7acf", + ) + go_repository( + name = "com_github_cpuguy83_go_md2man", + build_file_proto_mode = "disable_global", + importpath = "github.com/cpuguy83/go-md2man", + sum = "h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=", + version = "v1.0.10", + ) + go_repository( + name = "com_github_creack_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/creack/pty", + sum = "h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w=", + version = "v1.1.9", + ) + go_repository( + name = "com_github_data_dog_go_sqlmock", + build_file_proto_mode = "disable_global", + importpath = "github.com/DATA-DOG/go-sqlmock", + sum = "h1:2L2f5t3kKnCLxnClDD/PrDfExFFa1wjESgxHG/B1ibo=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_datadog_zstd", + build_file_proto_mode = "disable_global", + importpath = "github.com/DataDog/zstd", + sum = "h1:+IawcoXhCBylN7ccwdwf8LOH2jKq7NavGpEPanrlTzE=", + version = "v1.4.4", + ) + go_repository( + name = "com_github_dave_dst", + build_file_proto_mode = "disable_global", + importpath = "github.com/dave/dst", + sum = "h1:5wtsjxee7nUDlKEz4i6ewJVn1193vfv2UpEXKqzmaUI=", + version = "v0.24.0", + ) + go_repository( + name = "com_github_dave_gopackages", + build_file_proto_mode = "disable_global", + importpath = "github.com/dave/gopackages", + sum = "h1:l99YKCdrK4Lvb/zTupt0GMPfNbncAGf8Cv/t1sYLOg0=", + version = "v0.0.0-20170318123100-46e7023ec56e", + ) + go_repository( + name = "com_github_dave_jennifer", + build_file_proto_mode = "disable_global", + importpath = "github.com/dave/jennifer", + sum = "h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_dave_kerr", + build_file_proto_mode = "disable_global", + importpath = "github.com/dave/kerr", + sum = "h1:xURkGi4RydhyaYR6PzcyHTueQudxY4LgxN1oYEPJHa0=", + version = "v0.0.0-20170318121727-bc25dd6abe8e", + ) + go_repository( + name = "com_github_dave_rebecca", + build_file_proto_mode = "disable_global", + importpath = "github.com/dave/rebecca", + sum = "h1:jxVfdOxRirbXL28vXMvUvJ1in3djwkVKXCq339qhBL0=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_davecgh_go_spew", + build_file_proto_mode = "disable_global", + importpath = "github.com/davecgh/go-spew", + sum = "h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_dgraph_io_badger", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgraph-io/badger", + sum = "h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_dgrijalva_jwt_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgrijalva/jwt-go", + sum = "h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=", + version = "v3.2.0+incompatible", + ) + go_repository( + name = "com_github_dgryski_go_farm", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgryski/go-farm", + sum = "h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA=", + version = "v0.0.0-20190423205320-6a90982ecee2", + ) + go_repository( + name = "com_github_dgryski_go_metro", + build_file_proto_mode = "disable_global", + importpath = "github.com/dgryski/go-metro", + sum = "h1:8WFBn63wegobsYAX0YjD+8suexZDga5CctH4CCTx2+8=", + version = "v0.0.0-20180109044635-280f6062b5bc", + ) + go_repository( + name = "com_github_dimchansky_utfbom", + build_file_proto_mode = "disable_global", + importpath = "github.com/dimchansky/utfbom", + sum = "h1:FcM3g+nofKgUteL8dm/UpdRXNC9KmADgTpLKsu0TRo4=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_docker_distribution", + build_file_proto_mode = "disable_global", + importpath = "github.com/docker/distribution", + sum = "h1:neUDAlf3wX6Ml4HdqTrbcOHXtfRN0TFIwt6YFL7N9RU=", + version = "v2.7.0+incompatible", + ) + go_repository( + name = "com_github_docker_docker", + build_file_proto_mode = "disable_global", + importpath = "github.com/docker/docker", + sum = "h1:V6pqHzGtZNa2JZXY97Nq+E1IIVwlA90Ql+wDCHPu6Ts=", + version = "v17.12.0-ce-rc1.0.20190115172544-0dc531243dd3+incompatible", + ) + go_repository( + name = "com_github_docker_go_connections", + build_file_proto_mode = "disable_global", + importpath = "github.com/docker/go-connections", + sum = "h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_docker_go_units", + build_file_proto_mode = "disable_global", + importpath = "github.com/docker/go-units", + sum = "h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_dustin_go_humanize", + build_file_proto_mode = "disable_global", + importpath = "github.com/dustin/go-humanize", + sum = "h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_eapache_go_resiliency", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-resiliency", + sum = "h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_eapache_go_xerial_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/go-xerial-snappy", + sum = "h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw=", + version = "v0.0.0-20180814174437-776d5712da21", + ) + go_repository( + name = "com_github_eapache_queue", + build_file_proto_mode = "disable_global", + importpath = "github.com/eapache/queue", + sum = "h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_edsrzf_mmap_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/edsrzf/mmap-go", + sum = "h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_eknkc_amber", + build_file_proto_mode = "disable_global", + importpath = "github.com/eknkc/amber", + sum = "h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=", + version = "v0.0.0-20171010120322-cdade1c07385", + ) + go_repository( + name = "com_github_elastic_gosigar", + build_file_proto_mode = "disable_global", + importpath = "github.com/elastic/gosigar", + sum = "h1:bPIzW1Qkut7n9uwvPAXbnLDVEd45TV5ZwxYZAVX/zEQ=", + version = "v0.10.0", + ) + go_repository( + name = "com_github_elazarl_go_bindata_assetfs", + build_file_proto_mode = "disable_global", + importpath = "github.com/elazarl/go-bindata-assetfs", + sum = "h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_envoyproxy_go_control_plane", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/go-control-plane", + sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=", + version = "v0.9.4", + ) + go_repository( + name = "com_github_envoyproxy_protoc_gen_validate", + build_file_proto_mode = "disable_global", + importpath = "github.com/envoyproxy/protoc-gen-validate", + sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_etcd_io_bbolt", + build_file_proto_mode = "disable_global", + importpath = "github.com/etcd-io/bbolt", + sum = "h1:gSJmxrs37LgTqR/oyJBWok6k6SvXEUerFTbltIhXkBM=", + version = "v1.3.3", + ) + go_repository( + name = "com_github_facebookgo_clock", + build_file_proto_mode = "disable_global", + importpath = "github.com/facebookgo/clock", + sum = "h1:yDWHCSQ40h88yih2JAcL6Ls/kVkSE8GFACTGVnMPruw=", + version = "v0.0.0-20150410010913-600d898af40a", + ) + go_repository( + name = "com_github_fanixk_geohash", + build_file_proto_mode = "disable_global", + importpath = "github.com/fanixk/geohash", + sum = "h1:Fyfh/dsHFrC6nkX7H7+nFdTd1wROlX/FxEIWVpKYf1U=", + version = "v0.0.0-20150324002647-c1f9b5fa157a", + ) + go_repository( + name = "com_github_fasthttp_contrib_websocket", + build_file_proto_mode = "disable_global", + importpath = "github.com/fasthttp-contrib/websocket", + sum = "h1:DddqAaWDpywytcG8w/qoQ5sAN8X12d3Z3koB0C3Rxsc=", + version = "v0.0.0-20160511215533-1f3b11f56072", + ) + go_repository( + name = "com_github_fatih_color", + build_file_proto_mode = "disable_global", + importpath = "github.com/fatih/color", + sum = "h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=", + version = "v1.7.0", + ) + go_repository( + name = "com_github_fatih_structs", + build_file_proto_mode = "disable_global", + importpath = "github.com/fatih/structs", + sum = "h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_flosch_pongo2", + build_file_proto_mode = "disable_global", + importpath = "github.com/flosch/pongo2", + sum = "h1:GY1+t5Dr9OKADM64SYnQjw/w99HMYvQ0A8/JoUkxVmc=", + version = "v0.0.0-20190707114632-bbf5a6c351f4", + ) + go_repository( + name = "com_github_frankban_quicktest", + build_file_proto_mode = "disable_global", + importpath = "github.com/frankban/quicktest", + sum = "h1:kV0lw0TH1j1hozahVmcpFCsbV5hcS4ZalH+U7UoeTow=", + version = "v1.7.3", + ) + go_repository( + name = "com_github_fsnotify_fsnotify", + build_file_proto_mode = "disable_global", + importpath = "github.com/fsnotify/fsnotify", + sum = "h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=", + version = "v1.4.9", + ) + go_repository( + name = "com_github_gavv_httpexpect", + build_file_proto_mode = "disable_global", + importpath = "github.com/gavv/httpexpect", + sum = "h1:1X9kcRshkSKEjNJJxX9Y9mQ5BRfbxU5kORdjhlA1yX8=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_getsentry_raven_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/getsentry/raven-go", + sum = "h1:no+xWJRb5ZI7eE8TWgIq1jLulQiIoLG0IfYxv5JYMGs=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_ghemawat_stream", + build_file_proto_mode = "disable_global", + importpath = "github.com/ghemawat/stream", + sum = "h1:r5GgOLGbza2wVHRzK7aAj6lWZjfbAwiu/RDCVOKjRyM=", + version = "v0.0.0-20171120220530-696b145b53b9", + ) + go_repository( + name = "com_github_ghodss_yaml", + build_file_proto_mode = "disable_global", + importpath = "github.com/ghodss/yaml", + sum = "h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_gin_contrib_sse", + build_file_proto_mode = "disable_global", + importpath = "github.com/gin-contrib/sse", + sum = "h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=", + version = "v0.0.0-20190301062529-5545eab6dad3", + ) + go_repository( + name = "com_github_gin_gonic_gin", + build_file_proto_mode = "disable_global", + importpath = "github.com/gin-gonic/gin", + sum = "h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=", + version = "v1.4.0", + ) + go_repository( + name = "com_github_go_check_check", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-check/check", + sum = "h1:0gkP6mzaMqkmpcJYCFOLkIBwI7xFExG03bbkOkCvUPI=", + version = "v0.0.0-20180628173108-788fd7840127", + ) + go_repository( + name = "com_github_go_errors_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-errors/errors", + sum = "h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_go_gl_glfw_v3_3_glfw", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-gl/glfw/v3.3/glfw", + sum = "h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I=", + version = "v0.0.0-20200222043503-6f7a984d4dc4", + ) + go_repository( + name = "com_github_go_kit_kit", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-kit/kit", + sum = "h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_go_logfmt_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-logfmt/logfmt", + sum = "h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_go_martini_martini", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-martini/martini", + sum = "h1:xveKWz2iaueeTaUgdetzel+U7exyigDYBryyVfV/rZk=", + version = "v0.0.0-20170121215854-22fa46961aab", + ) + go_repository( + name = "com_github_go_ole_go_ole", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-ole/go-ole", + sum = "h1:QNWhweRd9D5Py2rRVboZ2L4SEoW/dyraWJCc8bgS8kE=", + version = "v1.2.2", + ) + go_repository( + name = "com_github_go_sql_driver_mysql", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-sql-driver/mysql", + sum = "h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_go_stack_stack", + build_file_proto_mode = "disable_global", + importpath = "github.com/go-stack/stack", + sum = "h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_gobwas_httphead", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/httphead", + sum = "h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=", + version = "v0.0.0-20180130184737-2c6c146eadee", + ) + go_repository( + name = "com_github_gobwas_pool", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/pool", + sum = "h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_gobwas_ws", + build_file_proto_mode = "disable_global", + importpath = "github.com/gobwas/ws", + sum = "h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_gofrs_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/gofrs/uuid", + sum = "h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6rR7UHz84=", + version = "v3.3.0+incompatible", + ) + go_repository( + name = "com_github_gogo_googleapis", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/googleapis", + sum = "h1:dR8+Q0uO5S2ZBcs2IH6VBKYwSxPo2vYCYq0ot0mu7xA=", + version = "v0.0.0-20180223154316-0cd9801be74a", + ) + go_repository( + name = "com_github_gogo_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/protobuf", + replace = "github.com/cockroachdb/gogoproto", + sum = "h1:UoEUWRRZjeOfGenewnmzRCA0kWWRtZogNdidaXjZ/+c=", + version = "v1.2.1-0.20190102194534-ca10b809dba0", + ) + go_repository( + name = "com_github_gogo_status", + build_file_proto_mode = "disable_global", + importpath = "github.com/gogo/status", + sum = "h1:+eIkrewn5q6b30y+g/BJINVVdi2xH7je5MPJ3ZPK3JA=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_golang_commonmark_html", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-commonmark/html", + sum = "h1:FeNEDxIy7XouGTJKiJ9Ze5vUbcAIW/FRhQbtKBNmEz8=", + version = "v0.0.0-20180910111043-7d7c804e1d46", + ) + go_repository( + name = "com_github_golang_commonmark_linkify", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-commonmark/linkify", + sum = "h1:TkuRzcq232K5ytXtQ+BPicsjYWZgt/lS6gJ5HqcUifQ=", + version = "v0.0.0-20180910111149-f05efb453a0e", + ) + go_repository( + name = "com_github_golang_commonmark_markdown", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-commonmark/markdown", + sum = "h1:YaQaotRjMcVth1VzHUEQlD2oeyQAglA7CXdxp9QLvKM=", + version = "v0.0.0-20180910011815-a8f139058164", + ) + go_repository( + name = "com_github_golang_commonmark_mdurl", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-commonmark/mdurl", + sum = "h1:XkgfhPs5AotQfcu3EfDEjyAUx91KdtjrxHXYGnZJhoU=", + version = "v0.0.0-20180910110917-8d018c6567d6", + ) + go_repository( + name = "com_github_golang_commonmark_puny", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang-commonmark/puny", + sum = "h1:DUgQdQmDg4sk4SfNR+qOkXcopGz36BL02vp/V7WbPQI=", + version = "v0.0.0-20180910110745-050be392d8b8", + ) + go_repository( + name = "com_github_golang_geo", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/geo", + sum = "h1:C/hKUcHT483btRbeGkrRjJz+Zbcj8audldIi9tRJDCc=", + version = "v0.0.0-20200319012246-673a6f80352d", + ) + go_repository( + name = "com_github_golang_glog", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/glog", + sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=", + version = "v0.0.0-20160126235308-23def4e6c14b", + ) + go_repository( + name = "com_github_golang_groupcache", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/groupcache", + sum = "h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8=", + version = "v0.0.0-20160516000752-02826c3e7903", + ) + go_repository( + name = "com_github_golang_lint", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/lint", + sum = "h1:2hRPrmiwPrp3fQX967rNJIhQPtiGXdlQWAxKbKw3VHA=", + version = "v0.0.0-20180702182130-06c8688daad7", + ) + go_repository( + name = "com_github_golang_mock", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/mock", + sum = "h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_golang_protobuf", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/protobuf", + sum = "h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_golang_snappy", + build_file_proto_mode = "disable_global", + importpath = "github.com/golang/snappy", + sum = "h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw=", + version = "v0.0.2", + ) + go_repository( + name = "com_github_gomodule_redigo", + build_file_proto_mode = "disable_global", + importpath = "github.com/gomodule/redigo", + sum = "h1:y0Wmhvml7cGnzPa9nocn/fMraMH/lMDdeG+rkx4VgYY=", + version = "v1.7.1-0.20190724094224-574c33c3df38", + ) + go_repository( + name = "com_github_google_btree", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/btree", + sum = "h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_flatbuffers", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/flatbuffers", + sum = "h1:O7CEyB8Cb3/DmtxODGtLHcEvpr81Jm5qLg/hsHnxA2A=", + version = "v1.11.0", + ) + go_repository( + name = "com_github_google_go_cmp", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-cmp", + sum = "h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_google_go_github", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-github", + sum = "h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=", + version = "v17.0.0+incompatible", + ) + go_repository( + name = "com_github_google_go_querystring", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/go-querystring", + sum = "h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_gofuzz", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/gofuzz", + sum = "h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_google_martian", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/martian", + sum = "h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_google_pprof", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/pprof", + sum = "h1:beB+Da4k9B1zmgag78k3k1Bx4L/fdWr5FwNa0f8RxmY=", + version = "v0.0.0-20190109223431-e84dfd68c163", + ) + go_repository( + name = "com_github_google_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/google/uuid", + sum = "h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_googleapis_gax_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/googleapis/gax-go", + sum = "h1:silFMLAnr330+NRuag/VjIGF7TLp/LBrV2CJKFLWEww=", + version = "v2.0.2+incompatible", + ) + go_repository( + name = "com_github_gopherjs_gopherjs", + build_file_proto_mode = "disable_global", + importpath = "github.com/gopherjs/gopherjs", + sum = "h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=", + version = "v0.0.0-20181017120253-0766667cb4d1", + ) + go_repository( + name = "com_github_gorhill_cronexpr", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorhill/cronexpr", + sum = "h1:Spo+4PFAGDqULAsZ7J69MOxq4/fwgZ0zvmDTBqpq7yU=", + version = "v0.0.0-20140423231348-a557574d6c02", + ) + go_repository( + name = "com_github_gorilla_mux", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/mux", + sum = "h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc=", + version = "v1.7.4", + ) + go_repository( + name = "com_github_gorilla_securecookie", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/securecookie", + sum = "h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_gorilla_sessions", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/sessions", + sum = "h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_gorilla_websocket", + build_file_proto_mode = "disable_global", + importpath = "github.com/gorilla/websocket", + sum = "h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=", + version = "v1.4.0", + ) + go_repository( + name = "com_github_goware_modvendor", + build_file_proto_mode = "disable_global", + importpath = "github.com/goware/modvendor", + sum = "h1:pQoHt7SOUiWSwN/W5FzibTQLx/1Xa3VMBRcZGtdb1wo=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_middleware", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/go-grpc-middleware", + sum = "h1:z53tR0945TRRQO/fLEVPI6SMv7ZflF0TEaTAoU7tOzg=", + version = "v1.0.1-0.20190118093823-f849b5445de4", + ) + go_repository( + name = "com_github_grpc_ecosystem_go_grpc_prometheus", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/go-grpc-prometheus", + sum = "h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_gateway", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/grpc-gateway", + replace = "github.com/cockroachdb/grpc-gateway", + sum = "h1:pZuUpNtmLArGU2vCW+mNetvruw6jRcxDxwOnMT+XLWI=", + version = "v1.14.6-0.20200519165156-52697fc4a249", + ) + go_repository( + name = "com_github_grpc_ecosystem_grpc_opentracing", + build_file_proto_mode = "disable_global", + importpath = "github.com/grpc-ecosystem/grpc-opentracing", + sum = "h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU=", + version = "v0.0.0-20180507213350-8e809c8a8645", + ) + go_repository( + name = "com_github_hashicorp_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-uuid", + sum = "h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_hashicorp_go_version", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/go-version", + sum = "h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_hashicorp_hcl", + build_file_proto_mode = "disable_global", + importpath = "github.com/hashicorp/hcl", + sum = "h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_hpcloud_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/hpcloud/tail", + sum = "h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_huandu_xstrings", + build_file_proto_mode = "disable_global", + importpath = "github.com/huandu/xstrings", + sum = "h1:gvV6jG9dTgFEncxo+AF7PH6MZXi/vZl25owA/8Dg8Wo=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_hydrogen18_memlistener", + build_file_proto_mode = "disable_global", + importpath = "github.com/hydrogen18/memlistener", + sum = "h1:EPRgaDqXpLFUJLXZdGLnBTy1l6CLiNAPnvn2l+kHit0=", + version = "v0.0.0-20141126152155-54553eb933fb", + ) + go_repository( + name = "com_github_ianlancetaylor_cgosymbolizer", + build_file_proto_mode = "disable_global", + importpath = "github.com/ianlancetaylor/cgosymbolizer", + sum = "h1:SgAfkQ7+MVwIQP9PPN+NrTsRvzLOfpDuMqaVhvjqMGA=", + version = "v0.0.0-20201002210021-dda951febc36", + ) + go_repository( + name = "com_github_ianlancetaylor_demangle", + build_file_proto_mode = "disable_global", + importpath = "github.com/ianlancetaylor/demangle", + sum = "h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=", + version = "v0.0.0-20181102032728-5e5cf60278f6", + ) + go_repository( + name = "com_github_imdario_mergo", + build_file_proto_mode = "disable_global", + importpath = "github.com/imdario/mergo", + sum = "h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg=", + version = "v0.3.9", + ) + go_repository( + name = "com_github_imkira_go_interpol", + build_file_proto_mode = "disable_global", + importpath = "github.com/imkira/go-interpol", + sum = "h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_inconshreveable_mousetrap", + build_file_proto_mode = "disable_global", + importpath = "github.com/inconshreveable/mousetrap", + sum = "h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_iris_contrib_blackfriday", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/blackfriday", + sum = "h1:o5sHQHHm0ToHUlAJSTjW9UWicjJSDDauOOQ2AHuIVp4=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_iris_contrib_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/go.uuid", + sum = "h1:XZubAYg61/JwnJNbZilGjf3b3pB80+OQg2qf6c8BfWE=", + version = "v2.0.0+incompatible", + ) + go_repository( + name = "com_github_iris_contrib_i18n", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/i18n", + sum = "h1:Kyp9KiXwsyZRTeoNjgVCrWks7D8ht9+kg6yCjh8K97o=", + version = "v0.0.0-20171121225848-987a633949d0", + ) + go_repository( + name = "com_github_iris_contrib_schema", + build_file_proto_mode = "disable_global", + importpath = "github.com/iris-contrib/schema", + sum = "h1:10g/WnoRR+U+XXHWKBHeNy/+tZmM2kcAVGLOsz+yaDA=", + version = "v0.0.1", + ) + go_repository( + name = "com_github_jackc_chunkreader", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/chunkreader", + sum = "h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jackc_chunkreader_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/chunkreader/v2", + sum = "h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8=", + version = "v2.0.1", + ) + go_repository( + name = "com_github_jackc_fake", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/fake", + sum = "h1:vr3AYkKovP8uR8AvSGGUK1IDqRa5lAAvEkZG1LKaCRc=", + version = "v0.0.0-20150926172116-812a484cc733", + ) + go_repository( + name = "com_github_jackc_pgconn", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgconn", + sum = "h1:lwofaXKPbIx6qEaK8mNm7uZuOwxHw+PnAFGDsDFpkRI=", + version = "v1.6.1", + ) + go_repository( + name = "com_github_jackc_pgio", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgio", + sum = "h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jackc_pgmock", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgmock", + sum = "h1:JVX6jT/XfzNqIjye4717ITLaNwV9mWbJx0dLCpcRzdA=", + version = "v0.0.0-20190831213851-13a1b77aafa2", + ) + go_repository( + name = "com_github_jackc_pgpassfile", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgpassfile", + sum = "h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jackc_pgproto3", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgproto3", + sum = "h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_jackc_pgproto3_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgproto3/v2", + sum = "h1:RHkX5ZUD9bl/kn0f9dYUWs1N7Nwvo1wwUYvKiR26Zco=", + version = "v2.0.4", + ) + go_repository( + name = "com_github_jackc_pgservicefile", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgservicefile", + sum = "h1:Q3tB+ExeflWUW7AFcAhXqk40s9mnNYLk1nOkKNZ5GnU=", + version = "v0.0.0-20200307190119-3430c5407db8", + ) + go_repository( + name = "com_github_jackc_pgtype", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgtype", + sum = "h1:l8JvKrby3RI7Kg3bYEeU9TA4vqC38QDpFCfcrC7KuN0=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_jackc_pgx", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgx", + sum = "h1:2zP5OD7kiyR3xzRYMhOcXVvkDZsImVXfj+yIyTQf3/o=", + version = "v3.6.2+incompatible", + ) + go_repository( + name = "com_github_jackc_pgx_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/pgx/v4", + sum = "h1:Fh0O9GdlG4gYpjpwOqjdEodJUQM9jzN3Hdv7PN0xmm0=", + version = "v4.6.0", + ) + go_repository( + name = "com_github_jackc_puddle", + build_file_proto_mode = "disable_global", + importpath = "github.com/jackc/puddle", + sum = "h1:musOWczZC/rSbqut475Vfcczg7jJsdUQf0D6oKPLgNU=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_jaegertracing_jaeger", + build_file_proto_mode = "disable_global", + importpath = "github.com/jaegertracing/jaeger", + sum = "h1:SekUYENjk7gp38SJWM7kKuJjZ1EK7dNqE9UjKaCNJD8=", + version = "v1.17.0", + ) + go_repository( + name = "com_github_jcmturner_aescts_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/aescts/v2", + sum = "h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_dnsutils_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/dnsutils/v2", + sum = "h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo=", + version = "v2.0.0", + ) + go_repository( + name = "com_github_jcmturner_gofork", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gofork", + sum = "h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_jcmturner_goidentity_v6", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/goidentity/v6", + sum = "h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o=", + version = "v6.0.1", + ) + go_repository( + name = "com_github_jcmturner_gokrb5_v8", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/gokrb5/v8", + sum = "h1:lzPl/30ZLkTveYsYZPKMcgXc8MbnE6RsTd4F9KgiLtk=", + version = "v8.2.0", + ) + go_repository( + name = "com_github_jcmturner_rpc_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/jcmturner/rpc/v2", + sum = "h1:gMB4IwRXYsWw4Bc6o/az2HJgFUA1ffSh90i26ZJ6Xl0=", + version = "v2.0.2", + ) + go_repository( + name = "com_github_jmespath_go_jmespath", + build_file_proto_mode = "disable_global", + importpath = "github.com/jmespath/go-jmespath", + sum = "h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_joker_hpp", + build_file_proto_mode = "disable_global", + importpath = "github.com/Joker/hpp", + sum = "h1:65+iuJYdRXv/XyN62C1uEmmOx3432rNG/rKlX6V7Kkc=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_joker_jade", + build_file_proto_mode = "disable_global", + importpath = "github.com/Joker/jade", + sum = "h1:mreN1m/5VJ/Zc3b4pzj9qU6D9SRQ6Vm+3KfI328t3S8=", + version = "v1.0.1-0.20190614124447-d475f43051e7", + ) + go_repository( + name = "com_github_jonboulle_clockwork", + build_file_proto_mode = "disable_global", + importpath = "github.com/jonboulle/clockwork", + sum = "h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=", + version = "v0.1.0", + ) + go_repository( + name = "com_github_jordanlewis_gcassert", + build_file_proto_mode = "disable_global", + importpath = "github.com/jordanlewis/gcassert", + sum = "h1:d1Ov7s7RbMdHcgE1Eh1CxR+yd2TTKYOCHZf92Tm/fLs=", + version = "v0.0.0-20200706043056-bf61eb72ee48", + ) + go_repository( + name = "com_github_json_iterator_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/json-iterator/go", + sum = "h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=", + version = "v1.1.7", + ) + go_repository( + name = "com_github_jtolds_gls", + build_file_proto_mode = "disable_global", + importpath = "github.com/jtolds/gls", + sum = "h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=", + version = "v4.20.0+incompatible", + ) + go_repository( + name = "com_github_juju_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/errors", + sum = "h1:rhqTjzJlm7EbkELJDKMTU7udov+Se0xZkWmugr6zGok=", + version = "v0.0.0-20181118221551-089d3ea4e4d5", + ) + go_repository( + name = "com_github_juju_loggo", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/loggo", + sum = "h1:MK144iBQF9hTSwBW/9eJm034bVoG30IshVm688T2hi8=", + version = "v0.0.0-20180524022052-584905176618", + ) + go_repository( + name = "com_github_juju_testing", + build_file_proto_mode = "disable_global", + importpath = "github.com/juju/testing", + sum = "h1:WQM1NildKThwdP7qWrNAFGzp4ijNLw8RlgENkaI4MJs=", + version = "v0.0.0-20180920084828-472a3e8b2073", + ) + go_repository( + name = "com_github_julienschmidt_httprouter", + build_file_proto_mode = "disable_global", + importpath = "github.com/julienschmidt/httprouter", + sum = "h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+9HbQbYf7g=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_k0kubun_colorstring", + build_file_proto_mode = "disable_global", + importpath = "github.com/k0kubun/colorstring", + sum = "h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=", + version = "v0.0.0-20150214042306-9440f1994b88", + ) + go_repository( + name = "com_github_kataras_golog", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/golog", + sum = "h1:J7Dl82843nbKQDrQM/abbNJZvQjS6PfmkkffhOTXEpM=", + version = "v0.0.9", + ) + go_repository( + name = "com_github_kataras_iris_v12", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/iris/v12", + sum = "h1:Wo5S7GMWv5OAzJmvFTvss/C4TS1W0uo6LkDlSymT4rM=", + version = "v12.0.1", + ) + go_repository( + name = "com_github_kataras_neffos", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/neffos", + sum = "h1:O06dvQlxjdWvzWbm2Bq+Si6psUhvSmEctAMk9Xujqms=", + version = "v0.0.10", + ) + go_repository( + name = "com_github_kataras_pio", + build_file_proto_mode = "disable_global", + importpath = "github.com/kataras/pio", + sum = "h1:V5Rs9ztEWdp58oayPq/ulmlqJJZeJP6pP79uP3qjcao=", + version = "v0.0.0-20190103105442-ea782b38602d", + ) + go_repository( + name = "com_github_kevinburke_go_bindata", + build_file_proto_mode = "disable_global", + importpath = "github.com/kevinburke/go-bindata", + sum = "h1:hThDhUBH4KjTyhfXfOgacEPfFBNjltnzl/xzfLfrPoQ=", + version = "v3.13.0+incompatible", + ) + go_repository( + name = "com_github_kisielk_errcheck", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/errcheck", + sum = "h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_kisielk_gotool", + build_file_proto_mode = "disable_global", + importpath = "github.com/kisielk/gotool", + sum = "h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_klauspost_compress", + build_file_proto_mode = "disable_global", + importpath = "github.com/klauspost/compress", + sum = "h1:GhthINjveNZAdFUD8QoQYfjxnOONZgztK/Yr6M23UTY=", + version = "v1.9.0", + ) + go_repository( + name = "com_github_klauspost_cpuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/klauspost/cpuid", + sum = "h1:vJi+O/nMdFt0vqm8NZBI6wzALWdA2X+egi0ogNyrC/w=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_knz_go_libedit", + build_file_proto_mode = "disable_global", + importpath = "github.com/knz/go-libedit", + replace = "github.com/otan-cockroach/go-libedit", + sum = "h1:JZt/IahREIv11tegg2OoWEpTr/Zk8gtny+4EKMQqGEU=", + version = "v1.10.2-0.20201016212517-2c66cfe9603c", + ) + go_repository( + name = "com_github_knz_strtime", + build_file_proto_mode = "disable_global", + importpath = "github.com/knz/strtime", + sum = "h1:GQE1iatYDRrIidq4Zf/9ZzKWyrTk2sXOYc1JADbkAjQ=", + version = "v0.0.0-20200318182718-be999391ffa9", + ) + go_repository( + name = "com_github_konsorten_go_windows_terminal_sequences", + build_file_proto_mode = "disable_global", + importpath = "github.com/konsorten/go-windows-terminal-sequences", + sum = "h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_kr_logfmt", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/logfmt", + sum = "h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY=", + version = "v0.0.0-20140226030751-b84e30acd515", + ) + go_repository( + name = "com_github_kr_pretty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pretty", + sum = "h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=", + version = "v0.2.1", + ) + go_repository( + name = "com_github_kr_pty", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/pty", + sum = "h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI=", + version = "v1.1.8", + ) + go_repository( + name = "com_github_kr_text", + build_file_proto_mode = "disable_global", + importpath = "github.com/kr/text", + sum = "h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_labstack_echo_v4", + build_file_proto_mode = "disable_global", + importpath = "github.com/labstack/echo/v4", + sum = "h1:z0BZoArY4FqdpUEl+wlHp4hnr/oSR6MTmQmv8OHSoww=", + version = "v4.1.11", + ) + go_repository( + name = "com_github_labstack_gommon", + build_file_proto_mode = "disable_global", + importpath = "github.com/labstack/gommon", + sum = "h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=", + version = "v0.3.0", + ) + go_repository( + name = "com_github_leanovate_gopter", + build_file_proto_mode = "disable_global", + importpath = "github.com/leanovate/gopter", + sum = "h1:+OUpk+IVvmKU0jivOVFGtOzA6U5AWFs8HE4DRzWLOUE=", + version = "v0.2.5-0.20190402064358-634a59d12406", + ) + go_repository( + name = "com_github_lib_pq", + build_file_proto_mode = "disable_global", + importpath = "github.com/lib/pq", + sum = "h1:9xohqzkUwzR4Ga4ivdTcawVS89YSDVxXMa3xJX3cGzg=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_lib_pq_auth_kerberos", + build_file_proto_mode = "disable_global", + importpath = "github.com/lib/pq/auth/kerberos", + sum = "h1:q7hY+WNJTcSqJNGwJzXZYL++nWBaoKlKdgZOyY6jxz4=", + version = "v0.0.0-20200720160335-984a6aa1ca46", + ) + go_repository( + name = "com_github_lightstep_lightstep_tracer_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/lightstep/lightstep-tracer-go", + sum = "h1:D0GGa7afJ7GcQvu5as6ssLEEKYXvRgKI5d5cevtz8r4=", + version = "v0.15.6", + ) + go_repository( + name = "com_github_linkedin_goavro_v2", + build_file_proto_mode = "disable_global", + importpath = "github.com/linkedin/goavro/v2", + sum = "h1:4OGyN6pvutqmVtObCSzm0BQ+wQQNxSuHCN0t8UAfrjk=", + version = "v2.8.1", + ) + go_repository( + name = "com_github_lufia_iostat", + build_file_proto_mode = "disable_global", + importpath = "github.com/lufia/iostat", + sum = "h1:umdPgllno4d03WCBsA0UIwzGIJYV8FfV4325kOYIhBU=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_lusis_go_slackbot", + build_file_proto_mode = "disable_global", + importpath = "github.com/lusis/go-slackbot", + sum = "h1:AsEBgzv3DhuYHI/GiQh2HxvTP71HCCE9E/tzGUzGdtU=", + version = "v0.0.0-20180109053408-401027ccfef5", + ) + go_repository( + name = "com_github_lusis_slack_test", + build_file_proto_mode = "disable_global", + importpath = "github.com/lusis/slack-test", + sum = "h1:MNApn+Z+fIT4NPZopPfCc1obT6aY3SVM6DOctz1A9ZU=", + version = "v0.0.0-20190426140909-c40012f20018", + ) + go_repository( + name = "com_github_magiconair_properties", + build_file_proto_mode = "disable_global", + importpath = "github.com/magiconair/properties", + sum = "h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=", + version = "v1.8.0", + ) + go_repository( + name = "com_github_maruel_panicparse", + build_file_proto_mode = "disable_global", + importpath = "github.com/maruel/panicparse", + sum = "h1:mtX2D0ta3lWxCvv276VVIH6mMYzm4jhSfYP70ZJSOQU=", + version = "v1.1.2-0.20180806203336-f20d4c4d746f", + ) + go_repository( + name = "com_github_marusama_semaphore", + build_file_proto_mode = "disable_global", + importpath = "github.com/marusama/semaphore", + sum = "h1:sq+a5mb8zHbmHhrIH06oqIMGsanjpbxNgxEgZVfgpvQ=", + version = "v0.0.0-20190110074507-6952cef993b2", + ) + go_repository( + name = "com_github_masterminds_goutils", + build_file_proto_mode = "disable_global", + importpath = "github.com/Masterminds/goutils", + sum = "h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_masterminds_semver", + build_file_proto_mode = "disable_global", + importpath = "github.com/Masterminds/semver", + sum = "h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_masterminds_sprig", + build_file_proto_mode = "disable_global", + importpath = "github.com/Masterminds/sprig", + sum = "h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=", + version = "v2.22.0+incompatible", + ) + go_repository( + name = "com_github_mattn_go_colorable", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-colorable", + sum = "h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=", + version = "v0.1.2", + ) + go_repository( + name = "com_github_mattn_go_isatty", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-isatty", + sum = "h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=", + version = "v0.0.12", + ) + go_repository( + name = "com_github_mattn_go_runewidth", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-runewidth", + sum = "h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=", + version = "v0.0.7", + ) + go_repository( + name = "com_github_mattn_go_zglob", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/go-zglob", + sum = "h1:6HgbBMgs3hI9y1/MYG0r9j6daUubUskZNsEW4fkWR/k=", + version = "v0.0.2-0.20191112051448-a8912a37f9e7", + ) + go_repository( + name = "com_github_mattn_goveralls", + build_file_proto_mode = "disable_global", + importpath = "github.com/mattn/goveralls", + sum = "h1:7eJB6EqsPhRVxvwEXGnqdO2sJI0PTsrWoTMXEk9/OQc=", + version = "v0.0.2", + ) + go_repository( + name = "com_github_matttproud_golang_protobuf_extensions", + build_file_proto_mode = "disable_global", + importpath = "github.com/matttproud/golang_protobuf_extensions", + sum = "h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_mediocregopher_mediocre_go_lib", + build_file_proto_mode = "disable_global", + importpath = "github.com/mediocregopher/mediocre-go-lib", + sum = "h1:3dQJqqDouawQgl3gBE1PNHKFkJYGEuFb1DbSlaxdosE=", + version = "v0.0.0-20181029021733-cb65787f37ed", + ) + go_repository( + name = "com_github_mediocregopher_radix_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/mediocregopher/radix/v3", + sum = "h1:oacPXPKHJg0hcngVVrdtTnfGJiS+PtwoQwTBZGFlV4k=", + version = "v3.3.0", + ) + go_repository( + name = "com_github_mibk_dupl", + build_file_proto_mode = "disable_global", + importpath = "github.com/mibk/dupl", + sum = "h1:aZc3jqrF9n0tUHwHt/+jsRxA8cRgA0Gdl56M7W7PoqE=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_michaeltjones_walk", + build_file_proto_mode = "disable_global", + importpath = "github.com/MichaelTJones/walk", + sum = "h1:FSsoaa1q4jAaeiAUxf9H0PgFP7eA/UL6c3PdJH+nMN4=", + version = "v0.0.0-20161122175330-4748e29d5718", + ) + go_repository( + name = "com_github_microcosm_cc_bluemonday", + build_file_proto_mode = "disable_global", + importpath = "github.com/microcosm-cc/bluemonday", + sum = "h1:5lPfLTTAvAbtS0VqT+94yOtFnGfUWYyx0+iToC3Os3s=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_microsoft_go_winio", + build_file_proto_mode = "disable_global", + importpath = "github.com/Microsoft/go-winio", + sum = "h1:+hMXMk01us9KgxGb7ftKQt2Xpf5hH/yky+TDA+qxleU=", + version = "v0.4.14", + ) + go_repository( + name = "com_github_mitchellh_copystructure", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/copystructure", + sum = "h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mitchellh_go_homedir", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/go-homedir", + sum = "h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_mitchellh_mapstructure", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/mapstructure", + sum = "h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_mitchellh_reflectwalk", + build_file_proto_mode = "disable_global", + importpath = "github.com/mitchellh/reflectwalk", + sum = "h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mmatczuk_go_generics", + build_file_proto_mode = "disable_global", + importpath = "github.com/mmatczuk/go_generics", + sum = "h1:QjLgi/L+MjxysinrA8KkNZLf3cAhTluBoSXUvFeN144=", + version = "v0.0.0-20181212143635-0aaa050f9bab", + ) + go_repository( + name = "com_github_mmcloughlin_geohash", + build_file_proto_mode = "disable_global", + importpath = "github.com/mmcloughlin/geohash", + sum = "h1:FihR004p/aE1Sju6gcVq5OLDqGcMnpBY+8moBqIsVOs=", + version = "v0.9.0", + ) + go_repository( + name = "com_github_modern_go_concurrent", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/concurrent", + sum = "h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=", + version = "v0.0.0-20180306012644-bacd9c7ef1dd", + ) + go_repository( + name = "com_github_modern_go_reflect2", + build_file_proto_mode = "disable_global", + importpath = "github.com/modern-go/reflect2", + sum = "h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_montanaflynn_stats", + build_file_proto_mode = "disable_global", + importpath = "github.com/montanaflynn/stats", + sum = "h1:l4v5f5zMxqzCwPRRIlL5yCD/REWJ94PrId/ESmRPEDc=", + version = "v0.4.1-0.20190115100425-713f2944833c", + ) + go_repository( + name = "com_github_moul_http2curl", + build_file_proto_mode = "disable_global", + importpath = "github.com/moul/http2curl", + sum = "h1:dRMWoAtb+ePxMlLkrCbAqh4TlPHXvoGUSQ323/9Zahs=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_mwitkow_go_conntrack", + build_file_proto_mode = "disable_global", + importpath = "github.com/mwitkow/go-conntrack", + sum = "h1:F9x/1yl3T2AeKLr2AMdilSD8+f9bvMnNN8VS5iDtovc=", + version = "v0.0.0-20161129095857-cc309e4a2223", + ) + go_repository( + name = "com_github_mwitkow_go_proto_validators", + build_file_proto_mode = "disable_global", + importpath = "github.com/mwitkow/go-proto-validators", + sum = "h1:28i1IjGcx8AofiB4N3q5Yls55VEaitzuEPkFJEVgGkA=", + version = "v0.0.0-20180403085117-0950a7990007", + ) + go_repository( + name = "com_github_nats_io_nats_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nats.go", + sum = "h1:6lF/f1/NN6kzUDBz6pyvQDEXO39jqXcWRLu/tKjtOUQ=", + version = "v1.8.1", + ) + go_repository( + name = "com_github_nats_io_nkeys", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nkeys", + sum = "h1:+qM7QpgXnvDDixitZtQUBDY9w/s9mu1ghS+JIbsrx6M=", + version = "v0.0.2", + ) + go_repository( + name = "com_github_nats_io_nuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/nats-io/nuid", + sum = "h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_nlopes_slack", + build_file_proto_mode = "disable_global", + importpath = "github.com/nlopes/slack", + sum = "h1:OVnHm7lv5gGT5gkcHsZAyw++oHVFihbjWbL3UceUpiA=", + version = "v0.4.0", + ) + go_repository( + name = "com_github_nvveen_gotty", + build_file_proto_mode = "disable_global", + importpath = "github.com/Nvveen/Gotty", + sum = "h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=", + version = "v0.0.0-20120604004816-cd527374f1e5", + ) + go_repository( + name = "com_github_nxadm_tail", + build_file_proto_mode = "disable_global", + importpath = "github.com/nxadm/tail", + sum = "h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=", + version = "v1.4.4", + ) + go_repository( + name = "com_github_olekukonko_tablewriter", + build_file_proto_mode = "disable_global", + importpath = "github.com/olekukonko/tablewriter", + replace = "github.com/cockroachdb/tablewriter", + sum = "h1:c7yLgqcm/3c9lYtpWeVD9NYqA9cKsKHdpQM62PHtTUM=", + version = "v0.0.5-0.20200105123400-bd15540e8847", + ) + go_repository( + name = "com_github_onsi_ginkgo", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/ginkgo", + sum = "h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y=", + version = "v1.13.0", + ) + go_repository( + name = "com_github_onsi_gomega", + build_file_proto_mode = "disable_global", + importpath = "github.com/onsi/gomega", + sum = "h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=", + version = "v1.10.1", + ) + go_repository( + name = "com_github_opencontainers_go_digest", + build_file_proto_mode = "disable_global", + importpath = "github.com/opencontainers/go-digest", + sum = "h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ=", + version = "v1.0.0-rc1", + ) + go_repository( + name = "com_github_opencontainers_image_spec", + build_file_proto_mode = "disable_global", + importpath = "github.com/opencontainers/image-spec", + sum = "h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_opencontainers_runc", + build_file_proto_mode = "disable_global", + importpath = "github.com/opencontainers/runc", + sum = "h1:/k06BMULKF5hidyoZymkoDCzdJzltZpz/UU4LguQVtc=", + version = "v1.0.0-rc9", + ) + go_repository( + name = "com_github_opennota_wd", + build_file_proto_mode = "disable_global", + importpath = "github.com/opennota/wd", + sum = "h1:cVQhwfBgiKTMAdYPbVeuIiTkdY59qZ3sp5RpyO8CNtg=", + version = "v0.0.0-20180911144301-b446539ab1e7", + ) + go_repository( + name = "com_github_opentracing_contrib_go_observer", + build_file_proto_mode = "disable_global", + importpath = "github.com/opentracing-contrib/go-observer", + sum = "h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU=", + version = "v0.0.0-20170622124052-a52f23424492", + ) + go_repository( + name = "com_github_opentracing_opentracing_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/opentracing/opentracing-go", + sum = "h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_openzipkin_contrib_zipkin_go_opentracing", + build_file_proto_mode = "disable_global", + importpath = "github.com/openzipkin-contrib/zipkin-go-opentracing", + sum = "h1:82Tnq9OJpn+h5xgGpss5/mOv3KXdjtkdorFSOUusjM8=", + version = "v0.3.5", + ) + go_repository( + name = "com_github_openzipkin_zipkin_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/openzipkin/zipkin-go", + sum = "h1:A/ADD6HaPnAKj3yS7HjGHRK77qi41Hi0DirOOIQAeIw=", + version = "v0.1.1", + ) + go_repository( + name = "com_github_ory_dockertest_v3", + build_file_proto_mode = "disable_global", + importpath = "github.com/ory/dockertest/v3", + sum = "h1:I6KNJ6izxGduLACQii2SP/g7GN0JM9Xfaik6aAVaw6Y=", + version = "v3.6.0", + ) + go_repository( + name = "com_github_pborman_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/pborman/uuid", + sum = "h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_pelletier_go_toml", + build_file_proto_mode = "disable_global", + importpath = "github.com/pelletier/go-toml", + sum = "h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_peterbourgon_g2s", + build_file_proto_mode = "disable_global", + importpath = "github.com/peterbourgon/g2s", + sum = "h1:sKwxy1H95npauwu8vtF95vG/syrL0p8fSZo/XlDg5gk=", + version = "v0.0.0-20170223122336-d4e7ad98afea", + ) + go_repository( + name = "com_github_petermattis_goid", + build_file_proto_mode = "disable_global", + importpath = "github.com/petermattis/goid", + sum = "h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ=", + version = "v0.0.0-20180202154549-b0b1615b78e5", + ) + go_repository( + name = "com_github_pierrec_lz4", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrec/lz4", + sum = "h1:mFe7ttWaflA46Mhqh+jUfjp2qTbPYxLB2/OyBppH9dg=", + version = "v2.4.1+incompatible", + ) + go_repository( + name = "com_github_pierrre_compare", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrre/compare", + sum = "h1:k4IUsHgh+dbcAOIWCfxVa/7G6STjADH2qmhomv+1quc=", + version = "v1.0.2", + ) + go_repository( + name = "com_github_pierrre_geohash", + build_file_proto_mode = "disable_global", + importpath = "github.com/pierrre/geohash", + sum = "h1:f/zfjdV4rVofTCz1FhP07T+EMQAvcMM2ioGZVt+zqjI=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_pingcap_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/pingcap/errors", + sum = "h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=", + version = "v0.11.4", + ) + go_repository( + name = "com_github_pkg_browser", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/browser", + sum = "h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98=", + version = "v0.0.0-20180916011732-0a3d74bf9ce4", + ) + go_repository( + name = "com_github_pkg_errors", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/errors", + sum = "h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_pkg_profile", + build_file_proto_mode = "disable_global", + importpath = "github.com/pkg/profile", + sum = "h1:F++O52m40owAmADcojzM+9gyjmMOY/T4oYJkgFDH8RE=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_pmezard_go_difflib", + build_file_proto_mode = "disable_global", + importpath = "github.com/pmezard/go-difflib", + sum = "h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_pquerna_cachecontrol", + build_file_proto_mode = "disable_global", + importpath = "github.com/pquerna/cachecontrol", + sum = "h1:JDEmUDtyiLMyMlFwiaDOv2hxUp35497fkwePcLeV7j4=", + version = "v0.0.0-20200819021114-67c6ae64274f", + ) + go_repository( + name = "com_github_prometheus_client_golang", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_golang", + sum = "h1:BQ53HtBmfOitExawJ6LokA4x8ov/z0SYYb0+HxJfRI8=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_prometheus_client_model", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/client_model", + sum = "h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_prometheus_common", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/common", + sum = "h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=", + version = "v0.9.1", + ) + go_repository( + name = "com_github_prometheus_procfs", + build_file_proto_mode = "disable_global", + importpath = "github.com/prometheus/procfs", + sum = "h1:QJQN3jYQhkamO4mhfUWqdDH2asK7ONOI9MTWjyAxNKM=", + version = "v0.0.10", + ) + go_repository( + name = "com_github_pseudomuto_protoc_gen_doc", + build_file_proto_mode = "disable_global", + importpath = "github.com/pseudomuto/protoc-gen-doc", + sum = "h1:61vWZuxYa8D7Rn4h+2dgoTNqnluBmJya2MgbqO32z6g=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_pseudomuto_protokit", + build_file_proto_mode = "disable_global", + importpath = "github.com/pseudomuto/protokit", + sum = "h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_puerkitobio_goquery", + build_file_proto_mode = "disable_global", + importpath = "github.com/PuerkitoBio/goquery", + sum = "h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk=", + version = "v1.5.0", + ) + go_repository( + name = "com_github_rcrowley_go_metrics", + build_file_proto_mode = "disable_global", + importpath = "github.com/rcrowley/go-metrics", + sum = "h1:dY6ETXrvDG7Sa4vE8ZQG4yqWg6UnOcbqTAahkV813vQ=", + version = "v0.0.0-20190826022208-cac0b30c2563", + ) + go_repository( + name = "com_github_rogpeppe_fastuuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/rogpeppe/fastuuid", + sum = "h1:Ppwyp6VYCF1nvBTXL3trRso7mXMlRrw9ooo375wvi2s=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_rs_xid", + build_file_proto_mode = "disable_global", + importpath = "github.com/rs/xid", + sum = "h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=", + version = "v1.2.1", + ) + go_repository( + name = "com_github_rs_zerolog", + build_file_proto_mode = "disable_global", + importpath = "github.com/rs/zerolog", + sum = "h1:uPRuwkWF4J6fGsJ2R0Gn2jB1EQiav9k3S6CSdygQJXY=", + version = "v1.15.0", + ) + go_repository( + name = "com_github_russross_blackfriday", + build_file_proto_mode = "disable_global", + importpath = "github.com/russross/blackfriday", + sum = "h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=", + version = "v1.5.2", + ) + go_repository( + name = "com_github_ryanuber_columnize", + build_file_proto_mode = "disable_global", + importpath = "github.com/ryanuber/columnize", + sum = "h1:j1Wcmh8OrK4Q7GXY+V7SVSY8nUWQxHW5TkBe7YUl+2s=", + version = "v2.1.0+incompatible", + ) + go_repository( + name = "com_github_sasha_s_go_deadlock", + build_file_proto_mode = "disable_global", + importpath = "github.com/sasha-s/go-deadlock", + sum = "h1:lMqc+fUb7RrFS3gQLtoQsJ7/6TV/pAIFvBsqX73DK8Y=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_satori_go_uuid", + build_file_proto_mode = "disable_global", + importpath = "github.com/satori/go.uuid", + sum = "h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_sclevine_agouti", + build_file_proto_mode = "disable_global", + importpath = "github.com/sclevine/agouti", + sum = "h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=", + version = "v3.0.0+incompatible", + ) + go_repository( + name = "com_github_sergi_go_diff", + build_file_proto_mode = "disable_global", + importpath = "github.com/sergi/go-diff", + sum = "h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=", + version = "v1.1.0", + ) + go_repository( + name = "com_github_shirou_gopsutil", + build_file_proto_mode = "disable_global", + importpath = "github.com/shirou/gopsutil", + sum = "h1:P37G9YH8M4vqkKcwBosp+URN5O8Tay67D2MbR361ioY=", + version = "v2.20.6+incompatible", + ) + go_repository( + name = "com_github_shopify_goreferrer", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/goreferrer", + sum = "h1:WDC6ySpJzbxGWFh4aMxFFC28wwGp5pEuoTtvA4q/qQ4=", + version = "v0.0.0-20181106222321-ec9c9a553398", + ) + go_repository( + name = "com_github_shopify_sarama", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/sarama", + sum = "h1:SgZvxOvp9NLnAjkIiby0LQgXH0yQNTk2eDzbYPVoTA4=", + version = "v1.22.2-0.20190604114437-cd910a683f9f", + ) + go_repository( + name = "com_github_shopify_toxiproxy", + build_file_proto_mode = "disable_global", + importpath = "github.com/Shopify/toxiproxy", + sum = "h1:TKdv8HiTLgE5wdJuEML90aBgNWsokNbMijUGhmcoBJc=", + version = "v2.1.4+incompatible", + ) + go_repository( + name = "com_github_shopspring_decimal", + build_file_proto_mode = "disable_global", + importpath = "github.com/shopspring/decimal", + sum = "h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_shurcool_sanitized_anchor_name", + build_file_proto_mode = "disable_global", + importpath = "github.com/shurcooL/sanitized_anchor_name", + sum = "h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_sirupsen_logrus", + build_file_proto_mode = "disable_global", + importpath = "github.com/sirupsen/logrus", + sum = "h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=", + version = "v1.4.2", + ) + go_repository( + name = "com_github_smartystreets_assertions", + build_file_proto_mode = "disable_global", + importpath = "github.com/smartystreets/assertions", + sum = "h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=", + version = "v0.0.0-20180927180507-b2de0cb4f26d", + ) + go_repository( + name = "com_github_smartystreets_goconvey", + build_file_proto_mode = "disable_global", + importpath = "github.com/smartystreets/goconvey", + sum = "h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=", + version = "v1.6.4", + ) + go_repository( + name = "com_github_soheilhy_cmux", + build_file_proto_mode = "disable_global", + importpath = "github.com/soheilhy/cmux", + sum = "h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=", + version = "v0.1.4", + ) + go_repository( + name = "com_github_spf13_afero", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/afero", + sum = "h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=", + version = "v1.1.2", + ) + go_repository( + name = "com_github_spf13_cast", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/cast", + sum = "h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=", + version = "v1.3.0", + ) + go_repository( + name = "com_github_spf13_cobra", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/cobra", + sum = "h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=", + version = "v0.0.5", + ) + go_repository( + name = "com_github_spf13_jwalterweatherman", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/jwalterweatherman", + sum = "h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_spf13_pflag", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/pflag", + sum = "h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=", + version = "v1.0.5", + ) + go_repository( + name = "com_github_spf13_viper", + build_file_proto_mode = "disable_global", + importpath = "github.com/spf13/viper", + sum = "h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M=", + version = "v1.3.2", + ) + go_repository( + name = "com_github_stackexchange_wmi", + build_file_proto_mode = "disable_global", + importpath = "github.com/StackExchange/wmi", + sum = "h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=", + version = "v0.0.0-20180116203802-5d049714c4a6", + ) + go_repository( + name = "com_github_stretchr_objx", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/objx", + sum = "h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=", + version = "v0.2.0", + ) + go_repository( + name = "com_github_stretchr_testify", + build_file_proto_mode = "disable_global", + importpath = "github.com/stretchr/testify", + sum = "h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=", + version = "v1.6.1", + ) + go_repository( + name = "com_github_the42_cartconvert", + build_file_proto_mode = "disable_global", + importpath = "github.com/the42/cartconvert", + sum = "h1:I4DY8wLxJXCrMYzDM6lKCGc3IQwJX0PlTLsd3nQqI3c=", + version = "v0.0.0-20131203171324-aae784c392b8", + ) + go_repository( + name = "com_github_tmc_grpc_websocket_proxy", + build_file_proto_mode = "disable_global", + importpath = "github.com/tmc/grpc-websocket-proxy", + sum = "h1:ndzgwNDnKIqyCvHTXaCqh9KlOWKvBry6nuXMJmonVsE=", + version = "v0.0.0-20170815181823-89b8d40f7ca8", + ) + go_repository( + name = "com_github_tomihiltunen_geohash_golang", + build_file_proto_mode = "disable_global", + importpath = "github.com/TomiHiltunen/geohash-golang", + sum = "h1:wumPkzt4zaxO4rHPBrjDK8iZMR41C1qs7njNqlacwQg=", + version = "v0.0.0-20150112065804-b3e4e625abfb", + ) + go_repository( + name = "com_github_twpayne_go_geom", + build_file_proto_mode = "disable_global", + importpath = "github.com/twpayne/go-geom", + sum = "h1:O27mIXZnMYiZi0ZD8ewjs/IT/ZOFVbZHBzPjA9skdmg=", + version = "v1.3.6", + ) + go_repository( + name = "com_github_twpayne_go_kml", + build_file_proto_mode = "disable_global", + importpath = "github.com/twpayne/go-kml", + sum = "h1:RI0JKh/VzdK/d+ZxdJzt8Ar921KMYPfg9qkw7vsbAGw=", + version = "v1.5.1", + ) + go_repository( + name = "com_github_twpayne_go_polyline", + build_file_proto_mode = "disable_global", + importpath = "github.com/twpayne/go-polyline", + sum = "h1:EA8HPg0MNS62R5D2E8B6zyz2TMkmkXVlQaVBVgY3F5A=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_twpayne_go_waypoint", + build_file_proto_mode = "disable_global", + importpath = "github.com/twpayne/go-waypoint", + sum = "h1:0DvmyIQBIEYpXJt7Wm242Wn6ePH84FR5wv2Jh/yRgUw=", + version = "v0.0.0-20200706203930-b263a7f6e4e8", + ) + go_repository( + name = "com_github_ugorji_go", + build_file_proto_mode = "disable_global", + importpath = "github.com/ugorji/go", + sum = "h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=", + version = "v1.1.4", + ) + go_repository( + name = "com_github_ugorji_go_codec", + build_file_proto_mode = "disable_global", + importpath = "github.com/ugorji/go/codec", + sum = "h1:3SVOIvH7Ae1KRYyQWRjXWJEA9sS/c/pjvH++55Gr648=", + version = "v0.0.0-20181204163529-d75b2dcb6bc8", + ) + go_repository( + name = "com_github_urfave_cli", + build_file_proto_mode = "disable_global", + importpath = "github.com/urfave/cli", + sum = "h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=", + version = "v1.20.0", + ) + go_repository( + name = "com_github_urfave_negroni", + build_file_proto_mode = "disable_global", + importpath = "github.com/urfave/negroni", + sum = "h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_valyala_bytebufferpool", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/bytebufferpool", + sum = "h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_valyala_fasthttp", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/fasthttp", + sum = "h1:uWF8lgKmeaIewWVPwi4GRq2P6+R46IgYZdxWtM+GtEY=", + version = "v1.6.0", + ) + go_repository( + name = "com_github_valyala_fasttemplate", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/fasttemplate", + sum = "h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8=", + version = "v1.0.1", + ) + go_repository( + name = "com_github_valyala_tcplisten", + build_file_proto_mode = "disable_global", + importpath = "github.com/valyala/tcplisten", + sum = "h1:0R4NLDRDZX6JcmhJgXi5E4b8Wg84ihbmUKp/GvSPEzc=", + version = "v0.0.0-20161114210144-ceec8f93295a", + ) + go_repository( + name = "com_github_vividcortex_ewma", + build_file_proto_mode = "disable_global", + importpath = "github.com/VividCortex/ewma", + sum = "h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdcM=", + version = "v1.1.1", + ) + go_repository( + name = "com_github_wadey_gocovmerge", + build_file_proto_mode = "disable_global", + importpath = "github.com/wadey/gocovmerge", + sum = "h1:W0LEBv82YCGEtcmPA3uNZBI33/qF//HAAs3MawDjRa0=", + version = "v0.0.0-20160331181800-b5bfa59ec0ad", + ) + go_repository( + name = "com_github_xdg_scram", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg/scram", + sum = "h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk=", + version = "v0.0.0-20180814205039-7eeb5667e42c", + ) + go_repository( + name = "com_github_xdg_stringprep", + build_file_proto_mode = "disable_global", + importpath = "github.com/xdg/stringprep", + sum = "h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_xeipuuv_gojsonpointer", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonpointer", + sum = "h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=", + version = "v0.0.0-20180127040702-4e3ac2762d5f", + ) + go_repository( + name = "com_github_xeipuuv_gojsonreference", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonreference", + sum = "h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=", + version = "v0.0.0-20180127040603-bd5ef7bd5415", + ) + go_repository( + name = "com_github_xeipuuv_gojsonschema", + build_file_proto_mode = "disable_global", + importpath = "github.com/xeipuuv/gojsonschema", + sum = "h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=", + version = "v1.2.0", + ) + go_repository( + name = "com_github_xiang90_probing", + build_file_proto_mode = "disable_global", + importpath = "github.com/xiang90/probing", + sum = "h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=", + version = "v0.0.0-20190116061207-43a291ad63a2", + ) + go_repository( + name = "com_github_xordataexchange_crypt", + build_file_proto_mode = "disable_global", + importpath = "github.com/xordataexchange/crypt", + sum = "h1:ESFSdwYZvkeru3RtdrYueztKhOBCSAAzS4Gf+k0tEow=", + version = "v0.0.3-0.20170626215501-b2862e3d0a77", + ) + go_repository( + name = "com_github_yalp_jsonpath", + build_file_proto_mode = "disable_global", + importpath = "github.com/yalp/jsonpath", + sum = "h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY=", + version = "v0.0.0-20180802001716-5cc68e5049a0", + ) + go_repository( + name = "com_github_yudai_gojsondiff", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/gojsondiff", + sum = "h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=", + version = "v1.0.0", + ) + go_repository( + name = "com_github_yudai_golcs", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/golcs", + sum = "h1:BHyfKlQyqbsFN5p3IfnEUduWvb9is428/nNb5L3U01M=", + version = "v0.0.0-20170316035057-ecda9a501e82", + ) + go_repository( + name = "com_github_yudai_pp", + build_file_proto_mode = "disable_global", + importpath = "github.com/yudai/pp", + sum = "h1:Q4//iY4pNF6yPLZIigmvcl7k/bPgrcTPIFIcmawg5bI=", + version = "v2.0.1+incompatible", + ) + go_repository( + name = "com_github_yuin_goldmark", + build_file_proto_mode = "disable_global", + importpath = "github.com/yuin/goldmark", + sum = "h1:nqDD4MMMQA0lmWq03Z2/myGPYLQoXtmi0rGVs95ntbo=", + version = "v1.1.27", + ) + go_repository( + name = "com_github_zabawaba99_go_gitignore", + build_file_proto_mode = "disable_global", + importpath = "github.com/zabawaba99/go-gitignore", + sum = "h1:vpcCVk+pSR/6zcurmlGFD3jC5I/7RMl+GwGAPLxvX18=", + version = "v0.0.0-20200117185801-39e6bddfb292", + ) + go_repository( + name = "com_github_zenazn_goji", + build_file_proto_mode = "disable_global", + importpath = "github.com/zenazn/goji", + sum = "h1:RSQQAbXGArQ0dIDEq+PI6WqN6if+5KHu6x2Cx/GXLTQ=", + version = "v0.9.0", + ) + go_repository( + name = "com_google_cloud_go", + build_file_proto_mode = "disable_global", + importpath = "cloud.google.com/go", + sum = "h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg=", + version = "v0.34.0", + ) + go_repository( + name = "com_shuralyov_dmitri_gpu_mtl", + build_file_proto_mode = "disable_global", + importpath = "dmitri.shuralyov.com/gpu/mtl", + sum = "h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY=", + version = "v0.0.0-20190408044501-666a987793e9", + ) + go_repository( + name = "in_gopkg_alecthomas_kingpin_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/alecthomas/kingpin.v2", + sum = "h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=", + version = "v2.2.6", + ) + go_repository( + name = "in_gopkg_check_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/check.v1", + sum = "h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=", + version = "v1.0.0-20190902080502-41f04d3bba15", + ) + go_repository( + name = "in_gopkg_cheggaaa_pb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/cheggaaa/pb.v1", + sum = "h1:Ev7yu1/f6+d+b3pi5vPdRPc6nNtP1umSfcWiEfRqv6I=", + version = "v1.0.25", + ) + go_repository( + name = "in_gopkg_fsnotify_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/fsnotify.v1", + sum = "h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=", + version = "v1.4.7", + ) + go_repository( + name = "in_gopkg_go_playground_assert_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/go-playground/assert.v1", + sum = "h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=", + version = "v1.2.1", + ) + go_repository( + name = "in_gopkg_go_playground_validator_v8", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/go-playground/validator.v8", + sum = "h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=", + version = "v8.18.2", + ) + go_repository( + name = "in_gopkg_inconshreveable_log15_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/inconshreveable/log15.v2", + sum = "h1:RlWgLqCMMIYYEVcAR5MDsuHlVkaIPDAF+5Dehzg8L5A=", + version = "v2.0.0-20180818164646-67afb5ed74ec", + ) + go_repository( + name = "in_gopkg_jcmturner_aescts_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/aescts.v1", + sum = "h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw=", + version = "v1.0.1", + ) + go_repository( + name = "in_gopkg_jcmturner_dnsutils_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/dnsutils.v1", + sum = "h1:cIuC1OLRGZrld+16ZJvvZxVJeKPsvd5eUIvxfoN5hSM=", + version = "v1.0.1", + ) + go_repository( + name = "in_gopkg_jcmturner_goidentity_v3", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/goidentity.v3", + sum = "h1:1duIyWiTaYvVx3YX2CYtpJbUFd7/UuPYCfgXtQ3VTbI=", + version = "v3.0.0", + ) + go_repository( + name = "in_gopkg_jcmturner_gokrb5_v7", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/gokrb5.v7", + sum = "h1:a9tsXlIDD9SKxotJMK3niV7rPZAJeX2aD/0yg3qlIrg=", + version = "v7.5.0", + ) + go_repository( + name = "in_gopkg_jcmturner_rpc_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/jcmturner/rpc.v1", + sum = "h1:QHIUxTX1ISuAv9dD2wJ9HWQVuWDX/Zc0PfeC2tjc4rU=", + version = "v1.1.0", + ) + go_repository( + name = "in_gopkg_mgo_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/mgo.v2", + sum = "h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU=", + version = "v2.0.0-20180705113604-9856a29383ce", + ) + go_repository( + name = "in_gopkg_square_go_jose_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/square/go-jose.v2", + sum = "h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=", + version = "v2.5.1", + ) + go_repository( + name = "in_gopkg_src_d_go_billy_v4", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/src-d/go-billy.v4", + sum = "h1:KtlZ4c1OWbIs4jCv5ZXrTqG8EQocr0g/d4DjNg70aek=", + version = "v4.3.0", + ) + go_repository( + name = "in_gopkg_tomb_v1", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/tomb.v1", + sum = "h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=", + version = "v1.0.0-20141024135613-dd632973f1e7", + ) + go_repository( + name = "in_gopkg_yaml_v2", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v2", + replace = "github.com/cockroachdb/yaml", + sum = "h1:EqoCicA1pbWWDGniFxhTElh2hvui7E7tEvuBNJSDn3A=", + version = "v0.0.0-20180705215940-0e2822948641", + ) + go_repository( + name = "in_gopkg_yaml_v3", + build_file_proto_mode = "disable_global", + importpath = "gopkg.in/yaml.v3", + sum = "h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=", + version = "v3.0.0-20200313102051-9f266ea9e77c", + ) + go_repository( + name = "io_etcd_go_bbolt", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/bbolt", + sum = "h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk=", + version = "v1.3.3", + ) + go_repository( + name = "io_etcd_go_etcd", + build_file_proto_mode = "disable_global", + importpath = "go.etcd.io/etcd", + replace = "github.com/cockroachdb/etcd", + sum = "h1:1ELogBFqZl2Cj/Rn0wWAU4z2/ghBlHzhXDlbT8RlrKU=", + version = "v0.4.7-0.20200615211340-a17df30d5955", + ) + go_repository( + name = "io_k8s_sigs_yaml", + build_file_proto_mode = "disable_global", + importpath = "sigs.k8s.io/yaml", + sum = "h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=", + version = "v1.1.0", + ) + go_repository( + name = "io_opencensus_go", + build_file_proto_mode = "disable_global", + importpath = "go.opencensus.io", + sum = "h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938=", + version = "v0.18.0", + ) + go_repository( + name = "io_vitess_vitess", + build_file_proto_mode = "disable_global", + importpath = "vitess.io/vitess", + replace = "github.com/cockroachdb/vitess", + sum = "h1:Ecr6ZKQU8edcSK19d1HJKnQrQyzxCA4heauBJmygepc=", + version = "v2.2.0-rc.1.0.20180830030426-1740ce8b3188+incompatible", + ) + go_repository( + name = "org_apache_git_thrift_git", + build_file_proto_mode = "disable_global", + importpath = "git.apache.org/thrift.git", + sum = "h1:OR8VhtwhcAI3U48/rzBsVOuHi0zDPzYI1xASVcdSgR8=", + version = "v0.0.0-20180902110319-2566ecd5d999", + ) + go_repository( + name = "org_golang_google_api", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/api", + sum = "h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI=", + version = "v0.1.0", + ) + go_repository( + name = "org_golang_google_appengine", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/appengine", + sum = "h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=", + version = "v1.4.0", + ) + go_repository( + name = "org_golang_google_genproto", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/genproto", + sum = "h1:jB9+PJSvu5tBfmJHy/OVapFdjDF3WvpkqRhxqrmzoEU=", + version = "v0.0.0-20200218151345-dad8c97a84f5", + ) + go_repository( + name = "org_golang_google_grpc", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/grpc", + sum = "h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4=", + version = "v1.29.1", + ) + go_repository( + name = "org_golang_google_protobuf", + build_file_proto_mode = "disable_global", + importpath = "google.golang.org/protobuf", + sum = "h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=", + version = "v1.23.0", + ) + go_repository( + name = "org_golang_x_arch", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/arch", + sum = "h1:Vsc61gop4hfHdzQNolo6Fi/sw7TnJ2yl3ZR4i7bYirs=", + version = "v0.0.0-20180920145803-b19384d3c130", + ) + go_repository( + name = "org_golang_x_crypto", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/crypto", + sum = "h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=", + version = "v0.0.0-20200622213623-75b288015ac9", + ) + go_repository( + name = "org_golang_x_exp", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/exp", + sum = "h1:2/QncOxxpPAdiH+E00abYw/SaQG353gltz79Nl1zrYE=", + version = "v0.0.0-20201008143054-e3b2a7f2fdc7", + ) + go_repository( + name = "org_golang_x_image", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/image", + sum = "h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=", + version = "v0.0.0-20190802002840-cff245a6509b", + ) + go_repository( + name = "org_golang_x_lint", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/lint", + sum = "h1:0IiAsCRByjO2QjX7ZPkw5oU9x+n1YqRL802rjC0c3Aw=", + version = "v0.0.0-20200130185559-910be7a94367", + ) + go_repository( + name = "org_golang_x_mobile", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mobile", + sum = "h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=", + version = "v0.0.0-20190719004257-d2bd2a29d028", + ) + go_repository( + name = "org_golang_x_mod", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/mod", + sum = "h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=", + version = "v0.3.1-0.20200828183125-ce943fd02449", + ) + go_repository( + name = "org_golang_x_net", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/net", + sum = "h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=", + version = "v0.0.0-20200602114024-627f9648deb9", + ) + go_repository( + name = "org_golang_x_oauth2", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/oauth2", + sum = "h1:pcBdqVcrlT+A3i+tWsOROFONQyey9tisIQHI4xqVGLg=", + version = "v0.0.0-20190115181402-5dab4167f31c", + ) + go_repository( + name = "org_golang_x_perf", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/perf", + sum = "h1:xYq6+9AtI+xP3M4r0N1hCkHrInHDBohhquRgx9Kk6gI=", + version = "v0.0.0-20180704124530-6e6d33e29852", + ) + go_repository( + name = "org_golang_x_sync", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sync", + sum = "h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck=", + version = "v0.0.0-20201020160332-67f06af15bc9", + ) + go_repository( + name = "org_golang_x_sys", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/sys", + sum = "h1:WgqgiQvkiZWz7XLhphjt2GI2GcGCTIZs9jqXMWmH+oc=", + version = "v0.0.0-20201022201747-fb209a7c41cd", + ) + go_repository( + name = "org_golang_x_text", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/text", + sum = "h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=", + version = "v0.3.3", + ) + go_repository( + name = "org_golang_x_time", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/time", + sum = "h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ=", + version = "v0.0.0-20190308202827-9d24e82272b4", + ) + go_repository( + name = "org_golang_x_tools", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/tools", + sum = "h1:/e4fNMHdLn7SQSxTrRZTma2xjQW6ELdxcnpqMhpo9X4=", + version = "v0.0.0-20200702044944-0cc1aa72b347", + ) + go_repository( + name = "org_golang_x_xerrors", + build_file_proto_mode = "disable_global", + importpath = "golang.org/x/xerrors", + sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=", + version = "v0.0.0-20191204190536-9bdfabe68543", + ) + go_repository( + name = "org_uber_go_atomic", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/atomic", + sum = "h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=", + version = "v1.4.0", + ) + go_repository( + name = "org_uber_go_multierr", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/multierr", + sum = "h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=", + version = "v1.1.0", + ) + go_repository( + name = "org_uber_go_zap", + build_file_proto_mode = "disable_global", + importpath = "go.uber.org/zap", + sum = "h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=", + version = "v1.10.0", + ) + go_repository( + name = "tools_gotest", + build_file_proto_mode = "disable_global", + importpath = "gotest.tools", + sum = "h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=", + version = "v2.2.0+incompatible", + ) + go_repository( + name = "tools_gotest_v3", + build_file_proto_mode = "disable_global", + importpath = "gotest.tools/v3", + sum = "h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=", + version = "v3.0.2", + ) diff --git a/Makefile b/Makefile index f6400373a85d..950cf8906054 100644 --- a/Makefile +++ b/Makefile @@ -315,11 +315,21 @@ ifeq (, $(shell which ccache)) $(info $(yellow)Warning: 'ccache' not found, consider installing it for faster builds$(term-reset)) endif +# Warn maintainers if bazel is not found. +# +# TODO(irfansharif): Assert here instead, on a fixed version of bazel (3.7.0). Something like: +# +# $(error $(yellow)'bazel' not found (`brew install bazel` for macs)$(term-reset)) +ifeq (, $(shell which bazel)) +$(info $(yellow)Warning: 'bazel' not found (`brew install bazel` for macs)$(term-reset)) +endif + # Force vendor directory to rebuild. .PHONY: vendor_rebuild vendor_rebuild: bin/.submodules-initialized $(GO_INSTALL) -v github.com/goware/modvendor ./build/vendor_rebuild.sh + bazel run //:gazelle # Tell Make to delete the target if its recipe fails. Otherwise, if a recipe # modifies its target before failing, the target's timestamp will make it appear @@ -1699,6 +1709,11 @@ fuzz: ## Run fuzz tests. fuzz: bin/fuzz bin/fuzz $(TESTFLAGS) -tests $(TESTS) -timeout $(TESTTIMEOUT) $(PKG) +# Short hand to re-generate all bazel BUILD files. +bazel-generate: ## Generate all bazel BUILD files. + @echo 'Generating DEPS.bzl and BUILD files using gazelle' + @bazel run //:gazelle -- update-repos -from_file=go.mod -build_file_proto_mode=disable -to_macro=DEPS.bzl%go_deps + @bazel run //:gazelle # No need to include all the dependency files if the user is just # requesting help or cleanup. @@ -1749,3 +1764,4 @@ build/variables.mk: Makefile build/archive/contents/Makefile pkg/ui/Makefile bui include build/variables.mk $(foreach v,$(filter-out $(strip $(VALID_VARS)),$(.VARIABLES)),\ $(if $(findstring command line,$(origin $v)),$(error Variable '$v' is not recognized by this Makefile))) + diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 000000000000..ff8bc4105dc9 --- /dev/null +++ b/WORKSPACE @@ -0,0 +1,115 @@ +# Define the top level namespace. This lets everything be addressable using +# `@cockroach//...`. +workspace(name = "cockroach") + +# Load the things that let us load other things. +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") + +# Load go bazel tools. This gives us access to the go bazel SDK/toolchains. +http_archive( + name = "io_bazel_rules_go", + sha256 = "ac03931e56c3b229c145f1a8b2a2ad3e8d8f1af57e43ef28a26123362a1e3c7e", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz", + "https://github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz", + ], +) + +# Load the go dependencies and invoke them. +load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") +go_rules_dependencies() +go_register_toolchains() + +# Load gazelle. This lets us auto-generate BUILD.bazel files throughout the +# repo. +# +# TODO(irfansharif): Point to a proper bazelle-gazelle release once +# https://github.com/bazelbuild/bazel-gazelle/pull/933 lands upstream. +git_repository( + name = "bazel_gazelle", + remote = "https://github.com/bazelbuild/bazel-gazelle", + commit = "493b9adf67665beede36502c2094496af9f245a3", +) + +# Load gazelle dependencies. +load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") +gazelle_dependencies() + +# Load the protobuf depedency. +# +# Ref: https://github.com/bazelbuild/rules_go/blob/0.19.0/go/workspace.rst#proto-dependencies +# https://github.com/bazelbuild/bazel-gazelle/issues/591 +# +# TODO(irfansharif): We're not yet using this. We'll eventually need to when we +# try to generate proto files through bazel. +git_repository( + name = "com_google_protobuf", + commit = "09745575a923640154bcf307fba8aedff47f240a", + remote = "https://github.com/protocolbuffers/protobuf", +) +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") +protobuf_deps() + +# Load up cockroachdb's go dependencies (the ones listed under go.mod). The +# `DEPS.bzl` file is kept upto date using the following: +# +# bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=DEPS.bzl%go_deps +# +# gazelle:repository_macro DEPS.bzl%go_deps +load("//:DEPS.bzl", "go_deps") +go_deps() + +# Load the bazel utility that lets us build C/C++ projects using cmake/make/etc. +# +# TODO(irfansharif): Point to an upstream SHA once it picks up Oliver's changes +# that add autoconf support. +git_repository( + name = "rules_foreign_cc", + commit = "f6a15abd55be915b914aa618b50831bf5981340f", + remote = "https://github.com/otan-cockroach/rules_foreign_cc", +) +load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies") +rules_foreign_cc_dependencies() + +# Define the repositories for each of our c-dependencies. BUILD_ALL_CONTENT is +# a shorthand to glob over all checked-in files. +BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])""" + +# Each of these c-dependencies map to one or more library definitions in the +# top-level BUILD.bazel. Library definitions will list the following +# definitions as sources. For certain libraries (like `libroachccl`), the +# repository definitions are also listed as tool dependencies. This is because +# building those libraries require certain checked out repositories being +# placed relative to the source tree of the library itself. + +new_local_repository( + name = "libroach", + path = "c-deps/libroach", + build_file_content = BUILD_ALL_CONTENT, +) + +new_local_repository( + name = "proj", + path = "c-deps/proj", + build_file_content = BUILD_ALL_CONTENT, +) + +# For c-deps/protobuf, we elide a checked in generated file. Already generated +# files are read-only in the bazel sandbox, so bazel is unable to regenerate +# the same files, which the build process requires it to do so. +BUILD_PROTOBUF_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["src/google/protobuf/compiler/js/well_known_types_embed.cc"]), visibility = ["//visibility:public"])""" +new_local_repository( + name = "protobuf", + path = "c-deps/protobuf", + build_file_content = BUILD_PROTOBUF_CONTENT, +) + +# This is essentially the same above, we elide a generated file to avoid +# permission issues when building jemalloc within the bazel sandbox. +BUILD_JEMALLOC_CONTENT = """filegroup(name = "all", srcs = glob(["**"], exclude=["configure"]), visibility = ["//visibility:public"])""" +new_local_repository( + name = "jemalloc", + path = "c-deps/jemalloc", + build_file_content = BUILD_JEMALLOC_CONTENT, +) diff --git a/pkg/acceptance/BUILD.bazel b/pkg/acceptance/BUILD.bazel new file mode 100644 index 000000000000..1653f48da736 --- /dev/null +++ b/pkg/acceptance/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "acceptance", + srcs = [ + "flags.go", + "test_main.go", + "util_cluster.go", + "util_docker.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/acceptance", + visibility = ["//visibility:public"], + deps = [ + "//pkg/acceptance/cluster", + "//pkg/base", + "//pkg/security", + "//pkg/testutils", + "//pkg/util/log", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/docker/docker/api/types", + "//vendor/github.com/docker/docker/api/types/container", + ], +) + +go_test( + name = "acceptance_test", + srcs = [ + "adapter_test.go", + "cli_test.go", + "compose_test.go", + "debug_remote_test.go", + "main_test.go", + ], + data = glob(["testdata/**"]), + embed = [":acceptance"], + deps = [ + "//pkg/acceptance/cluster", + "//pkg/security", + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util/log", + ], +) diff --git a/pkg/acceptance/cluster/BUILD.bazel b/pkg/acceptance/cluster/BUILD.bazel new file mode 100644 index 000000000000..4f0d7cffbf41 --- /dev/null +++ b/pkg/acceptance/cluster/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cluster", + srcs = [ + "certs.go", + "cluster.go", + "docker.go", + "dockercluster.go", + "http.go", + "testconfig.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/acceptance/cluster", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/security", + "//pkg/util/contextutil", + "//pkg/util/log", + "//pkg/util/log/logflags", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/docker/distribution/reference", + "//vendor/github.com/docker/docker/api/types", + "//vendor/github.com/docker/docker/api/types/container", + "//vendor/github.com/docker/docker/api/types/events", + "//vendor/github.com/docker/docker/api/types/filters", + "//vendor/github.com/docker/docker/api/types/network", + "//vendor/github.com/docker/docker/client", + "//vendor/github.com/docker/docker/pkg/jsonmessage", + "//vendor/github.com/docker/docker/pkg/stdcopy", + "//vendor/github.com/docker/go-connections/nat", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/mattn/go-isatty", + ], +) diff --git a/pkg/acceptance/compose/gss/psql/BUILD.bazel b/pkg/acceptance/compose/gss/psql/BUILD.bazel new file mode 100644 index 000000000000..3e830b16167b --- /dev/null +++ b/pkg/acceptance/compose/gss/psql/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "psql", + srcs = ["empty.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/acceptance/compose/gss/psql", + visibility = ["//visibility:public"], +) diff --git a/pkg/acceptance/localcluster/BUILD.bazel b/pkg/acceptance/localcluster/BUILD.bazel new file mode 100644 index 000000000000..0fb2f1b83d59 --- /dev/null +++ b/pkg/acceptance/localcluster/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "localcluster", + srcs = [ + "cluster.go", + "localcluster.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/acceptance/localcluster", + visibility = ["//visibility:public"], + deps = [ + "//pkg/acceptance/cluster", + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/server/serverpb", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/lib/pq", + ], +) diff --git a/pkg/acceptance/localcluster/tc/BUILD.bazel b/pkg/acceptance/localcluster/tc/BUILD.bazel new file mode 100644 index 000000000000..16032eec049b --- /dev/null +++ b/pkg/acceptance/localcluster/tc/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tc", + srcs = ["tc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/acceptance/localcluster/tc", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/base/BUILD.bazel b/pkg/base/BUILD.bazel new file mode 100644 index 000000000000..979d2b558fdb --- /dev/null +++ b/pkg/base/BUILD.bazel @@ -0,0 +1,65 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "base", + srcs = [ + "addr_validation.go", + "cluster_id.go", + "config.go", + "constants.go", + "license.go", + "node_id.go", + "store_spec.go", + "test_server_args.go", + "testclusterreplicationmode_string.go", + "testing_knobs.go", + "zone.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/base", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cli/cliflags", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings/cluster", + "//pkg/util", + "//pkg/util/envutil", + "//pkg/util/errorutil", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/netutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/spf13/pflag", + ], +) + +go_test( + name = "base_test", + srcs = [ + "addr_validation_test.go", + "cluster_id_test.go", + "main_test.go", + "node_id_test.go", + "store_spec_test.go", + ], + deps = [ + ":base", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/bench/BUILD.bazel b/pkg/bench/BUILD.bazel new file mode 100644 index 000000000000..82221528359b --- /dev/null +++ b/pkg/bench/BUILD.bazel @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bench", + srcs = [ + "foreachdb.go", + "query.go", + "setup.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/bench", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//vendor/github.com/go-sql-driver/mysql", + "//vendor/github.com/lib/pq", + ], +) + +go_test( + name = "bench_test", + srcs = [ + "bench_test.go", + "main_test.go", + "pgbench_test.go", + ], + embed = [":bench"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/retry", + "//vendor/github.com/go-sql-driver/mysql", + "//vendor/github.com/lib/pq", + ], +) diff --git a/pkg/bench/cmd/pgbenchsetup/BUILD.bazel b/pkg/bench/cmd/pgbenchsetup/BUILD.bazel new file mode 100644 index 000000000000..e7d60406e25a --- /dev/null +++ b/pkg/bench/cmd/pgbenchsetup/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "pgbenchsetup_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/bench/cmd/pgbenchsetup", + visibility = ["//visibility:private"], + deps = [ + "//pkg/bench", + "//vendor/github.com/lib/pq", + ], +) + +go_binary( + name = "pgbenchsetup", + embed = [":pgbenchsetup_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/bench/ddl_analysis/BUILD.bazel b/pkg/bench/ddl_analysis/BUILD.bazel new file mode 100644 index 000000000000..79d84fe1a89a --- /dev/null +++ b/pkg/bench/ddl_analysis/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ddl_analysis", + srcs = ["ddl_analysis_bench.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/bench/ddl_analysis", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv/kvclient/kvcoord", + "//pkg/sql", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/log", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "ddl_analysis_test", + srcs = [ + "alter_table_bench_test.go", + "bench_test.go", + "create_alter_role_bench_test.go", + "drop_bench_test.go", + "grant_revoke_bench_test.go", + "grant_revoke_role_bench_test.go", + "truncate_bench_test.go", + ], + embed = [":ddl_analysis"], + deps = [ + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/randutil", + ], +) diff --git a/pkg/blobs/BUILD.bazel b/pkg/blobs/BUILD.bazel new file mode 100644 index 000000000000..fc3534a3d79f --- /dev/null +++ b/pkg/blobs/BUILD.bazel @@ -0,0 +1,50 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "blobs", + srcs = [ + "client.go", + "local_storage.go", + "service.go", + "stream.go", + "testutils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/blobs", + visibility = ["//visibility:public"], + deps = [ + "//pkg/blobs/blobspb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/util/fileutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/metadata", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "blobs_test", + srcs = [ + "bench_test.go", + "client_test.go", + "local_storage_test.go", + "service_test.go", + ], + embed = [":blobs"], + deps = [ + "//pkg/blobs/blobspb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/testutils", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/netutil", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/blobs/blobspb/BUILD.bazel b/pkg/blobs/blobspb/BUILD.bazel new file mode 100644 index 000000000000..c599aca597e0 --- /dev/null +++ b/pkg/blobs/blobspb/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "blobspb", + srcs = ["blobs.pb.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/blobs/blobspb", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/build/BUILD.bazel b/pkg/build/BUILD.bazel new file mode 100644 index 000000000000..807a011b4139 --- /dev/null +++ b/pkg/build/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "build", + srcs = [ + "cgo_compiler.go", + "cgo_compiler_nocgo.go", + "info.go", + "info.pb.go", + ], + cgo = True, + importpath = "github.com/cockroachdb/cockroach/pkg/build", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/envutil", + "//pkg/util/version", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/ccl/BUILD.bazel b/pkg/ccl/BUILD.bazel new file mode 100644 index 000000000000..35fdb2f5aef1 --- /dev/null +++ b/pkg/ccl/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ccl", + srcs = ["ccl_init.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/backupccl", + "//pkg/ccl/buildccl", + "//pkg/ccl/changefeedccl", + "//pkg/ccl/cliccl", + "//pkg/ccl/gssapiccl", + "//pkg/ccl/importccl", + "//pkg/ccl/kvccl", + "//pkg/ccl/oidcccl", + "//pkg/ccl/partitionccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/storageccl/engineccl", + "//pkg/ccl/utilccl", + "//pkg/ccl/workloadccl", + ], +) diff --git a/pkg/ccl/backupccl/BUILD.bazel b/pkg/ccl/backupccl/BUILD.bazel new file mode 100644 index 000000000000..664a07ff37fc --- /dev/null +++ b/pkg/ccl/backupccl/BUILD.bazel @@ -0,0 +1,196 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "backupccl", + srcs = [ + "backup.pb.go", + "backup_destination.go", + "backup_job.go", + "backup_planning.go", + "backup_processor.go", + "backup_processor_planning.go", + "create_scheduled_backup.go", + "manifest_handling.go", + "restore_data_processor.go", + "restore_job.go", + "restore_planning.go", + "restore_processor_planning.go", + "restore_schema_change_creation.go", + "schedule_exec.go", + "show.go", + "split_and_scatter_processor.go", + "targets.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/backupccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/clusterversion", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobsprotectedts", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/protectedts", + "//pkg/roachpb", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/covering", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/physicalplan", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqlutil", + "//pkg/sql/stats", + "//pkg/sql/types", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/interval", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/gorhill/cronexpr", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "backupccl_test", + srcs = [ + "backup_cloud_test.go", + "backup_destination_test.go", + "backup_test.go", + "bench_test.go", + "create_scheduled_backup_test.go", + "full_cluster_backup_restore_test.go", + "helpers_test.go", + "main_test.go", + "partitioned_backup_test.go", + "restore_mid_schema_change_test.go", + "restore_old_versions_test.go", + "show_test.go", + "split_and_scatter_processor_test.go", + "targets_test.go", + ], + data = glob(["testdata/**"]), + embed = [":backupccl"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/ccl/kvccl", + "//pkg/ccl/partitionccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/ccl/utilccl/sampledataccl", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobstest", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/rowflow", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/testutils", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/jobutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/ctxgroup", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/workload/bank", + "//pkg/workload/workloadsql", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/gorhill/cronexpr", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/ccl/baseccl/BUILD.bazel b/pkg/ccl/baseccl/BUILD.bazel new file mode 100644 index 000000000000..fb3a2410653e --- /dev/null +++ b/pkg/ccl/baseccl/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "baseccl", + srcs = [ + "encryption_options.pb.go", + "encryption_spec.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/baseccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/ccl/cliccl/cliflagsccl", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/spf13/pflag", + ], +) + +go_test( + name = "baseccl_test", + srcs = ["encryption_spec_test.go"], + embed = [":baseccl"], + deps = ["//pkg/util/leaktest"], +) diff --git a/pkg/ccl/buildccl/BUILD.bazel b/pkg/ccl/buildccl/BUILD.bazel new file mode 100644 index 000000000000..60aba9483da8 --- /dev/null +++ b/pkg/ccl/buildccl/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "buildccl", + srcs = ["buildinfo.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/buildccl", + visibility = ["//visibility:public"], + deps = ["//pkg/build"], +) diff --git a/pkg/ccl/changefeedccl/BUILD.bazel b/pkg/ccl/changefeedccl/BUILD.bazel new file mode 100644 index 000000000000..9bc1a3011eb9 --- /dev/null +++ b/pkg/ccl/changefeedccl/BUILD.bazel @@ -0,0 +1,182 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "changefeedccl", + srcs = [ + "avro.go", + "changefeed.go", + "changefeed_dist.go", + "changefeed_processors.go", + "changefeed_stmt.go", + "encoder.go", + "errors.go", + "metrics.go", + "name.go", + "rowfetcher_cache.go", + "sink.go", + "sink_cloudstorage.go", + "testing_knobs.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/ccl/backupccl", + "//pkg/ccl/changefeedccl/changefeedbase", + "//pkg/ccl/changefeedccl/kvfeed", + "//pkg/ccl/utilccl", + "//pkg/docs", + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobsprotectedts", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/protectedts", + "//pkg/roachpb", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/hydratedtables", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/physicalplan", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/util", + "//pkg/util/bufalloc", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/httputil", + "//pkg/util/humanizeutil", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/span", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/Shopify/sarama", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/google/btree", + "//vendor/github.com/linkedin/goavro/v2:goavro", + ], +) + +go_test( + name = "changefeedccl_test", + srcs = [ + "avro_test.go", + "bench_test.go", + "changefeed_test.go", + "encoder_test.go", + "helpers_test.go", + "main_test.go", + "name_test.go", + "nemeses_test.go", + "sink_cloudstorage_test.go", + "sink_test.go", + "validations_test.go", + ], + embed = [":changefeedccl"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/ccl/changefeedccl/cdctest", + "//pkg/ccl/changefeedccl/changefeedbase", + "//pkg/ccl/changefeedccl/kvfeed", + "//pkg/ccl/importccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/distsql", + "//pkg/sql/execinfra", + "//pkg/sql/flowinfra", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/span", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/bank", + "//pkg/workload/ledger", + "//pkg/workload/workloadsql", + "//vendor/github.com/Shopify/sarama", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/linkedin/goavro/v2:goavro", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/changefeedccl/cdctest/BUILD.bazel b/pkg/ccl/changefeedccl/cdctest/BUILD.bazel new file mode 100644 index 000000000000..afbd30f7f6ec --- /dev/null +++ b/pkg/ccl/changefeedccl/cdctest/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cdctest", + srcs = [ + "nemeses.go", + "testfeed.go", + "validator.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdctest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/sql", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/testutils/serverutils", + "//pkg/util/fsm", + "//pkg/util/hlc", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgx", + ], +) + +go_test( + name = "cdctest_test", + srcs = [ + "main_test.go", + "validator_test.go", + ], + embed = [":cdctest"], + deps = [ + "//pkg/base", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/changefeedccl/changefeedbase/BUILD.bazel b/pkg/ccl/changefeedccl/changefeedbase/BUILD.bazel new file mode 100644 index 000000000000..255b83dcff8a --- /dev/null +++ b/pkg/ccl/changefeedccl/changefeedbase/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "changefeedbase", + srcs = [ + "options.go", + "settings.go", + "validate.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/changefeedbase", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/settings", + "//pkg/sql", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/ccl/changefeedccl/kvfeed/BUILD.bazel b/pkg/ccl/changefeedccl/kvfeed/BUILD.bazel new file mode 100644 index 000000000000..8bee36424a5b --- /dev/null +++ b/pkg/ccl/changefeedccl/kvfeed/BUILD.bazel @@ -0,0 +1,68 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvfeed", + srcs = [ + "buffer.go", + "kv_feed.go", + "metrics.go", + "physical_kv_feed.go", + "scanner.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/kvfeed", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/changefeedccl/changefeedbase", + "//pkg/ccl/changefeedccl/schemafeed", + "//pkg/gossip", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/lease", + "//pkg/sql/covering", + "//pkg/sql/rowcontainer", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage/enginepb", + "//pkg/util/ctxgroup", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/span", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "kvfeed_test", + srcs = ["kv_feed_test.go"], + embed = [":kvfeed"], + deps = [ + "//pkg/ccl/changefeedccl/changefeedbase", + "//pkg/ccl/changefeedccl/schemafeed", + "//pkg/ccl/changefeedccl/schemafeed/schematestutils", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/mon", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/changefeedccl/schemafeed/BUILD.bazel b/pkg/ccl/changefeedccl/schemafeed/BUILD.bazel new file mode 100644 index 000000000000..6e6c4539ad93 --- /dev/null +++ b/pkg/ccl/changefeedccl/schemafeed/BUILD.bazel @@ -0,0 +1,52 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schemafeed", + srcs = [ + "schema_feed.go", + "table_event_filter.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/schemafeed", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/changefeedccl/changefeedbase", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/storage", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "schemafeed_test", + srcs = [ + "schema_feed_test.go", + "table_event_filter_test.go", + ], + embed = [":schemafeed"], + deps = [ + "//pkg/ccl/changefeedccl/schemafeed/schematestutils", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/changefeedccl/schemafeed/schematestutils/BUILD.bazel b/pkg/ccl/changefeedccl/schemafeed/schematestutils/BUILD.bazel new file mode 100644 index 000000000000..0a3f215c2c99 --- /dev/null +++ b/pkg/ccl/changefeedccl/schemafeed/schematestutils/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "schematestutils", + srcs = ["schema_test_utils.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/schemafeed/schematestutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/types", + "//pkg/util/hlc", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/ccl/cliccl/BUILD.bazel b/pkg/ccl/cliccl/BUILD.bazel new file mode 100644 index 000000000000..449885808abe --- /dev/null +++ b/pkg/ccl/cliccl/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cliccl", + srcs = [ + "cliccl.go", + "debug.go", + "demo.go", + "load.go", + "mtproxy.go", + "start.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/cliccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/build", + "//pkg/ccl/backupccl", + "//pkg/ccl/baseccl", + "//pkg/ccl/cliccl/cliflagsccl", + "//pkg/ccl/sqlproxyccl", + "//pkg/ccl/storageccl/engineccl/enginepbccl", + "//pkg/ccl/workloadccl/cliccl", + "//pkg/cli", + "//pkg/security", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/storage/enginepb", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/cmux", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_test( + name = "cliccl_test", + srcs = ["main_test.go"], + deps = [ + "//pkg/build", + "//pkg/ccl/utilccl", + "//pkg/server", + "//pkg/testutils/serverutils", + ], +) diff --git a/pkg/ccl/cliccl/cliflagsccl/BUILD.bazel b/pkg/ccl/cliccl/cliflagsccl/BUILD.bazel new file mode 100644 index 000000000000..f89ef3819c7e --- /dev/null +++ b/pkg/ccl/cliccl/cliflagsccl/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cliflagsccl", + srcs = ["flags.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/cliccl/cliflagsccl", + visibility = ["//visibility:public"], + deps = ["//pkg/cli/cliflags"], +) diff --git a/pkg/ccl/cmdccl/enc_utils/BUILD.bazel b/pkg/ccl/cmdccl/enc_utils/BUILD.bazel new file mode 100644 index 000000000000..82c2a962e01b --- /dev/null +++ b/pkg/ccl/cmdccl/enc_utils/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "enc_utils_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/cmdccl/enc_utils", + visibility = ["//visibility:private"], + deps = [ + "//pkg/ccl/storageccl/engineccl/enginepbccl", + "//pkg/storage/enginepb", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "enc_utils", + embed = [":enc_utils_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/ccl/gssapiccl/BUILD.bazel b/pkg/ccl/gssapiccl/BUILD.bazel new file mode 100644 index 000000000000..3e09e2b2b201 --- /dev/null +++ b/pkg/ccl/gssapiccl/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gssapiccl", + # keep + srcs = ["empty.go"], + cgo = True, + clinkopts = [], # keep + cppopts = [], # keep + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/gssapiccl", + visibility = ["//visibility:public"], +) diff --git a/pkg/ccl/importccl/BUILD.bazel b/pkg/ccl/importccl/BUILD.bazel new file mode 100644 index 000000000000..df8f53a17e85 --- /dev/null +++ b/pkg/ccl/importccl/BUILD.bazel @@ -0,0 +1,185 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "importccl", + srcs = [ + "exportcsv.go", + "import_processor.go", + "import_stmt.go", + "import_table_creation.go", + "read_import_avro.go", + "read_import_base.go", + "read_import_csv.go", + "read_import_mysql.go", + "read_import_mysqlout.go", + "read_import_pgcopy.go", + "read_import_pgdump.go", + "read_import_workload.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/importccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/backupccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/clusterversion", + "//pkg/col/coldata", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobsprotectedts", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/protectedts", + "//pkg/roachpb", + "//pkg/security", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/resolver", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/gcjob", + "//pkg/sql/lex", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/util", + "//pkg/util/bufalloc", + "//pkg/util/ctxgroup", + "//pkg/util/encoding/csv", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//pkg/workload", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/linkedin/goavro/v2:goavro", + "//vendor/vitess.io/vitess/go/sqltypes", + "//vendor/vitess.io/vitess/go/vt/sqlparser", + ], +) + +go_test( + name = "importccl_test", + srcs = [ + "bench_test.go", + "client_import_test.go", + "csv_internal_test.go", + "csv_testdata_helpers_test.go", + "exportcsv_test.go", + "import_into_test.go", + "import_processor_test.go", + "import_stmt_test.go", + "main_test.go", + "mysql_testdata_helpers_test.go", + "pg_testdata_helpers_test.go", + "read_import_avro_test.go", + "read_import_base_test.go", + "read_import_mysql_test.go", + "read_import_pgdump_test.go", + "testutils_test.go", + ], + data = glob(["testdata/**"]), + embed = [":importccl"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/ccl/backupccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/ccl/workloadccl/format", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/distsql", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/gcjob", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/stats", + "//pkg/sql/tests", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/testutils", + "//pkg/testutils/jobutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/ctxgroup", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/bank", + "//pkg/workload/tpcc", + "//pkg/workload/workloadsql", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/go-sql-driver/mysql", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/linkedin/goavro/v2:goavro", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/vitess.io/vitess/go/vt/sqlparser", + ], +) diff --git a/pkg/ccl/kvccl/BUILD.bazel b/pkg/ccl/kvccl/BUILD.bazel new file mode 100644 index 000000000000..e171d5073751 --- /dev/null +++ b/pkg/ccl/kvccl/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvccl", + srcs = ["kvccl.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/kvccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/kvccl/kvfollowerreadsccl", + "//pkg/ccl/kvccl/kvtenantccl", + ], +) diff --git a/pkg/ccl/kvccl/kvfollowerreadsccl/BUILD.bazel b/pkg/ccl/kvccl/kvfollowerreadsccl/BUILD.bazel new file mode 100644 index 000000000000..a4e9aa31e4f9 --- /dev/null +++ b/pkg/ccl/kvccl/kvfollowerreadsccl/BUILD.bazel @@ -0,0 +1,67 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvfollowerreadsccl", + srcs = ["followerreads.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvfollowerreadsccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/ccl/utilccl", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/closedts", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/physicalplan/replicaoracle", + "//pkg/sql/sem/builtins", + "//pkg/util/hlc", + "//pkg/util/timeutil", + "//pkg/util/uuid", + ], +) + +go_test( + name = "kvfollowerreadsccl_test", + srcs = [ + "followerreads_test.go", + "main_test.go", + ], + embed = [":kvfollowerreadsccl"], + deps = [ + "//pkg/base", + "//pkg/ccl/utilccl", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/physicalplan/replicaoracle", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/kvccl/kvtenantccl/BUILD.bazel b/pkg/ccl/kvccl/kvtenantccl/BUILD.bazel new file mode 100644 index 000000000000..6eb91bc47d85 --- /dev/null +++ b/pkg/ccl/kvccl/kvtenantccl/BUILD.bazel @@ -0,0 +1,53 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvtenantccl", + srcs = ["connector.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/kvccl/kvtenantccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvclient/kvtenant", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/util/contextutil", + "//pkg/util/grpcutil", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "kvtenantccl_test", + srcs = ["connector_test.go"], + embed = [":kvtenantccl"], + deps = [ + "//pkg/config", + "//pkg/gossip", + "//pkg/kv/kvclient/kvtenant", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/testutils", + "//pkg/util", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/tracing", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/logictestccl/BUILD.bazel b/pkg/ccl/logictestccl/BUILD.bazel new file mode 100644 index 000000000000..ece184a35ed7 --- /dev/null +++ b/pkg/ccl/logictestccl/BUILD.bazel @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "logictestccl", + srcs = ["doc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/logictestccl", + visibility = ["//visibility:public"], +) + +go_test( + name = "logictestccl_test", + srcs = [ + "logic_test.go", + "main_test.go", + ], + data = glob(["testdata/**"]), + embed = [":logictestccl"], + deps = [ + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/logictest", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/ccl/oidcccl/BUILD.bazel b/pkg/ccl/oidcccl/BUILD.bazel new file mode 100644 index 000000000000..46258664bc85 --- /dev/null +++ b/pkg/ccl/oidcccl/BUILD.bazel @@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "oidcccl", + srcs = [ + "authentication_oidc.go", + "settings.go", + "state.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/oidcccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/utilccl", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/ui", + "//pkg/util/cache", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/coreos/go-oidc", + "//vendor/golang.org/x/oauth2", + ], +) + +go_test( + name = "oidcccl_test", + srcs = ["authentication_oidc_test.go"], + embed = [":oidcccl"], + deps = [ + "//pkg/base", + "//pkg/ccl/utilccl", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + ], +) diff --git a/pkg/ccl/partitionccl/BUILD.bazel b/pkg/ccl/partitionccl/BUILD.bazel new file mode 100644 index 000000000000..d77f26c0c11a --- /dev/null +++ b/pkg/ccl/partitionccl/BUILD.bazel @@ -0,0 +1,77 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "partitionccl", + srcs = ["partition.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/partitionccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/utilccl", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "partitionccl_test", + srcs = [ + "drop_test.go", + "main_test.go", + "partition_test.go", + "zone_test.go", + ], + embed = [":partitionccl"], + deps = [ + "//pkg/base", + "//pkg/ccl/importccl", + "//pkg/ccl/storageccl", + "//pkg/ccl/utilccl", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/gcjob", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/tests", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/ccl/serverccl/BUILD.bazel b/pkg/ccl/serverccl/BUILD.bazel new file mode 100644 index 000000000000..03c046c0080c --- /dev/null +++ b/pkg/ccl/serverccl/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "serverccl", + srcs = ["doc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/serverccl", + visibility = ["//visibility:public"], +) + +go_test( + name = "serverccl_test", + srcs = [ + "admin_test.go", + "main_test.go", + "role_authentication_test.go", + "server_sql_test.go", + ], + embed = [":serverccl"], + deps = [ + "//pkg/base", + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/sql", + "//pkg/sql/pgwire/pgcode", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/httputil", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/lib/pq", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/crypto/bcrypt", + ], +) diff --git a/pkg/ccl/sqlproxyccl/BUILD.bazel b/pkg/ccl/sqlproxyccl/BUILD.bazel new file mode 100644 index 000000000000..89c1f78b24a8 --- /dev/null +++ b/pkg/ccl/sqlproxyccl/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sqlproxyccl", + srcs = [ + "error.go", + "errorcode_string.go", + "metrics.go", + "proxy.go", + "server.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/sqlproxyccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/contextutil", + "//pkg/util/httputil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgproto3/v2:pgproto3", + ], +) + +go_test( + name = "sqlproxyccl_test", + srcs = [ + "proxy_test.go", + "server_test.go", + ], + embed = [":sqlproxyccl"], + deps = [ + "//pkg/testutils/skip", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgx/v4:pgx", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/storageccl/BUILD.bazel b/pkg/ccl/storageccl/BUILD.bazel new file mode 100644 index 000000000000..e3cadc793c81 --- /dev/null +++ b/pkg/ccl/storageccl/BUILD.bazel @@ -0,0 +1,89 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storageccl", + srcs = [ + "encryption.go", + "export.go", + "import.go", + "key_rewriter.go", + "revision_reader.go", + "writebatch.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/storageccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/ccl/storageccl/engineccl", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/bulk", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/batcheval", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/spanset", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/builtins", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/enginepb", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/iterutil", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/crypto/pbkdf2", + ], +) + +go_test( + name = "storageccl_test", + srcs = [ + "encryption_test.go", + "export_test.go", + "import_test.go", + "key_rewriter_test.go", + "main_test.go", + "writebatch_test.go", + ], + embed = [":storageccl"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/batcheval", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/rowenc", + "//pkg/storage", + "//pkg/storage/cloudimpl", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/leaktest", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/storageccl/engineccl/BUILD.bazel b/pkg/ccl/storageccl/engineccl/BUILD.bazel new file mode 100644 index 000000000000..326d0ace8a0d --- /dev/null +++ b/pkg/ccl/storageccl/engineccl/BUILD.bazel @@ -0,0 +1,64 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "engineccl", + srcs = [ + "batch_repr.go", + "ctr_stream.go", + "encrypted_fs.go", + "pebble_key_manager.go", + ], + cdeps = [], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/storageccl/engineccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/baseccl", + "//pkg/ccl/storageccl/engineccl/enginepbccl", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble/vfs", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "engineccl_test", + srcs = [ + "batch_repr_test.go", + "bench_test.go", + "ctr_stream_test.go", + "encrypted_fs_test.go", + "main_test.go", + "pebble_key_manager_test.go", + ], + data = glob(["testdata/**"]), + embed = [":engineccl"], + deps = [ + "//pkg/base", + "//pkg/ccl/baseccl", + "//pkg/ccl/storageccl/engineccl/enginepbccl", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/pebble/vfs", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/storageccl/engineccl/enginepbccl/BUILD.bazel b/pkg/ccl/storageccl/engineccl/enginepbccl/BUILD.bazel new file mode 100644 index 000000000000..d9bd2220cc6c --- /dev/null +++ b/pkg/ccl/storageccl/engineccl/enginepbccl/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "enginepbccl", + srcs = [ + "key_registry.pb.go", + "stats.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/storageccl/engineccl/enginepbccl", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) diff --git a/pkg/ccl/utilccl/BUILD.bazel b/pkg/ccl/utilccl/BUILD.bazel new file mode 100644 index 000000000000..edf06046d60f --- /dev/null +++ b/pkg/ccl/utilccl/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utilccl", + srcs = [ + "jobutils.go", + "license_check.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/utilccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/ccl/utilccl/licenseccl", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/types", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + ], +) + +go_test( + name = "utilccl_test", + srcs = [ + "license_check_test.go", + "license_test.go", + ], + embed = [":utilccl"], + deps = [ + "//pkg/ccl/utilccl/licenseccl", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/timeutil", + "//pkg/util/uuid", + ], +) diff --git a/pkg/ccl/utilccl/licenseccl/BUILD.bazel b/pkg/ccl/utilccl/licenseccl/BUILD.bazel new file mode 100644 index 000000000000..d0fa076d6b69 --- /dev/null +++ b/pkg/ccl/utilccl/licenseccl/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "licenseccl", + srcs = [ + "license.go", + "license.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/utilccl/licenseccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/protoutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/ccl/utilccl/sampledataccl/BUILD.bazel b/pkg/ccl/utilccl/sampledataccl/BUILD.bazel new file mode 100644 index 000000000000..cec3caac2aa1 --- /dev/null +++ b/pkg/ccl/utilccl/sampledataccl/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sampledataccl", + srcs = ["bankdata.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/utilccl/sampledataccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/testutils/serverutils", + "//pkg/workload", + "//pkg/workload/workloadsql", + ], +) + +go_test( + name = "sampledataccl_test", + srcs = ["main_test.go"], + embed = [":sampledataccl"], + deps = [ + "//pkg/ccl/utilccl", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/randutil", + ], +) diff --git a/pkg/ccl/workloadccl/BUILD.bazel b/pkg/ccl/workloadccl/BUILD.bazel new file mode 100644 index 000000000000..6aa73a8b4fa8 --- /dev/null +++ b/pkg/ccl/workloadccl/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workloadccl", + srcs = ["fixture.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/workloadccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/ctxgroup", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/timeutil", + "//pkg/workload", + "//vendor/cloud.google.com/go/storage", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/google.golang.org/api/iterator", + ], +) + +go_test( + name = "workloadccl_test", + srcs = [ + "bench_test.go", + "fixture_test.go", + "main_test.go", + ], + embed = [":workloadccl"], + deps = [ + "//pkg/base", + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/stats", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/tpcc", + "//vendor/cloud.google.com/go/storage", + "//vendor/github.com/spf13/pflag", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/oauth2/google", + "//vendor/google.golang.org/api/option", + ], +) diff --git a/pkg/ccl/workloadccl/allccl/BUILD.bazel b/pkg/ccl/workloadccl/allccl/BUILD.bazel new file mode 100644 index 000000000000..98c8c069e31d --- /dev/null +++ b/pkg/ccl/workloadccl/allccl/BUILD.bazel @@ -0,0 +1,67 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "allccl", + srcs = ["all.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/workloadccl/allccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/workloadccl/roachmartccl", + "//pkg/workload/bank", + "//pkg/workload/bulkingest", + "//pkg/workload/debug", + "//pkg/workload/examples", + "//pkg/workload/geospatial", + "//pkg/workload/indexes", + "//pkg/workload/interleavebench", + "//pkg/workload/interleavedpartitioned", + "//pkg/workload/jsonload", + "//pkg/workload/kv", + "//pkg/workload/ledger", + "//pkg/workload/movr", + "//pkg/workload/querybench", + "//pkg/workload/querylog", + "//pkg/workload/queue", + "//pkg/workload/rand", + "//pkg/workload/schemachange", + "//pkg/workload/sqlsmith", + "//pkg/workload/tpcc", + "//pkg/workload/tpccchecks", + "//pkg/workload/tpcds", + "//pkg/workload/tpch", + "//pkg/workload/ycsb", + ], +) + +go_test( + name = "allccl_test", + srcs = [ + "all_test.go", + "main_test.go", + ], + embed = [":allccl"], + deps = [ + "//pkg/base", + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/ccl/workloadccl", + "//pkg/col/coldata", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/types", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/bufalloc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/workload", + "//pkg/workload/workloadsql", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/ccl/workloadccl/cliccl/BUILD.bazel b/pkg/ccl/workloadccl/cliccl/BUILD.bazel new file mode 100644 index 000000000000..c663b9e6d4db --- /dev/null +++ b/pkg/ccl/workloadccl/cliccl/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cliccl", + srcs = ["fixtures.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/workloadccl/cliccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/workloadccl", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/cli", + "//pkg/workload/workloadsql", + "//vendor/cloud.google.com/go/storage", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/spf13/pflag", + "//vendor/google.golang.org/api/option", + ], +) diff --git a/pkg/ccl/workloadccl/format/BUILD.bazel b/pkg/ccl/workloadccl/format/BUILD.bazel new file mode 100644 index 000000000000..a8b266ea8bc0 --- /dev/null +++ b/pkg/ccl/workloadccl/format/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "format", + srcs = ["sstable.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/workloadccl/format", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ccl/importccl", + "//pkg/keys", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/parser", + "//pkg/sql/row", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/storage", + "//pkg/util/ctxgroup", + "//pkg/util/hlc", + "//pkg/workload", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/ccl/workloadccl/roachmartccl/BUILD.bazel b/pkg/ccl/workloadccl/roachmartccl/BUILD.bazel new file mode 100644 index 000000000000..6375c29d8425 --- /dev/null +++ b/pkg/ccl/workloadccl/roachmartccl/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "roachmartccl", + srcs = ["roachmart.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ccl/workloadccl/roachmartccl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/cli/BUILD.bazel b/pkg/cli/BUILD.bazel new file mode 100644 index 000000000000..84e40a4f16df --- /dev/null +++ b/pkg/cli/BUILD.bazel @@ -0,0 +1,340 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cli", + srcs = [ + "auth.go", + "cert.go", + "cli.go", + "client_url.go", + "context.go", + "cpuprofile.go", + "debug.go", + "debug_check_store.go", + "debug_merge_logs.go", + "debug_synctest.go", + "decode.go", + "demo.go", + "demo_cluster.go", + "demo_telemetry.go", + "doctor.go", + "dump.go", + "error.go", + "examples.go", + "flags.go", + "flags_util.go", + "format_table.go", + "gen.go", + "haproxy.go", + "import.go", + "init.go", + "initial_sql.go", + "keytype_string.go", + "mt.go", + "mt_cert.go", + "mt_start_sql.go", + "node.go", + "nodelocal.go", + "quit.go", + "sql.go", + "sql_util.go", + "sqlfmt.go", + "start.go", + "start_jemalloc.go", + "start_unix.go", + "start_windows.go", + "statement_diag.go", + "systembench.go", + "testutils.go", + "tsdump.go", + "userfile.go", + "zip.go", + ], + # keep + cdeps = [ + "@cockroach//:libjemalloc", + ], + cgo = True, + # keep + clinkopts = select({ + "@io_bazel_rules_go//go/platform:android": [ + "-lrt -lm -lpthread", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "-lrt -lm -lpthread", + ], + "//conditions:default": [], + }), + # keep + cppopts = [ + "-DJEMALLOC_NO_DEMANGLE", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cli", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/cli/cliflags", + "//pkg/cli/syncbench", + "//pkg/cli/systembench", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/docs", + "//pkg/geo/geos", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/gc", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/rditer", + "//pkg/kv/kvserver/stateloader", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/server", + "//pkg/server/debug", + "//pkg/server/dumpstore", + "//pkg/server/heapprofiler", + "//pkg/server/serverpb", + "//pkg/server/status", + "//pkg/server/status/statuspb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/doctor", + "//pkg/sql/execinfrapb", + "//pkg/sql/lex", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/protoreflect", + "//pkg/sql/row", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/types", + "//pkg/sqlmigrations", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/storage/enginepb", + "//pkg/ts/tspb", + "//pkg/util", + "//pkg/util/contextutil", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/encoding/csv", + "//pkg/util/envutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/flagutil", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/iterutil", + "//pkg/util/keysutil", + "//pkg/util/log", + "//pkg/util/log/logflags", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/sdnotify", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//pkg/util/version", + "//pkg/workload", + "//pkg/workload/bank", + "//pkg/workload/bulkingest", + "//pkg/workload/cli", + "//pkg/workload/examples", + "//pkg/workload/histogram", + "//pkg/workload/kv", + "//pkg/workload/movr", + "//pkg/workload/tpcc", + "//pkg/workload/tpch", + "//pkg/workload/workloadsql", + "//pkg/workload/ycsb", + "//vendor/github.com/benesch/cgosymbolizer", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/pebble/tool", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/elastic/gosigar", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/knz/go-libedit", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/lib/pq/auth/kerberos", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/mattn/go-isatty", + "//vendor/github.com/olekukonko/tablewriter", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/spf13/cobra/doc", + "//vendor/github.com/spf13/pflag", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/golang.org/x/time/rate", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/status", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "cli_test", + srcs = [ + "cli_debug_test.go", + "cli_test.go", + "debug_check_store_test.go", + "debug_merge_logs_test.go", + "debug_test.go", + "decode_test.go", + "demo_locality_test.go", + "demo_test.go", + "doctor_test.go", + "dump_test.go", + "error_test.go", + "flags_test.go", + "haproxy_test.go", + "import_test.go", + "main_test.go", + "nodelocal_test.go", + "sql_test.go", + "sql_util_test.go", + "start_test.go", + "statement_diag_test.go", + "userfiletable_test.go", + "zip_test.go", + ], + data = glob(["testdata/**"]), + embed = [":cli"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/cli/cliflags", + "//pkg/gossip", + "//pkg/gossip/resolver", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/stateloader", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/server/status", + "//pkg/server/status/statuspb", + "//pkg/sql", + "//pkg/sql/catalog/descpb", + "//pkg/sql/lex", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/protoreflect", + "//pkg/sql/sem/tree", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/ipaddr", + "//pkg/util/json", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/log/logflags", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/util/uuid", + "//pkg/workload/examples", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/lib/pq", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/spf13/pflag", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/cli/cliflags/BUILD.bazel b/pkg/cli/cliflags/BUILD.bazel new file mode 100644 index 000000000000..a674dced3e41 --- /dev/null +++ b/pkg/cli/cliflags/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cliflags", + srcs = [ + "flags.go", + "flags_mt.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cli/cliflags", + visibility = ["//visibility:public"], + deps = [ + "//pkg/docs", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/kr/text", + ], +) diff --git a/pkg/cli/syncbench/BUILD.bazel b/pkg/cli/syncbench/BUILD.bazel new file mode 100644 index 000000000000..ede19346d8de --- /dev/null +++ b/pkg/cli/syncbench/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "syncbench", + srcs = ["syncbench.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cli/syncbench", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/codahale/hdrhistogram", + ], +) diff --git a/pkg/cli/systembench/BUILD.bazel b/pkg/cli/systembench/BUILD.bazel new file mode 100644 index 000000000000..505f1d7d6c01 --- /dev/null +++ b/pkg/cli/systembench/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "systembench", + srcs = [ + "cpu_bench.go", + "disk_bench.go", + "network_test_client.go", + "network_test_common.go", + "network_test_server.go", + "systembench_common.go", + "tests.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cli/systembench", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cli/systembench/systembenchpb", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/codahale/hdrhistogram", + "//vendor/github.com/dustin/go-humanize", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/cli/systembench/systembenchpb/BUILD.bazel b/pkg/cli/systembench/systembenchpb/BUILD.bazel new file mode 100644 index 000000000000..72c3e4a12cf9 --- /dev/null +++ b/pkg/cli/systembench/systembenchpb/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "systembenchpb", + srcs = ["ping.pb.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cli/systembench/systembenchpb", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/clusterversion/BUILD.bazel b/pkg/clusterversion/BUILD.bazel new file mode 100644 index 000000000000..dc4fa76da9e0 --- /dev/null +++ b/pkg/clusterversion/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "clusterversion", + srcs = [ + "cluster_version.pb.go", + "clusterversion.go", + "cockroach_versions.go", + "keyed_versions.go", + "setting.go", + "testutils.go", + "versionkey_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/clusterversion", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/kr/pretty", + ], +) + +go_test( + name = "clusterversion_test", + srcs = ["cockroach_versions_test.go"], + embed = [":clusterversion"], + deps = [ + "//pkg/roachpb", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/cmd/allocsim/BUILD.bazel b/pkg/cmd/allocsim/BUILD.bazel new file mode 100644 index 000000000000..bea6a665d8c4 --- /dev/null +++ b/pkg/cmd/allocsim/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "allocsim_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/allocsim", + visibility = ["//visibility:private"], + deps = [ + "//pkg/acceptance/localcluster", + "//pkg/acceptance/localcluster/tc", + "//pkg/cli", + "//pkg/kv/kvserver", + "//pkg/server/serverpb", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "allocsim", + embed = [":allocsim_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cmdutil/BUILD.bazel b/pkg/cmd/cmdutil/BUILD.bazel new file mode 100644 index 000000000000..24b0cf7b41c2 --- /dev/null +++ b/pkg/cmd/cmdutil/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cmdutil", + srcs = ["env.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cmdutil", + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cmp-protocol/BUILD.bazel b/pkg/cmd/cmp-protocol/BUILD.bazel new file mode 100644 index 000000000000..ce85f13a9619 --- /dev/null +++ b/pkg/cmd/cmp-protocol/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cmp-protocol_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cmp-protocol", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cmp-protocol/pgconnect", + "//pkg/sql/pgwire/pgwirebase", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "cmp-protocol", + embed = [":cmp-protocol_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cmp-protocol/pgconnect/BUILD.bazel b/pkg/cmd/cmp-protocol/pgconnect/BUILD.bazel new file mode 100644 index 000000000000..fee29dda0051 --- /dev/null +++ b/pkg/cmd/cmp-protocol/pgconnect/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgconnect", + srcs = ["pgconnect.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cmp-protocol/pgconnect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgwirebase", + "//pkg/util/ctxgroup", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgproto3/v2:pgproto3", + ], +) diff --git a/pkg/cmd/cmp-sql/BUILD.bazel b/pkg/cmd/cmp-sql/BUILD.bazel new file mode 100644 index 000000000000..4fbe2b2bfd87 --- /dev/null +++ b/pkg/cmd/cmp-sql/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cmp-sql_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cmp-sql", + visibility = ["//visibility:private"], + deps = [ + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/jackc/pgx/pgtype", + ], +) + +go_binary( + name = "cmp-sql", + embed = [":cmp-sql_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cmpconn/BUILD.bazel b/pkg/cmd/cmpconn/BUILD.bazel new file mode 100644 index 000000000000..d5808081b180 --- /dev/null +++ b/pkg/cmd/cmpconn/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cmpconn", + srcs = [ + "compare.go", + "conn.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cmpconn", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/mutations", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/util/duration", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-cmp/cmp", + "//vendor/github.com/google/go-cmp/cmp/cmpopts", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/jackc/pgx/pgtype", + "//vendor/github.com/lib/pq", + ], +) + +go_test( + name = "cmpconn_test", + srcs = ["compare_test.go"], + embed = [":cmpconn"], + deps = ["//vendor/github.com/cockroachdb/apd/v2:apd"], +) diff --git a/pkg/cmd/cockroach-oss/BUILD.bazel b/pkg/cmd/cockroach-oss/BUILD.bazel new file mode 100644 index 000000000000..9cc1464f5965 --- /dev/null +++ b/pkg/cmd/cockroach-oss/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "cockroach-oss_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cockroach-oss", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cli", + "//pkg/ui/distoss", + ], +) + +go_binary( + name = "cockroach-oss", + embed = [":cockroach-oss_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "cockroach-oss_test", + srcs = ["dep_test.go"], + embed = [":cockroach-oss_lib"], + deps = [ + "//pkg/testutils/buildutil", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/cmd/cockroach-short/BUILD.bazel b/pkg/cmd/cockroach-short/BUILD.bazel new file mode 100644 index 000000000000..919d53a63866 --- /dev/null +++ b/pkg/cmd/cockroach-short/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cockroach-short_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cockroach-short", + visibility = ["//visibility:private"], + deps = [ + "//pkg/ccl", + "//pkg/cli", + ], +) + +go_binary( + name = "cockroach-short", + embed = [":cockroach-short_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cockroach/BUILD.bazel b/pkg/cmd/cockroach/BUILD.bazel new file mode 100644 index 000000000000..6e55b9231504 --- /dev/null +++ b/pkg/cmd/cockroach/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cockroach_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cockroach", + visibility = ["//visibility:private"], + deps = [ + "//pkg/ccl", + "//pkg/ccl/cliccl", + "//pkg/cli", + "//pkg/ui/distccl", + ], +) + +go_binary( + name = "cockroach", + embed = [":cockroach_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/compile-build/BUILD.bazel b/pkg/cmd/compile-build/BUILD.bazel new file mode 100644 index 000000000000..e4c288747015 --- /dev/null +++ b/pkg/cmd/compile-build/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "compile-build_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/compile-build", + visibility = ["//visibility:private"], + deps = ["//pkg/release"], +) + +go_binary( + name = "compile-build", + embed = [":compile-build_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cr2pg/BUILD.bazel b/pkg/cmd/cr2pg/BUILD.bazel new file mode 100644 index 000000000000..5aabbd7a35ec --- /dev/null +++ b/pkg/cmd/cr2pg/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cr2pg_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cr2pg", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cr2pg/sqlstream", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_binary( + name = "cr2pg", + embed = [":cr2pg_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/cr2pg/sqlstream/BUILD.bazel b/pkg/cmd/cr2pg/sqlstream/BUILD.bazel new file mode 100644 index 000000000000..89d6d509076c --- /dev/null +++ b/pkg/cmd/cr2pg/sqlstream/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqlstream", + srcs = ["stream.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/cr2pg/sqlstream", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/parser", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/cmd/docgen/BUILD.bazel b/pkg/cmd/docgen/BUILD.bazel new file mode 100644 index 000000000000..f6d94f8900ac --- /dev/null +++ b/pkg/cmd/docgen/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "docgen_lib", + srcs = [ + "diagrams.go", + "funcs.go", + "http.go", + "main.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/docgen", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/docgen/extract", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/util/envutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang-commonmark/markdown", + "//vendor/github.com/spf13/cobra", + ], +) + +go_binary( + name = "docgen", + embed = [":docgen_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/docgen/extract/BUILD.bazel b/pkg/cmd/docgen/extract/BUILD.bazel new file mode 100644 index 000000000000..9009f5a79cd5 --- /dev/null +++ b/pkg/cmd/docgen/extract/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "extract", + srcs = [ + "extract.go", + "xhtml.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/docgen/extract", + visibility = ["//visibility:public"], + deps = [ + "//pkg/internal/rsg/yacc", + "//pkg/util/httputil", + "//pkg/util/syncutil", + "//vendor/github.com/PuerkitoBio/goquery", + "//vendor/golang.org/x/net/html", + ], +) + +go_test( + name = "extract_test", + srcs = ["extract_test.go"], + embed = [":extract"], +) diff --git a/pkg/cmd/fuzz/BUILD.bazel b/pkg/cmd/fuzz/BUILD.bazel new file mode 100644 index 000000000000..724d1e810e90 --- /dev/null +++ b/pkg/cmd/fuzz/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "fuzz_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/fuzz", + visibility = ["//visibility:private"], + deps = ["//vendor/golang.org/x/tools/go/packages"], +) + +go_binary( + name = "fuzz", + embed = [":fuzz_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/generate-binary/BUILD.bazel b/pkg/cmd/generate-binary/BUILD.bazel new file mode 100644 index 000000000000..9d87e6731271 --- /dev/null +++ b/pkg/cmd/generate-binary/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "generate-binary_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/generate-binary", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cmp-protocol/pgconnect", + "//pkg/sql/pgwire/pgwirebase", + ], +) + +go_binary( + name = "generate-binary", + embed = [":generate-binary_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/generate-spatial-ref-sys/BUILD.bazel b/pkg/cmd/generate-spatial-ref-sys/BUILD.bazel new file mode 100644 index 000000000000..c325d2a31328 --- /dev/null +++ b/pkg/cmd/generate-spatial-ref-sys/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "generate-spatial-ref-sys_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/generate-spatial-ref-sys", + visibility = ["//visibility:private"], + deps = [ + "//pkg/geo/geoproj", + "//pkg/geo/geoprojbase", + "//pkg/util/ctxgroup", + "//pkg/util/httputil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + ], +) + +go_binary( + name = "generate-spatial-ref-sys", + embed = [":generate-spatial-ref-sys_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/geoviz/BUILD.bazel b/pkg/cmd/geoviz/BUILD.bazel new file mode 100644 index 000000000000..fcae92909faf --- /dev/null +++ b/pkg/cmd/geoviz/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "geoviz_lib", + srcs = [ + "geoviz.go", + "main.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/geoviz", + visibility = ["//visibility:private"], + deps = [ + "//pkg/geo", + "//pkg/geo/geoindex", + "//pkg/geo/geos", + "//vendor/github.com/golang/geo/s2", + ], +) + +go_binary( + name = "geoviz", + embed = [":geoviz_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/github-post/BUILD.bazel b/pkg/cmd/github-post/BUILD.bazel new file mode 100644 index 000000000000..ac468b728ba2 --- /dev/null +++ b/pkg/cmd/github-post/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "github-post_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/github-post", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/internal/issues", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "github-post", + embed = [":github-post_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "github-post_test", + srcs = ["main_test.go"], + data = glob(["testdata/**"]), + embed = [":github-post_lib"], +) diff --git a/pkg/cmd/github-pull-request-make/BUILD.bazel b/pkg/cmd/github-pull-request-make/BUILD.bazel new file mode 100644 index 000000000000..710006ac1fd6 --- /dev/null +++ b/pkg/cmd/github-pull-request-make/BUILD.bazel @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "github-pull-request-make_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/github-pull-request-make", + visibility = ["//visibility:private"], + deps = [ + "//pkg/testutils/buildutil", + "//vendor/github.com/google/go-github/github", + "//vendor/golang.org/x/oauth2", + ], +) + +go_binary( + name = "github-pull-request-make", + embed = [":github-pull-request-make_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "github-pull-request-make_test", + srcs = ["main_test.go"], + data = glob(["testdata/**"]), + embed = [":github-pull-request-make_lib"], + deps = [ + "//pkg/testutils/skip", + "//vendor/github.com/kr/pretty", + ], +) diff --git a/pkg/cmd/gossipsim/BUILD.bazel b/pkg/cmd/gossipsim/BUILD.bazel new file mode 100644 index 000000000000..690864e688b5 --- /dev/null +++ b/pkg/cmd/gossipsim/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "gossipsim_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/gossipsim", + visibility = ["//visibility:private"], + deps = [ + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/gossip/simulation", + "//pkg/roachpb", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/stop", + ], +) + +go_binary( + name = "gossipsim", + embed = [":gossipsim_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/internal/issues/BUILD.bazel b/pkg/cmd/internal/issues/BUILD.bazel new file mode 100644 index 000000000000..3b670be8161b --- /dev/null +++ b/pkg/cmd/internal/issues/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "issues", + srcs = [ + "condense.go", + "issues.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/internal/issues", + visibility = ["//pkg/cmd:__subpackages__"], + deps = [ + "//pkg/util/version", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-github/github", + "//vendor/golang.org/x/oauth2", + ], +) + +go_test( + name = "issues_test", + srcs = [ + "condense_test.go", + "issues_test.go", + ], + data = glob(["testdata/**"]), + embed = [":issues"], + deps = [ + "//pkg/testutils/skip", + "//vendor/github.com/google/go-github/github", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/cmd/prereqs/BUILD.bazel b/pkg/cmd/prereqs/BUILD.bazel new file mode 100644 index 000000000000..4806342fd3f7 --- /dev/null +++ b/pkg/cmd/prereqs/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "prereqs_lib", + srcs = ["prereqs.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/prereqs", + visibility = ["//visibility:private"], + deps = ["//vendor/golang.org/x/tools/go/packages"], +) + +go_binary( + name = "prereqs", + embed = [":prereqs_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "prereqs_test", + srcs = ["prereqs_test.go"], + data = glob(["testdata/**"]), + embed = [":prereqs_lib"], + deps = ["//pkg/testutils"], +) diff --git a/pkg/cmd/protoc-gen-gogoroach/BUILD.bazel b/pkg/cmd/protoc-gen-gogoroach/BUILD.bazel new file mode 100644 index 000000000000..30b0a304e42e --- /dev/null +++ b/pkg/cmd/protoc-gen-gogoroach/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "protoc-gen-gogoroach_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/protoc-gen-gogoroach", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor", + "//vendor/github.com/gogo/protobuf/vanity", + "//vendor/github.com/gogo/protobuf/vanity/command", + ], +) + +go_binary( + name = "protoc-gen-gogoroach", + embed = [":protoc-gen-gogoroach_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/publish-artifacts/BUILD.bazel b/pkg/cmd/publish-artifacts/BUILD.bazel new file mode 100644 index 000000000000..faa2a2927637 --- /dev/null +++ b/pkg/cmd/publish-artifacts/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "publish-artifacts_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/publish-artifacts", + visibility = ["//visibility:private"], + deps = [ + "//pkg/release", + "//pkg/util/version", + "//vendor/github.com/aws/aws-sdk-go/aws", + "//vendor/github.com/aws/aws-sdk-go/aws/session", + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/kr/pretty", + ], +) + +go_binary( + name = "publish-artifacts", + embed = [":publish-artifacts_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "publish-artifacts_test", + srcs = ["main_test.go"], + embed = [":publish-artifacts_lib"], + deps = [ + "//pkg/testutils/skip", + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/cmd/publish-provisional-artifacts/BUILD.bazel b/pkg/cmd/publish-provisional-artifacts/BUILD.bazel new file mode 100644 index 000000000000..865240078453 --- /dev/null +++ b/pkg/cmd/publish-provisional-artifacts/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "publish-provisional-artifacts_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/publish-provisional-artifacts", + visibility = ["//visibility:private"], + deps = [ + "//pkg/release", + "//pkg/util/version", + "//vendor/github.com/aws/aws-sdk-go/aws", + "//vendor/github.com/aws/aws-sdk-go/aws/session", + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/kr/pretty", + ], +) + +go_binary( + name = "publish-provisional-artifacts", + embed = [":publish-provisional-artifacts_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "publish-provisional-artifacts_test", + srcs = ["main_test.go"], + embed = [":publish-provisional-artifacts_lib"], + deps = [ + "//pkg/release", + "//pkg/testutils", + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/cmd/reduce/BUILD.bazel b/pkg/cmd/reduce/BUILD.bazel new file mode 100644 index 000000000000..157bfad9957d --- /dev/null +++ b/pkg/cmd/reduce/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "reduce_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/reduce", + visibility = ["//visibility:private"], + deps = [ + "//pkg/testutils/reduce", + "//pkg/testutils/reduce/reducesql", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "reduce", + embed = [":reduce_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/returncheck/BUILD.bazel b/pkg/cmd/returncheck/BUILD.bazel new file mode 100644 index 000000000000..533a5177e39b --- /dev/null +++ b/pkg/cmd/returncheck/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "returncheck_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/returncheck", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/cockroachdb/returncheck", + "//vendor/github.com/kisielk/gotool", + ], +) + +go_binary( + name = "returncheck", + embed = [":returncheck_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod-stress/BUILD.bazel b/pkg/cmd/roachprod-stress/BUILD.bazel new file mode 100644 index 000000000000..cb2e98c7c6d3 --- /dev/null +++ b/pkg/cmd/roachprod-stress/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "roachprod-stress_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod-stress", + visibility = ["//visibility:private"], + deps = [ + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "roachprod-stress", + embed = [":roachprod-stress_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod/BUILD.bazel b/pkg/cmd/roachprod/BUILD.bazel new file mode 100644 index 000000000000..bbf181d1cf9d --- /dev/null +++ b/pkg/cmd/roachprod/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "roachprod_lib", + srcs = [ + "hosts.go", + "main.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/roachprod/cloud", + "//pkg/cmd/roachprod/config", + "//pkg/cmd/roachprod/errors", + "//pkg/cmd/roachprod/install", + "//pkg/cmd/roachprod/ssh", + "//pkg/cmd/roachprod/ui", + "//pkg/cmd/roachprod/vm", + "//pkg/cmd/roachprod/vm/aws", + "//pkg/cmd/roachprod/vm/azure", + "//pkg/cmd/roachprod/vm/gce", + "//pkg/cmd/roachprod/vm/local", + "//pkg/util/flagutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + "//vendor/golang.org/x/crypto/ssh/terminal", + "//vendor/golang.org/x/sys/unix", + ], +) + +go_binary( + name = "roachprod", + embed = [":roachprod_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod/cloud/BUILD.bazel b/pkg/cmd/roachprod/cloud/BUILD.bazel new file mode 100644 index 000000000000..f7dd468e2544 --- /dev/null +++ b/pkg/cmd/roachprod/cloud/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cloud", + srcs = [ + "cluster_cloud.go", + "gc.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/cloud", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//pkg/cmd/roachprod/vm", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/nlopes/slack", + ], +) diff --git a/pkg/cmd/roachprod/config/BUILD.bazel b/pkg/cmd/roachprod/config/BUILD.bazel new file mode 100644 index 000000000000..f45cd09d24c7 --- /dev/null +++ b/pkg/cmd/roachprod/config/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "config", + srcs = ["config.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/config", + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod/errors/BUILD.bazel b/pkg/cmd/roachprod/errors/BUILD.bazel new file mode 100644 index 000000000000..92785f352383 --- /dev/null +++ b/pkg/cmd/roachprod/errors/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "errors", + srcs = ["errors.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/errors", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/cmd/roachprod/install/BUILD.bazel b/pkg/cmd/roachprod/install/BUILD.bazel new file mode 100644 index 000000000000..30937abfbbf0 --- /dev/null +++ b/pkg/cmd/roachprod/install/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "install", + srcs = [ + "cassandra.go", + "cassandra_yaml.go", + "cluster_synced.go", + "cockroach.go", + "expander.go", + "install.go", + "iterm2.go", + "nodes.go", + "session.go", + "staging.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/install", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//pkg/cmd/roachprod/errors", + "//pkg/cmd/roachprod/ssh", + "//pkg/cmd/roachprod/ui", + "//pkg/util/envutil", + "//pkg/util/httputil", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/version", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/cmd/roachprod/ssh/BUILD.bazel b/pkg/cmd/roachprod/ssh/BUILD.bazel new file mode 100644 index 000000000000..65e83f0437b4 --- /dev/null +++ b/pkg/cmd/roachprod/ssh/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ssh", + srcs = [ + "shell.go", + "ssh.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/ssh", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/crypto/ssh", + "//vendor/golang.org/x/crypto/ssh/agent", + "//vendor/golang.org/x/crypto/ssh/knownhosts", + ], +) diff --git a/pkg/cmd/roachprod/ui/BUILD.bazel b/pkg/cmd/roachprod/ui/BUILD.bazel new file mode 100644 index 000000000000..525433dc0da8 --- /dev/null +++ b/pkg/cmd/roachprod/ui/BUILD.bazel @@ -0,0 +1,11 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ui", + srcs = [ + "collate_errors.go", + "writer.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/ui", + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod/vm/BUILD.bazel b/pkg/cmd/roachprod/vm/BUILD.bazel new file mode 100644 index 000000000000..e1953f2c7539 --- /dev/null +++ b/pkg/cmd/roachprod/vm/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "vm", + srcs = ["vm.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_test( + name = "vm_test", + srcs = ["vm_test.go"], + embed = [":vm"], + deps = ["//vendor/github.com/stretchr/testify/assert"], +) diff --git a/pkg/cmd/roachprod/vm/aws/BUILD.bazel b/pkg/cmd/roachprod/vm/aws/BUILD.bazel new file mode 100644 index 000000000000..be39dadc9ac0 --- /dev/null +++ b/pkg/cmd/roachprod/vm/aws/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "aws", + srcs = [ + "aws.go", + "config.go", + "embedded.go", + "keys.go", + "support.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/aws", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/vm", + "//pkg/cmd/roachprod/vm/flagstub", + "//pkg/util/retry", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/golang.org/x/time/rate", + ], +) diff --git a/pkg/cmd/roachprod/vm/aws/terraformgen/BUILD.bazel b/pkg/cmd/roachprod/vm/aws/terraformgen/BUILD.bazel new file mode 100644 index 000000000000..1ab1cc7abaab --- /dev/null +++ b/pkg/cmd/roachprod/vm/aws/terraformgen/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "terraformgen_lib", + srcs = ["terraformgen.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/aws/terraformgen", + visibility = ["//visibility:private"], + deps = ["//vendor/github.com/spf13/cobra"], +) + +go_binary( + name = "terraformgen", + embed = [":terraformgen_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/roachprod/vm/azure/BUILD.bazel b/pkg/cmd/roachprod/vm/azure/BUILD.bazel new file mode 100644 index 000000000000..ecb6614a24b2 --- /dev/null +++ b/pkg/cmd/roachprod/vm/azure/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "azure", + srcs = [ + "auth.go", + "azure.go", + "doc.go", + "flags.go", + "ids.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/azure", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/vm", + "//pkg/cmd/roachprod/vm/flagstub", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute", + "//vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network", + "//vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources", + "//vendor/github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/subscriptions", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute", + "//vendor/github.com/Azure/go-autorest/autorest", + "//vendor/github.com/Azure/go-autorest/autorest/azure/auth", + "//vendor/github.com/Azure/go-autorest/autorest/to", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/cmd/roachprod/vm/flagstub/BUILD.bazel b/pkg/cmd/roachprod/vm/flagstub/BUILD.bazel new file mode 100644 index 000000000000..dc24f3ca79e6 --- /dev/null +++ b/pkg/cmd/roachprod/vm/flagstub/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "flagstub", + srcs = ["flagstub.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/flagstub", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/vm", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/cmd/roachprod/vm/gce/BUILD.bazel b/pkg/cmd/roachprod/vm/gce/BUILD.bazel new file mode 100644 index 000000000000..a51eff01d00e --- /dev/null +++ b/pkg/cmd/roachprod/vm/gce/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gce", + srcs = [ + "gcloud.go", + "utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/gce", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//pkg/cmd/roachprod/vm", + "//pkg/cmd/roachprod/vm/flagstub", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/cmd/roachprod/vm/local/BUILD.bazel b/pkg/cmd/roachprod/vm/local/BUILD.bazel new file mode 100644 index 000000000000..37779649a55d --- /dev/null +++ b/pkg/cmd/roachprod/vm/local/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "local", + srcs = ["local.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/vm/local", + visibility = ["//visibility:public"], + deps = [ + "//pkg/cmd/roachprod/config", + "//pkg/cmd/roachprod/install", + "//pkg/cmd/roachprod/vm", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/cmd/roachtest/BUILD.bazel b/pkg/cmd/roachtest/BUILD.bazel new file mode 100644 index 000000000000..5833f1f2fabd --- /dev/null +++ b/pkg/cmd/roachtest/BUILD.bazel @@ -0,0 +1,211 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "roachtest_lib", + srcs = [ + "acceptance.go", + "activerecord.go", + "activerecord_blocklist.go", + "allocator.go", + "alterpk.go", + "autoupgrade.go", + "backup.go", + "bank.go", + "build_info.go", + "canary.go", + "cancel.go", + "cdc.go", + "chaos.go", + "clearrange.go", + "cli.go", + "clock_jump_crash.go", + "clock_monotonic.go", + "clock_util.go", + "cluster.go", + "cluster_init.go", + "copy.go", + "decommission.go", + "disk_full.go", + "disk_stall.go", + "django.go", + "django_blocklist.go", + "drop.go", + "dump.go", + "election.go", + "encryption.go", + "engine_switch.go", + "event_log.go", + "flowable.go", + "follower_reads.go", + "go_helpers.go", + "gopg.go", + "gopg_blocklist.go", + "gossip.go", + "hibernate.go", + "hibernate_blocklist.go", + "hotspotsplits.go", + "import.go", + "inconsistency.go", + "indexes.go", + "interleavedpartitioned.go", + "inverted_index.go", + "java_helpers.go", + "jepsen.go", + "kv.go", + "kvbench.go", + "ledger.go", + "libpq.go", + "libpq_blocklist.go", + "log.go", + "main.go", + "many_splits.go", + "mixed_version_decommission.go", + "mixed_version_jobs.go", + "mixed_version_join_init.go", + "mixed_version_schemachange.go", + "multitenant.go", + "namespace_upgrade.go", + "network.go", + "orm_helpers.go", + "overload_tpcc_olap.go", + "pebble.go", + "pgjdbc.go", + "pgjdbc_blocklist.go", + "pgx.go", + "pgx_blocklist.go", + "psycopg.go", + "psycopg_blocklist.go", + "python_helpers.go", + "queue.go", + "quit.go", + "rapid_restart.go", + "rebalance_load.go", + "registry.go", + "replicagc.go", + "restart.go", + "restore.go", + "roachmart.go", + "scaledata.go", + "schema_change_database_version_upgrade.go", + "schemachange.go", + "schemachange_random_load.go", + "scrub.go", + "secondary_indexes.go", + "slack.go", + "split.go", + "sqlalchemy.go", + "sqlalchemy_blocklist.go", + "sqlsmith.go", + "status_server.go", + "synctest.go", + "sysbench.go", + "test.go", + "test_registry.go", + "test_runner.go", + "toxiproxy.go", + "tpc_utils.go", + "tpcc.go", + "tpcdsvec.go", + "tpchbench.go", + "tpchvec.go", + "ts_util.go", + "typeorm.go", + "version.go", + "versionupgrade.go", + "work_pool.go", + "ycsb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachtest", + visibility = ["//visibility:private"], + deps = [ + "//pkg/base", + "//pkg/ccl/changefeedccl/cdctest", + "//pkg/cmd/cmpconn", + "//pkg/cmd/internal/issues", + "//pkg/gossip", + "//pkg/internal/sqlsmith", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/storage/cloudimpl", + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/ts/tspb", + "//pkg/util", + "//pkg/util/binfetcher", + "//pkg/util/contextutil", + "//pkg/util/ctxgroup", + "//pkg/util/httputil", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/quotapool", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/search", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//pkg/util/version", + "//pkg/workload/histogram", + "//pkg/workload/querybench", + "//pkg/workload/tpcc", + "//pkg/workload/tpcds", + "//pkg/workload/tpch", + "//vendor/github.com/Shopify/sarama", + "//vendor/github.com/Shopify/toxiproxy/client", + "//vendor/github.com/armon/circbuf", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/ttycolor", + "//vendor/github.com/codahale/hdrhistogram", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/nlopes/slack", + "//vendor/github.com/petermattis/goid", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/exp/rand", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_binary( + name = "roachtest", + embed = [":roachtest_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "roachtest_test", + srcs = [ + "blocklist_test.go", + "cluster_test.go", + "test_test.go", + "tpcc_test.go", + ], + embed = [":roachtest_lib"], + deps = [ + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/version", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-github/github", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/oauth2", + ], +) diff --git a/pkg/cmd/roachvet/BUILD.bazel b/pkg/cmd/roachvet/BUILD.bazel new file mode 100644 index 000000000000..aea34522f613 --- /dev/null +++ b/pkg/cmd/roachvet/BUILD.bazel @@ -0,0 +1,48 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "roachvet_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/roachvet", + visibility = ["//visibility:private"], + deps = [ + "//pkg/testutils/lint/passes/descriptormarshal", + "//pkg/testutils/lint/passes/errcmp", + "//pkg/testutils/lint/passes/fmtsafe", + "//pkg/testutils/lint/passes/hash", + "//pkg/testutils/lint/passes/nocopy", + "//pkg/testutils/lint/passes/returnerrcheck", + "//pkg/testutils/lint/passes/timer", + "//pkg/testutils/lint/passes/unconvert", + "//vendor/golang.org/x/tools/go/analysis/passes/asmdecl", + "//vendor/golang.org/x/tools/go/analysis/passes/assign", + "//vendor/golang.org/x/tools/go/analysis/passes/atomic", + "//vendor/golang.org/x/tools/go/analysis/passes/bools", + "//vendor/golang.org/x/tools/go/analysis/passes/buildtag", + "//vendor/golang.org/x/tools/go/analysis/passes/cgocall", + "//vendor/golang.org/x/tools/go/analysis/passes/composite", + "//vendor/golang.org/x/tools/go/analysis/passes/copylock", + "//vendor/golang.org/x/tools/go/analysis/passes/errorsas", + "//vendor/golang.org/x/tools/go/analysis/passes/httpresponse", + "//vendor/golang.org/x/tools/go/analysis/passes/loopclosure", + "//vendor/golang.org/x/tools/go/analysis/passes/lostcancel", + "//vendor/golang.org/x/tools/go/analysis/passes/nilfunc", + "//vendor/golang.org/x/tools/go/analysis/passes/printf", + "//vendor/golang.org/x/tools/go/analysis/passes/shadow", + "//vendor/golang.org/x/tools/go/analysis/passes/shift", + "//vendor/golang.org/x/tools/go/analysis/passes/stdmethods", + "//vendor/golang.org/x/tools/go/analysis/passes/structtag", + "//vendor/golang.org/x/tools/go/analysis/passes/tests", + "//vendor/golang.org/x/tools/go/analysis/passes/unmarshal", + "//vendor/golang.org/x/tools/go/analysis/passes/unreachable", + "//vendor/golang.org/x/tools/go/analysis/passes/unsafeptr", + "//vendor/golang.org/x/tools/go/analysis/passes/unusedresult", + "//vendor/golang.org/x/tools/go/analysis/unitchecker", + ], +) + +go_binary( + name = "roachvet", + embed = [":roachvet_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/skip-test/BUILD.bazel b/pkg/cmd/skip-test/BUILD.bazel new file mode 100644 index 000000000000..f7434ee69a00 --- /dev/null +++ b/pkg/cmd/skip-test/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "skip-test_lib", + srcs = [ + "exec.go", + "main.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/skip-test", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-github/github", + "//vendor/golang.org/x/oauth2", + ], +) + +go_binary( + name = "skip-test", + embed = [":skip-test_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/skiperrs/BUILD.bazel b/pkg/cmd/skiperrs/BUILD.bazel new file mode 100644 index 000000000000..eed9e24dc75f --- /dev/null +++ b/pkg/cmd/skiperrs/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "skiperrs_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/skiperrs", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cr2pg/sqlstream", + "//vendor/github.com/lib/pq", + ], +) + +go_binary( + name = "skiperrs", + embed = [":skiperrs_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/skipped-tests/BUILD.bazel b/pkg/cmd/skipped-tests/BUILD.bazel new file mode 100644 index 000000000000..0d6ee1fe93b8 --- /dev/null +++ b/pkg/cmd/skipped-tests/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "skipped-tests_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/skipped-tests", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/ghemawat/stream", + "//vendor/github.com/nlopes/slack", + ], +) + +go_binary( + name = "skipped-tests", + embed = [":skipped-tests_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/smithcmp/BUILD.bazel b/pkg/cmd/smithcmp/BUILD.bazel new file mode 100644 index 000000000000..f5cae8d69a45 --- /dev/null +++ b/pkg/cmd/smithcmp/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "smithcmp_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/smithcmp", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cmpconn", + "//pkg/internal/sqlsmith", + "//pkg/sql/mutations", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/timeutil", + "//vendor/github.com/BurntSushi/toml", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_binary( + name = "smithcmp", + embed = [":smithcmp_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/smithtest/BUILD.bazel b/pkg/cmd/smithtest/BUILD.bazel new file mode 100644 index 000000000000..1d8d1dacd840 --- /dev/null +++ b/pkg/cmd/smithtest/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "smithtest_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/smithtest", + visibility = ["//visibility:private"], + deps = [ + "//pkg/internal/sqlsmith", + "//pkg/util/ctxgroup", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-github/github", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/lib/pq", + "//vendor/github.com/pkg/browser", + ], +) + +go_binary( + name = "smithtest", + embed = [":smithtest_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/teamcity-trigger/BUILD.bazel b/pkg/cmd/teamcity-trigger/BUILD.bazel new file mode 100644 index 000000000000..d145c8c3d4c3 --- /dev/null +++ b/pkg/cmd/teamcity-trigger/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "teamcity-trigger_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/teamcity-trigger", + visibility = ["//visibility:private"], + deps = [ + "//pkg/cmd/cmdutil", + "//vendor/github.com/abourget/teamcity", + "//vendor/github.com/kisielk/gotool", + ], +) + +go_binary( + name = "teamcity-trigger", + embed = [":teamcity-trigger_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "teamcity-trigger_test", + srcs = ["main_test.go"], + embed = [":teamcity-trigger_lib"], +) diff --git a/pkg/cmd/testfilter/BUILD.bazel b/pkg/cmd/testfilter/BUILD.bazel new file mode 100644 index 000000000000..bed1539e07e7 --- /dev/null +++ b/pkg/cmd/testfilter/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "testfilter_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/testfilter", + visibility = ["//visibility:private"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_binary( + name = "testfilter", + embed = [":testfilter_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "testfilter_test", + srcs = ["main_test.go"], + data = glob(["testdata/**"]), + embed = [":testfilter_lib"], + deps = [ + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/cmd/uptodate/BUILD.bazel b/pkg/cmd/uptodate/BUILD.bazel new file mode 100644 index 000000000000..eb6c28cbffba --- /dev/null +++ b/pkg/cmd/uptodate/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "uptodate_lib", + srcs = ["uptodate.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/uptodate", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/MichaelTJones/walk", + "//vendor/github.com/spf13/pflag", + ], +) + +go_binary( + name = "uptodate", + embed = [":uptodate_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/urlcheck/BUILD.bazel b/pkg/cmd/urlcheck/BUILD.bazel new file mode 100644 index 000000000000..678523f8c6ba --- /dev/null +++ b/pkg/cmd/urlcheck/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "urlcheck_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/urlcheck", + visibility = ["//visibility:private"], + deps = ["//pkg/cmd/urlcheck/lib/urlcheck"], +) + +go_binary( + name = "urlcheck", + embed = [":urlcheck_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/urlcheck/lib/urlcheck/BUILD.bazel b/pkg/cmd/urlcheck/lib/urlcheck/BUILD.bazel new file mode 100644 index 000000000000..c5f0d396480b --- /dev/null +++ b/pkg/cmd/urlcheck/lib/urlcheck/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "urlcheck", + srcs = ["urlcheck.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/urlcheck/lib/urlcheck", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/ghemawat/stream", + ], +) diff --git a/pkg/cmd/whoownsit/BUILD.bazel b/pkg/cmd/whoownsit/BUILD.bazel new file mode 100644 index 000000000000..afada1305006 --- /dev/null +++ b/pkg/cmd/whoownsit/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "whoownsit_lib", + srcs = ["whoownsit.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/whoownsit", + visibility = ["//visibility:private"], + deps = ["//pkg/internal/codeowners"], +) + +go_binary( + name = "whoownsit", + embed = [":whoownsit_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/workload/BUILD.bazel b/pkg/cmd/workload/BUILD.bazel new file mode 100644 index 000000000000..ec759d12fc02 --- /dev/null +++ b/pkg/cmd/workload/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "workload_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/workload", + visibility = ["//visibility:private"], + deps = [ + "//pkg/ccl/workloadccl/allccl", + "//pkg/ccl/workloadccl/cliccl", + "//pkg/workload/cli", + ], +) + +go_binary( + name = "workload", + embed = [":workload_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/wraprules/BUILD.bazel b/pkg/cmd/wraprules/BUILD.bazel new file mode 100644 index 000000000000..63cfb274eca1 --- /dev/null +++ b/pkg/cmd/wraprules/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "wraprules_lib", + srcs = ["wraprules.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/wraprules", + visibility = ["//visibility:private"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +go_binary( + name = "wraprules", + embed = [":wraprules_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/cmd/zerosum/BUILD.bazel b/pkg/cmd/zerosum/BUILD.bazel new file mode 100644 index 000000000000..3b3f889fe237 --- /dev/null +++ b/pkg/cmd/zerosum/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "zerosum_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/cmd/zerosum", + visibility = ["//visibility:private"], + deps = [ + "//pkg/acceptance/cluster", + "//pkg/acceptance/localcluster", + "//pkg/keys", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + ], +) + +go_binary( + name = "zerosum", + embed = [":zerosum_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/col/coldata/BUILD.bazel b/pkg/col/coldata/BUILD.bazel new file mode 100644 index 000000000000..d0c7ed2482dd --- /dev/null +++ b/pkg/col/coldata/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "coldata", + # TODO(irfansharif): The dependency tree for vec.eg.go need fleshing out. + # It's generated using execgen+templates, from another package. + srcs = [ + "batch.go", + "bytes.go", + "datum_vec.go", + "native_types.go", + "nulls.go", + "testutils.go", + "vec.eg.go", # keep + "vec.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/col/coldata", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/typeconv", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/duration", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) + +go_test( + name = "coldata_test", + srcs = [ + "batch_test.go", + "bytes_test.go", + "dep_test.go", + "main_test.go", + "nulls_test.go", + "vec_test.go", + ], + embed = [":coldata"], + deps = [ + "//pkg/col/coldatatestutils", + "//pkg/sql/types", + "//pkg/testutils/buildutil", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/col/coldataext/BUILD.bazel b/pkg/col/coldataext/BUILD.bazel new file mode 100644 index 000000000000..0b2efae3427b --- /dev/null +++ b/pkg/col/coldataext/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "coldataext", + srcs = [ + "datum_vec.go", + "extended_column_factory.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/col/coldataext", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/typeconv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "coldataext_test", + srcs = ["datum_vec_test.go"], + embed = [":coldataext"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/json", + "//pkg/util/leaktest", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/col/coldatatestutils/BUILD.bazel b/pkg/col/coldatatestutils/BUILD.bazel new file mode 100644 index 000000000000..c223b82578e3 --- /dev/null +++ b/pkg/col/coldatatestutils/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "coldatatestutils", + srcs = [ + "random_testutils.go", + "utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/col/coldatatestutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/rowenc", + "//pkg/sql/types", + "//pkg/util/duration", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/col/colserde/BUILD.bazel b/pkg/col/colserde/BUILD.bazel new file mode 100644 index 000000000000..f942aa0d06ed --- /dev/null +++ b/pkg/col/colserde/BUILD.bazel @@ -0,0 +1,61 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colserde", + srcs = [ + "arrowbatchconverter.go", + "file.go", + "record_batch.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/col/colserde", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/colserde/arrowserde", + "//pkg/col/typeconv", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/types", + "//pkg/util/duration", + "//vendor/github.com/apache/arrow/go/arrow", + "//vendor/github.com/apache/arrow/go/arrow/array", + "//vendor/github.com/apache/arrow/go/arrow/memory", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/edsrzf/mmap-go", + "//vendor/github.com/google/flatbuffers/go", + ], +) + +go_test( + name = "colserde_test", + srcs = [ + "arrowbatchconverter_test.go", + "file_test.go", + "main_test.go", + "record_batch_test.go", + ], + deps = [ + ":colserde", + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/coldatatestutils", + "//pkg/col/typeconv", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/rowenc", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/apache/arrow/go/arrow", + "//vendor/github.com/apache/arrow/go/arrow/array", + "//vendor/github.com/apache/arrow/go/arrow/memory", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/col/colserde/arrowserde/BUILD.bazel b/pkg/col/colserde/arrowserde/BUILD.bazel new file mode 100644 index 000000000000..7e98247e58f4 --- /dev/null +++ b/pkg/col/colserde/arrowserde/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "arrowserde", + srcs = [ + "doc.go", + "file_generated.go", + "message_generated.go", + "schema_generated.go", + "tensor_generated.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/col/colserde/arrowserde", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/google/flatbuffers/go"], +) diff --git a/pkg/col/typeconv/BUILD.bazel b/pkg/col/typeconv/BUILD.bazel new file mode 100644 index 000000000000..fab98d241763 --- /dev/null +++ b/pkg/col/typeconv/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "typeconv", + srcs = ["typeconv.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/col/typeconv", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/types", + "//pkg/util/duration", + "//vendor/github.com/cockroachdb/apd/v2:apd", + ], +) diff --git a/pkg/compose/BUILD.bazel b/pkg/compose/BUILD.bazel new file mode 100644 index 000000000000..9c1e48ab551e --- /dev/null +++ b/pkg/compose/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "compose", + srcs = ["empty.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/compose", + visibility = ["//visibility:public"], +) diff --git a/pkg/compose/compare/compare/BUILD.bazel b/pkg/compose/compare/compare/BUILD.bazel new file mode 100644 index 000000000000..37ad1d14e296 --- /dev/null +++ b/pkg/compose/compare/compare/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "compare", + srcs = ["empty.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/compose/compare/compare", + visibility = ["//visibility:public"], +) diff --git a/pkg/config/BUILD.bazel b/pkg/config/BUILD.bazel new file mode 100644 index 000000000000..0e2301f1c73c --- /dev/null +++ b/pkg/config/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "config", + srcs = [ + "keys.go", + "provider.go", + "system.go", + "system.pb.go", + "system_mask.go", + "testutil.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/config", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "config_test", + srcs = [ + "keys_test.go", + "main_test.go", + "system_test.go", + ], + deps = [ + ":config", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/testutils", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/config/zonepb/BUILD.bazel b/pkg/config/zonepb/BUILD.bazel new file mode 100644 index 000000000000..508b9d18cf97 --- /dev/null +++ b/pkg/config/zonepb/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "zonepb", + srcs = [ + "zone.go", + "zone.pb.go", + "zone_yaml.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/config/zonepb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/opt/cat", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +go_test( + name = "zonepb_test", + srcs = ["zone_test.go"], + embed = [":zonepb"], + deps = [ + "//pkg/keys", + "//pkg/sql/sem/tree", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/docs/BUILD.bazel b/pkg/docs/BUILD.bazel new file mode 100644 index 000000000000..95d2b4ca9a2a --- /dev/null +++ b/pkg/docs/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "docs", + srcs = ["docs.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/docs", + visibility = ["//visibility:public"], + deps = ["//pkg/build"], +) diff --git a/pkg/geo/BUILD.bazel b/pkg/geo/BUILD.bazel new file mode 100644 index 000000000000..a73bad357f18 --- /dev/null +++ b/pkg/geo/BUILD.bazel @@ -0,0 +1,64 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geo", + srcs = [ + "bbox.go", + "encode.go", + "errors.go", + "geo.go", + "hilbert.go", + "iterator.go", + "latlng.go", + "parse.go", + "polyline.go", + "summary.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geographiclib", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/geo/geos", + "//pkg/util", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/r1", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/pierrre/geohash", + "//vendor/github.com/twpayne/go-geom", + "//vendor/github.com/twpayne/go-geom/encoding/ewkb", + "//vendor/github.com/twpayne/go-geom/encoding/ewkbhex", + "//vendor/github.com/twpayne/go-geom/encoding/geojson", + "//vendor/github.com/twpayne/go-geom/encoding/kml", + "//vendor/github.com/twpayne/go-geom/encoding/wkb", + "//vendor/github.com/twpayne/go-geom/encoding/wkbcommon", + "//vendor/github.com/twpayne/go-geom/encoding/wkbhex", + "//vendor/github.com/twpayne/go-geom/encoding/wkt", + ], +) + +go_test( + name = "geo_test", + srcs = [ + "bbox_test.go", + "encode_test.go", + "geo_test.go", + "iterator_test.go", + "latlng_test.go", + "parse_test.go", + ], + embed = [":geo"], + deps = [ + "//pkg/geo/geopb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/pierrre/geohash", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/geo/geodist/BUILD.bazel b/pkg/geo/geodist/BUILD.bazel new file mode 100644 index 000000000000..b5d776493dc5 --- /dev/null +++ b/pkg/geo/geodist/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "geodist", + srcs = ["geodist.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geodist", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/geo/geogen/BUILD.bazel b/pkg/geo/geogen/BUILD.bazel new file mode 100644 index 000000000000..f74095d55a7d --- /dev/null +++ b/pkg/geo/geogen/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geogen", + srcs = ["geogen.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geogen", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/twpayne/go-geom", + ], +) + +go_test( + name = "geogen_test", + srcs = ["geogen_test.go"], + embed = [":geogen"], + deps = [ + "//pkg/geo/geopb", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/geo/geogfn/BUILD.bazel b/pkg/geo/geogfn/BUILD.bazel new file mode 100644 index 000000000000..bd17d01b75a8 --- /dev/null +++ b/pkg/geo/geogfn/BUILD.bazel @@ -0,0 +1,58 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geogfn", + srcs = [ + "azimuth.go", + "best_projection.go", + "covers.go", + "distance.go", + "dwithin.go", + "geogfn.go", + "geographiclib.go", + "intersects.go", + "segmentize.go", + "topology_operations.go", + "unary_operators.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geogfn", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geodist", + "//pkg/geo/geographiclib", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/geo/geosegmentize", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/r3", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/twpayne/go-geom", + ], +) + +go_test( + name = "geogfn_test", + srcs = [ + "azimuth_test.go", + "best_projection_test.go", + "covers_test.go", + "distance_test.go", + "dwithin_test.go", + "geogfn_test.go", + "intersects_test.go", + "segmentize_test.go", + "topology_operations_test.go", + "unary_operators_test.go", + ], + embed = [":geogfn"], + deps = [ + "//pkg/geo", + "//pkg/geo/geoprojbase", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/stretchr/testify/require", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/geo/geographiclib/BUILD.bazel b/pkg/geo/geographiclib/BUILD.bazel new file mode 100644 index 000000000000..206683413327 --- /dev/null +++ b/pkg/geo/geographiclib/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geographiclib", + srcs = [ + "geodesic.c", + "geodesic.h", + "geographiclib.cc", + "geographiclib.go", + "geographiclib.h", + ], + cgo = True, + clinkopts = ["-lm"], + cxxopts = ["-std=c++14"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geographiclib", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + ], +) + +go_test( + name = "geographiclib_test", + srcs = ["geographiclib_test.go"], + embed = [":geographiclib"], + deps = [ + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/geo/geoindex/BUILD.bazel b/pkg/geo/geoindex/BUILD.bazel new file mode 100644 index 000000000000..27a83e85d4ae --- /dev/null +++ b/pkg/geo/geoindex/BUILD.bazel @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geoindex", + srcs = [ + "config.pb.go", + "geoindex.go", + "s2_geography_index.go", + "s2_geometry_index.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geoindex", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geogfn", + "//pkg/geo/geomfn", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/geo/geos", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/golang/geo/r3", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/twpayne/go-geom", + ], +) + +go_test( + name = "geoindex_test", + srcs = [ + "s2_geography_index_test.go", + "s2_geometry_index_test.go", + "utils_test.go", + ], + data = glob(["testdata/**"]), + embed = [":geoindex"], + deps = [ + "//pkg/geo", + "//pkg/geo/geogfn", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/geo/geos", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/golang/geo/s2", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/geo/geomfn/BUILD.bazel b/pkg/geo/geomfn/BUILD.bazel new file mode 100644 index 000000000000..08a91c85b913 --- /dev/null +++ b/pkg/geo/geomfn/BUILD.bazel @@ -0,0 +1,91 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geomfn", + srcs = [ + "affine_transforms.go", + "angle.go", + "azimuth.go", + "binary_predicates.go", + "buffer.go", + "collections.go", + "coord.go", + "de9im.go", + "distance.go", + "envelope.go", + "flip_coordinates.go", + "force_layout.go", + "geomfn.go", + "linear_reference.go", + "linestring.go", + "make_geometry.go", + "orientation.go", + "remove_repeated_points.go", + "reverse.go", + "segmentize.go", + "snap_to_grid.go", + "swap_ordinates.go", + "topology_operations.go", + "unary_operators.go", + "unary_predicates.go", + "validity_check.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geomfn", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geodist", + "//pkg/geo/geopb", + "//pkg/geo/geos", + "//pkg/geo/geosegmentize", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/twpayne/go-geom", + "//vendor/github.com/twpayne/go-geom/encoding/ewkb", + "//vendor/github.com/twpayne/go-geom/xy/lineintersector", + ], +) + +go_test( + name = "geomfn_test", + srcs = [ + "affine_transforms_test.go", + "angle_test.go", + "azimuth_test.go", + "binary_predicates_test.go", + "buffer_test.go", + "collections_test.go", + "de9im_test.go", + "distance_test.go", + "envelope_test.go", + "flip_coordinates_test.go", + "force_layout_test.go", + "geomfn_test.go", + "linear_reference_test.go", + "linestring_test.go", + "make_geometry_test.go", + "orientation_test.go", + "remove_repeated_points_test.go", + "reverse_test.go", + "segmentize_test.go", + "snap_to_grid_test.go", + "swap_ordinates_test.go", + "topology_operations_test.go", + "unary_operators_test.go", + "unary_predicates_test.go", + "validity_check_test.go", + ], + embed = [":geomfn"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/geo/geos", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/github.com/twpayne/go-geom", + "//vendor/github.com/twpayne/go-geom/encoding/wkt", + ], +) diff --git a/pkg/geo/geopb/BUILD.bazel b/pkg/geo/geopb/BUILD.bazel new file mode 100644 index 000000000000..63a8c13206ee --- /dev/null +++ b/pkg/geo/geopb/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "geopb", + srcs = [ + "geopb.go", + "geopb.pb.go", + "types.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geopb", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/gogo/protobuf/proto"], +) diff --git a/pkg/geo/geoproj/BUILD.bazel b/pkg/geo/geoproj/BUILD.bazel new file mode 100644 index 000000000000..6a36cc3884d0 --- /dev/null +++ b/pkg/geo/geoproj/BUILD.bazel @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geoproj", + srcs = [ + "geoproj.go", + "proj.cc", + "proj.h", + ], + # Depend on libproj. All the necessary linker+include directive are + # automatically generated through usage of go_library, so we pin + # clinkopts/cppopts to not let gazelle look towards the cgo directives when + # autogenerating them. + # + # keep + cdeps = ["@cockroach//:libproj"], + cgo = True, + # keep + clinkopts = select({ + "@io_bazel_rules_go//go/platform:linux": [ + "-lrt -lm -lpthread", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "-lshlwapi -lrpcrt4", + ], + "//conditions:default": [], + }), + # keep + cppopts = [], + cxxopts = ["-std=c++14"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geoproj", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geographiclib", + "//pkg/geo/geoprojbase", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "geoproj_test", + srcs = ["geoproj_test.go"], + embed = [":geoproj"], + deps = [ + "//pkg/geo/geoprojbase", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/geo/geoprojbase/BUILD.bazel b/pkg/geo/geoprojbase/BUILD.bazel new file mode 100644 index 000000000000..40de67240d33 --- /dev/null +++ b/pkg/geo/geoprojbase/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geoprojbase", + srcs = [ + "geoprojbase.go", + "projections.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geoprojbase", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geographiclib", + "//pkg/geo/geopb", + ], +) + +go_test( + name = "geoprojbase_test", + srcs = ["projections_test.go"], + embed = [":geoprojbase"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/geo/geos/BUILD.bazel b/pkg/geo/geos/BUILD.bazel new file mode 100644 index 000000000000..f7218e79d1c6 --- /dev/null +++ b/pkg/geo/geos/BUILD.bazel @@ -0,0 +1,73 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geos", + srcs = [ + "geos.cc", + "geos.go", + "geos.h", + ], + cgo = True, + clinkopts = select({ + "@io_bazel_rules_go//go/platform:aix": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:android": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:js": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "-ldl", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "-ldl", + ], + "//conditions:default": [], + }), + cxxopts = ["-std=c++14"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geos", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geopb", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "geos_test", + srcs = ["geos_test.go"], + embed = [":geos"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/geo/geosegmentize/BUILD.bazel b/pkg/geo/geosegmentize/BUILD.bazel new file mode 100644 index 000000000000..039edbc8078c --- /dev/null +++ b/pkg/geo/geosegmentize/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "geosegmentize", + srcs = ["geosegmentize.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geosegmentize", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/geo/geotransform/BUILD.bazel b/pkg/geo/geotransform/BUILD.bazel new file mode 100644 index 000000000000..55ed368b8f27 --- /dev/null +++ b/pkg/geo/geotransform/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "geotransform", + srcs = ["geotransform.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/geo/geotransform", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/geo/geoproj", + "//pkg/geo/geoprojbase", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/twpayne/go-geom", + ], +) + +go_test( + name = "geotransform_test", + srcs = ["geotransform_test.go"], + embed = [":geotransform"], + deps = [ + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//vendor/github.com/stretchr/testify/require", + "//vendor/github.com/twpayne/go-geom", + ], +) diff --git a/pkg/gossip/BUILD.bazel b/pkg/gossip/BUILD.bazel new file mode 100644 index 000000000000..5c03371ec1cb --- /dev/null +++ b/pkg/gossip/BUILD.bazel @@ -0,0 +1,95 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gossip", + srcs = [ + "client.go", + "doc.go", + "gossip.go", + "gossip.pb.go", + "info.go", + "infostore.go", + "keys.go", + "node_set.go", + "server.go", + "status.go", + "util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/gossip", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip/resolver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/util", + "//pkg/util/errorutil", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "gossip_test", + srcs = [ + "client_test.go", + "convergence_test.go", + "gossip_test.go", + "info_test.go", + "infostore_test.go", + "keys_test.go", + "main_test.go", + "node_set_test.go", + "status_test.go", + "storage_test.go", + "util_test.go", + ], + embed = [":gossip"], + deps = [ + "//pkg/base", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip/resolver", + "//pkg/gossip/simulation", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/gossip/resolver/BUILD.bazel b/pkg/gossip/resolver/BUILD.bazel new file mode 100644 index 000000000000..1e687b6f9329 --- /dev/null +++ b/pkg/gossip/resolver/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "resolver", + srcs = [ + "resolver.go", + "socket.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/gossip/resolver", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/netutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "resolver_test", + srcs = ["resolver_test.go"], + embed = [":resolver"], + deps = [ + "//pkg/base", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/gossip/simulation/BUILD.bazel b/pkg/gossip/simulation/BUILD.bazel new file mode 100644 index 000000000000..42ffcfea79df --- /dev/null +++ b/pkg/gossip/simulation/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "simulation", + srcs = ["network.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/gossip/simulation", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/gossip/resolver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/netutil", + "//pkg/util/stop", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/internal/client/requestbatcher/BUILD.bazel b/pkg/internal/client/requestbatcher/BUILD.bazel new file mode 100644 index 000000000000..8255cea68a46 --- /dev/null +++ b/pkg/internal/client/requestbatcher/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "requestbatcher", + srcs = ["batcher.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/client/requestbatcher", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/util/contextutil", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/timeutil", + ], +) + +go_test( + name = "requestbatcher_test", + srcs = ["batcher_test.go"], + embed = [":requestbatcher"], + deps = [ + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/internal/codeowners/BUILD.bazel b/pkg/internal/codeowners/BUILD.bazel new file mode 100644 index 000000000000..d5e450c27e1e --- /dev/null +++ b/pkg/internal/codeowners/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "codeowners", + srcs = ["codeowners.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/codeowners", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/internal/gopath", + "//pkg/internal/team", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/zabawaba99/go-gitignore", + ], +) + +go_test( + name = "codeowners_test", + srcs = ["codeowners_test.go"], + embed = [":codeowners"], + deps = [ + "//pkg/internal/team", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/internal/gopath/BUILD.bazel b/pkg/internal/gopath/BUILD.bazel new file mode 100644 index 000000000000..4d1e972d79d6 --- /dev/null +++ b/pkg/internal/gopath/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gopath", + srcs = ["gopath.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/gopath", + visibility = ["//pkg:__subpackages__"], + deps = ["//pkg/util/envutil"], +) diff --git a/pkg/internal/rsg/BUILD.bazel b/pkg/internal/rsg/BUILD.bazel new file mode 100644 index 000000000000..55742ff2aa96 --- /dev/null +++ b/pkg/internal/rsg/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rsg", + srcs = ["rsg.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/rsg", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/internal/rsg/yacc", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/syncutil", + ], +) + +go_test( + name = "rsg_test", + srcs = ["rsg_test.go"], + embed = [":rsg"], +) diff --git a/pkg/internal/rsg/yacc/BUILD.bazel b/pkg/internal/rsg/yacc/BUILD.bazel new file mode 100644 index 000000000000..92cb964c7c10 --- /dev/null +++ b/pkg/internal/rsg/yacc/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "yacc", + srcs = [ + "lex.go", + "node.go", + "parse.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/rsg/yacc", + visibility = ["//pkg:__subpackages__"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "yacc_test", + srcs = ["parse_test.go"], + embed = [":yacc"], + deps = ["//pkg/util/log"], +) diff --git a/pkg/internal/sqlsmith/BUILD.bazel b/pkg/internal/sqlsmith/BUILD.bazel new file mode 100644 index 000000000000..5de625e92cc4 --- /dev/null +++ b/pkg/internal/sqlsmith/BUILD.bazel @@ -0,0 +1,58 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sqlsmith", + srcs = [ + "alter.go", + "bulkio.go", + "random.go", + "relational.go", + "sampler.go", + "scalar.go", + "schema.go", + "scope.go", + "setup.go", + "sqlsmith.go", + "type.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/sqlsmith", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/mutations", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "sqlsmith_test", + srcs = [ + "main_test.go", + "sqlsmith_test.go", + ], + embed = [":sqlsmith"], + deps = [ + "//pkg/base", + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/parser", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/internal/team/BUILD.bazel b/pkg/internal/team/BUILD.bazel new file mode 100644 index 000000000000..6bbbce025c88 --- /dev/null +++ b/pkg/internal/team/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "team", + srcs = ["team.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/internal/team", + visibility = ["//pkg:__subpackages__"], + deps = [ + "//pkg/internal/gopath", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +go_test( + name = "team_test", + srcs = ["team_test.go"], + embed = [":team"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/jobs/BUILD.bazel b/pkg/jobs/BUILD.bazel new file mode 100644 index 000000000000..73bf85ff069e --- /dev/null +++ b/pkg/jobs/BUILD.bazel @@ -0,0 +1,136 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "jobs", + srcs = [ + "adopt.go", + "deprecated.go", + "executor_impl.go", + "helpers.go", + "job_scheduler.go", + "jobs.go", + "metrics.go", + "progress.go", + "registry.go", + "schedule_metrics.go", + "scheduled_job.go", + "scheduled_job_executor.go", + "testing_knobs.go", + "update.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/jobs", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/optionalnodeliveness", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/gorhill/cronexpr", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/prometheus/client_model/go", + ], +) + +go_test( + name = "jobs_test", + srcs = [ + "executor_impl_test.go", + "helpers_test.go", + "job_scheduler_test.go", + "jobs_test.go", + "lease_test.go", + "main_test.go", + "registry_external_test.go", + "registry_test.go", + "schedule_control_test.go", + "scheduled_job_executor_test.go", + "scheduled_job_test.go", + "testutils_test.go", + ], + embed = [":jobs"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobstest", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/optionalnodeliveness", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlliveness/slinstance", + "//pkg/sql/sqlliveness/slstorage", + "//pkg/sql/sqlutil", + "//pkg/sql/tests", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/ctxgroup", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/google/go-cmp/cmp", + "//vendor/github.com/gorhill/cronexpr", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/jobs/jobspb/BUILD.bazel b/pkg/jobs/jobspb/BUILD.bazel new file mode 100644 index 000000000000..8bc2591688e3 --- /dev/null +++ b/pkg/jobs/jobspb/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "jobspb", + srcs = [ + "jobs.pb.go", + "schedule.pb.go", + "wrap.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobspb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/sem/tree", + "//pkg/sql/stats", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/errorspb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + ], +) diff --git a/pkg/jobs/jobsprotectedts/BUILD.bazel b/pkg/jobs/jobsprotectedts/BUILD.bazel new file mode 100644 index 000000000000..285f123e197e --- /dev/null +++ b/pkg/jobs/jobsprotectedts/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "jobsprotectedts", + srcs = ["jobs_protected_ts.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobsprotectedts", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs", + "//pkg/kv", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/protectedts/ptreconcile", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "jobsprotectedts_test", + srcs = [ + "jobs_protected_ts_test.go", + "main_test.go", + ], + deps = [ + ":jobsprotectedts", + "//pkg/base", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/catalog/descpb", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/jobs/jobstest/BUILD.bazel b/pkg/jobs/jobstest/BUILD.bazel new file mode 100644 index 000000000000..40ec1e48c1cb --- /dev/null +++ b/pkg/jobs/jobstest/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "jobstest", + srcs = ["utils.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobstest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/scheduledjobs", + "//pkg/sql/catalog/systemschema", + "//pkg/util/syncutil", + ], +) diff --git a/pkg/keys/BUILD.bazel b/pkg/keys/BUILD.bazel new file mode 100644 index 000000000000..b1a3a357bd6f --- /dev/null +++ b/pkg/keys/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "keys", + srcs = [ + "constants.go", + "doc.go", + "errors.go", + "keys.go", + "printer.go", + "spans.go", + "sql.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/keys", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/util/encoding", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "keys_test", + srcs = [ + "keys_test.go", + "printer_test.go", + ], + embed = [":keys"], + deps = [ + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/keysutil", + "//pkg/util/leaktest", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/BUILD.bazel b/pkg/kv/BUILD.bazel new file mode 100644 index 000000000000..45b83db5aa5e --- /dev/null +++ b/pkg/kv/BUILD.bazel @@ -0,0 +1,78 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kv", + srcs = [ + "batch.go", + "db.go", + "doc.go", + "mock_transactional_sender.go", + "range_lookup.go", + "sender.go", + "test_utils.go", + "txn.go", + "util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv/kvbase", + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/contextutil", + "//pkg/util/duration", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "kv_test", + srcs = [ + "client_test.go", + "db_test.go", + "main_test.go", + "range_lookup_test.go", + "txn_external_test.go", + "txn_test.go", + ], + embed = [":kv"], + deps = [ + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/kvclientutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/bulk/BUILD.bazel b/pkg/kv/bulk/BUILD.bazel new file mode 100644 index 000000000000..998861fc87ae --- /dev/null +++ b/pkg/kv/bulk/BUILD.bazel @@ -0,0 +1,64 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bulk", + srcs = [ + "buffering_adder.go", + "bulk_metrics.go", + "kv_buf.go", + "sst_batcher.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/bulk", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "bulk_test", + srcs = [ + "kv_buf_test.go", + "main_test.go", + "sst_batcher_test.go", + ], + embed = [":bulk"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/testcluster", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/tracing", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvbase/BUILD.bazel b/pkg/kv/kvbase/BUILD.bazel new file mode 100644 index 000000000000..04f6432b5472 --- /dev/null +++ b/pkg/kv/kvbase/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvbase", + srcs = [ + "constants.go", + "range_cache.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvbase", + visibility = ["//visibility:public"], + deps = ["//pkg/roachpb"], +) diff --git a/pkg/kv/kvclient/BUILD.bazel b/pkg/kv/kvclient/BUILD.bazel new file mode 100644 index 000000000000..c288b5f50ff6 --- /dev/null +++ b/pkg/kv/kvclient/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvclient", + srcs = ["placeholder.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvclient", + visibility = ["//visibility:public"], +) diff --git a/pkg/kv/kvclient/kvcoord/BUILD.bazel b/pkg/kv/kvclient/kvcoord/BUILD.bazel new file mode 100644 index 000000000000..5566a5ccb423 --- /dev/null +++ b/pkg/kv/kvclient/kvcoord/BUILD.bazel @@ -0,0 +1,159 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvcoord", + srcs = [ + "batch.go", + "condensable_span_set.go", + "dist_sender.go", + "dist_sender_rangefeed.go", + "doc.go", + "local_test_cluster_util.go", + "node_store.go", + "range_cache.go", + "range_iter.go", + "replica_slice.go", + "testing_knobs.go", + "transport.go", + "transport_race.go", + "transport_regular.go", + "txn_coord_sender.go", + "txn_coord_sender_factory.go", + "txn_coord_sender_savepoints.go", + "txn_interceptor_committer.go", + "txn_interceptor_heartbeater.go", + "txn_interceptor_metric_recorder.go", + "txn_interceptor_pipeliner.go", + "txn_interceptor_seq_num_allocator.go", + "txn_interceptor_span_refresher.go", + "txn_lock_gatekeeper.go", + "txn_metrics.go", + "txnstate_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvcoord", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvbase", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage/enginepb", + "//pkg/util", + "//pkg/util/cache", + "//pkg/util/contextutil", + "//pkg/util/ctxgroup", + "//pkg/util/duration", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/quotapool", + "//pkg/util/retry", + "//pkg/util/shuffle", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/biogo/store/llrb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/google/btree", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "kvcoord_test", + srcs = [ + "batch_test.go", + "condensable_span_set_test.go", + "dist_sender_server_test.go", + "dist_sender_test.go", + "integration_test.go", + "main_test.go", + "range_cache_test.go", + "range_iter_test.go", + "replica_slice_test.go", + "send_test.go", + "split_test.go", + "transport_test.go", + "truncate_test.go", + "txn_coord_sender_savepoints_test.go", + "txn_coord_sender_server_test.go", + "txn_coord_sender_test.go", + "txn_correctness_test.go", + "txn_interceptor_committer_test.go", + "txn_interceptor_heartbeater_test.go", + "txn_interceptor_pipeliner_test.go", + "txn_interceptor_seq_num_allocator_test.go", + "txn_interceptor_span_refresher_test.go", + "txn_test.go", + ], + data = glob(["testdata/**"]), + embed = [":kvcoord"], + deps = [ + "//pkg/base", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/gossip/simulation", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/tscache", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/kvclientutils", + "//pkg/testutils/localtestcluster", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/util", + "//pkg/util/caller", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/netutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/biogo/store/llrb", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/kv/kvclient/kvtenant/BUILD.bazel b/pkg/kv/kvclient/kvtenant/BUILD.bazel new file mode 100644 index 000000000000..a7b40808db6f --- /dev/null +++ b/pkg/kv/kvclient/kvtenant/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvtenant", + srcs = ["connector.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvclient/kvtenant", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/util/log", + "//pkg/util/retry", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/kv/kvnemesis/BUILD.bazel b/pkg/kv/kvnemesis/BUILD.bazel new file mode 100644 index 000000000000..914d7535a83e --- /dev/null +++ b/pkg/kv/kvnemesis/BUILD.bazel @@ -0,0 +1,75 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvnemesis", + srcs = [ + "applier.go", + "doc.go", + "engine.go", + "generator.go", + "kvnemesis.go", + "operations.go", + "operations.pb.go", + "validator.go", + "watcher.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvnemesis", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/util/bufalloc", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/span", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/errorspb", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/pebble/vfs", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "kvnemesis_test", + srcs = [ + "applier_test.go", + "engine_test.go", + "generator_test.go", + "kvnemesis_test.go", + "main_test.go", + "operations_test.go", + "validator_test.go", + ], + embed = [":kvnemesis"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/storage", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/BUILD.bazel b/pkg/kv/kvserver/BUILD.bazel new file mode 100644 index 000000000000..11cf514bea88 --- /dev/null +++ b/pkg/kv/kvserver/BUILD.bazel @@ -0,0 +1,386 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvserver", + srcs = [ + "addressing.go", + "allocator.go", + "allocator_scorer.go", + "api.pb.go", + "cclglue.go", + "consistency_queue.go", + "debug_print.go", + "doc.go", + "gc_queue.go", + "lease_history.go", + "log.go", + "merge_queue.go", + "metrics.go", + "node_liveness.go", + "queue.go", + "queue_helpers_testutil.go", + "raft.go", + "raft.pb.go", + "raft_log_queue.go", + "raft_snapshot_queue.go", + "raft_transport.go", + "refreshraftreason_string.go", + "replica.go", + "replica_application_cmd.go", + "replica_application_cmd_buf.go", + "replica_application_decoder.go", + "replica_application_result.go", + "replica_application_state_machine.go", + "replica_backpressure.go", + "replica_batch_updates.go", + "replica_closedts.go", + "replica_command.go", + "replica_consistency.go", + "replica_consistency_diff.go", + "replica_corruption.go", + "replica_destroy.go", + "replica_eval_context.go", + "replica_eval_context_span.go", + "replica_evaluate.go", + "replica_follower_read.go", + "replica_gc_queue.go", + "replica_gossip.go", + "replica_init.go", + "replica_metrics.go", + "replica_placeholder.go", + "replica_proposal.go", + "replica_proposal_buf.go", + "replica_proposal_quota.go", + "replica_protected_timestamp.go", + "replica_raft.go", + "replica_raft_quiesce.go", + "replica_raftstorage.go", + "replica_range_lease.go", + "replica_rangefeed.go", + "replica_rankings.go", + "replica_rate_limit.go", + "replica_read.go", + "replica_send.go", + "replica_sideload.go", + "replica_sideload_disk.go", + "replica_sideload_inmem.go", + "replica_split_load.go", + "replica_sst_snapshot_storage.go", + "replica_stats.go", + "replica_tscache.go", + "replica_write.go", + "replicate_queue.go", + "scanner.go", + "scheduler.go", + "split_delay_helper.go", + "split_queue.go", + "split_trigger_helper.go", + "storage_services.pb.go", + "store.go", + "store_bootstrap.go", + "store_create_replica.go", + "store_merge.go", + "store_pool.go", + "store_raft.go", + "store_rebalancer.go", + "store_remove_replica.go", + "store_send.go", + "store_snapshot.go", + "store_split.go", + "stores.go", + "stores_server.go", + "syncing_write.go", + "testing_knobs.go", + "track_raft_protos.go", + "ts_maintenance_queue.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/docs", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvbase", + "//pkg/kv/kvserver/abortspan", + "//pkg/kv/kvserver/apply", + "//pkg/kv/kvserver/batcheval", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/container", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/closedts/storage", + "//pkg/kv/kvserver/compactor", + "//pkg/kv/kvserver/concurrency", + "//pkg/kv/kvserver/constraint", + "//pkg/kv/kvserver/gc", + "//pkg/kv/kvserver/idalloc", + "//pkg/kv/kvserver/intentresolver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/raftentry", + "//pkg/kv/kvserver/rangefeed", + "//pkg/kv/kvserver/rditer", + "//pkg/kv/kvserver/spanset", + "//pkg/kv/kvserver/split", + "//pkg/kv/kvserver/stateloader", + "//pkg/kv/kvserver/tenantrate", + "//pkg/kv/kvserver/tscache", + "//pkg/kv/kvserver/txnrecovery", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/enginepb", + "//pkg/storage/fs", + "//pkg/util", + "//pkg/util/bufalloc", + "//pkg/util/contextutil", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/envutil", + "//pkg/util/errorutil", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/iterutil", + "//pkg/util/limit", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/metric/aggmetric", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/quotapool", + "//pkg/util/retry", + "//pkg/util/shuffle", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/google/btree", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/go.etcd.io/etcd/raft", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/go.etcd.io/etcd/raft/tracker", + "//vendor/golang.org/x/time/rate", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "kvserver_test", + srcs = [ + "addressing_test.go", + "allocator_scorer_test.go", + "allocator_test.go", + "batch_spanset_test.go", + "below_raft_protos_test.go", + "client_atomic_membership_change_test.go", + "client_closed_timestamp_test.go", + "client_lease_test.go", + "client_merge_test.go", + "client_metrics_test.go", + "client_protectedts_test.go", + "client_raft_helpers_test.go", + "client_raft_log_queue_test.go", + "client_raft_test.go", + "client_rangefeed_test.go", + "client_relocate_range_test.go", + "client_replica_backpressure_test.go", + "client_replica_gc_test.go", + "client_replica_test.go", + "client_split_test.go", + "client_status_test.go", + "client_tenant_test.go", + "client_test.go", + "closed_timestamp_test.go", + "consistency_queue_test.go", + "debug_print_test.go", + "gc_queue_test.go", + "gossip_test.go", + "helpers_test.go", + "intent_resolver_integration_test.go", + "lease_history_test.go", + "log_test.go", + "main_test.go", + "merge_queue_test.go", + "metrics_test.go", + "node_liveness_test.go", + "node_liveness_unit_test.go", + "queue_concurrency_test.go", + "queue_test.go", + "raft_log_queue_test.go", + "raft_test.go", + "raft_transport_test.go", + "raft_transport_unit_test.go", + "replica_application_cmd_buf_test.go", + "replica_application_state_machine_test.go", + "replica_batch_updates_test.go", + "replica_command_test.go", + "replica_consistency_test.go", + "replica_evaluate_test.go", + "replica_gc_queue_test.go", + "replica_init_test.go", + "replica_learner_test.go", + "replica_metrics_test.go", + "replica_proposal_buf_test.go", + "replica_protected_timestamp_test.go", + "replica_raft_test.go", + "replica_raft_truncation_test.go", + "replica_rangefeed_test.go", + "replica_rankings_test.go", + "replica_sideload_test.go", + "replica_sst_snapshot_storage_test.go", + "replica_stats_test.go", + "replica_test.go", + "replicate_queue_test.go", + "replicate_test.go", + "scanner_test.go", + "scheduler_test.go", + "single_key_test.go", + "split_delay_helper_test.go", + "split_queue_test.go", + "split_trigger_helper_test.go", + "stats_test.go", + "store_pool_test.go", + "store_rebalancer_test.go", + "store_test.go", + "stores_test.go", + "ts_maintenance_queue_test.go", + "txn_recovery_integration_test.go", + "txn_wait_queue_test.go", + ], + data = glob(["testdata/**"]), + embed = [":kvserver"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/gossip/resolver", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/abortspan", + "//pkg/kv/kvserver/apply", + "//pkg/kv/kvserver/batcheval", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/concurrency", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/constraint", + "//pkg/kv/kvserver/gc", + "//pkg/kv/kvserver/intentresolver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/protectedts/ptstorage", + "//pkg/kv/kvserver/protectedts/ptverifier", + "//pkg/kv/kvserver/raftentry", + "//pkg/kv/kvserver/rditer", + "//pkg/kv/kvserver/spanset", + "//pkg/kv/kvserver/stateloader", + "//pkg/kv/kvserver/tenantrate", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/storage/fs", + "//pkg/testutils", + "//pkg/testutils/gossiputil", + "//pkg/testutils/kvclientutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/ts", + "//pkg/ts/tspb", + "//pkg/util", + "//pkg/util/caller", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/leaktest", + "//pkg/util/limit", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/quotapool", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cenkalti/backoff", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/google/btree", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/olekukonko/tablewriter", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/go.etcd.io/etcd/raft", + "//vendor/go.etcd.io/etcd/raft/confchange", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/go.etcd.io/etcd/raft/tracker", + "//vendor/golang.org/x/net/trace", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/golang.org/x/sync/syncmap", + "//vendor/golang.org/x/time/rate", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/metadata", + ], +) diff --git a/pkg/kv/kvserver/abortspan/BUILD.bazel b/pkg/kv/kvserver/abortspan/BUILD.bazel new file mode 100644 index 000000000000..ecedb19a2b36 --- /dev/null +++ b/pkg/kv/kvserver/abortspan/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "abortspan", + srcs = ["abortspan.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/abortspan", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "abortspan_test", + srcs = ["abortspan_test.go"], + embed = [":abortspan"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/uuid", + ], +) diff --git a/pkg/kv/kvserver/apply/BUILD.bazel b/pkg/kv/kvserver/apply/BUILD.bazel new file mode 100644 index 000000000000..98e5f6115c6b --- /dev/null +++ b/pkg/kv/kvserver/apply/BUILD.bazel @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "apply", + srcs = [ + "cmd.go", + "doc.go", + "task.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/apply", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) + +go_test( + name = "apply_test", + srcs = [ + "doc_test.go", + "task_test.go", + ], + deps = [ + ":apply", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) diff --git a/pkg/kv/kvserver/batcheval/BUILD.bazel b/pkg/kv/kvserver/batcheval/BUILD.bazel new file mode 100644 index 000000000000..2c229867b4ed --- /dev/null +++ b/pkg/kv/kvserver/batcheval/BUILD.bazel @@ -0,0 +1,130 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "batcheval", + srcs = [ + "cmd_add_sstable.go", + "cmd_clear_range.go", + "cmd_compute_checksum.go", + "cmd_conditional_put.go", + "cmd_delete.go", + "cmd_delete_range.go", + "cmd_end_transaction.go", + "cmd_gc.go", + "cmd_get.go", + "cmd_heartbeat_txn.go", + "cmd_increment.go", + "cmd_init_put.go", + "cmd_lease.go", + "cmd_lease_info.go", + "cmd_lease_request.go", + "cmd_lease_transfer.go", + "cmd_merge.go", + "cmd_push_txn.go", + "cmd_put.go", + "cmd_query_intent.go", + "cmd_query_txn.go", + "cmd_range_stats.go", + "cmd_recompute_stats.go", + "cmd_recover_txn.go", + "cmd_refresh.go", + "cmd_refresh_range.go", + "cmd_resolve_intent.go", + "cmd_resolve_intent_range.go", + "cmd_reverse_scan.go", + "cmd_revert_range.go", + "cmd_scan.go", + "cmd_subsume.go", + "cmd_truncate_log.go", + "command.go", + "declare.go", + "eval_context.go", + "intent.go", + "split_stats_helper.go", + "stateloader.go", + "transaction.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/abortspan", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/concurrency", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/rditer", + "//pkg/kv/kvserver/spanset", + "//pkg/kv/kvserver/stateloader", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/enginepb", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/limit", + "//pkg/util/log", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/kr/pretty", + "//vendor/golang.org/x/time/rate", + ], +) + +go_test( + name = "batcheval_test", + srcs = [ + "cmd_add_sstable_test.go", + "cmd_clear_range_test.go", + "cmd_end_transaction_test.go", + "cmd_lease_test.go", + "cmd_recover_txn_test.go", + "cmd_refresh_range_test.go", + "cmd_resolve_intent_test.go", + "cmd_revert_range_test.go", + "cmd_scan_test.go", + "cmd_subsume_test.go", + "cmd_truncate_log_test.go", + "intent_test.go", + "main_test.go", + "transaction_test.go", + ], + embed = [":batcheval"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/abortspan", + "//pkg/kv/kvserver/spanset", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/batcheval/result/BUILD.bazel b/pkg/kv/kvserver/batcheval/result/BUILD.bazel new file mode 100644 index 000000000000..e603b0a7a476 --- /dev/null +++ b/pkg/kv/kvserver/batcheval/result/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "result", + srcs = [ + "intent.go", + "metrics.go", + "result.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + ], +) + +go_test( + name = "result_test", + srcs = ["result_test.go"], + embed = [":result"], + deps = [ + "//pkg/kv/kvserver/kvserverpb", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/kv/kvserver/closedts/BUILD.bazel b/pkg/kv/kvserver/closedts/BUILD.bazel new file mode 100644 index 000000000000..5d62919e9b81 --- /dev/null +++ b/pkg/kv/kvserver/closedts/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "closedts", + srcs = [ + "closedts.go", + "setting.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/hlc", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/kv/kvserver/closedts/container/BUILD.bazel b/pkg/kv/kvserver/closedts/container/BUILD.bazel new file mode 100644 index 000000000000..7b657f84fc0f --- /dev/null +++ b/pkg/kv/kvserver/closedts/container/BUILD.bazel @@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "container", + srcs = [ + "container.go", + "noop.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/container", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/closedts/minprop", + "//pkg/kv/kvserver/closedts/provider", + "//pkg/kv/kvserver/closedts/storage", + "//pkg/kv/kvserver/closedts/transport", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/hlc", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "container_test", + srcs = ["container_test.go"], + deps = [ + ":container", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/closedts/provider/testutils", + "//pkg/kv/kvserver/closedts/transport/testutils", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/closedts/ctpb/BUILD.bazel b/pkg/kv/kvserver/closedts/ctpb/BUILD.bazel new file mode 100644 index 000000000000..cb620a73dc20 --- /dev/null +++ b/pkg/kv/kvserver/closedts/ctpb/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ctpb", + srcs = [ + "client.go", + "entry.go", + "entry.pb.go", + "server.go", + "service.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/ctpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/util/hlc", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/kv/kvserver/closedts/minprop/BUILD.bazel b/pkg/kv/kvserver/closedts/minprop/BUILD.bazel new file mode 100644 index 000000000000..7a425810c4e8 --- /dev/null +++ b/pkg/kv/kvserver/closedts/minprop/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "minprop", + srcs = [ + "doc.go", + "tracker.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/minprop", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/syncutil", + ], +) + +go_test( + name = "minprop_test", + srcs = [ + "doc_test.go", + "tracker_test.go", + ], + embed = [":minprop"], + deps = [ + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/kv/kvserver/closedts/provider/BUILD.bazel b/pkg/kv/kvserver/closedts/provider/BUILD.bazel new file mode 100644 index 000000000000..579835eccd83 --- /dev/null +++ b/pkg/kv/kvserver/closedts/provider/BUILD.bazel @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "provider", + srcs = ["provider.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/provider", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "provider_test", + srcs = ["provider_test.go"], + deps = [ + ":provider", + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/closedts/provider/testutils", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/kv/kvserver/closedts/provider/testutils/BUILD.bazel b/pkg/kv/kvserver/closedts/provider/testutils/BUILD.bazel new file mode 100644 index 000000000000..c323c763de07 --- /dev/null +++ b/pkg/kv/kvserver/closedts/provider/testutils/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "testutils", + srcs = [ + "clock.go", + "storage.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/provider/testutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/kv/kvserver/closedts/storage/BUILD.bazel b/pkg/kv/kvserver/closedts/storage/BUILD.bazel new file mode 100644 index 000000000000..1da4b8c61ca3 --- /dev/null +++ b/pkg/kv/kvserver/closedts/storage/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storage", + srcs = [ + "storage.go", + "storage_mem.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/storage", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/syncutil", + "//vendor/github.com/olekukonko/tablewriter", + ], +) + +go_test( + name = "storage_test", + srcs = ["storage_test.go"], + embed = [":storage"], + deps = [ + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/kv/kvserver/closedts/transport/BUILD.bazel b/pkg/kv/kvserver/closedts/transport/BUILD.bazel new file mode 100644 index 000000000000..e96a5fc2577d --- /dev/null +++ b/pkg/kv/kvserver/closedts/transport/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "transport", + srcs = [ + "clients.go", + "server.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/transport", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "transport_test", + srcs = [ + "transport_test.go", + "transport_util_test.go", + ], + deps = [ + ":transport", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/closedts/transport/testutils", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + ], +) diff --git a/pkg/kv/kvserver/closedts/transport/testutils/BUILD.bazel b/pkg/kv/kvserver/closedts/transport/testutils/BUILD.bazel new file mode 100644 index 000000000000..7feeb1a7fcc3 --- /dev/null +++ b/pkg/kv/kvserver/closedts/transport/testutils/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "testutils", + srcs = ["chan_dialer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/closedts/transport/testutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/util/stop", + "//pkg/util/syncutil", + ], +) diff --git a/pkg/kv/kvserver/compactor/BUILD.bazel b/pkg/kv/kvserver/compactor/BUILD.bazel new file mode 100644 index 000000000000..99d53d1993ec --- /dev/null +++ b/pkg/kv/kvserver/compactor/BUILD.bazel @@ -0,0 +1,48 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "compactor", + srcs = [ + "compactor.go", + "metrics.go", + "settings.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/compactor", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "compactor_test", + srcs = ["compactor_test.go"], + embed = [":compactor"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/kv/kvserver/concurrency/BUILD.bazel b/pkg/kv/kvserver/concurrency/BUILD.bazel new file mode 100644 index 000000000000..83032dc61136 --- /dev/null +++ b/pkg/kv/kvserver/concurrency/BUILD.bazel @@ -0,0 +1,79 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "concurrency", + srcs = [ + "concurrency_control.go", + "concurrency_manager.go", + "latch_manager.go", + "lock_table.go", + "lock_table_waiter.go", + "lockstate_interval_btree.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/intentresolver", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/spanlatch", + "//pkg/kv/kvserver/spanset", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "concurrency_test", + srcs = [ + "concurrency_manager_test.go", + "datadriven_util_test.go", + "lock_table_test.go", + "lock_table_waiter_test.go", + "lockstate_interval_btree_test.go", + ], + data = glob(["testdata/**"]), + embed = [":concurrency"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/batcheval", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/intentresolver", + "//pkg/kv/kvserver/spanlatch", + "//pkg/kv/kvserver/spanset", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/maruel/panicparse/stack", + "//vendor/github.com/petermattis/goid", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/exp/rand", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/kv/kvserver/concurrency/lock/BUILD.bazel b/pkg/kv/kvserver/concurrency/lock/BUILD.bazel new file mode 100644 index 000000000000..207cbf6733f6 --- /dev/null +++ b/pkg/kv/kvserver/concurrency/lock/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "lock", + srcs = [ + "locking.go", + "locking.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/concurrency/lock", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/gogo/protobuf/proto"], +) diff --git a/pkg/kv/kvserver/constraint/BUILD.bazel b/pkg/kv/kvserver/constraint/BUILD.bazel new file mode 100644 index 000000000000..719037736301 --- /dev/null +++ b/pkg/kv/kvserver/constraint/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "constraint", + srcs = ["analyzer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/constraint", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config/zonepb", + "//pkg/roachpb", + ], +) diff --git a/pkg/kv/kvserver/diskmap/BUILD.bazel b/pkg/kv/kvserver/diskmap/BUILD.bazel new file mode 100644 index 000000000000..146871cc4233 --- /dev/null +++ b/pkg/kv/kvserver/diskmap/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "diskmap", + srcs = ["disk_map.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/diskmap", + visibility = ["//visibility:public"], +) diff --git a/pkg/kv/kvserver/gc/BUILD.bazel b/pkg/kv/kvserver/gc/BUILD.bazel new file mode 100644 index 000000000000..cd93d0f485e7 --- /dev/null +++ b/pkg/kv/kvserver/gc/BUILD.bazel @@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gc", + srcs = [ + "gc.go", + "gc_iterator.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/gc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv/kvserver/abortspan", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/rditer", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/bufalloc", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "gc_test", + srcs = [ + "data_distribution_test.go", + "gc_iterator_test.go", + "gc_old_test.go", + "gc_random_test.go", + "gc_test.go", + ], + embed = [":gc"], + deps = [ + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/rditer", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/idalloc/BUILD.bazel b/pkg/kv/kvserver/idalloc/BUILD.bazel new file mode 100644 index 000000000000..979ace7eb638 --- /dev/null +++ b/pkg/kv/kvserver/idalloc/BUILD.bazel @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "idalloc", + srcs = ["id_alloc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/idalloc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "idalloc_test", + srcs = [ + "helpers_test.go", + "id_alloc_test.go", + "main_test.go", + ], + embed = [":idalloc"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/sql", + "//pkg/testutils", + "//pkg/testutils/localtestcluster", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/intentresolver/BUILD.bazel b/pkg/kv/kvserver/intentresolver/BUILD.bazel new file mode 100644 index 000000000000..34b34126f36a --- /dev/null +++ b/pkg/kv/kvserver/intentresolver/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "intentresolver", + srcs = [ + "intent_resolver.go", + "metrics.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/intentresolver", + visibility = ["//visibility:public"], + deps = [ + "//pkg/internal/client/requestbatcher", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvbase", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/txnwait", + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/util/contextutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/quotapool", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "intentresolver_test", + srcs = ["intent_resolver_test.go"], + embed = [":intentresolver"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver/batcheval/result", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/kv/kvserver/kvserverbase/BUILD.bazel b/pkg/kv/kvserver/kvserverbase/BUILD.bazel new file mode 100644 index 000000000000..598e59870015 --- /dev/null +++ b/pkg/kv/kvserver/kvserverbase/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvserverbase", + srcs = [ + "base.go", + "bulk_adder.go", + "knobs.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/hlc", + ], +) diff --git a/pkg/kv/kvserver/kvserverpb/BUILD.bazel b/pkg/kv/kvserver/kvserverpb/BUILD.bazel new file mode 100644 index 000000000000..294899875027 --- /dev/null +++ b/pkg/kv/kvserver/kvserverpb/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvserverpb", + srcs = [ + "lease_status.pb.go", + "liveness.go", + "liveness.pb.go", + "log.go", + "log.pb.go", + "proposer_kv.go", + "proposer_kv.pb.go", + "state.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/status", + ], +) diff --git a/pkg/kv/kvserver/protectedts/BUILD.bazel b/pkg/kv/kvserver/protectedts/BUILD.bazel new file mode 100644 index 000000000000..a2e157b27cc8 --- /dev/null +++ b/pkg/kv/kvserver/protectedts/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "protectedts", + srcs = [ + "protectedts.go", + "settings.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/hlc", + "//pkg/util/stop", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "protectedts_test", + srcs = ["protectedts_test.go"], + embed = [":protectedts"], +) diff --git a/pkg/kv/kvserver/protectedts/ptcache/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptcache/BUILD.bazel new file mode 100644 index 000000000000..0d16930d1d41 --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptcache/BUILD.bazel @@ -0,0 +1,58 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ptcache", + srcs = ["cache.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptcache", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "ptcache_test", + srcs = [ + "cache_test.go", + "main_test.go", + ], + deps = [ + ":ptcache", + "//pkg/base", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/protectedts/ptstorage", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/sqlutil", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel new file mode 100644 index 000000000000..f85b8e1ca19f --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptpb/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ptpb", + srcs = ["protectedts.pb.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/kv/kvserver/protectedts/ptprovider/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptprovider/BUILD.bazel new file mode 100644 index 000000000000..4c9257a353b1 --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptprovider/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ptprovider", + srcs = ["provider.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptprovider", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptcache", + "//pkg/kv/kvserver/protectedts/ptreconcile", + "//pkg/kv/kvserver/protectedts/ptstorage", + "//pkg/kv/kvserver/protectedts/ptverifier", + "//pkg/settings/cluster", + "//pkg/sql/sqlutil", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/kv/kvserver/protectedts/ptreconcile/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptreconcile/BUILD.bazel new file mode 100644 index 000000000000..ce5112c44f9b --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptreconcile/BUILD.bazel @@ -0,0 +1,59 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ptreconcile", + srcs = [ + "metrics.go", + "reconciler.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptreconcile", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/prometheus/client_model/go", + ], +) + +go_test( + name = "ptreconcile_test", + srcs = [ + "main_test.go", + "reconciler_test.go", + ], + deps = [ + ":ptreconcile", + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/protectedts/ptstorage/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptstorage/BUILD.bazel new file mode 100644 index 000000000000..f9061fc37c30 --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptstorage/BUILD.bazel @@ -0,0 +1,67 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ptstorage", + srcs = [ + "sql.go", + "storage.go", + "storage.pb.go", + "storage_with_database.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptstorage", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings/cluster", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "ptstorage_test", + srcs = [ + "main_test.go", + "storage_test.go", + "validate_test.go", + ], + embed = [":ptstorage"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/protectedts/ptverifier/BUILD.bazel b/pkg/kv/kvserver/protectedts/ptverifier/BUILD.bazel new file mode 100644 index 000000000000..60cd75f9c6bb --- /dev/null +++ b/pkg/kv/kvserver/protectedts/ptverifier/BUILD.bazel @@ -0,0 +1,47 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ptverifier", + srcs = ["verifier.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/protectedts/ptverifier", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "ptverifier_test", + srcs = [ + "main_test.go", + "verifier_test.go", + ], + deps = [ + ":ptverifier", + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/protectedts/ptstorage", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/sqlutil", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/raftentry/BUILD.bazel b/pkg/kv/kvserver/raftentry/BUILD.bazel new file mode 100644 index 000000000000..44fac6bb0356 --- /dev/null +++ b/pkg/kv/kvserver/raftentry/BUILD.bazel @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "raftentry", + srcs = [ + "cache.go", + "metrics.go", + "ring_buffer.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/raftentry", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) + +go_test( + name = "raftentry_test", + srcs = ["cache_test.go"], + embed = [":raftentry"], + deps = [ + "//pkg/roachpb", + "//pkg/util/leaktest", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) diff --git a/pkg/kv/kvserver/rangefeed/BUILD.bazel b/pkg/kv/kvserver/rangefeed/BUILD.bazel new file mode 100644 index 000000000000..b0c9e8f0ae9f --- /dev/null +++ b/pkg/kv/kvserver/rangefeed/BUILD.bazel @@ -0,0 +1,62 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rangefeed", + srcs = [ + "filter.go", + "metrics.go", + "processor.go", + "registry.go", + "resolved_timestamp.go", + "task.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rangefeed", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/bufalloc", + "//pkg/util/hlc", + "//pkg/util/interval", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "rangefeed_test", + srcs = [ + "processor_test.go", + "registry_test.go", + "resolved_timestamp_test.go", + "task_test.go", + ], + embed = [":rangefeed"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/rditer/BUILD.bazel b/pkg/kv/kvserver/rditer/BUILD.bazel new file mode 100644 index 000000000000..59f33bd3aab6 --- /dev/null +++ b/pkg/kv/kvserver/rditer/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rditer", + srcs = [ + "replica_data_iter.go", + "stats.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rditer", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/bufalloc", + ], +) + +go_test( + name = "rditer_test", + srcs = ["replica_data_iter_test.go"], + embed = [":rditer"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/spanset", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/uuid", + ], +) diff --git a/pkg/kv/kvserver/reports/BUILD.bazel b/pkg/kv/kvserver/reports/BUILD.bazel new file mode 100644 index 000000000000..018d670f357b --- /dev/null +++ b/pkg/kv/kvserver/reports/BUILD.bazel @@ -0,0 +1,87 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "reports", + srcs = [ + "constraint_stats_report.go", + "critical_localities_report.go", + "replication_stats_report.go", + "reporter.go", + "zone_key.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/reports", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/descpb", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "reports_test", + srcs = [ + "constraint_stats_report_test.go", + "critical_localities_report_test.go", + "helpers_test.go", + "main_test.go", + "replication_stats_report_test.go", + "reporter_test.go", + ], + embed = [":reports"], + deps = [ + "//pkg/base", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/keysutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/testcluster", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/keysutil", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/kv/kvserver/spanlatch/BUILD.bazel b/pkg/kv/kvserver/spanlatch/BUILD.bazel new file mode 100644 index 000000000000..3b4a05e831f1 --- /dev/null +++ b/pkg/kv/kvserver/spanlatch/BUILD.bazel @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "spanlatch", + srcs = [ + "doc.go", + "latch_interval_btree.go", + "list.go", + "manager.go", + "signal.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/spanlatch", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/spanset", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + ], +) + +go_test( + name = "spanlatch_test", + srcs = [ + "latch_interval_btree_test.go", + "manager_test.go", + "signal_test.go", + ], + embed = [":spanlatch"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/spanset", + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/spanset/BUILD.bazel b/pkg/kv/kvserver/spanset/BUILD.bazel new file mode 100644 index 000000000000..e04f38b2efee --- /dev/null +++ b/pkg/kv/kvserver/spanset/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "spanset", + srcs = [ + "batch.go", + "merge.go", + "spanset.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/spanset", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "spanset_test", + srcs = ["spanset_test.go"], + embed = [":spanset"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/split/BUILD.bazel b/pkg/kv/kvserver/split/BUILD.bazel new file mode 100644 index 000000000000..308a51058368 --- /dev/null +++ b/pkg/kv/kvserver/split/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "split", + srcs = [ + "decider.go", + "finder.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/split", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/util/syncutil", + ], +) + +go_test( + name = "split_test", + srcs = [ + "decider_test.go", + "finder_test.go", + ], + embed = [":split"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/kv/kvserver/stateloader/BUILD.bazel b/pkg/kv/kvserver/stateloader/BUILD.bazel new file mode 100644 index 000000000000..a8324e52caf6 --- /dev/null +++ b/pkg/kv/kvserver/stateloader/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stateloader", + srcs = [ + "initial.go", + "stateloader.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/stateloader", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) + +go_test( + name = "stateloader_test", + srcs = ["initial_test.go"], + embed = [":stateloader"], + deps = [ + "//pkg/roachpb", + "//pkg/storage", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//vendor/go.etcd.io/etcd/raft/raftpb", + ], +) diff --git a/pkg/kv/kvserver/tenantrate/BUILD.bazel b/pkg/kv/kvserver/tenantrate/BUILD.bazel new file mode 100644 index 000000000000..ef6f641adb40 --- /dev/null +++ b/pkg/kv/kvserver/tenantrate/BUILD.bazel @@ -0,0 +1,48 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tenantrate", + srcs = [ + "doc.go", + "factory.go", + "limiter.go", + "metrics.go", + "settings.go", + "system_limiter.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/tenantrate", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/metric", + "//pkg/util/metric/aggmetric", + "//pkg/util/quotapool", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "tenantrate_test", + srcs = [ + "helpers_test.go", + "limiter_test.go", + ], + data = glob(["testdata/**"]), + embed = [":tenantrate"], + deps = [ + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/metric", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/kv/kvserver/tscache/BUILD.bazel b/pkg/kv/kvserver/tscache/BUILD.bazel new file mode 100644 index 000000000000..87c75536f28d --- /dev/null +++ b/pkg/kv/kvserver/tscache/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tscache", + srcs = [ + "cache.go", + "interval_skl.go", + "metrics.go", + "skl_impl.go", + "tree_impl.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/tscache", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/util", + "//pkg/util/cache", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/interval", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/andy-kimball/arenaskl", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "tscache_test", + srcs = [ + "cache_test.go", + "interval_skl_test.go", + "tree_impl_test.go", + ], + embed = [":tscache"], + deps = [ + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/andy-kimball/arenaskl", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/kv/kvserver/txnrecovery/BUILD.bazel b/pkg/kv/kvserver/txnrecovery/BUILD.bazel new file mode 100644 index 000000000000..e5c6de017778 --- /dev/null +++ b/pkg/kv/kvserver/txnrecovery/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "txnrecovery", + srcs = [ + "manager.go", + "metrics.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/txnrecovery", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/syncutil/singleflight", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "txnrecovery_test", + srcs = ["manager_test.go"], + embed = [":txnrecovery"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/tracing", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/kv/kvserver/txnwait/BUILD.bazel b/pkg/kv/kvserver/txnwait/BUILD.bazel new file mode 100644 index 000000000000..faaba06d965a --- /dev/null +++ b/pkg/kv/kvserver/txnwait/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "txnwait", + srcs = [ + "metrics.go", + "queue.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/txnwait", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + ], +) + +go_test( + name = "txnwait_test", + srcs = ["queue_test.go"], + embed = [":txnwait"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/release/BUILD.bazel b/pkg/release/BUILD.bazel new file mode 100644 index 000000000000..3c2421e4c69a --- /dev/null +++ b/pkg/release/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "release", + srcs = ["release.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/release", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/roachpb/BUILD.bazel b/pkg/roachpb/BUILD.bazel new file mode 100644 index 000000000000..5b8ff9e2e12d --- /dev/null +++ b/pkg/roachpb/BUILD.bazel @@ -0,0 +1,112 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "roachpb", + srcs = [ + "api.go", + "api.pb.go", + "app_stats.go", + "app_stats.pb.go", + "batch.go", + "batch_generated.go", + "data.go", + "data.pb.go", + "errordetailtype_string.go", + "errors.go", + "errors.pb.go", + "internal.go", + "internal.pb.go", + "internal_raft.pb.go", + "io-formats.pb.go", + "merge_spans.go", + "metadata.go", + "metadata.pb.go", + "metadata_replicas.go", + "method.go", + "method_string.go", + "span_group.go", + "tenant.go", + "version.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/roachpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/storage/enginepb", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/caller", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/interval", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/timetz", + "//pkg/util/tracing/tracingpb", + "//pkg/util/uuid", + "//vendor/github.com/aws/aws-sdk-go/aws", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "roachpb_test", + srcs = [ + "api_test.go", + "app_stats_test.go", + "batch_test.go", + "data_test.go", + "dep_test.go", + "errors_test.go", + "main_test.go", + "merge_spans_test.go", + "metadata_replicas_test.go", + "metadata_test.go", + "span_group_test.go", + "string_test.go", + "tenant_test.go", + "version_test.go", + ], + embed = [":roachpb"], + deps = [ + "//pkg/keys", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/storage/enginepb", + "//pkg/testutils/buildutil", + "//pkg/testutils/zerofields", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/go.etcd.io/etcd/raft", + "//vendor/go.etcd.io/etcd/raft/confchange", + "//vendor/go.etcd.io/etcd/raft/quorum", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/go.etcd.io/etcd/raft/tracker", + ], +) diff --git a/pkg/rpc/BUILD.bazel b/pkg/rpc/BUILD.bazel new file mode 100644 index 000000000000..0d27bebce521 --- /dev/null +++ b/pkg/rpc/BUILD.bazel @@ -0,0 +1,116 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rpc", + srcs = [ + "auth.go", + "auth_tenant.go", + "breaker.go", + "clock_offset.go", + "connection_class.go", + "context.go", + "context_testutils.go", + "heartbeat.go", + "heartbeat.pb.go", + "keepalive.go", + "metrics.go", + "pg.go", + "snappy.go", + "stats_handler.go", + "tls.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/rpc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings/cluster", + "//pkg/util/contextutil", + "//pkg/util/envutil", + "//pkg/util/growstack", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/netutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/VividCortex/ewma", + "//vendor/github.com/cenkalti/backoff", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/facebookgo/clock", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/golang/snappy", + "//vendor/github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc", + "//vendor/github.com/montanaflynn/stats", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/golang.org/x/sync/syncmap", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/backoff", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/credentials", + "//vendor/google.golang.org/grpc/encoding", + "//vendor/google.golang.org/grpc/encoding/proto", + "//vendor/google.golang.org/grpc/keepalive", + "//vendor/google.golang.org/grpc/metadata", + "//vendor/google.golang.org/grpc/peer", + "//vendor/google.golang.org/grpc/stats", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "rpc_test", + srcs = [ + "auth_test.go", + "clock_offset_test.go", + "context_test.go", + "heartbeat_test.go", + "main_test.go", + "stats_handler_test.go", + "tls_test.go", + ], + embed = [":rpc"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/netutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/stretchr/testify/require", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/credentials", + "//vendor/google.golang.org/grpc/keepalive", + "//vendor/google.golang.org/grpc/metadata", + "//vendor/google.golang.org/grpc/peer", + "//vendor/google.golang.org/grpc/stats", + "//vendor/google.golang.org/grpc/status", + ], +) diff --git a/pkg/rpc/nodedialer/BUILD.bazel b/pkg/rpc/nodedialer/BUILD.bazel new file mode 100644 index 000000000000..46c57c3bc29a --- /dev/null +++ b/pkg/rpc/nodedialer/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "nodedialer", + srcs = ["nodedialer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/rpc/nodedialer", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/closedts", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/util/grpcutil", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "nodedialer_test", + srcs = ["nodedialer_test.go"], + embed = [":nodedialer"], + deps = [ + "//pkg/clusterversion", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/scheduledjobs/BUILD.bazel b/pkg/scheduledjobs/BUILD.bazel new file mode 100644 index 000000000000..5e77126e5621 --- /dev/null +++ b/pkg/scheduledjobs/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "scheduledjobs", + srcs = ["env.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/scheduledjobs", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/settings/cluster", + "//pkg/sql/sqlutil", + "//pkg/util/timeutil", + ], +) diff --git a/pkg/security/BUILD.bazel b/pkg/security/BUILD.bazel new file mode 100644 index 000000000000..1a431fbd0a38 --- /dev/null +++ b/pkg/security/BUILD.bazel @@ -0,0 +1,114 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "security", + srcs = [ + "auth.go", + "certificate_loader.go", + "certificate_manager.go", + "certs.go", + "ocsp.go", + "password.go", + "pem.go", + "tls.go", + "tls_settings.go", + "utils.go", + "x509.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/security", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/contextutil", + "//pkg/util/envutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/crypto/bcrypt", + "//vendor/golang.org/x/crypto/ocsp", + "//vendor/golang.org/x/crypto/ssh/terminal", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_test( + name = "security_test", + srcs = [ + "auth_test.go", + "certificate_loader_test.go", + "certificate_manager_test.go", + "certs_rotation_test.go", + "certs_tenant_test.go", + "certs_test.go", + "main_test.go", + "tls_test.go", + "x509_test.go", + ], + deps = [ + ":security", + "//pkg/base", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util/envutil", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/exp/rand", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) diff --git a/pkg/security/securitytest/BUILD.bazel b/pkg/security/securitytest/BUILD.bazel new file mode 100644 index 000000000000..2fc85a354eba --- /dev/null +++ b/pkg/security/securitytest/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "securitytest", + srcs = [ + "embedded.go", + "securitytest.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/security/securitytest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/security", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/server/BUILD.bazel b/pkg/server/BUILD.bazel new file mode 100644 index 000000000000..02e6da7193df --- /dev/null +++ b/pkg/server/BUILD.bazel @@ -0,0 +1,321 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "server", + srcs = [ + "admin.go", + "api_error.go", + "authentication.go", + "config.go", + "config_unix.go", + "config_windows.go", + "doc.go", + "drain.go", + "grpc_server.go", + "init.go", + "loopback.go", + "node.go", + "node_engine_health.go", + "node_tombstone_storage.go", + "problem_ranges.go", + "rlimit_bsd.go", + "rlimit_darwin.go", + "rlimit_unix.go", + "server.go", + "server_sql.go", + "server_systemlog_gc.go", + "server_update.go", + "settingsworker.go", + "statement_diagnostics_requests.go", + "statements.go", + "status.go", + "sticky_engine.go", + "tenant_status.go", + "testing_knobs.go", + "testserver.go", + "updates.go", + ], + cgo = True, + importpath = "github.com/cockroachdb/cockroach/pkg/server", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/blobs/blobspb", + "//pkg/build", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/docs", + "//pkg/gossip", + "//pkg/gossip/resolver", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/jobs/jobsprotectedts", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/bulk", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvclient/kvtenant", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/closedts/container", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/kv/kvserver/protectedts/ptprovider", + "//pkg/kv/kvserver/protectedts/ptreconcile", + "//pkg/kv/kvserver/reports", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/server/debug", + "//pkg/server/diagnosticspb", + "//pkg/server/goroutinedumper", + "//pkg/server/heapprofiler", + "//pkg/server/serverpb", + "//pkg/server/status", + "//pkg/server/status/statuspb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/hydratedtables", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/colexec", + "//pkg/sql/distsql", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/gcjob", + "//pkg/sql/gcjob/gcjobnotifier", + "//pkg/sql/optionalnodeliveness", + "//pkg/sql/parser", + "//pkg/sql/pgwire", + "//pkg/sql/physicalplan", + "//pkg/sql/querycache", + "//pkg/sql/roleoption", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlliveness/slprovider", + "//pkg/sql/sqlutil", + "//pkg/sql/stats", + "//pkg/sql/stmtdiagnostics", + "//pkg/sql/types", + "//pkg/sqlmigrations", + "//pkg/storage", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/storage/enginepb", + "//pkg/ts", + "//pkg/ts/catalog", + "//pkg/ui", + "//pkg/util", + "//pkg/util/cloudinfo", + "//pkg/util/contextutil", + "//pkg/util/encoding", + "//pkg/util/envutil", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/httputil", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/quotapool", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//pkg/util/uuid", + "//vendor/github.com/cenkalti/backoff", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/circuitbreaker", + "//vendor/github.com/cockroachdb/cmux", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/cockroachdb/sentry-go", + "//vendor/github.com/elastic/gosigar", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/utilities", + "//vendor/github.com/marusama/semaphore", + "//vendor/github.com/mitchellh/reflectwalk", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/shirou/gopsutil/cpu", + "//vendor/github.com/shirou/gopsutil/host", + "//vendor/github.com/shirou/gopsutil/load", + "//vendor/github.com/shirou/gopsutil/mem", + "//vendor/go.etcd.io/etcd/raft", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/metadata", + "//vendor/google.golang.org/grpc/status", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "server_test", + srcs = [ + "admin_cluster_test.go", + "admin_test.go", + "authentication_test.go", + "config_test.go", + "connectivity_test.go", + "drain_test.go", + "graphite_test.go", + "intent_test.go", + "main_test.go", + "multi_store_test.go", + "node_test.go", + "node_tombstone_storage_test.go", + "servemode_test.go", + "server_systemlog_gc_test.go", + "server_test.go", + "settingsworker_test.go", + "stats_test.go", + "status_test.go", + "sticky_engine_test.go", + "testserver_test.go", + "updates_test.go", + "version_cluster_test.go", + ], + embed = [":server"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/gossip/resolver", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/closedts/ctpb", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server/debug", + "//pkg/server/diagnosticspb", + "//pkg/server/serverpb", + "//pkg/server/status/statuspb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/execinfrapb", + "//pkg/sql/sem/tree", + "//pkg/sql/tests", + "//pkg/sqlmigrations", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/testutils", + "//pkg/testutils/diagutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/ts", + "//pkg/ts/catalog", + "//pkg/ts/tspb", + "//pkg/ui", + "//pkg/util", + "//pkg/util/envutil", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/httputil", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/netutil", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/crypto/bcrypt", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/credentials", + "//vendor/google.golang.org/grpc/status", + ], +) diff --git a/pkg/server/debug/BUILD.bazel b/pkg/server/debug/BUILD.bazel new file mode 100644 index 000000000000..1007681a14be --- /dev/null +++ b/pkg/server/debug/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "debug", + srcs = [ + "cpuprofile.go", + "logspy.go", + "server.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/debug", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv/kvserver", + "//pkg/server/debug/goroutineui", + "//pkg/server/debug/pprofui", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble/tool", + "//vendor/github.com/rcrowley/go-metrics", + "//vendor/github.com/rcrowley/go-metrics/exp", + "//vendor/github.com/spf13/cobra", + "//vendor/golang.org/x/net/trace", + "//vendor/google.golang.org/grpc/metadata", + ], +) + +go_test( + name = "debug_test", + srcs = ["logspy_test.go"], + embed = [":debug"], + deps = [ + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/server/debug/goroutineui/BUILD.bazel b/pkg/server/debug/goroutineui/BUILD.bazel new file mode 100644 index 000000000000..5efbe8bbe36f --- /dev/null +++ b/pkg/server/debug/goroutineui/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "goroutineui", + srcs = [ + "dump.go", + "html.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/debug/goroutineui", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/maruel/panicparse/stack"], +) + +go_test( + name = "goroutineui_test", + srcs = ["dump_test.go"], + embed = [":goroutineui"], + deps = [ + "//pkg/util/leaktest", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/server/debug/pprofui/BUILD.bazel b/pkg/server/debug/pprofui/BUILD.bazel new file mode 100644 index 000000000000..dd2918eebe0a --- /dev/null +++ b/pkg/server/debug/pprofui/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pprofui", + srcs = [ + "fakeflags.go", + "response_writer.go", + "server.go", + "storage.go", + "storage_mem.go", + "ui.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/debug/pprofui", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/google/pprof/driver", + "//vendor/github.com/google/pprof/profile", + "//vendor/github.com/spf13/pflag", + ], +) + +go_test( + name = "pprofui_test", + srcs = ["server_test.go"], + embed = [":pprofui"], +) diff --git a/pkg/server/diagnosticspb/BUILD.bazel b/pkg/server/diagnosticspb/BUILD.bazel new file mode 100644 index 000000000000..a627fbf22b8f --- /dev/null +++ b/pkg/server/diagnosticspb/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "diagnosticspb", + srcs = [ + "diagnostics.go", + "diagnostics.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/diagnosticspb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//pkg/config/zonepb", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/util/envutil", + "//pkg/util/uuid", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) + +go_test( + name = "diagnosticspb_test", + srcs = ["dep_test.go"], + embed = [":diagnosticspb"], + deps = [ + "//pkg/testutils/buildutil", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/server/dumpstore/BUILD.bazel b/pkg/server/dumpstore/BUILD.bazel new file mode 100644 index 000000000000..ef43b1958cee --- /dev/null +++ b/pkg/server/dumpstore/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "dumpstore", + srcs = ["dumpstore.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/server/dumpstore", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/log", + ], +) + +go_test( + name = "dumpstore_test", + srcs = ["dumpstore_test.go"], + embed = [":dumpstore"], + deps = [ + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/server/goroutinedumper/BUILD.bazel b/pkg/server/goroutinedumper/BUILD.bazel new file mode 100644 index 000000000000..dd317c2d312d --- /dev/null +++ b/pkg/server/goroutinedumper/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "goroutinedumper", + srcs = ["goroutinedumper.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/server/goroutinedumper", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/dumpstore", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "goroutinedumper_test", + srcs = ["goroutinedumper_test.go"], + embed = [":goroutinedumper"], + deps = [ + "//pkg/server/dumpstore", + "//pkg/settings/cluster", + "//pkg/testutils", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/server/heapprofiler/BUILD.bazel b/pkg/server/heapprofiler/BUILD.bazel new file mode 100644 index 000000000000..c18c5fbb9210 --- /dev/null +++ b/pkg/server/heapprofiler/BUILD.bazel @@ -0,0 +1,37 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "heapprofiler", + srcs = [ + "cgoprofiler.go", + "heapprofiler.go", + "profiler_common.go", + "profilestore.go", + "statsprofiler.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/heapprofiler", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/dumpstore", + "//pkg/server/status", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/util/envutil", + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "heapprofiler_test", + srcs = [ + "profiler_common_test.go", + "profilestore_test.go", + ], + embed = [":heapprofiler"], + deps = [ + "//pkg/server/dumpstore", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/server/serverpb/BUILD.bazel b/pkg/server/serverpb/BUILD.bazel new file mode 100644 index 000000000000..d16f33ebb0aa --- /dev/null +++ b/pkg/server/serverpb/BUILD.bazel @@ -0,0 +1,55 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "serverpb", + srcs = [ + "admin.go", + "admin.pb.go", + "admin.pb.gw.go", + "authentication.pb.go", + "authentication.pb.gw.go", + "init.pb.go", + "status.go", + "status.pb.go", + "status.pb.gw.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/serverpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/jobs/jobspb", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/server/diagnosticspb", + "//pkg/server/status/statuspb", + "//pkg/sql/catalog/descpb", + "//pkg/storage/enginepb", + "//pkg/ts/catalog", + "//pkg/util", + "//pkg/util/errorutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/uuid", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/golang/protobuf/descriptor", + "//vendor/github.com/golang/protobuf/proto", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/utilities", + "//vendor/go.etcd.io/etcd/raft/raftpb", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/grpclog", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "serverpb_test", + srcs = ["admin_test.go"], + embed = [":serverpb"], + deps = ["//vendor/github.com/stretchr/testify/assert"], +) diff --git a/pkg/server/status/BUILD.bazel b/pkg/server/status/BUILD.bazel new file mode 100644 index 000000000000..2ab771494f86 --- /dev/null +++ b/pkg/server/status/BUILD.bazel @@ -0,0 +1,142 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "status", + srcs = [ + "disk_counters.go", + "disk_counters_darwin.go", + "health_check.go", + "recorder.go", + "runtime.go", + "runtime_jemalloc.go", + "runtime_jemalloc_darwin.go", + ], + # keep + cdeps = [ + "@cockroach//:libjemalloc", + ], + cgo = True, + # keep + clinkopts = select({ + "@io_bazel_rules_go//go/platform:android": [ + "-lrt -lm -lpthread", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "-lrt -lm -lpthread", + ], + "//conditions:default": [], + }), + # keep + cppopts = [ + "-DJEMALLOC_NO_DEMANGLE", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/status", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/server/status/statuspb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/ts/tspb", + "//pkg/util/cgroups", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/elastic/gosigar", + "//vendor/github.com/shirou/gopsutil/net", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/github.com/lufia/iostat", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/github.com/lufia/iostat", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/github.com/shirou/gopsutil/disk", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "status_test", + srcs = [ + "health_check_test.go", + "jemalloc_test.go", + "main_test.go", + "recorder_test.go", + "runtime_test.go", + ], + embed = [":status"], + deps = [ + "//pkg/build", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server/status/statuspb", + "//pkg/settings/cluster", + "//pkg/ts/tspb", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/metric", + "//pkg/util/metric/aggmetric", + "//pkg/util/timeutil", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/shirou/gopsutil/net", + ], +) diff --git a/pkg/server/status/statuspb/BUILD.bazel b/pkg/server/status/statuspb/BUILD.bazel new file mode 100644 index 000000000000..74c9dc08cc97 --- /dev/null +++ b/pkg/server/status/statuspb/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "statuspb", + srcs = ["status.pb.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/server/status/statuspb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//pkg/roachpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) diff --git a/pkg/server/telemetry/BUILD.bazel b/pkg/server/telemetry/BUILD.bazel new file mode 100644 index 000000000000..d9dd99822b1d --- /dev/null +++ b/pkg/server/telemetry/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "telemetry", + srcs = [ + "doc.go", + "features.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/server/telemetry", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "telemetry_test", + srcs = ["features_test.go"], + deps = [ + ":telemetry", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/settings/BUILD.bazel b/pkg/settings/BUILD.bazel new file mode 100644 index 000000000000..286d234bbc35 --- /dev/null +++ b/pkg/settings/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "settings", + srcs = [ + "bool.go", + "byte_size.go", + "doc.go", + "duration.go", + "enum.go", + "float.go", + "int.go", + "masked.go", + "registry.go", + "setting.go", + "statemachine.go", + "string.go", + "updater.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/settings", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/humanizeutil", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "settings_test", + srcs = ["settings_test.go"], + deps = [ + ":settings", + "//pkg/testutils", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/settings/cluster/BUILD.bazel b/pkg/settings/cluster/BUILD.bazel new file mode 100644 index 000000000000..045cb8172964 --- /dev/null +++ b/pkg/settings/cluster/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cluster", + srcs = ["cluster_settings.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/settings/cluster", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/envutil", + "//pkg/util/log", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/BUILD.bazel b/pkg/sql/BUILD.bazel new file mode 100644 index 000000000000..47ebc0fd206b --- /dev/null +++ b/pkg/sql/BUILD.bazel @@ -0,0 +1,571 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sql", + srcs = [ + "add_column.go", + "advancecode_string.go", + "alter_column_type.go", + "alter_database.go", + "alter_index.go", + "alter_primary_key.go", + "alter_role.go", + "alter_schema.go", + "alter_sequence.go", + "alter_table.go", + "alter_table_regional_affinity.go", + "alter_table_set_schema.go", + "alter_type.go", + "analyze_expr.go", + "app_stats.go", + "apply_join.go", + "authorization.go", + "backfill.go", + "buffer.go", + "cancel_queries.go", + "cancel_sessions.go", + "check.go", + "cluster_wide_id.go", + "comment_on_column.go", + "comment_on_database.go", + "comment_on_index.go", + "comment_on_table.go", + "conn_executor.go", + "conn_executor_exec.go", + "conn_executor_prepare.go", + "conn_executor_savepoints.go", + "conn_fsm.go", + "conn_io.go", + "control_jobs.go", + "control_schedules.go", + "copy.go", + "copy_file_upload.go", + "crdb_internal.go", + "create_database.go", + "create_extension.go", + "create_index.go", + "create_role.go", + "create_schema.go", + "create_sequence.go", + "create_stats.go", + "create_table.go", + "create_type.go", + "create_view.go", + "data_source.go", + "database.go", + "deallocate.go", + "delayed.go", + "delete.go", + "delete_range.go", + "descriptor.go", + "discard.go", + "distinct.go", + "distsql_physical_planner.go", + "distsql_plan_backfill.go", + "distsql_plan_bulk.go", + "distsql_plan_csv.go", + "distsql_plan_ctas.go", + "distsql_plan_join.go", + "distsql_plan_scrub_physical.go", + "distsql_plan_stats.go", + "distsql_plan_window.go", + "distsql_running.go", + "distsql_spec_exec_factory.go", + "doc.go", + "drop_cascade.go", + "drop_database.go", + "drop_index.go", + "drop_owned_by.go", + "drop_role.go", + "drop_schema.go", + "drop_sequence.go", + "drop_table.go", + "drop_type.go", + "drop_view.go", + "error_if_rows.go", + "event_log.go", + "exec_factory_util.go", + "exec_log.go", + "exec_util.go", + "execute.go", + "executor_statement_metrics.go", + "explain_bundle.go", + "explain_distsql.go", + "explain_plan.go", + "explain_vec.go", + "export.go", + "filter.go", + "grant_revoke.go", + "grant_role.go", + "group.go", + "index_join.go", + "information_schema.go", + "insert.go", + "insert_fast_path.go", + "internal.go", + "inverted_filter.go", + "inverted_join.go", + "inverted_span_encoding.go", + "join.go", + "join_predicate.go", + "limit.go", + "lookup_join.go", + "max_one_row.go", + "mem_metrics.go", + "nodestatus_string.go", + "notice.go", + "opaque.go", + "opt_catalog.go", + "opt_exec_factory.go", + "ordinality.go", + "partition_utils.go", + "pg_catalog.go", + "pg_extension.go", + "plan.go", + "plan_batch.go", + "plan_columns.go", + "plan_node_to_row_source.go", + "plan_opt.go", + "plan_ordering.go", + "planhook.go", + "planner.go", + "prepared_stmt.go", + "privileged_accessor.go", + "project_set.go", + "reassign_owned_by.go", + "recursive_cte.go", + "refresh_materialized_view.go", + "relocate.go", + "rename_column.go", + "rename_database.go", + "rename_index.go", + "rename_table.go", + "render.go", + "reparent_database.go", + "resolver.go", + "revert.go", + "revoke_role.go", + "row_source_to_plan_node.go", + "save_table.go", + "scan.go", + "scatter.go", + "schema.go", + "schema_changer.go", + "schema_changer_metrics.go", + "scrub.go", + "scrub_constraint.go", + "scrub_fk.go", + "scrub_index.go", + "scrub_physical.go", + "select_name_resolution.go", + "sequence.go", + "sequence_select.go", + "serial.go", + "set_cluster_setting.go", + "set_default_isolation.go", + "set_schema.go", + "set_session_authorization.go", + "set_transaction.go", + "set_var.go", + "set_zone_config.go", + "show_cluster_setting.go", + "show_create.go", + "show_create_clauses.go", + "show_fingerprints.go", + "show_histogram.go", + "show_ranges.go", + "show_stats.go", + "show_trace.go", + "show_trace_replica.go", + "show_zone_config.go", + "sort.go", + "split.go", + "spool.go", + "statement.go", + "subquery.go", + "table.go", + "tablewriter.go", + "tablewriter_delete.go", + "tablewriter_insert.go", + "tablewriter_update.go", + "tablewriter_upsert_opt.go", + "temporary_schema.go", + "tenant.go", + "testutils.go", + "truncate.go", + "txn_state.go", + "txnevent_string.go", + "txntype_string.go", + "type_change.go", + "unary.go", + "union.go", + "unsplit.go", + "unsupported_vars.go", + "update.go", + "upsert.go", + "user.go", + "values.go", + "vars.go", + "views.go", + "virtual_schema.go", + "virtual_table.go", + "walk.go", + "window.go", + "zero.go", + "zigzag_join.go", + "zone_config.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/docs", + "//pkg/geo/geoindex", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/kv/kvserver/protectedts", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/scheduledjobs", + "//pkg/security", + "//pkg/server/serverpb", + "//pkg/server/status/statuspb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/backfill", + "//pkg/sql/catalog", + "//pkg/sql/catalog/accessors", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/hydratedtables", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/resolver", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/colexec", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colflow", + "//pkg/sql/covering", + "//pkg/sql/delegate", + "//pkg/sql/distsql", + "//pkg/sql/enum", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/faketreeeval", + "//pkg/sql/flowinfra", + "//pkg/sql/gcjob/gcjobnotifier", + "//pkg/sql/lex", + "//pkg/sql/mutations", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/exec", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/exec/explain", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/xform", + "//pkg/sql/paramparse", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/pgwire/pgwirebase", + "//pkg/sql/physicalplan", + "//pkg/sql/physicalplan/replicaoracle", + "//pkg/sql/privilege", + "//pkg/sql/querycache", + "//pkg/sql/roleoption", + "//pkg/sql/row", + "//pkg/sql/rowcontainer", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/schemachange", + "//pkg/sql/schemaexpr", + "//pkg/sql/scrub", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/transform", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/span", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqltelemetry", + "//pkg/sql/sqlutil", + "//pkg/sql/stats", + "//pkg/sql/stmtdiagnostics", + "//pkg/sql/types", + "//pkg/sql/vtable", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/cancelchecker", + "//pkg/util/contextutil", + "//pkg/util/ctxgroup", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/envutil", + "//pkg/util/errorutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/fsm", + "//pkg/util/grpcutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/ring", + "//pkg/util/sequence", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//pkg/util/treeprinter", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/hintdetail", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/lib/pq", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/prometheus/client_model/go", + "//vendor/golang.org/x/net/trace", + "//vendor/golang.org/x/text/collate", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +go_test( + name = "sql_test", + srcs = [ + "alter_column_type_test.go", + "ambiguous_commit_test.go", + "as_of_test.go", + "builtin_mem_usage_test.go", + "builtin_test.go", + "comment_on_column_test.go", + "comment_on_database_test.go", + "comment_on_index_test.go", + "comment_on_table_test.go", + "conn_executor_internal_test.go", + "conn_executor_savepoints_test.go", + "conn_executor_test.go", + "conn_io_test.go", + "copy_file_upload_test.go", + "copy_in_test.go", + "copy_test.go", + "crdb_internal_test.go", + "create_role_test.go", + "create_stats_test.go", + "create_table_test.go", + "create_test.go", + "database_test.go", + "dep_test.go", + "descriptor_mutation_test.go", + "distsql_physical_planner_test.go", + "distsql_plan_backfill_test.go", + "distsql_running_test.go", + "drop_helpers_test.go", + "drop_test.go", + "err_count_test.go", + "explain_bundle_test.go", + "explain_test.go", + "explain_tree_test.go", + "indexbackfiller_test.go", + "internal_test.go", + "main_test.go", + "materialized_view_test.go", + "metric_test.go", + "metric_util_test.go", + "mutation_test.go", + "namespace_test.go", + "old_foreign_key_desc_test.go", + "partition_test.go", + "pg_oid_test.go", + "pgwire_internal_test.go", + "plan_opt_test.go", + "planner_test.go", + "privileged_accessor_test.go", + "rand_test.go", + "rename_test.go", + "revert_test.go", + "run_control_test.go", + "scan_test.go", + "scatter_test.go", + "schema_changer_test.go", + "scrub_test.go", + "sequence_test.go", + "set_zone_config_test.go", + "show_fingerprints_test.go", + "show_ranges_test.go", + "show_stats_test.go", + "show_test.go", + "show_trace_replica_test.go", + "sort_test.go", + "span_builder_test.go", + "split_test.go", + "table_ref_test.go", + "table_test.go", + "telemetry_test.go", + "temporary_schema_test.go", + "trace_test.go", + "txn_restart_test.go", + "txn_state_test.go", + "type_change_test.go", + "unsplit_test.go", + "upsert_test.go", + "user_test.go", + "values_test.go", + "virtual_table_test.go", + "zone_config_test.go", + "zone_test.go", + ], + data = glob(["testdata/**"]), + embed = [":sql"], + deps = [ + "//pkg/base", + "//pkg/ccl/kvccl/kvtenantccl", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/diagnosticspb", + "//pkg/server/serverpb", + "//pkg/server/status/statuspb", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/distsql", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/gcjob", + "//pkg/sql/lex", + "//pkg/sql/mutations", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgwirebase", + "//pkg/sql/physicalplan", + "//pkg/sql/querycache", + "//pkg/sql/roleoption", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/scrub", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/span", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqltestutils", + "//pkg/sql/sqlutil", + "//pkg/sql/stats", + "//pkg/sql/stmtdiagnostics", + "//pkg/sql/tests", + "//pkg/sql/types", + "//pkg/sqlmigrations", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/diagutils", + "//pkg/testutils/jobutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/caller", + "//pkg/util/cancelchecker", + "//pkg/util/cloudinfo", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/fsm", + "//pkg/util/hlc", + "//pkg/util/httputil", + "//pkg/util/json", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/shuffle", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/treeprinter", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/jackc/pgx/pgtype", + "//vendor/github.com/jackc/pgx/v4:pgx", + "//vendor/github.com/lib/pq", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/pmezard/go-difflib/difflib", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/backfill/BUILD.bazel b/pkg/sql/backfill/BUILD.bazel new file mode 100644 index 000000000000..784752385ace --- /dev/null +++ b/pkg/sql/backfill/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "backfill", + srcs = ["backfill.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/backfill", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/execinfra", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/transform", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlerrors", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/mon", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/catalog/BUILD.bazel b/pkg/sql/catalog/BUILD.bazel new file mode 100644 index 000000000000..59abe902fe6b --- /dev/null +++ b/pkg/sql/catalog/BUILD.bazel @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "catalog", + srcs = [ + "accessor.go", + "catalog.go", + "desc_getter.go", + "descriptor.go", + "errors.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/hlc", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + ], +) + +go_test( + name = "catalog_test", + srcs = [ + "dep_test.go", + "descriptor_test.go", + ], + embed = [":catalog"], + deps = [ + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/tabledesc", + "//pkg/testutils/buildutil", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/catalog/accessors/BUILD.bazel b/pkg/sql/catalog/accessors/BUILD.bazel new file mode 100644 index 000000000000..c87d3d8eb386 --- /dev/null +++ b/pkg/sql/catalog/accessors/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "accessors", + srcs = [ + "logical_schema_accessors.go", + "physical_schema_accessors.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/accessors", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlerrors", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/catalog/bootstrap/BUILD.bazel b/pkg/sql/catalog/bootstrap/BUILD.bazel new file mode 100644 index 000000000000..366c2cb54c04 --- /dev/null +++ b/pkg/sql/catalog/bootstrap/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "bootstrap", + srcs = ["metadata.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/bootstrap", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/catalog/catalogkeys/BUILD.bazel b/pkg/sql/catalog/catalogkeys/BUILD.bazel new file mode 100644 index 000000000000..d3a3a1d6c179 --- /dev/null +++ b/pkg/sql/catalog/catalogkeys/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "catalogkeys", + srcs = ["keys.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/catalogkeys", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/sem/tree", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "catalogkeys_test", + srcs = ["keys_test.go"], + embed = [":catalogkeys"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/sql/catalog/catalogkv/BUILD.bazel b/pkg/sql/catalog/catalogkv/BUILD.bazel new file mode 100644 index 000000000000..63d1201ae656 --- /dev/null +++ b/pkg/sql/catalog/catalogkv/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "catalogkv", + srcs = [ + "catalogkv.go", + "descriptorkind_string.go", + "namespace.go", + "physical_accessor.go", + "test_utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/catalogkv", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/kv", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlerrors", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/catalog/catconstants/BUILD.bazel b/pkg/sql/catalog/catconstants/BUILD.bazel new file mode 100644 index 000000000000..3a53d5b67670 --- /dev/null +++ b/pkg/sql/catalog/catconstants/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "catconstants", + srcs = ["constants.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/catconstants", + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/catalog/colinfo/BUILD.bazel b/pkg/sql/catalog/colinfo/BUILD.bazel new file mode 100644 index 000000000000..55a5d337d67e --- /dev/null +++ b/pkg/sql/catalog/colinfo/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colinfo", + srcs = [ + "col_type_info.go", + "column_resolver.go", + "column_type_properties.go", + "data_source.go", + "doc.go", + "ordering.go", + "result_columns.go", + "system_columns.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/colinfo", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + "//vendor/golang.org/x/text/language", + ], +) + +go_test( + name = "colinfo_test", + srcs = ["result_columns_test.go"], + embed = [":colinfo"], + deps = ["//pkg/sql/types"], +) diff --git a/pkg/sql/catalog/database/BUILD.bazel b/pkg/sql/catalog/database/BUILD.bazel new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkg/sql/catalog/dbdesc/BUILD.bazel b/pkg/sql/catalog/dbdesc/BUILD.bazel new file mode 100644 index 000000000000..3d82fb414a4d --- /dev/null +++ b/pkg/sql/catalog/dbdesc/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "dbdesc", + srcs = ["database_desc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/dbdesc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/privilege", + "//pkg/util/hlc", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/redact", + ], +) + +go_test( + name = "dbdesc_test", + srcs = ["database_test.go"], + embed = [":dbdesc"], + deps = [ + "//pkg/security", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/catalog/descpb/BUILD.bazel b/pkg/sql/catalog/descpb/BUILD.bazel new file mode 100644 index 000000000000..d63c9c2fe734 --- /dev/null +++ b/pkg/sql/catalog/descpb/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "descpb", + srcs = [ + "column.go", + "constraint.go", + "descriptor.go", + "encoded_datum.pb.go", + "formatversion_string.go", + "index.go", + "join_type.go", + "join_type.pb.go", + "locking.go", + "locking.pb.go", + "privilege.go", + "privilege.pb.go", + "privilegedescversion_string.go", + "structured.go", + "structured.pb.go", + "tenant.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/security", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/parser", + "//pkg/sql/privilege", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/hlc", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) + +go_test( + name = "descpb_test", + srcs = ["privilege_test.go"], + embed = [":descpb"], + deps = [ + "//pkg/keys", + "//pkg/security", + "//pkg/sql/privilege", + "//pkg/testutils", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/sql/catalog/descs/BUILD.bazel b/pkg/sql/catalog/descs/BUILD.bazel new file mode 100644 index 000000000000..10954da9a070 --- /dev/null +++ b/pkg/sql/catalog/descs/BUILD.bazel @@ -0,0 +1,71 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "descs", + srcs = [ + "collection.go", + "txn.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/hydratedtables", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/resolver", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "descs_test", + srcs = [ + "collection_test.go", + "main_test.go", + ], + deps = [ + ":descs", + "//pkg/base", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlutil", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/catalog/hydratedtables/BUILD.bazel b/pkg/sql/catalog/hydratedtables/BUILD.bazel new file mode 100644 index 000000000000..9d33247d25fe --- /dev/null +++ b/pkg/sql/catalog/hydratedtables/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hydratedtables", + srcs = ["hydratedcache.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/hydratedtables", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/sem/tree", + "//pkg/util/cache", + "//pkg/util/metric", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//vendor/github.com/biogo/store/llrb", + "//vendor/github.com/prometheus/client_model/go", + ], +) + +go_test( + name = "hydratedtables_test", + srcs = ["hydratedcache_test.go"], + embed = [":hydratedtables"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/leaktest", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/catalog/lease/BUILD.bazel b/pkg/sql/catalog/lease/BUILD.bazel new file mode 100644 index 000000000000..8fdf8cb68a2e --- /dev/null +++ b/pkg/sql/catalog/lease/BUILD.bazel @@ -0,0 +1,94 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lease", + srcs = [ + "lease.go", + "lease_test_utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/lease", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/quotapool", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + ], +) + +go_test( + name = "lease_test", + srcs = [ + "helpers_test.go", + "lease_internal_test.go", + "lease_test.go", + "main_test.go", + ], + embed = [":lease"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/sqltestutils", + "//pkg/sql/tests", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/lib/pq", + "//vendor/github.com/stretchr/testify/require", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/sql/catalog/resolver/BUILD.bazel b/pkg/sql/catalog/resolver/BUILD.bazel new file mode 100644 index 000000000000..002f951a621a --- /dev/null +++ b/pkg/sql/catalog/resolver/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "resolver", + srcs = ["resolver.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/resolver", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlerrors", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/catalog/schemadesc/BUILD.bazel b/pkg/sql/catalog/schemadesc/BUILD.bazel new file mode 100644 index 000000000000..b419611224b9 --- /dev/null +++ b/pkg/sql/catalog/schemadesc/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schemadesc", + srcs = ["schema_desc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/schemadesc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sessiondata", + "//pkg/util/hlc", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + ], +) + +go_test( + name = "schemadesc_test", + srcs = ["schema_desc_test.go"], + deps = [ + ":schemadesc", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/catalog/systemschema/BUILD.bazel b/pkg/sql/catalog/systemschema/BUILD.bazel new file mode 100644 index 000000000000..91258fc26254 --- /dev/null +++ b/pkg/sql/catalog/systemschema/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "systemschema", + srcs = ["system.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/systemschema", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/security", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/privilege", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "systemschema_test", + srcs = ["system_test.go"], + embed = [":systemschema"], + deps = [ + "//pkg/roachpb", + "//pkg/security", + "//pkg/sql/catalog", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/catalog/typedesc", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/catalog/tabledesc/BUILD.bazel b/pkg/sql/catalog/tabledesc/BUILD.bazel new file mode 100644 index 000000000000..b7485dfa1c3e --- /dev/null +++ b/pkg/sql/catalog/tabledesc/BUILD.bazel @@ -0,0 +1,77 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tabledesc", + srcs = [ + "safe_format.go", + "structured.go", + "table.go", + "table_desc.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/tabledesc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlerrors", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/hlc", + "//pkg/util/interval", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "tabledesc_test", + srcs = [ + "helpers_test.go", + "main_test.go", + "safe_format_test.go", + "structured_test.go", + "table_desc_test.go", + "validate_test.go", + ], + embed = [":tabledesc"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/typedesc", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/catalog/typedesc/BUILD.bazel b/pkg/sql/catalog/typedesc/BUILD.bazel new file mode 100644 index 000000000000..7ad463e4190c --- /dev/null +++ b/pkg/sql/catalog/typedesc/BUILD.bazel @@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "typedesc", + srcs = [ + "safe_format.go", + "type_desc.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/typedesc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/enum", + "//pkg/sql/oidext", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/hlc", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "typedesc_test", + srcs = [ + "main_test.go", + "safe_format_test.go", + "type_desc_test.go", + ], + deps = [ + ":typedesc", + "//pkg/keys", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/catalog", + "//pkg/sql/catalog/dbdesc", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/schemadesc", + "//pkg/sql/privilege", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/colcontainer/BUILD.bazel b/pkg/sql/colcontainer/BUILD.bazel new file mode 100644 index 000000000000..e8b198fe12fe --- /dev/null +++ b/pkg/sql/colcontainer/BUILD.bazel @@ -0,0 +1,52 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colcontainer", + srcs = [ + "diskqueue.go", + "partitionedqueue.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colcontainer", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/colserde", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/types", + "//pkg/storage/fs", + "//pkg/util/mon", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/snappy", + "//vendor/github.com/marusama/semaphore", + ], +) + +go_test( + name = "colcontainer_test", + srcs = [ + "diskqueue_test.go", + "main_test.go", + "partitionedqueue_test.go", + ], + deps = [ + ":colcontainer", + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/coldatatestutils", + "//pkg/settings/cluster", + "//pkg/sql/colexecbase", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/types", + "//pkg/storage/fs", + "//pkg/testutils/colcontainerutils", + "//pkg/testutils/skip", + "//pkg/util/humanizeutil", + "//pkg/util/leaktest", + "//pkg/util/mon", + "//pkg/util/randutil", + "//vendor/github.com/marusama/semaphore", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/colconv/BUILD.bazel b/pkg/sql/colconv/BUILD.bazel new file mode 100644 index 000000000000..465508bcaefa --- /dev/null +++ b/pkg/sql/colconv/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +# TODO(irfansharif): The dependency tree for *.eg.go needs +# sorting out. It depends on execgen+templates from elsewhere. Look towards +# colexec for how this should be done. For now we just lazily depend on the +# already generated+checked in file. +# +# keep +go_library( + name = "colconv", + srcs = [ + "datum_to_vec.eg.go", + "vec_to_datum.eg.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colconv", + visibility = ["//visibility:public"], + # Pin dependencies used by auto-generated code. + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/typeconv", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", # keep + "//pkg/util/timeutil/pgdate", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", # keep + "//vendor/github.com/lib/pq/oid", + ], +) diff --git a/pkg/sql/colencoding/BUILD.bazel b/pkg/sql/colencoding/BUILD.bazel new file mode 100644 index 000000000000..6b02b950c2e9 --- /dev/null +++ b/pkg/sql/colencoding/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colencoding", + srcs = [ + "key_encoding.go", + "value_encoding.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colencoding", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/roachpb", + "//pkg/sql/catalog", + "//pkg/sql/catalog/descpb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "colencoding_test", + srcs = ["value_encoding_test.go"], + embed = [":colencoding"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/sql/catalog/descpb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/randutil", + ], +) diff --git a/pkg/sql/colexec/BUILD.bazel b/pkg/sql/colexec/BUILD.bazel new file mode 100644 index 000000000000..e95a054516c1 --- /dev/null +++ b/pkg/sql/colexec/BUILD.bazel @@ -0,0 +1,255 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") +load(":COLEXEC.bzl", "generate") + +go_library( + name = "colexec", + srcs = [ + "aggregators_util.go", + "bool_vec_to_sel.go", + "buffer.go", + "builtin_funcs.go", + "cancel_checker.go", + "case.go", + "columnarizer.go", + "constants.go", + "count.go", + "deselector.go", + "disk_spiller.go", + "expr.go", + "external_hash_joiner.go", + "external_sort.go", + "fn_op.go", + "hash.go", + "hash_aggregator.go", + "hash_utils.go", + "hashjoiner.go", + "hashtable.go", + "invariants_checker.go", + "like_ops.go", + "limit.go", + "materializer.go", + "mergejoiner.go", + "mergejoiner_util.go", + "offset.go", + "one_shot.go", + "op_creation.go", + "operator.go", + "ordered_aggregator.go", + "ordinality.go", + "panic_injector.go", + "parallel_unordered_synchronizer.go", + "partially_ordered_distinct.go", + "partitioner.go", + "routers.go", + "serial_unordered_synchronizer.go", + "simple_project.go", + "sort.go", + "sort_chunks.go", + "sorttopk.go", + "spilling_queue.go", + "stats.go", + "tuple_proj_op.go", + "unordered_distinct.go", + "utils.go", + ":gen-exec", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec", + visibility = ["//visibility:public"], + # Pin the dependencies used in auto-generated code. + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", # keep + "//pkg/col/typeconv", + "//pkg/server/telemetry", # keep + "//pkg/sql/catalog/colinfo", # keep + "//pkg/sql/catalog/descpb", + "//pkg/sql/colcontainer", + "//pkg/sql/colconv", + "//pkg/sql/colexec/colexecagg", # keep + "//pkg/sql/colexec/execgen", # keep + "//pkg/sql/colexec/execpb", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqltelemetry", # keep + "//pkg/sql/types", + "//pkg/util/cancelchecker", + "//pkg/util/duration", # keep + "//pkg/util/encoding", # keep + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/stringarena", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/apd/v2:apd", # keep + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/marusama/semaphore", + ], +) + +go_test( + name = "colexec_test", + srcs = [ + "aggregators_test.go", + "and_or_projection_test.go", + "bool_vec_to_sel_test.go", + "buffer_test.go", + "builtin_funcs_test.go", + "cancel_checker_test.go", + "case_test.go", + "cast_test.go", + "columnarizer_test.go", + "const_test.go", + "count_test.go", + "default_agg_test.go", + "default_cmp_op_test.go", + "dep_test.go", + "deselector_test.go", + "distinct_test.go", + "external_hash_joiner_test.go", + "external_sort_test.go", + "hash_utils_test.go", + "hashjoiner_test.go", + "inject_setup_test.go", + "is_null_ops_test.go", + "like_ops_test.go", + "limit_test.go", + "main_test.go", + "materializer_test.go", + "mergejoiner_test.go", + "offset_test.go", + "ordered_synchronizer_test.go", + "ordinality_test.go", + "parallel_unordered_synchronizer_test.go", + "projection_ops_test.go", + "routers_test.go", + "rowstovec_test.go", + "select_in_test.go", + "selection_ops_test.go", + "serial_unordered_synchronizer_test.go", + "simple_project_test.go", + "sort_chunks_test.go", + "sort_test.go", + "sorttopk_test.go", + "spilling_queue_test.go", + "stats_test.go", + "types_integration_test.go", + "utils_test.go", + "window_functions_test.go", + ], + embed = [":colexec"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/coldatatestutils", + "//pkg/col/colserde", + "//pkg/col/typeconv", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/colcontainer", + "//pkg/sql/colconv", + "//pkg/sql/colexec/colbuilder", + "//pkg/sql/colexec/colexecagg", + "//pkg/sql/colexec/execgen", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/colcontainerutils", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/skip", + "//pkg/util/cancelchecker", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/envutil", + "//pkg/util/humanizeutil", + "//pkg/util/json", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//vendor/github.com/apache/arrow/go/arrow/array", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/marusama/semaphore", + "//vendor/github.com/pmezard/go-difflib/difflib", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) + +# Define a file group for all the .eg.go targets. +targets = [ + "and_or_projection.eg.go", + "cast.eg.go", + "const.eg.go", + "default_cmp_expr.eg.go", + "default_cmp_proj_ops.eg.go", + "default_cmp_sel_ops.eg.go", + "distinct.eg.go", + "hashjoiner.eg.go", + "hashtable_distinct.eg.go", + "hashtable_full_default.eg.go", + "hashtable_full_deleting.eg.go", + "hash_aggregator.eg.go", + "hash_utils.eg.go", + "is_null_ops.eg.go", + "like_ops.eg.go", + "mergejoinbase.eg.go", + "mergejoiner_exceptall.eg.go", + "mergejoiner_fullouter.eg.go", + "mergejoiner_inner.eg.go", + "mergejoiner_intersectall.eg.go", + "mergejoiner_leftanti.eg.go", + "mergejoiner_leftouter.eg.go", + "mergejoiner_leftsemi.eg.go", + "mergejoiner_rightouter.eg.go", + "ordered_synchronizer.eg.go", + "proj_const_left_ops.eg.go", + "proj_const_right_ops.eg.go", + "proj_non_const_ops.eg.go", + "quicksort.eg.go", + "rank.eg.go", + "relative_rank.eg.go", + "row_number.eg.go", + "rowstovec.eg.go", + "selection_ops.eg.go", + "select_in.eg.go", + "sort.eg.go", + "substring.eg.go", + "values_differ.eg.go", + "vec_comparators.eg.go", + "window_peer_grouper.eg.go", +] + +# Define a generator for all execgen code. Look towards COLEXEC.bzl for the +# implementation. +generate( + name = "gen-exec", + execgen = "//pkg/sql/colexec/execgen/cmd/execgen", + goimports = "//vendor/github.com/cockroachdb/gostdlib/x/tools/cmd/goimports", + targets = targets, + templates = glob(["*_tmpl.go"]), +) diff --git a/pkg/sql/colexec/COLEXEC.bzl b/pkg/sql/colexec/COLEXEC.bzl new file mode 100644 index 000000000000..79800411eec1 --- /dev/null +++ b/pkg/sql/colexec/COLEXEC.bzl @@ -0,0 +1,43 @@ +def _generate_impl(ctx): + output_files, input_files = [], [] + # Gather the full list of all input template files (deconstructing it from + # the filegroup input). See [1] for a reference of all types/members within + # skylark. + # + # [1]: https://docs.bazel.build/versions/master/skylark/lib/skylark-overview.html + for tmpl in ctx.attr.templates: + input_files.extend(tmpl.files.to_list()) + + execgen_binary = ctx.executable.execgen + goimports_binary = ctx.executable.goimports + input_binaries = [execgen_binary, goimports_binary] + + # For each target, run execgen and goimports. + for generated_file_name in ctx.attr.targets: + generated_file = ctx.actions.declare_file(generated_file_name) + ctx.actions.run_shell( + tools = input_binaries, + inputs = input_files, + outputs = [generated_file], + progress_message = "Generating pkg/cmd/colexec/%s" % generated_file_name, + command = """ + %s -fmt=false pkg/sql/colexec/%s > %s + %s -w %s + """ % (execgen_binary.path, generated_file_name, generated_file.path, goimports_binary.path, generated_file.path), + ) + output_files.append(generated_file) + + # Construct the full set of output files for bazel to be able to analyse. + # See https://docs.bazel.build/versions/master/skylark/lib/DefaultInfo.html. + return [DefaultInfo(files = depset(output_files))] + +generate = rule( + implementation = _generate_impl, + # Source all the necessary template files, output targets, the execgen and goimports binaries. + attrs = { + "templates": attr.label_list(mandatory = True, allow_files = ["tmpl.go"]), + "targets": attr.string_list(mandatory = True), + "execgen": attr.label(mandatory = True, executable = True, allow_files = True, cfg = "exec"), + "goimports": attr.label(mandatory = True, executable = True, allow_files = True, cfg = "exec"), + }, +) diff --git a/pkg/sql/colexec/colbuilder/BUILD.bazel b/pkg/sql/colexec/colbuilder/BUILD.bazel new file mode 100644 index 000000000000..641fb2111c14 --- /dev/null +++ b/pkg/sql/colexec/colbuilder/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "colbuilder", + srcs = [ + "execplan.go", + "window_functions_util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/colbuilder", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/typeconv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/colcontainer", + "//pkg/sql/colconv", + "//pkg/sql/colexec", + "//pkg/sql/colexec/colexecagg", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colfetcher", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondatapb", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/mon", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/colexec/colexecagg/BUILD.bazel b/pkg/sql/colexec/colexecagg/BUILD.bazel new file mode 100644 index 000000000000..c431f329a609 --- /dev/null +++ b/pkg/sql/colexec/colexecagg/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +# TODO(irfansharif): The dependency tree for the *.eg.go needs sorting out. It +# depends on execgen+templates from a parent package. Look towards colexec for +# how this should be done. For now we just lazily depend on the already +# generated+checked in file. +# +# keep +go_library( + name = "colexecagg", + srcs = [ + "aggregate_funcs.go", + "hash_any_not_null_agg.eg.go", + "hash_avg_agg.eg.go", + "hash_bool_and_or_agg.eg.go", + "hash_concat_agg.eg.go", + "hash_count_agg.eg.go", + "hash_default_agg.eg.go", + "hash_min_max_agg.eg.go", + "hash_sum_agg.eg.go", + "hash_sum_int_agg.eg.go", + "ordered_any_not_null_agg.eg.go", + "ordered_avg_agg.eg.go", + "ordered_bool_and_or_agg.eg.go", + "ordered_concat_agg.eg.go", + "ordered_count_agg.eg.go", + "ordered_default_agg.eg.go", + "ordered_min_max_agg.eg.go", + "ordered_sum_agg.eg.go", + "ordered_sum_int_agg.eg.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecagg", + visibility = ["//visibility:public"], + # Pin the dependencies used in auto-generated code. + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", # keep + "//pkg/col/typeconv", # keep + "//pkg/sql/colconv", + "//pkg/sql/colexec/execgen", # keep + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfrapb", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/duration", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/colexec/execgen/BUILD.bazel b/pkg/sql/colexec/execgen/BUILD.bazel new file mode 100644 index 000000000000..081be0e98d2e --- /dev/null +++ b/pkg/sql/colexec/execgen/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "execgen", + srcs = [ + "execgen.go", + "inline.go", + "overloads_util.go", + "placeholders.go", + "supported_bin_cmp_ops.go", + "template.go", + "util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/dave/dst", + "//vendor/github.com/dave/dst/decorator", + "//vendor/github.com/dave/dst/dstutil", + ], +) + +go_test( + name = "execgen_test", + srcs = [ + "datadriven_test.go", + "inline_test.go", + "template_test.go", + "util_test.go", + ], + data = glob(["testdata/**"]), + embed = [":execgen"], + deps = [ + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/dave/dst", + "//vendor/github.com/dave/dst/decorator", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/sql/colexec/execgen/cmd/execgen/BUILD.bazel b/pkg/sql/colexec/execgen/cmd/execgen/BUILD.bazel new file mode 100644 index 000000000000..71d964179969 --- /dev/null +++ b/pkg/sql/colexec/execgen/cmd/execgen/BUILD.bazel @@ -0,0 +1,72 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "execgen_lib", + srcs = [ + "agg_gen_util.go", + "and_or_projection_gen.go", + "any_not_null_agg_gen.go", + "avg_agg_gen.go", + "bool_and_or_agg_gen.go", + "cast_gen.go", + "concat_agg_gen.go", + "const_gen.go", + "count_agg_gen.go", + "data_manipulation_gen.go", + "datum_to_vec_gen.go", + "default_agg_gen.go", + "default_cmp_expr_gen.go", + "default_cmp_proj_ops_gen.go", + "default_cmp_sel_ops_gen.go", + "distinct_gen.go", + "hash_aggregator_gen.go", + "hash_utils_gen.go", + "hashjoiner_gen.go", + "hashtable_gen.go", + "is_null_ops_gen.go", + "like_ops_gen.go", + "main.go", + "mergejoinbase_gen.go", + "mergejoiner_gen.go", + "min_max_agg_gen.go", + "ordered_synchronizer_gen.go", + "overloads_base.go", + "overloads_bin.go", + "overloads_cast.go", + "overloads_cmp.go", + "overloads_gen_util.go", + "overloads_hash.go", + "projection_ops_gen.go", + "rank_gen.go", + "relative_rank_gen.go", + "row_number_gen.go", + "rowstovec_gen.go", + "select_in_gen.go", + "selection_ops_gen.go", + "sort_gen.go", + "substring_gen.go", + "sum_agg_gen.go", + "values_differ_gen.go", + "vec_comparators_gen.go", + "vec_gen.go", + "vec_to_datum_gen.go", + "window_peer_grouper_gen.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/execgen/cmd/execgen", + visibility = ["//visibility:private"], + deps = [ + "//pkg/col/typeconv", + "//pkg/sql/colexec/execgen", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/gostdlib/x/tools/imports", + ], +) + +go_binary( + name = "execgen", + embed = [":execgen_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/colexec/execpb/BUILD.bazel b/pkg/sql/colexec/execpb/BUILD.bazel new file mode 100644 index 000000000000..a08eb8f1c408 --- /dev/null +++ b/pkg/sql/colexec/execpb/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "execpb", + srcs = [ + "stats.go", + "stats.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexec/execpb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/execinfrapb", + "//pkg/util/humanizeutil", + "//pkg/util/tracing", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/types", + ], +) diff --git a/pkg/sql/colexecbase/BUILD.bazel b/pkg/sql/colexecbase/BUILD.bazel new file mode 100644 index 000000000000..d9d19e5495d6 --- /dev/null +++ b/pkg/sql/colexecbase/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colexecbase", + srcs = [ + "operator.go", + "testutils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexecbase", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/types", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "colexecbase_test", + srcs = ["dep_test.go"], + embed = [":colexecbase"], + deps = [ + "//pkg/testutils/buildutil", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/sql/colexecbase/colexecerror/BUILD.bazel b/pkg/sql/colexecbase/colexecerror/BUILD.bazel new file mode 100644 index 000000000000..db8e384f23c9 --- /dev/null +++ b/pkg/sql/colexecbase/colexecerror/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "colexecerror", + srcs = ["error.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colexecbase/colexecerror", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/sql/colfetcher/BUILD.bazel b/pkg/sql/colfetcher/BUILD.bazel new file mode 100644 index 000000000000..bbd4c78fbe81 --- /dev/null +++ b/pkg/sql/colfetcher/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "colfetcher", + srcs = [ + "cfetcher.go", + "colbatch_scan.go", + "fetcherstate_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colfetcher", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/colconv", + "//pkg/sql/colencoding", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/scrub", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/colflow/BUILD.bazel b/pkg/sql/colflow/BUILD.bazel new file mode 100644 index 000000000000..fb3d527a7da1 --- /dev/null +++ b/pkg/sql/colflow/BUILD.bazel @@ -0,0 +1,101 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colflow", + srcs = ["vectorized_flow.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colflow", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/rpc/nodedialer", + "//pkg/settings", + "//pkg/sql/colcontainer", + "//pkg/sql/colexec", + "//pkg/sql/colexec/colbuilder", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colflow/colrpc", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowexec", + "//pkg/sql/sessiondatapb", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/marusama/semaphore", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "colflow_test", + srcs = [ + "colbatch_scan_test.go", + "dep_test.go", + "main_test.go", + "vectorized_flow_shutdown_test.go", + "vectorized_flow_space_test.go", + "vectorized_flow_test.go", + "vectorized_meta_propagation_test.go", + "vectorized_panic_propagation_test.go", + ], + embed = [":colflow"], + deps = [ + "//pkg/base", + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/coldatatestutils", + "//pkg/keys", + "//pkg/kv", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/colcontainer", + "//pkg/sql/colexec", + "//pkg/sql/colexec/colbuilder", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colfetcher", + "//pkg/sql/colflow/colrpc", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/colcontainerutils", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/colflow/colrpc/BUILD.bazel b/pkg/sql/colflow/colrpc/BUILD.bazel new file mode 100644 index 000000000000..b92060ab53b7 --- /dev/null +++ b/pkg/sql/colflow/colrpc/BUILD.bazel @@ -0,0 +1,63 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "colrpc", + srcs = [ + "inbox.go", + "outbox.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colflow/colrpc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/colserde", + "//pkg/roachpb", + "//pkg/sql/colexec", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/types", + "//pkg/util/log", + "//vendor/github.com/apache/arrow/go/arrow/array", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "colrpc_test", + srcs = [ + "colrpc_test.go", + "inbox_test.go", + "main_test.go", + "outbox_test.go", + ], + embed = [":colrpc"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/coldatatestutils", + "//pkg/col/colserde", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/colexec", + "//pkg/sql/colexecbase", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/stretchr/testify/require", + "//vendor/google.golang.org/grpc", + ], +) diff --git a/pkg/sql/colmem/BUILD.bazel b/pkg/sql/colmem/BUILD.bazel new file mode 100644 index 000000000000..80733542fabc --- /dev/null +++ b/pkg/sql/colmem/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "colmem", + srcs = ["allocator.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/colmem", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/typeconv", + "//pkg/sql/colexecbase/colexecerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/duration", + "//pkg/util/mon", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/covering/BUILD.bazel b/pkg/sql/covering/BUILD.bazel new file mode 100644 index 000000000000..e03ceceeb585 --- /dev/null +++ b/pkg/sql/covering/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "covering", + srcs = ["overlap_merge.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/covering", + visibility = ["//visibility:public"], +) + +go_test( + name = "covering_test", + srcs = [ + "bench_test.go", + "main_test.go", + "overlap_merge_test.go", + ], + embed = [":covering"], + deps = [ + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/delegate/BUILD.bazel b/pkg/sql/delegate/BUILD.bazel new file mode 100644 index 000000000000..afdb6c5c4b33 --- /dev/null +++ b/pkg/sql/delegate/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "delegate", + srcs = [ + "delegate.go", + "job_control.go", + "show_all_cluster_settings.go", + "show_database_indexes.go", + "show_databases.go", + "show_enums.go", + "show_grants.go", + "show_jobs.go", + "show_partitions.go", + "show_queries.go", + "show_range_for_row.go", + "show_ranges.go", + "show_regions.go", + "show_role_grants.go", + "show_roles.go", + "show_schedules.go", + "show_schemas.go", + "show_sequences.go", + "show_sessions.go", + "show_syntax.go", + "show_table.go", + "show_tables.go", + "show_transactions.go", + "show_types.go", + "show_var.go", + "show_zone_config.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/delegate", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/lex", + "//pkg/sql/opt/cat", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqltelemetry", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/distsql/BUILD.bazel b/pkg/sql/distsql/BUILD.bazel new file mode 100644 index 000000000000..b7f4501160bf --- /dev/null +++ b/pkg/sql/distsql/BUILD.bazel @@ -0,0 +1,90 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "distsql", + srcs = ["server.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/distsql", + visibility = ["//visibility:public"], + deps = [ + "//pkg/gossip", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/server/telemetry", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/lease", + "//pkg/sql/colflow", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/faketreeeval", + "//pkg/sql/flowinfra", + "//pkg/sql/rowflow", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/sqltelemetry", + "//pkg/sql/sqlutil", + "//pkg/util/contextutil", + "//pkg/util/envutil", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "distsql_test", + srcs = [ + "columnar_operators_test.go", + "columnar_utils_test.go", + "inbound_test.go", + "main_test.go", + "sync_flow_after_drain_test.go", + "vectorized_panic_propagation_test.go", + ], + embed = [":distsql"], + deps = [ + "//pkg/base", + "//pkg/col/coldata", + "//pkg/col/coldataext", + "//pkg/col/typeconv", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/colcontainer", + "//pkg/sql/colexec", + "//pkg/sql/colexec/colbuilder", + "//pkg/sql/colexecbase", + "//pkg/sql/colflow", + "//pkg/sql/colmem", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/netutil", + "//pkg/util/randutil", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/doctor/BUILD.bazel b/pkg/sql/doctor/BUILD.bazel new file mode 100644 index 000000000000..38897dbd02ed --- /dev/null +++ b/pkg/sql/doctor/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "doctor", + srcs = ["doctor.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/doctor", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/typedesc", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) + +go_test( + name = "doctor_test", + srcs = ["doctor_test.go"], + deps = [ + ":doctor", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/security", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/types", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/enum/BUILD.bazel b/pkg/sql/enum/BUILD.bazel new file mode 100644 index 000000000000..6502ddad2713 --- /dev/null +++ b/pkg/sql/enum/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "enum", + srcs = ["enum.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/enum", + visibility = ["//visibility:public"], +) + +go_test( + name = "enum_test", + srcs = ["enum_test.go"], + embed = [":enum"], + deps = [ + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/execinfra/BUILD.bazel b/pkg/sql/execinfra/BUILD.bazel new file mode 100644 index 000000000000..3e5d5793e0bd --- /dev/null +++ b/pkg/sql/execinfra/BUILD.bazel @@ -0,0 +1,89 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "execinfra", + srcs = [ + "base.go", + "consumerstatus_string.go", + "flow_context.go", + "metadata_test_receiver.go", + "metadata_test_sender.go", + "metrics.go", + "operator.go", + "outboxbase.go", + "processorsbase.go", + "procstate_string.go", + "readerbase.go", + "scanbase.go", + "server_config.go", + "testutils.go", + "version.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/execinfra", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/diskmap", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/kv/kvserver/protectedts", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/hydratedtables", + "//pkg/sql/execinfrapb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/storage/cloud", + "//pkg/storage/fs", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/marusama/semaphore", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "execinfra_test", + srcs = [ + "base_test.go", + "dep_test.go", + "main_test.go", + ], + embed = [":execinfra"], + deps = [ + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/execinfrapb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils/buildutil", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/sql/execinfrapb/BUILD.bazel b/pkg/sql/execinfrapb/BUILD.bazel new file mode 100644 index 000000000000..b7aa7e114741 --- /dev/null +++ b/pkg/sql/execinfrapb/BUILD.bazel @@ -0,0 +1,83 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "execinfrapb", + srcs = [ + "api.go", + "api.pb.go", + "data.go", + "data.pb.go", + "expr.go", + "flow_diagram.go", + "processors.go", + "processors.pb.go", + "processors_base.pb.go", + "processors_bulk_io.pb.go", + "processors_changefeeds.pb.go", + "processors_sql.pb.go", + "processors_table_stats.pb.go", + "stats.go", + "testutils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/jobs/jobspb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/transform", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/netutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/errorspb", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "execinfrapb_test", + srcs = [ + "expr_test.go", + "flow_diagram_test.go", + ], + embed = [":execinfrapb"], + deps = [ + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/sql/faketreeeval/BUILD.bazel b/pkg/sql/faketreeeval/BUILD.bazel new file mode 100644 index 000000000000..3cdea78546d2 --- /dev/null +++ b/pkg/sql/faketreeeval/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "faketreeeval", + srcs = ["evalctx.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/faketreeeval", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/roleoption", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) diff --git a/pkg/sql/flowinfra/BUILD.bazel b/pkg/sql/flowinfra/BUILD.bazel new file mode 100644 index 000000000000..b49dbe8cbfa7 --- /dev/null +++ b/pkg/sql/flowinfra/BUILD.bazel @@ -0,0 +1,106 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "flowinfra", + srcs = [ + "flow.go", + "flow_registry.go", + "flow_scheduler.go", + "inbound.go", + "outbox.go", + "stats.pb.go", + "stream_decoder.go", + "stream_encoder.go", + "testing_knobs.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/flowinfra", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/mutations", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/types", + "//pkg/util/cancelchecker", + "//pkg/util/contextutil", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "flowinfra_test", + srcs = [ + "cluster_test.go", + "dep_test.go", + "flow_registry_test.go", + "flow_scheduler_test.go", + "flow_test.go", + "main_test.go", + "outbox_test.go", + "server_test.go", + "stream_data_test.go", + "utils_test.go", + ], + embed = [":flowinfra"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/rpc/nodedialer", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/cancelchecker", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/gcjob/BUILD.bazel b/pkg/sql/gcjob/BUILD.bazel new file mode 100644 index 000000000000..ea187ee2c9a7 --- /dev/null +++ b/pkg/sql/gcjob/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gcjob", + srcs = [ + "descriptor_utils.go", + "gc_job.go", + "gc_job_utils.go", + "index_garbage_collection.go", + "refresh_statuses.go", + "table_garbage_collection.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/gcjob", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver/protectedts", + "//pkg/kv/kvserver/protectedts/ptpb", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/tree", + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/gcjob/gcjobnotifier/BUILD.bazel b/pkg/sql/gcjob/gcjobnotifier/BUILD.bazel new file mode 100644 index 000000000000..fc3aab445c1b --- /dev/null +++ b/pkg/sql/gcjob/gcjobnotifier/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gcjobnotifier", + srcs = ["notifier.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/gcjob/gcjobnotifier", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config", + "//pkg/gossip", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + ], +) + +go_test( + name = "gcjobnotifier_test", + srcs = ["notifier_test.go"], + embed = [":gcjobnotifier"], + deps = [ + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/gcjob_test/BUILD.bazel b/pkg/sql/gcjob_test/BUILD.bazel new file mode 100644 index 000000000000..668100de12f1 --- /dev/null +++ b/pkg/sql/gcjob_test/BUILD.bazel @@ -0,0 +1,33 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "gcjob_test_test", + srcs = [ + "gc_job_test.go", + "main_test.go", + ], + deps = [ + "//pkg/base", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/tree", + "//pkg/testutils", + "//pkg/testutils/jobutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/lex/BUILD.bazel b/pkg/sql/lex/BUILD.bazel new file mode 100644 index 000000000000..d306280ef413 --- /dev/null +++ b/pkg/sql/lex/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lex", + srcs = [ + "encode.go", + "experimental_keywords.go", + "keywords.go", + "normalize.go", + "predicates.go", + "reserved_keywords.go", + "tokens.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/lex", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sessiondatapb", + "//pkg/util/stringencoding", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/text/unicode/norm", + ], +) + +go_test( + name = "lex_test", + srcs = ["encode_test.go"], + deps = [ + ":lex", + "//pkg/sql/parser", + "//pkg/sql/sessiondatapb", + ], +) diff --git a/pkg/sql/logictest/BUILD.bazel b/pkg/sql/logictest/BUILD.bazel new file mode 100644 index 000000000000..147cc86da4d4 --- /dev/null +++ b/pkg/sql/logictest/BUILD.bazel @@ -0,0 +1,74 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "logictest", + srcs = ["logic.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/logictest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/col/coldata", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/execinfra", + "//pkg/sql/mutations", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/row", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/stats", + "//pkg/testutils", + "//pkg/testutils/physicalplanutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/util", + "//pkg/util/envutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq", + "//vendor/github.com/stretchr/testify/require", + ], +) + +go_test( + name = "logictest_test", + srcs = [ + "logic_test.go", + "main_test.go", + "parallel_test.go", + ], + data = glob(["testdata/**"]), + embed = [":logictest"], + deps = [ + "//pkg/base", + "//pkg/config/zonepb", + "//pkg/keys", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/sessiondata", + "//pkg/sql/tests", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/stop", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) diff --git a/pkg/sql/mutations/BUILD.bazel b/pkg/sql/mutations/BUILD.bazel new file mode 100644 index 000000000000..ac60b38d62cd --- /dev/null +++ b/pkg/sql/mutations/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "mutations", + srcs = [ + "mutations.go", + "mutations_util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/mutations", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/stats", + "//pkg/util", + "//pkg/util/encoding", + ], +) + +go_test( + name = "mutations_test", + srcs = ["mutations_test.go"], + embed = [":mutations"], + deps = ["//pkg/util/randutil"], +) diff --git a/pkg/sql/oidext/BUILD.bazel b/pkg/sql/oidext/BUILD.bazel new file mode 100644 index 000000000000..0db4aeeb092b --- /dev/null +++ b/pkg/sql/oidext/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "oidext", + srcs = ["oidext.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/oidext", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/lib/pq/oid"], +) + +go_test( + name = "oidext_test", + srcs = ["oidext_test.go"], + embed = [":oidext"], + deps = [ + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/opt/BUILD.bazel b/pkg/sql/opt/BUILD.bazel new file mode 100644 index 000000000000..4aee6da26c57 --- /dev/null +++ b/pkg/sql/opt/BUILD.bazel @@ -0,0 +1,116 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "opt", + srcs = [ + "colset.go", + "column_meta.go", + "constants.go", + "doc.go", + "metadata.go", + "operator.go", + "ordering.go", + "rule_name.go", + "table_meta.go", + "telemetry.go", + "view_dependencies.go", + ":gen-operator", # keep + ":gen-rulenames", # keep + ":gen-rulenames-stringer", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/telemetry", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt/cat", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/sem/tree", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "opt_test", + srcs = [ + "colset_test.go", + "metadata_test.go", + "operator_test.go", + "ordering_test.go", + ], + embed = [":opt"], + deps = [ + "//pkg/sql/opt/cat", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/privilege", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + ], +) + +# Define a file group for all the operator definitions. +ops = filegroup( + name = "ops", + srcs = glob(["ops/*.opt"]), + visibility = ["//visibility:public"], +) + +# Define the generator for the operator definitions and functions. +genrule( + name = "gen-operator", + srcs = [":ops"], + outs = ["operator.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ ops $(locations :ops) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) + +# Define the generator for the enumeration of rulenames. +genrule( + name = "gen-rulenames", + srcs = [ + ":ops", + "//pkg/sql/opt/xform:rules", + "//pkg/sql/opt/norm:rules", + ], + outs = ["rule_name.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ rulenames \ + $(locations :ops) $(locations //pkg/sql/opt/norm:rules) $(locations //pkg/sql/opt/xform:rules) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) + +# Define the generator for the stringification of rulenames. +# +# NB: Stringer doesn't support running stringer across files in multiple +# directories. To work around this, we manually copy one of the source files +# over into the location of the other, and run stringer there instead. Ew. +genrule( + name = "gen-rulenames-stringer", + srcs = [ + "rule_name.go", + ":gen-rulenames", + ], + outs = ["rule_name_string.go"], + cmd = """ + cp $(location rule_name.go) `dirname $(location :gen-rulenames)`/rule_name.go + env PATH=`dirname $(location @go_sdk//:bin/go)` HOME=$(GENDIR) \ + $(location @org_golang_x_tools//cmd/stringer:stringer) -output=$@ \ + -type=RuleName `dirname $(location :gen-rulenames)`/rule_name.go $(location :gen-rulenames) + """, + tools = [ + "@go_sdk//:bin/go", + "@org_golang_x_tools//cmd/stringer", + ], +) diff --git a/pkg/sql/opt/bench/BUILD.bazel b/pkg/sql/opt/bench/BUILD.bazel new file mode 100644 index 000000000000..cac2c172a145 --- /dev/null +++ b/pkg/sql/opt/bench/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bench", + srcs = ["doc.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/bench", + visibility = ["//visibility:public"], +) + +go_test( + name = "bench_test", + srcs = [ + "bench_test.go", + "fk_test.go", + ], + embed = [":bench"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/opt/exec", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/util/randutil", + "//pkg/util/timeutil", + ], +) diff --git a/pkg/sql/opt/cat/BUILD.bazel b/pkg/sql/opt/cat/BUILD.bazel new file mode 100644 index 000000000000..68670dfe8ff2 --- /dev/null +++ b/pkg/sql/opt/cat/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cat", + srcs = [ + "catalog.go", + "column.go", + "data_source.go", + "family.go", + "index.go", + "object.go", + "schema.go", + "sequence.go", + "table.go", + "utils.go", + "view.go", + "zone.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/cat", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/roachpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "cat_test", + srcs = ["utils_test.go"], + deps = [ + ":cat", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/sem/tree", + ], +) diff --git a/pkg/sql/opt/constraint/BUILD.bazel b/pkg/sql/opt/constraint/BUILD.bazel new file mode 100644 index 000000000000..17e15cdc6219 --- /dev/null +++ b/pkg/sql/opt/constraint/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "constraint", + srcs = [ + "columns.go", + "constraint.go", + "constraint_set.go", + "key.go", + "key_extension.go", + "span.go", + "spans.go", + "testutils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/constraint", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "constraint_test", + srcs = [ + "columns_test.go", + "constraint_set_test.go", + "constraint_test.go", + "key_test.go", + "span_test.go", + "spans_test.go", + ], + embed = [":constraint"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/sql/opt/exec/BUILD.bazel b/pkg/sql/opt/exec/BUILD.bazel new file mode 100644 index 000000000000..f7a8aa6c2042 --- /dev/null +++ b/pkg/sql/opt/exec/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "exec", + srcs = [ + "factory.go", + ":gen-factory", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/exec", + visibility = ["//visibility:public"], + # Pin the dependencies required in the auto-generated code. + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", # keep + "//pkg/sql/opt", # keep + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + ], +) + +# Define a file group for all the factory definitions. +rules = filegroup( + name = "defs", + srcs = ["factory.opt"], + visibility = ["//visibility:public"], +) + +# Define the generator for the expression tree creation and normalization +# functions. +genrule( + name = "gen-factory", + srcs = [ + "//pkg/sql/opt:ops", + ":defs", + ], + outs = ["factory.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ execfactory $(locations :defs) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) diff --git a/pkg/sql/opt/exec/execbuilder/BUILD.bazel b/pkg/sql/opt/exec/execbuilder/BUILD.bazel new file mode 100644 index 000000000000..fa8010e21cd9 --- /dev/null +++ b/pkg/sql/opt/exec/execbuilder/BUILD.bazel @@ -0,0 +1,66 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "execbuilder", + srcs = [ + "builder.go", + "cascades.go", + "format.go", + "mutation.go", + "relational.go", + "scalar.go", + "statement.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/exec/execbuilder", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/telemetry", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/lex", + "//pkg/sql/mutations", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/exec", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/ordering", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/opt/xform", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/row", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/errorutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/log", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "execbuilder_test", + srcs = [ + "builder_test.go", + "main_test.go", + ], + data = glob(["testdata/**"]), + deps = [ + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/logictest", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/sql/opt/exec/explain/BUILD.bazel b/pkg/sql/opt/exec/explain/BUILD.bazel new file mode 100644 index 000000000000..933d94168de1 --- /dev/null +++ b/pkg/sql/opt/exec/explain/BUILD.bazel @@ -0,0 +1,68 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "explain", + srcs = [ + "emit.go", + "explain_factory.go", + "flags.go", + "output.go", + "result_columns.go", + ":gen-explain-factory", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/exec/explain", + visibility = ["//visibility:public"], + # Pin the dependencies used in auto-generated code. + deps = [ + "//pkg/roachpb", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/opt", # keep + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/exec", + "//pkg/sql/opt/invertedexpr", # keep + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/errorutil", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "explain_test", + srcs = [ + "explain_factory_test.go", + "output_test.go", + ], + data = glob(["testdata/**"]), + embed = [":explain"], + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt/exec", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/stretchr/testify/require", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +# Define a generator for factory explanation code. +genrule( + name = "gen-explain-factory", + srcs = [ + "//pkg/sql/opt:ops", + "//pkg/sql/opt/exec:defs", + ], + outs = ["explain_factory.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ execexplain $(locations //pkg/sql/opt/exec:defs) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) diff --git a/pkg/sql/opt/idxconstraint/BUILD.bazel b/pkg/sql/opt/idxconstraint/BUILD.bazel new file mode 100644 index 000000000000..ce49e8aef0e2 --- /dev/null +++ b/pkg/sql/opt/idxconstraint/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "idxconstraint", + srcs = ["index_constraints.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/idxconstraint", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/json", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "idxconstraint_test", + srcs = ["index_constraints_test.go"], + data = glob(["testdata/**"]), + deps = [ + ":idxconstraint", + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/testutils", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/invertedexpr/BUILD.bazel b/pkg/sql/opt/invertedexpr/BUILD.bazel new file mode 100644 index 000000000000..ba5bd87d7ded --- /dev/null +++ b/pkg/sql/opt/invertedexpr/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "invertedexpr", + srcs = [ + "expression.go", + "geo_expression.go", + "span_expression.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/invertedexpr", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/roachpb", + "//pkg/sql/opt", + "//pkg/sql/rowenc", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "invertedexpr_test", + srcs = [ + "expression_test.go", + "geo_expression_test.go", + ], + data = glob(["testdata/**"]), + embed = [":invertedexpr"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/util/leaktest", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/opt/invertedidx/BUILD.bazel b/pkg/sql/opt/invertedidx/BUILD.bazel new file mode 100644 index 000000000000..ad3626b48883 --- /dev/null +++ b/pkg/sql/opt/invertedidx/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "invertedidx", + srcs = [ + "geo.go", + "inverted_index_expr.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/invertedidx", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geogfn", + "//pkg/geo/geoindex", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/sql/catalog/descpb", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/props", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/r1", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/golang/geo/s2", + ], +) + +go_test( + name = "invertedidx_test", + srcs = ["geo_test.go"], + deps = [ + ":invertedidx", + "//pkg/geo", + "//pkg/geo/geoindex", + "//pkg/geo/geopb", + "//pkg/sql/opt", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/opt/memo/BUILD.bazel b/pkg/sql/opt/memo/BUILD.bazel new file mode 100644 index 000000000000..4dbb593c4411 --- /dev/null +++ b/pkg/sql/opt/memo/BUILD.bazel @@ -0,0 +1,99 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "memo", + srcs = [ + "check_expr.go", + "check_expr_skip.go", + "constraint_builder.go", + "cost.go", + "expr.go", + "expr_format.go", + "expr_name_gen.go", + "extract.go", + "group.go", + "interner.go", + "logical_props_builder.go", + "memo.go", + "multiplicity_builder.go", + "statistics_builder.go", + "typing.go", + ":gen-expr", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/memo", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/rowenc", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "memo_test", + srcs = [ + "cost_test.go", + "expr_test.go", + "interner_test.go", + "logical_props_builder_test.go", + "memo_test.go", + "multiplicity_builder_test.go", + "statistics_builder_test.go", + "typing_test.go", + ], + data = glob(["testdata/**"]), + embed = [":memo"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/opt/testutils", + "//pkg/sql/opt/testutils/opttester", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/timeofday", + "//pkg/util/timeutil/pgdate", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/tools/container/intsets", + ], +) + +# Define a gerator for expression definitions and functions. +genrule( + name = "gen-expr", + srcs = ["//pkg/sql/opt:ops"], + outs = ["expr.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ exprs $(locations //pkg/sql/opt:ops) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/opt/norm/BUILD.bazel b/pkg/sql/opt/norm/BUILD.bazel new file mode 100644 index 000000000000..1a26a3034de6 --- /dev/null +++ b/pkg/sql/opt/norm/BUILD.bazel @@ -0,0 +1,103 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "norm", + srcs = [ + "bool_funcs.go", + "comp_funcs.go", + "decorrelate_funcs.go", + "factory.go", + "fold_constants_funcs.go", + "general_funcs.go", + "groupby_funcs.go", + "inline_funcs.go", + "join_funcs.go", + "limit_funcs.go", + "list_sorter.go", + "ordering_funcs.go", + "project_builder.go", + "project_funcs.go", + "project_set_funcs.go", + "prune_cols_funcs.go", + "reject_nulls_funcs.go", + "scalar_funcs.go", + "select_funcs.go", + "set_funcs.go", + "window_funcs.go", + "with_funcs.go", + ":gen-factory", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/norm", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/parser", + "//pkg/sql/privilege", + "//pkg/sql/rowenc", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/arith", + "//pkg/util/encoding", + "//pkg/util/errorutil", + "//pkg/util/json", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "norm_test", + srcs = [ + "decorrelate_funcs_test.go", + "factory_test.go", + "general_funcs_test.go", + "norm_test.go", + ], + data = glob(["testdata/**"]), + embed = [":norm"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/testutils", + "//pkg/sql/opt/testutils/opttester", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/xform", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/leaktest", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + ], +) + +# Define a file group for all the normalization rules. +rules = filegroup( + name = "rules", + srcs = glob(["rules/*.opt"]), + visibility = ["//visibility:public"], +) + +# Define a generator for expression tree creation and normalization functions. +genrule( + name = "gen-factory", + srcs = [ + "//pkg/sql/opt:ops", + ":rules", + ], + outs = ["factory.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ factory $(locations //pkg/sql/opt:ops) $(locations :rules) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) diff --git a/pkg/sql/opt/opbench/BUILD.bazel b/pkg/sql/opt/opbench/BUILD.bazel new file mode 100644 index 000000000000..647258273279 --- /dev/null +++ b/pkg/sql/opt/opbench/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "opbench", + srcs = [ + "cat.go", + "config.go", + "spec.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/opbench", + visibility = ["//visibility:public"], + deps = ["//pkg/sql/opt/testutils/testcat"], +) + +go_test( + name = "opbench_test", + srcs = [ + "config_test.go", + "opbench_test.go", + ], + data = glob(["testdata/**"]), + embed = [":opbench"], + deps = [ + "//pkg/sql/opt/memo", + "//pkg/sql/opt/testutils/opttester", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/opt/optbuilder/BUILD.bazel b/pkg/sql/opt/optbuilder/BUILD.bazel new file mode 100644 index 000000000000..00b77837feef --- /dev/null +++ b/pkg/sql/opt/optbuilder/BUILD.bazel @@ -0,0 +1,100 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "optbuilder", + srcs = [ + "alter_table.go", + "builder.go", + "create_table.go", + "create_view.go", + "delete.go", + "distinct.go", + "explain.go", + "export.go", + "fk_cascade.go", + "groupby.go", + "insert.go", + "join.go", + "limit.go", + "locking.go", + "misc_statements.go", + "mutation_builder.go", + "mutation_builder_fk.go", + "opaque.go", + "orderby.go", + "partial_index.go", + "project.go", + "scalar.go", + "scope.go", + "scope_column.go", + "select.go", + "show_trace.go", + "sql_fn.go", + "srfs.go", + "subquery.go", + "union.go", + "update.go", + "util.go", + "values.go", + "window.go", + "with.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optbuilder", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/telemetry", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/delegate", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optgen/exprgen", + "//pkg/sql/opt/partialidx", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/errorutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/log", + "//pkg/util/sequence", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "optbuilder_test", + srcs = [ + "builder_test.go", + "name_resolution_test.go", + ], + data = glob(["testdata/**"]), + embed = [":optbuilder"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/testutils", + "//pkg/sql/opt/testutils/opttester", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/testutils/sqlutils", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel b/pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel new file mode 100644 index 000000000000..6f9bbe7f0d0c --- /dev/null +++ b/pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "langgen_lib", + srcs = [ + "exprs_gen.go", + "main.go", + "ops_gen.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optgen/cmd/langgen", + visibility = ["//visibility:private"], + deps = [ + "//pkg/sql/opt/optgen/lang", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "langgen", + embed = [":langgen_lib"], + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/opt/optgen/cmd/optfmt/BUILD.bazel b/pkg/sql/opt/optgen/cmd/optfmt/BUILD.bazel new file mode 100644 index 000000000000..931d3cbbc5e1 --- /dev/null +++ b/pkg/sql/opt/optgen/cmd/optfmt/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "optfmt_lib", + srcs = ["main.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optgen/cmd/optfmt", + visibility = ["//visibility:private"], + deps = [ + "//pkg/sql/opt/optgen/lang", + "//pkg/util/pretty", + "//vendor/github.com/pmezard/go-difflib/difflib", + ], +) + +go_binary( + name = "optfmt", + embed = [":optfmt_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "optfmt_test", + srcs = ["main_test.go"], + data = glob(["testdata/**"]), + embed = [":optfmt_lib"], + deps = ["//vendor/github.com/cockroachdb/datadriven"], +) diff --git a/pkg/sql/opt/optgen/cmd/optgen/BUILD.bazel b/pkg/sql/opt/optgen/cmd/optgen/BUILD.bazel new file mode 100644 index 000000000000..02b7d2042407 --- /dev/null +++ b/pkg/sql/opt/optgen/cmd/optgen/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "optgen_lib", + srcs = [ + "exec_explain_gen.go", + "exec_factory_gen.go", + "explorer_gen.go", + "exprs_gen.go", + "factory_gen.go", + "main.go", + "match_writer.go", + "metadata.go", + "ops_gen.go", + "rule_gen.go", + "rule_names_gen.go", + "uniquifier.go", + "utils.go", + "validator.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optgen/cmd/optgen", + visibility = ["//visibility:private"], + deps = [ + "//pkg/sql/opt/optgen/lang", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_binary( + name = "optgen", + embed = [":optgen_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "optgen_test", + srcs = ["main_test.go"], + data = glob(["testdata/**"]), + embed = [":optgen_lib"], + deps = [ + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/opt/optgen/exprgen/BUILD.bazel b/pkg/sql/opt/optgen/exprgen/BUILD.bazel new file mode 100644 index 000000000000..6a8f9ccbc3aa --- /dev/null +++ b/pkg/sql/opt/optgen/exprgen/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "exprgen", + srcs = [ + "custom_funcs.go", + "expr_gen.go", + "parse_type.go", + "private.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optgen/exprgen", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optgen/lang", + "//pkg/sql/opt/ordering", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/sql/stats", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "exprgen_test", + srcs = ["expr_gen_test.go"], + data = glob(["testdata/**"]), + deps = [ + "//pkg/sql/opt/testutils/opttester", + "//pkg/sql/opt/testutils/testcat", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/optgen/lang/BUILD.bazel b/pkg/sql/opt/optgen/lang/BUILD.bazel new file mode 100644 index 000000000000..882e3c5b5ba8 --- /dev/null +++ b/pkg/sql/opt/optgen/lang/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lang", + srcs = [ + "compiler.go", + "data_type.go", + "doc.go", + "expr.go", + "expr.og.go", # keep + "operator.og.go", # keep + "operator_string.go", + "parser.go", + "scanner.go", + "token_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/optgen/lang", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "lang_test", + srcs = [ + "compiler_test.go", + "parser_test.go", + "scanner_test.go", + ], + data = glob(["testdata/**"]), + embed = [":lang"], + deps = [ + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/opt/ordering/BUILD.bazel b/pkg/sql/opt/ordering/BUILD.bazel new file mode 100644 index 000000000000..24446b7dd04b --- /dev/null +++ b/pkg/sql/opt/ordering/BUILD.bazel @@ -0,0 +1,61 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ordering", + srcs = [ + "doc.go", + "group_by.go", + "inverted_join.go", + "limit.go", + "lookup_join.go", + "merge_join.go", + "mutation.go", + "ordering.go", + "project.go", + "row_number.go", + "scan.go", + "select.go", + "sort.go", + "statement.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/ordering", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/sem/tree", + "//pkg/util", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "ordering_test", + srcs = [ + "group_by_test.go", + "inverted_join_test.go", + "lookup_join_test.go", + "ordering_test.go", + "project_test.go", + "row_number_test.go", + "scan_test.go", + ], + embed = [":ordering"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/testutils/testexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/opt/partialidx/BUILD.bazel b/pkg/sql/opt/partialidx/BUILD.bazel new file mode 100644 index 000000000000..a0bd8e278876 --- /dev/null +++ b/pkg/sql/opt/partialidx/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "partialidx", + srcs = ["implicator.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/partialidx", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/sem/tree", + "//pkg/util", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "partialidx_test", + srcs = ["implicator_test.go"], + data = glob(["testdata/**"]), + deps = [ + ":partialidx", + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/props", + "//pkg/sql/opt/testutils", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/props/BUILD.bazel b/pkg/sql/opt/props/BUILD.bazel new file mode 100644 index 000000000000..effdb7f10cbe --- /dev/null +++ b/pkg/sql/opt/props/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "props", + srcs = [ + "cardinality.go", + "col_stats_map.go", + "func_dep.go", + "histogram.go", + "logical.go", + "multiplicity.go", + "statistics.go", + "verify.go", + "volatility.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/props", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/olekukonko/tablewriter", + ], +) + +go_test( + name = "props_test", + srcs = [ + "cardinality_test.go", + "col_stats_map_test.go", + "func_dep_rand_test.go", + "func_dep_test.go", + "histogram_test.go", + "multiplicity_test.go", + "volatility_test.go", + ], + embed = [":props"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/opt/props/physical/BUILD.bazel b/pkg/sql/opt/props/physical/BUILD.bazel new file mode 100644 index 000000000000..39954e0eab33 --- /dev/null +++ b/pkg/sql/opt/props/physical/BUILD.bazel @@ -0,0 +1,30 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "physical", + srcs = [ + "ordering_choice.go", + "provided.go", + "required.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/props/physical", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/props", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "physical_test", + srcs = [ + "ordering_choice_test.go", + "required_test.go", + ], + deps = [ + ":physical", + "//pkg/sql/opt", + "//pkg/sql/opt/props", + ], +) diff --git a/pkg/sql/opt/testutils/BUILD.bazel b/pkg/sql/opt/testutils/BUILD.bazel new file mode 100644 index 000000000000..5933f99001c8 --- /dev/null +++ b/pkg/sql/opt/testutils/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testutils", + srcs = [ + "build.go", + "scalar_vars.go", + "utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "testutils_test", + srcs = ["scalar_vars_test.go"], + embed = [":testutils"], + deps = [ + "//pkg/sql/opt", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/sql/opt/testutils/opttester/BUILD.bazel b/pkg/sql/opt/testutils/opttester/BUILD.bazel new file mode 100644 index 000000000000..4e5329376401 --- /dev/null +++ b/pkg/sql/opt/testutils/opttester/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "opttester", + srcs = [ + "explore_trace.go", + "forcing_opt.go", + "memo_groups.go", + "opt_steps.go", + "opt_tester.go", + "reorder_joins.go", + "stats_tester.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/opttester", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/optgen/exprgen", + "//pkg/sql/opt/props/physical", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/stats", + "//pkg/testutils/sqlutils", + "//pkg/util", + "//pkg/util/timeutil", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/pmezard/go-difflib/difflib", + ], +) + +go_test( + name = "opttester_test", + srcs = ["opt_tester_test.go"], + data = glob(["testdata/**"]), + deps = [ + ":opttester", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/testutils/testcat", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/testutils/testcat/BUILD.bazel b/pkg/sql/opt/testutils/testcat/BUILD.bazel new file mode 100644 index 000000000000..10ee9b7144fb --- /dev/null +++ b/pkg/sql/opt/testutils/testcat/BUILD.bazel @@ -0,0 +1,55 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testcat", + srcs = [ + "alter_table.go", + "create_index.go", + "create_sequence.go", + "create_table.go", + "create_view.go", + "drop_index.go", + "drop_table.go", + "set_zone_config.go", + "table_expr.go", + "test_catalog.go", + "vtable.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/testcat", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config/zonepb", + "//pkg/geo/geoindex", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt/cat", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/stats", + "//pkg/sql/types", + "//pkg/sql/vtable", + "//pkg/util", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +go_test( + name = "testcat_test", + srcs = ["test_catalog_test.go"], + data = glob(["testdata/**"]), + deps = [ + ":testcat", + "//pkg/sql/opt/testutils/opttester", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/datadriven", + ], +) diff --git a/pkg/sql/opt/testutils/testexpr/BUILD.bazel b/pkg/sql/opt/testutils/testexpr/BUILD.bazel new file mode 100644 index 000000000000..7c6f1d280a05 --- /dev/null +++ b/pkg/sql/opt/testutils/testexpr/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "testexpr", + srcs = ["test_expr.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/testutils/testexpr", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/opt", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + ], +) diff --git a/pkg/sql/opt/xform/BUILD.bazel b/pkg/sql/opt/xform/BUILD.bazel new file mode 100644 index 000000000000..0919b16cfa74 --- /dev/null +++ b/pkg/sql/opt/xform/BUILD.bazel @@ -0,0 +1,103 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "xform", + srcs = [ + "coster.go", + "explorer.go", + "general_funcs.go", + "groupby_funcs.go", + "index_scan_builder.go", + "interesting_orderings.go", + "join_funcs.go", + "join_order_builder.go", + "limit_funcs.go", + "memo_format.go", + "optimizer.go", + "physical_props.go", + "scan_funcs.go", + "scan_index_iter.go", + "select_funcs.go", + ":gen-explorer", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/opt/xform", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt", + "//pkg/sql/opt/cat", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/idxconstraint", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/invertedidx", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/ordering", + "//pkg/sql/opt/partialidx", + "//pkg/sql/opt/props", + "//pkg/sql/opt/props/physical", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/errorutil", + "//pkg/util/log", + "//pkg/util/treeprinter", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/tools/container/intsets", + ], +) + +go_test( + name = "xform_test", + srcs = [ + "coster_test.go", + "join_order_builder_test.go", + "main_test.go", + "optimizer_test.go", + "physical_props_test.go", + ], + data = glob(["testdata/**"]), + embed = [":xform"], + deps = [ + "//pkg/config/zonepb", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/settings/cluster", + "//pkg/sql/opt", + "//pkg/sql/opt/memo", + "//pkg/sql/opt/norm", + "//pkg/sql/opt/testutils", + "//pkg/sql/opt/testutils/opttester", + "//pkg/sql/opt/testutils/testcat", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/gopkg.in/yaml.v2:yaml_v2", + ], +) + +# Define a filegroup for all xform rules. +rules = filegroup( + name = "rules", + srcs = glob(["rules/*.opt"]), + visibility = ["//visibility:public"], +) + +# Define a generator for expression tree exploration rules. +genrule( + name = "gen-explorer", + srcs = [ + "//pkg/sql/opt:ops", + ":rules", + ], + outs = ["explorer.og.go"], + cmd = """ + $(location //pkg/sql/opt/optgen/cmd/optgen) -out $@ explorer $(locations //pkg/sql/opt:ops) $(locations :rules) + """, + tools = ["//pkg/sql/opt/optgen/cmd/optgen"], +) diff --git a/pkg/sql/optionalnodeliveness/BUILD.bazel b/pkg/sql/optionalnodeliveness/BUILD.bazel new file mode 100644 index 000000000000..8db4c85305cd --- /dev/null +++ b/pkg/sql/optionalnodeliveness/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "optionalnodeliveness", + srcs = ["node_liveness.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/optionalnodeliveness", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/util/errorutil", + ], +) diff --git a/pkg/sql/paramparse/BUILD.bazel b/pkg/sql/paramparse/BUILD.bazel new file mode 100644 index 000000000000..44f002b5130b --- /dev/null +++ b/pkg/sql/paramparse/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "paramparse", + srcs = [ + "paramobserver.go", + "paramparse.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/paramparse", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/parser/BUILD.bazel b/pkg/sql/parser/BUILD.bazel new file mode 100644 index 000000000000..775fb20b5ad3 --- /dev/null +++ b/pkg/sql/parser/BUILD.bazel @@ -0,0 +1,91 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "parser", + # We intentionally elide sql.go here (that's done through an exclude + # directive in the top-level BUILD.bazel) and instead list the generation + # that constructs sql.go on the fly. We pin it lest gazelle removes it + # during BUILD file re-generation. + srcs = [ + "help.go", + "help_messages.go", + "lexer.go", + "parse.go", + "scan.go", + "show_syntax.go", + ":sql-goyacc", # keep + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/parser", + visibility = ["//visibility:public"], + # We pin some go dependencies that are present in auto-generated code, but + # are not visible to bazel/gazelle when generating BUILD files. + deps = [ + "//pkg/docs", + "//pkg/geo/geopb", # keep + "//pkg/roachpb", # keep + "//pkg/sql/lex", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/privilege", # keep + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", # keep + ], +) + +go_test( + name = "parser_test", + srcs = [ + "help_test.go", + "helpmap_test.go", + "lexer_test.go", + "parse_internal_test.go", + "parse_test.go", + "scan_test.go", + ], + data = glob(["testdata/**"]), + embed = [":parser"], + deps = [ + "//pkg/sql/lex", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/testutils", + "//pkg/testutils/sqlutils", + "//pkg/util/leaktest", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) + +sh_binary( + name = "sql-gen", + srcs = ["sql-gen.sh"], + data = ["sql-gen.sh"], +) + +# Define the target to auto-generate sql.go from the grammar file. +genrule( + name = "sql-goyacc", + srcs = [ + "sql.y", + "replace_help_rules.awk", + ], + outs = ["sql.go"], + cmd = """ + $(location :sql-gen) $(location sql.y) $(location replace_help_rules.awk) \ + $(location sql.go) $(location //vendor/golang.org/x/tools/cmd/goyacc) \ + $(location //vendor/github.com/cockroachdb/gostdlib/x/tools/cmd/goimports) + """, + tools = [ + ":sql-gen", + "//vendor/github.com/cockroachdb/gostdlib/x/tools/cmd/goimports", + "//vendor/golang.org/x/tools/cmd/goyacc", + ], +) diff --git a/pkg/sql/parser/fuzz/BUILD.bazel b/pkg/sql/parser/fuzz/BUILD.bazel new file mode 100644 index 000000000000..2a50e688b152 --- /dev/null +++ b/pkg/sql/parser/fuzz/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fuzz", + srcs = ["empty.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/parser/fuzz", + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/parser/sql-gen.sh b/pkg/sql/parser/sql-gen.sh new file mode 100755 index 000000000000..d2770737f655 --- /dev/null +++ b/pkg/sql/parser/sql-gen.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# This is used through bazel when generating sql.go. Look at BUILD.bazel for +# usage. + +set -euo pipefail + +awk '/func.*sqlSymUnion/ {print $(NF - 1)}' $1 | \ + sed -e 's/[]\/$*.^|[]/\\&/g' | \ + sed -e "s/^/s_(type|token) <(/" | \ + awk '{print $0")>_\\1 /* <\\2> */_"}' > types_regex.tmp + +sed -E -f types_regex.tmp < $1 | \ + awk -f $2 | \ + sed -Ee 's,//.*$$,,g;s,/[*]([^*]|[*][^/])*[*]/, ,g;s/ +$$//g' > sql-gen.y +rm types_regex.tmp + +ret=$($4 -p sql -o $3 sql-gen.y); \ + if expr "$$ret" : ".*conflicts" >/dev/null; then \ + echo "$$ret"; exit 1; \ + fi; +rm sql-gen.y +$5 -w $3 diff --git a/pkg/sql/pgwire/BUILD.bazel b/pkg/sql/pgwire/BUILD.bazel new file mode 100644 index 000000000000..690cda58bdce --- /dev/null +++ b/pkg/sql/pgwire/BUILD.bazel @@ -0,0 +1,121 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pgwire", + srcs = [ + "auth.go", + "auth_methods.go", + "command_result.go", + "conn.go", + "hba_conf.go", + "server.go", + "types.go", + "write_buffer.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/security", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/lex", + "//pkg/sql/parser", + "//pkg/sql/pgwire/hba", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/pgwire/pgwirebase", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondatapb", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/contextutil", + "//pkg/util/duration", + "//pkg/util/envutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/humanizeutil", + "//pkg/util/ipaddr", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "pgwire_test", + srcs = [ + "auth_test.go", + "conn_test.go", + "encoding_test.go", + "helpers_test.go", + "main_test.go", + "pgtest_test.go", + "pgwire_test.go", + "types_test.go", + ], + data = glob(["testdata/**"]), + embed = [":pgwire"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgwirebase", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/sqlutil", + "//pkg/sql/tests", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/pgtest", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/stdstrings", + "//vendor/github.com/jackc/pgproto3/v2:pgproto3", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/lib/pq", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/sql/pgwire/hba/BUILD.bazel b/pkg/sql/pgwire/hba/BUILD.bazel new file mode 100644 index 000000000000..c9bbf88d943a --- /dev/null +++ b/pkg/sql/pgwire/hba/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hba", + srcs = [ + "hba.go", + "parser.go", + "scanner.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/hba", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/util/errorutil/unimplemented", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/olekukonko/tablewriter", + ], +) + +go_test( + name = "hba_test", + srcs = [ + "hba_test.go", + "scanner_test.go", + ], + data = glob(["testdata/**"]), + embed = [":hba"], + deps = [ + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/kr/pretty", + ], +) diff --git a/pkg/sql/pgwire/pgcode/BUILD.bazel b/pkg/sql/pgwire/pgcode/BUILD.bazel new file mode 100644 index 000000000000..c778edc2b198 --- /dev/null +++ b/pkg/sql/pgwire/pgcode/BUILD.bazel @@ -0,0 +1,11 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgcode", + srcs = [ + "codes.go", + "doc.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode", + visibility = ["//visibility:public"], +) diff --git a/pkg/sql/pgwire/pgerror/BUILD.bazel b/pkg/sql/pgwire/pgerror/BUILD.bazel new file mode 100644 index 000000000000..4fdefe60611a --- /dev/null +++ b/pkg/sql/pgwire/pgerror/BUILD.bazel @@ -0,0 +1,53 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pgerror", + srcs = [ + "constraint_name.go", + "errors.go", + "errors.pb.go", + "flatten.go", + "internal_errors.go", + "pgcode.go", + "severity.go", + "with_candidate_code.go", + "wrap.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror", + visibility = ["//visibility:public"], + deps = [ + "//pkg/docs", + "//pkg/sql/pgwire/pgcode", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/errorspb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/lib/pq", + ], +) + +go_test( + name = "pgerror_test", + srcs = [ + "constraint_name_test.go", + "errors_test.go", + "flatten_test.go", + "internal_errors_test.go", + "main_test.go", + "pgcode_test.go", + "severity_test.go", + "wrap_test.go", + ], + embed = [":pgerror"], + deps = [ + "//pkg/roachpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/errors/testutils", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/pgwire/pgnotice/BUILD.bazel b/pkg/sql/pgwire/pgnotice/BUILD.bazel new file mode 100644 index 000000000000..8b950cb647bb --- /dev/null +++ b/pkg/sql/pgwire/pgnotice/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgnotice", + srcs = [ + "display_severity.go", + "pgnotice.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgnotice", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/pgwire/pgwirebase/BUILD.bazel b/pkg/sql/pgwire/pgwirebase/BUILD.bazel new file mode 100644 index 000000000000..b3814348027d --- /dev/null +++ b/pkg/sql/pgwire/pgwirebase/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgwirebase", + srcs = [ + "clientmessagetype_string.go", + "conn.go", + "doc.go", + "encoding.go", + "formatcode_string.go", + "msg.go", + "pgnumericsign_string.go", + "preparetype_string.go", + "servererrfieldtype_string.go", + "servermessagetype_string.go", + "too_big_error.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirebase", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/lex", + "//pkg/sql/oidext", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/ipaddr", + "//pkg/util/timeofday", + "//pkg/util/timeutil/pgdate", + "//pkg/util/uint128", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/jackc/pgx/pgtype", + "//vendor/github.com/lib/pq/oid", + ], +) diff --git a/pkg/sql/physicalplan/BUILD.bazel b/pkg/sql/physicalplan/BUILD.bazel new file mode 100644 index 000000000000..639b3e4af2f9 --- /dev/null +++ b/pkg/sql/physicalplan/BUILD.bazel @@ -0,0 +1,80 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "physicalplan", + srcs = [ + "aggregator_funcs.go", + "expression.go", + "fake_span_resolver.go", + "physical_plan.go", + "span_resolver.go", + "specs.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/physicalplan", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/physicalplan/replicaoracle", + "//pkg/sql/schemaexpr", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "physicalplan_test", + srcs = [ + "aggregator_funcs_test.go", + "fake_span_resolver_test.go", + "main_test.go", + "physical_plan_test.go", + "span_resolver_internal_test.go", + "span_resolver_test.go", + ], + embed = [":physicalplan"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/distsql", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/physicalplan/replicaoracle", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/physicalplanutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/physicalplan/replicaoracle/BUILD.bazel b/pkg/sql/physicalplan/replicaoracle/BUILD.bazel new file mode 100644 index 000000000000..e70c9d0a5375 --- /dev/null +++ b/pkg/sql/physicalplan/replicaoracle/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "replicaoracle", + srcs = ["oracle.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/physicalplan/replicaoracle", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/sql/sqlerrors", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "replicaoracle_test", + srcs = ["oracle_test.go"], + embed = [":replicaoracle"], + deps = [ + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/metric", + "//pkg/util/stop", + ], +) diff --git a/pkg/sql/privilege/BUILD.bazel b/pkg/sql/privilege/BUILD.bazel new file mode 100644 index 000000000000..34d7620671df --- /dev/null +++ b/pkg/sql/privilege/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "privilege", + srcs = [ + "kind_string.go", + "privilege.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/privilege", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "privilege_test", + srcs = [ + "main_test.go", + "privilege_test.go", + ], + deps = [ + ":privilege", + "//pkg/util/leaktest", + "//pkg/util/log", + ], +) diff --git a/pkg/sql/protoreflect/BUILD.bazel b/pkg/sql/protoreflect/BUILD.bazel new file mode 100644 index 000000000000..f182da99ecaf --- /dev/null +++ b/pkg/sql/protoreflect/BUILD.bazel @@ -0,0 +1,37 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "protoreflect", + srcs = ["utils.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/protoreflect", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/json", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "protoreflect_test", + srcs = [ + "main_test.go", + "utils_test.go", + ], + embed = [":protoreflect"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/sql/catalog/descpb", + "//pkg/util/leaktest", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/tracing/tracingpb", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/querycache/BUILD.bazel b/pkg/sql/querycache/BUILD.bazel new file mode 100644 index 000000000000..7a6cd4eec5d5 --- /dev/null +++ b/pkg/sql/querycache/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "querycache", + srcs = [ + "prepared_statement.go", + "query_cache.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/querycache", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/opt/memo", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "querycache_test", + srcs = ["query_cache_test.go"], + embed = [":querycache"], + deps = [ + "//pkg/sql/opt/memo", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/roleoption/BUILD.bazel b/pkg/sql/roleoption/BUILD.bazel new file mode 100644 index 000000000000..3cb6edf60feb --- /dev/null +++ b/pkg/sql/roleoption/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "roleoption", + srcs = [ + "option_string.go", + "role_option.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/roleoption", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sqltelemetry", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/row/BUILD.bazel b/pkg/sql/row/BUILD.bazel new file mode 100644 index 000000000000..0b2a4e3ee991 --- /dev/null +++ b/pkg/sql/row/BUILD.bazel @@ -0,0 +1,96 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "row", + srcs = [ + "deleter.go", + "errors.go", + "expr_walker.go", + "fetcher.go", + "fk_spans.go", + "helper.go", + "inserter.go", + "kv_batch_fetcher.go", + "kv_fetcher.go", + "partial_index.go", + "row_converter.go", + "truncate.go", + "updater.go", + "writer.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/row", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/roachpb", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/execinfra", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/schemaexpr", + "//pkg/sql/scrub", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/transform", + "//pkg/sql/sem/tree", + "//pkg/sql/span", + "//pkg/sql/sqlerrors", + "//pkg/sql/types", + "//pkg/storage/enginepb", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/timeutil", + "//pkg/util/unique", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "row_test", + srcs = [ + "fetcher_mvcc_test.go", + "fetcher_test.go", + "main_test.go", + ], + embed = [":row"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/sql/rowcontainer/BUILD.bazel b/pkg/sql/rowcontainer/BUILD.bazel new file mode 100644 index 000000000000..7d3662e30230 --- /dev/null +++ b/pkg/sql/rowcontainer/BUILD.bazel @@ -0,0 +1,65 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rowcontainer", + srcs = [ + "datum_row_container.go", + "disk_row_container.go", + "hash_row_container.go", + "numbered_row_container.go", + "row_container.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowcontainer", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/diskmap", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlerrors", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/cancelchecker", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/ring", + "//pkg/util/sort", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "rowcontainer_test", + srcs = [ + "datum_row_container_test.go", + "disk_row_container_test.go", + "hash_row_container_test.go", + "numbered_row_container_test.go", + "row_container_test.go", + ], + embed = [":rowcontainer"], + deps = [ + "//pkg/base", + "//pkg/kv/kvserver/diskmap", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/execinfra", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/rowenc/BUILD.bazel b/pkg/sql/rowenc/BUILD.bazel new file mode 100644 index 000000000000..85689d11f993 --- /dev/null +++ b/pkg/sql/rowenc/BUILD.bazel @@ -0,0 +1,95 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rowenc", + srcs = [ + "column_type_encoding.go", + "datum_alloc.go", + "encoded_datum.go", + "index_encoding.go", + "partition.go", + "roundtrip_format.go", + "testutils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowenc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geogen", + "//pkg/geo/geoindex", + "//pkg/geo/geopb", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/ipaddr", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/util/uint128", + "//pkg/util/unique", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "rowenc_test", + srcs = [ + "client_index_encoding_test.go", + "column_type_encoding_test.go", + "encoded_datum_test.go", + "helpers_test.go", + "index_encoding_test.go", + "main_test.go", + "roundtrip_format_test.go", + ], + embed = [":rowenc"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeofday", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/leanovate/gopter", + "//vendor/github.com/leanovate/gopter/prop", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/rowexec/BUILD.bazel b/pkg/sql/rowexec/BUILD.bazel new file mode 100644 index 000000000000..f70846477d9a --- /dev/null +++ b/pkg/sql/rowexec/BUILD.bazel @@ -0,0 +1,188 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rowexec", + srcs = [ + "aggregator.go", + "backfiller.go", + "bulk_row_writer.go", + "columnbackfiller.go", + "countrows.go", + "distinct.go", + "hashjoiner.go", + "indexbackfiller.go", + "inverted_expr_evaluator.go", + "inverted_filterer.go", + "inverted_joiner.go", + "joinerbase.go", + "joinreader.go", + "joinreader_strategies.go", + "mergejoiner.go", + "noop.go", + "ordinality.go", + "processors.go", + "project_set.go", + "rowfetcher.go", + "sample_aggregator.go", + "sampler.go", + "scrub_tablereader.go", + "sorter.go", + "stats.go", + "stats.pb.go", + "stream_group_accumulator.go", + "stream_merger.go", + "subquery.go", + "tablereader.go", + "values.go", + "windower.go", + "zigzagjoiner.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowexec", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/sql/backfill", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/opt/invertedidx", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/row", + "//pkg/sql/rowcontainer", + "//pkg/sql/rowenc", + "//pkg/sql/scrub", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/span", + "//pkg/sql/sqlerrors", + "//pkg/sql/sqltelemetry", + "//pkg/sql/stats", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/cancelchecker", + "//pkg/util/ctxgroup", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/stringarena", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/axiomhq/hyperloglog", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "rowexec_test", + srcs = [ + "aggregator_test.go", + "backfiller_test.go", + "dep_test.go", + "distinct_test.go", + "hashjoiner_test.go", + "inverted_expr_evaluator_test.go", + "inverted_filterer_test.go", + "inverted_joiner_test.go", + "joiner_test.go", + "joinreader_test.go", + "main_test.go", + "mergejoiner_test.go", + "noop_test.go", + "ordinality_test.go", + "processor_utils_test.go", + "processors_test.go", + "project_set_test.go", + "sample_aggregator_test.go", + "sampler_test.go", + "set_op_test.go", + "sorter_test.go", + "stats_test.go", + "tablereader_test.go", + "utils_test.go", + "values_test.go", + "windower_test.go", + "zigzagjoiner_test.go", + ], + embed = [":rowexec"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/backfill", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/opt/invertedexpr", + "//pkg/sql/rowcontainer", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlutil", + "//pkg/sql/stats", + "//pkg/sql/types", + "//pkg/sqlmigrations", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/distsqlutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/json", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/axiomhq/hyperloglog", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/rowflow/BUILD.bazel b/pkg/sql/rowflow/BUILD.bazel new file mode 100644 index 000000000000..aa3745755ab3 --- /dev/null +++ b/pkg/sql/rowflow/BUILD.bazel @@ -0,0 +1,65 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rowflow", + srcs = [ + "input_sync.go", + "routers.go", + "row_based_flow.go", + "stats.pb.go", + "test_utils.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowflow", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/catalog/colinfo", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/flowinfra", + "//pkg/sql/rowcontainer", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "rowflow_test", + srcs = [ + "dep_test.go", + "input_sync_test.go", + "routers_test.go", + ], + embed = [":rowflow"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/settings/cluster", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/distsqlutils", + "//pkg/util/encoding", + "//pkg/util/leaktest", + "//pkg/util/mon", + "//pkg/util/randutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/opentracing/opentracing-go", + ], +) diff --git a/pkg/sql/schemachange/BUILD.bazel b/pkg/sql/schemachange/BUILD.bazel new file mode 100644 index 000000000000..cfb876de9bbc --- /dev/null +++ b/pkg/sql/schemachange/BUILD.bazel @@ -0,0 +1,44 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schemachange", + srcs = [ + "alter_column_type.go", + "columnconversionkind_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachange", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + ], +) + +go_test( + name = "schemachange_test", + srcs = [ + "alter_column_type_test.go", + "main_test.go", + ], + embed = [":schemachange"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/uuid", + ], +) diff --git a/pkg/sql/schemaexpr/BUILD.bazel b/pkg/sql/schemaexpr/BUILD.bazel new file mode 100644 index 000000000000..29efcd5d506a --- /dev/null +++ b/pkg/sql/schemaexpr/BUILD.bazel @@ -0,0 +1,59 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schemaexpr", + srcs = [ + "check_constraint.go", + "column.go", + "computed_column.go", + "computed_exprs.go", + "default_exprs.go", + "doc.go", + "expr.go", + "expr_filter.go", + "partial_index.go", + "select_name_resolution.go", + "table_col_set.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemaexpr", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geoindex", + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/transform", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/util", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "schemaexpr_test", + srcs = [ + "check_constraint_test.go", + "column_test.go", + "expr_test.go", + "partial_index_test.go", + "table_col_set_test.go", + "testutils_test.go", + ], + embed = [":schemaexpr"], + deps = [ + "//pkg/sql/catalog", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/parser", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + ], +) diff --git a/pkg/sql/scrub/BUILD.bazel b/pkg/sql/scrub/BUILD.bazel new file mode 100644 index 000000000000..667eb904045b --- /dev/null +++ b/pkg/sql/scrub/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "scrub", + srcs = ["errors.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/scrub", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/sql/sem/builtins/BUILD.bazel b/pkg/sql/sem/builtins/BUILD.bazel new file mode 100644 index 000000000000..338e0cfc2859 --- /dev/null +++ b/pkg/sql/sem/builtins/BUILD.bazel @@ -0,0 +1,122 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "builtins", + srcs = [ + "aggregate_builtins.go", + "all_builtins.go", + "builtins.go", + "generator_builtins.go", + "geo_builtins.go", + "math_builtins.go", + "notice.go", + "pg_builtins.go", + "window_builtins.go", + "window_frame_builtins.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sem/builtins", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/geo", + "//pkg/geo/geogfn", + "//pkg/geo/geoindex", + "//pkg/geo/geomfn", + "//pkg/geo/geopb", + "//pkg/geo/geoprojbase", + "//pkg/geo/geos", + "//pkg/geo/geotransform", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/server/telemetry", + "//pkg/settings/cluster", + "//pkg/sql/catalog", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/catconstants", + "//pkg/sql/catalog/descpb", + "//pkg/sql/lex", + "//pkg/sql/paramparse", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/privilege", + "//pkg/sql/protoreflect", + "//pkg/sql/roleoption", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/arith", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/errorutil", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/humanizeutil", + "//pkg/util/ipaddr", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/ring", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/unaccent", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/golang/geo/s1", + "//vendor/github.com/knz/strtime", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/twpayne/go-geom", + "//vendor/github.com/twpayne/go-geom/encoding/ewkb", + ], +) + +go_test( + name = "builtins_test", + srcs = [ + "aggregate_builtins_test.go", + "all_builtins_test.go", + "builtins_test.go", + "generator_builtins_test.go", + "geo_builtins_test.go", + "help_test.go", + "main_test.go", + "math_builtins_test.go", + "window_frame_builtins_test.go", + ], + data = glob(["testdata/**"]), + embed = [":builtins"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/duration", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/sem/transform/BUILD.bazel b/pkg/sql/sem/transform/BUILD.bazel new file mode 100644 index 000000000000..60c5b86e2a8a --- /dev/null +++ b/pkg/sql/sem/transform/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "transform", + srcs = [ + "aggregates.go", + "expr_transform.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sem/transform", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + ], +) diff --git a/pkg/sql/sem/tree/BUILD.bazel b/pkg/sql/sem/tree/BUILD.bazel new file mode 100644 index 000000000000..0ced0df15125 --- /dev/null +++ b/pkg/sql/sem/tree/BUILD.bazel @@ -0,0 +1,223 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tree", + srcs = [ + "aggregate_funcs.go", + "alter_database.go", + "alter_index.go", + "alter_schema.go", + "alter_sequence.go", + "alter_table.go", + "alter_type.go", + "analyze.go", + "annotation.go", + "as_of.go", + "backup.go", + "casts.go", + "changefeed.go", + "col_name.go", + "comment_on_column.go", + "comment_on_database.go", + "comment_on_index.go", + "comment_on_table.go", + "constant.go", + "constant_eval.go", + "constants.go", + "copy.go", + "create.go", + "createtypevariety_string.go", + "datum.go", + "decimal.go", + "delete.go", + "discard.go", + "drop.go", + "drop_owned_by.go", + "eval.go", + "explain.go", + "export.go", + "expr.go", + "format.go", + "function_definition.go", + "function_name.go", + "generators.go", + "grant.go", + "hide_constants.go", + "import.go", + "indexed_vars.go", + "insert.go", + "interval.go", + "name_part.go", + "name_resolution.go", + "normalize.go", + "object_name.go", + "operators.go", + "overload.go", + "parse_array.go", + "parse_string.go", + "persistence.go", + "pgwire_encode.go", + "placeholders.go", + "prepare.go", + "pretty.go", + "reassign_owned_by.go", + "regexp_cache.go", + "region.go", + "rename.go", + "returning.go", + "revoke.go", + "run_control.go", + "schedule.go", + "scrub.go", + "select.go", + "set.go", + "show.go", + "split.go", + "statementtype_string.go", + "stmt.go", + "survive.go", + "table_name.go", + "table_pattern.go", + "table_ref.go", + "testutils.go", + "time.go", + "truncate.go", + "txn.go", + "type_check.go", + "type_name.go", + "union.go", + "update.go", + "values.go", + "var_name.go", + "volatility.go", + "walk.go", + "window_funcs.go", + "window_funcs_util.go", + "with.go", + "zone.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sem/tree", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/lex", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/privilege", + "//pkg/sql/roleoption", + "//pkg/sql/sessiondata", + "//pkg/sql/sessiondatapb", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqltelemetry", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/arith", + "//pkg/util/bitarray", + "//pkg/util/cache", + "//pkg/util/duration", + "//pkg/util/encoding", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/hlc", + "//pkg/util/ipaddr", + "//pkg/util/json", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/pretty", + "//pkg/util/ring", + "//pkg/util/stringencoding", + "//pkg/util/syncutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/google/go-cmp/cmp", + "//vendor/github.com/lib/pq/oid", + "//vendor/golang.org/x/text/collate", + "//vendor/golang.org/x/text/language", + ], +) + +go_test( + name = "tree_test", + srcs = [ + "casts_test.go", + "col_types_test.go", + "collatedstring_test.go", + "compare_test.go", + "constant_eval_test.go", + "constant_test.go", + "datum_invariants_test.go", + "datum_test.go", + "eval_internal_test.go", + "eval_test.go", + "expr_test.go", + "format_test.go", + "function_name_test.go", + "indexed_vars_test.go", + "interval_test.go", + "like_test.go", + "main_test.go", + "name_part_test.go", + "name_resolution_test.go", + "normalize_test.go", + "operators_test.go", + "overload_test.go", + "parse_array_test.go", + "placeholders_test.go", + "pretty_test.go", + "table_name_test.go", + "time_test.go", + "timeconv_test.go", + "type_check_internal_test.go", + "type_check_test.go", + "window_funcs_test.go", + ], + data = glob(["testdata/**"]), + embed = [":tree"], + deps = [ + "//pkg/internal/rsg", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/settings/cluster", + "//pkg/sql/oidext", + "//pkg/sql/opt/exec/execbuilder", + "//pkg/sql/opt/optbuilder", + "//pkg/sql/opt/xform", + "//pkg/sql/parser", + "//pkg/sql/sem/builtins", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/sqlutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/pretty", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/sql/sem/tree/eval_test/BUILD.bazel b/pkg/sql/sem/tree/eval_test/BUILD.bazel new file mode 100644 index 000000000000..afe8730467c6 --- /dev/null +++ b/pkg/sql/sem/tree/eval_test/BUILD.bazel @@ -0,0 +1,34 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "eval_test_test", + srcs = [ + "eval_test.go", + "main_test.go", + ], + deps = [ + "//pkg/base", + "//pkg/col/coldata", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/colexec", + "//pkg/sql/colexec/colbuilder", + "//pkg/sql/colexecbase", + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/parser", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/sessiondata/BUILD.bazel b/pkg/sql/sessiondata/BUILD.bazel new file mode 100644 index 000000000000..fcb691d58fac --- /dev/null +++ b/pkg/sql/sessiondata/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sessiondata", + srcs = [ + "internal.go", + "search_path.go", + "sequence_state.go", + "session_data.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sessiondata", + visibility = ["//visibility:public"], + deps = [ + "//pkg/security", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/pgwire/pgnotice", + "//pkg/sql/sessiondatapb", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + ], +) + +go_test( + name = "sessiondata_test", + srcs = ["search_path_test.go"], + embed = [":sessiondata"], + deps = ["//vendor/github.com/stretchr/testify/assert"], +) diff --git a/pkg/sql/sessiondatapb/BUILD.bazel b/pkg/sql/sessiondatapb/BUILD.bazel new file mode 100644 index 000000000000..4286e2c7c247 --- /dev/null +++ b/pkg/sql/sessiondatapb/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sessiondatapb", + srcs = [ + "session_data.go", + "session_data.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sessiondatapb", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/gogo/protobuf/proto"], +) diff --git a/pkg/sql/span/BUILD.bazel b/pkg/sql/span/BUILD.bazel new file mode 100644 index 000000000000..d83d881e8eda --- /dev/null +++ b/pkg/sql/span/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "span", + srcs = ["span_builder.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/span", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/opt/constraint", + "//pkg/sql/opt/exec", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/encoding", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/sqlerrors/BUILD.bazel b/pkg/sql/sqlerrors/BUILD.bazel new file mode 100644 index 000000000000..0e862cdfed33 --- /dev/null +++ b/pkg/sql/sqlerrors/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqlerrors", + srcs = ["errors.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlerrors", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/tree", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/sqlliveness/BUILD.bazel b/pkg/sql/sqlliveness/BUILD.bazel new file mode 100644 index 000000000000..935bc3836a88 --- /dev/null +++ b/pkg/sql/sqlliveness/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqlliveness", + srcs = ["sqlliveness.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness", + visibility = ["//visibility:public"], + deps = [ + "//pkg/clusterversion", + "//pkg/settings/cluster", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/metric", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/sqlliveness/slinstance/BUILD.bazel b/pkg/sql/sqlliveness/slinstance/BUILD.bazel new file mode 100644 index 000000000000..e94ac377f79c --- /dev/null +++ b/pkg/sql/sqlliveness/slinstance/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "slinstance", + srcs = ["slinstance.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness/slinstance", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/sqlliveness", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + ], +) + +go_test( + name = "slinstance_test", + srcs = [ + "helpers_test.go", + "slinstance_test.go", + ], + embed = [":slinstance"], + deps = [ + "//pkg/clusterversion", + "//pkg/settings/cluster", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlliveness/slstorage", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/stop", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/sqlliveness/slprovider/BUILD.bazel b/pkg/sql/sqlliveness/slprovider/BUILD.bazel new file mode 100644 index 000000000000..08d3db5ecb5c --- /dev/null +++ b/pkg/sql/sqlliveness/slprovider/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "slprovider", + srcs = ["slprovider.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness/slprovider", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/settings/cluster", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlliveness/slinstance", + "//pkg/sql/sqlliveness/slstorage", + "//pkg/sql/sqlutil", + "//pkg/util/hlc", + "//pkg/util/metric", + "//pkg/util/stop", + ], +) diff --git a/pkg/sql/sqlliveness/slstorage/BUILD.bazel b/pkg/sql/sqlliveness/slstorage/BUILD.bazel new file mode 100644 index 000000000000..e2c8b54853a9 --- /dev/null +++ b/pkg/sql/sqlliveness/slstorage/BUILD.bazel @@ -0,0 +1,66 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "slstorage", + srcs = [ + "metrics.go", + "slstorage.go", + "test_helpers.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness/slstorage", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlutil", + "//pkg/util/cache", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/prometheus/client_model/go", + ], +) + +go_test( + name = "slstorage_test", + srcs = [ + "main_test.go", + "slstorage_test.go", + ], + deps = [ + ":slstorage", + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/sqlliveness", + "//pkg/sql/sqlutil", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/sqltelemetry/BUILD.bazel b/pkg/sql/sqltelemetry/BUILD.bazel new file mode 100644 index 000000000000..a300bc27f01c --- /dev/null +++ b/pkg/sql/sqltelemetry/BUILD.bazel @@ -0,0 +1,36 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqltelemetry", + srcs = [ + "diagnostics.go", + "doc.go", + "drop_owned_by.go", + "enum.go", + "exec.go", + "extension.go", + "follower_reads.go", + "iam.go", + "partitioning.go", + "pgwire.go", + "planning.go", + "reassign_owned_by.go", + "report.go", + "scalar.go", + "scheduled_backups.go", + "schema.go", + "session.go", + "show.go", + "user_defined_schema.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/sqltestutils/BUILD.bazel b/pkg/sql/sqltestutils/BUILD.bazel new file mode 100644 index 000000000000..386300551124 --- /dev/null +++ b/pkg/sql/sqltestutils/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqltestutils", + srcs = ["sql_test_utils.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqltestutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config/zonepb", + "//pkg/sql/catalog/descpb", + "//pkg/util/protoutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/sqlutil/BUILD.bazel b/pkg/sql/sqlutil/BUILD.bazel new file mode 100644 index 000000000000..ccf251c5eb7d --- /dev/null +++ b/pkg/sql/sqlutil/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqlutil", + srcs = ["internal_executor.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqlutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/sql/catalog/colinfo", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + ], +) diff --git a/pkg/sql/stats/BUILD.bazel b/pkg/sql/stats/BUILD.bazel new file mode 100644 index 000000000000..b4ae486ee4c3 --- /dev/null +++ b/pkg/sql/stats/BUILD.bazel @@ -0,0 +1,107 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stats", + srcs = [ + "automatic_stats.go", + "delete_stats.go", + "histogram.go", + "histogram.pb.go", + "json.go", + "new_stat.go", + "row_sampling.go", + "stats_cache.go", + "table_statistic.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/stats", + visibility = ["//visibility:public"], + deps = [ + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/descs", + "//pkg/sql/catalog/lease", + "//pkg/sql/opt/cat", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/cache", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/types", + ], +) + +go_test( + name = "stats_test", + srcs = [ + "automatic_stats_manual_test.go", + "automatic_stats_test.go", + "create_stats_job_test.go", + "delete_stats_test.go", + "gossip_invalidation_test.go", + "histogram_test.go", + "main_test.go", + "row_sampling_test.go", + "stats_cache_test.go", + ], + embed = [":stats"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/lease", + "//pkg/sql/row", + "//pkg/sql/rowenc", + "//pkg/sql/rowexec", + "//pkg/sql/sem/tree", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/jobutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/sql/stmtdiagnostics/BUILD.bazel b/pkg/sql/stmtdiagnostics/BUILD.bazel new file mode 100644 index 000000000000..970e798ec46e --- /dev/null +++ b/pkg/sql/stmtdiagnostics/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stmtdiagnostics", + srcs = ["statement_diagnostics.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/stmtdiagnostics", + visibility = ["//visibility:public"], + deps = [ + "//pkg/gossip", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/sqlutil", + "//pkg/sql/types", + "//pkg/util", + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "stmtdiagnostics_test", + srcs = [ + "main_test.go", + "stament_diagnostics_helpers_test.go", + "statement_diagnostics_test.go", + ], + embed = [":stmtdiagnostics"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/tests/BUILD.bazel b/pkg/sql/tests/BUILD.bazel new file mode 100644 index 000000000000..2068a7243e8b --- /dev/null +++ b/pkg/sql/tests/BUILD.bazel @@ -0,0 +1,94 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tests", + srcs = [ + "command_filters.go", + "data.go", + "end_txn_trigger.go", + "server_params.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/tests", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/testutils/storageutils", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "tests_test", + srcs = [ + "bank_test.go", + "hash_sharded_test.go", + "impure_builtin_test.go", + "inverted_index_test.go", + "kv_test.go", + "main_test.go", + "monotonic_insert_test.go", + "random_schema_test.go", + "rsg_test.go", + "split_test.go", + "system_table_test.go", + "table_split_test.go", + ], + data = glob(["testdata/**"]), + deps = [ + ":tests", + "//pkg/base", + "//pkg/bench", + "//pkg/ccl", + "//pkg/ccl/utilccl", + "//pkg/config/zonepb", + "//pkg/internal/rsg", + "//pkg/internal/sqlsmith", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver/concurrency", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/privilege", + "//pkg/sql/rowenc", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/ctxgroup", + "//pkg/util/json", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/types/BUILD.bazel b/pkg/sql/types/BUILD.bazel new file mode 100644 index 000000000000..5b16fbfa3396 --- /dev/null +++ b/pkg/sql/types/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "types", + srcs = [ + "alias.go", + "oid.go", + "types.go", + "types.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/types", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo/geopb", + "//pkg/sql/lex", + "//pkg/sql/oidext", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/lib/pq/oid", + ], +) + +go_test( + name = "types_test", + srcs = ["types_test.go"], + embed = [":types"], + deps = [ + "//pkg/geo/geopb", + "//pkg/sql/oidext", + "//pkg/util/protoutil", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sql/vtable/BUILD.bazel b/pkg/sql/vtable/BUILD.bazel new file mode 100644 index 000000000000..3633f5a66b79 --- /dev/null +++ b/pkg/sql/vtable/BUILD.bazel @@ -0,0 +1,11 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "vtable", + srcs = [ + "information_schema.go", + "pg_catalog.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sql/vtable", + visibility = ["//visibility:public"], +) diff --git a/pkg/sqlmigrations/BUILD.bazel b/pkg/sqlmigrations/BUILD.bazel new file mode 100644 index 000000000000..5383cd8c0ebc --- /dev/null +++ b/pkg/sqlmigrations/BUILD.bazel @@ -0,0 +1,80 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sqlmigrations", + srcs = ["migrations.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/sqlmigrations", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/config/zonepb", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog", + "//pkg/sql/catalog/bootstrap", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/sqlmigrations/leasemanager", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + ], +) + +go_test( + name = "sqlmigrations_test", + srcs = [ + "main_test.go", + "migrations_test.go", + ], + embed = [":sqlmigrations"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/keys", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/catalog/catalogkeys", + "//pkg/sql/catalog/catalogkv", + "//pkg/sql/catalog/descpb", + "//pkg/sql/catalog/systemschema", + "//pkg/sql/catalog/tabledesc", + "//pkg/sql/sem/builtins", + "//pkg/sql/tests", + "//pkg/sqlmigrations/leasemanager", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/sqlmigrations/leasemanager/BUILD.bazel b/pkg/sqlmigrations/leasemanager/BUILD.bazel new file mode 100644 index 000000000000..afa6aac27cd4 --- /dev/null +++ b/pkg/sqlmigrations/leasemanager/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "leasemanager", + srcs = [ + "lease.go", + "lease.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/sqlmigrations/leasemanager", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "leasemanager_test", + srcs = [ + "lease_test.go", + "main_test.go", + ], + deps = [ + ":leasemanager", + "//pkg/base", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/storage/BUILD.bazel b/pkg/storage/BUILD.bazel new file mode 100644 index 000000000000..6f3fc2416134 --- /dev/null +++ b/pkg/storage/BUILD.bazel @@ -0,0 +1,174 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storage", + srcs = [ + "array_32bit.go", + "array_64bit.go", + "batch.go", + "disk_map.go", + "doc.go", + "enable_cc.cc", + "engine.go", + "engine_key.go", + "error.go", + "file_util.go", + "in_mem.go", + "multi_iterator.go", + "mvcc.go", + "mvcc_incremental_iterator.go", + "mvcc_logical_ops.go", + "pebble.go", + "pebble_batch.go", + "pebble_file_registry.go", + "pebble_iterator.go", + "pebble_merge.go", + "pebble_mvcc_scanner.go", + "row_counter.go", + "slice.go", + "slice_go1.9.go", + "sst_info.go", + "sst_iterator.go", + "sst_writer.go", + "stacks.go", + "temp_dir.go", + "temp_engine.go", + "version.go", + ], + # List out all the c-dependencies pkg/storage depends on. + cdeps = [ + "@cockroach//:libroach", + ], + cgo = True, + + # Pin the clinkopts, we don't have to link libroach directly (which gazelle + # would auto-generate through the cgo tags if left unpinned. Those linker + # directives are implicitly defined by listing out the appropriate + # c-dependencies above. + # + # keep + clinkopts = select({ + "@io_bazel_rules_go//go/platform:dragonfly": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "-lm", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "-lrt -lm -lpthread", + "-lrt -lpthread", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "-lshlwapi -lrpcrt4", + ], + "//conditions:default": [], + }), + # We do the same for the include directives. By defining the appropriate + # c-dependencies above, bazel determines the right ones automagically. + # + # keep + cppopts = [], + importpath = "github.com/cockroachdb/cockroach/pkg/storage", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/keys", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/diskmap", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage/enginepb", + "//pkg/storage/fs", + "//pkg/util/bufalloc", + "//pkg/util/encoding", + "//pkg/util/envutil", + "//pkg/util/hlc", + "//pkg/util/humanizeutil", + "//pkg/util/iterutil", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/pebble/bloom", + "//vendor/github.com/cockroachdb/pebble/sstable", + "//vendor/github.com/cockroachdb/pebble/vfs", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/elastic/gosigar", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "storage_test", + srcs = [ + "batch_test.go", + "bench_pebble_test.go", + "bench_test.go", + "disk_map_test.go", + "engine_key_test.go", + "engine_test.go", + "main_test.go", + "multi_iterator_test.go", + "mvcc_history_test.go", + "mvcc_incremental_iterator_test.go", + "mvcc_logical_ops_test.go", + "mvcc_stats_test.go", + "mvcc_test.go", + "pebble_file_registry_test.go", + "pebble_test.go", + "slice_test.go", + "sst_info_test.go", + "sst_iterator_test.go", + "sst_writer_test.go", + "temp_dir_test.go", + "temp_engine_test.go", + "version_test.go", + ], + data = glob(["testdata/**"]), + embed = [":storage"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv/kvserver/concurrency/lock", + "//pkg/kv/kvserver/diskmap", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage/enginepb", + "//pkg/storage/fs", + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/testutils/zerofields", + "//pkg/util/caller", + "//pkg/util/encoding", + "//pkg/util/fileutil", + "//pkg/util/hlc", + "//pkg/util/iterutil", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/protoutil", + "//pkg/util/randutil", + "//pkg/util/shuffle", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/pebble", + "//vendor/github.com/cockroachdb/pebble/vfs", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/google.golang.org/protobuf/proto", + ], +) diff --git a/pkg/storage/cloud/BUILD.bazel b/pkg/storage/cloud/BUILD.bazel new file mode 100644 index 000000000000..4d471cf0347d --- /dev/null +++ b/pkg/storage/cloud/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cloud", + srcs = [ + "external_storage.go", + "kms.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/cloud", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/storage/cloudimpl/BUILD.bazel b/pkg/storage/cloudimpl/BUILD.bazel new file mode 100644 index 000000000000..4e995c33613b --- /dev/null +++ b/pkg/storage/cloudimpl/BUILD.bazel @@ -0,0 +1,51 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cloudimpl", + srcs = [ + "aws_kms.go", + "azure_storage.go", + "external_storage.go", + "file_table_storage.go", + "gcs_storage.go", + "http_storage.go", + "kms.go", + "nodelocal_storage.go", + "s3_storage.go", + "workload_storage.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/cloudimpl", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/server/telemetry", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl/filetable", + "//pkg/util/contextutil", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/sysutil", + "//pkg/workload", + "//vendor/cloud.google.com/go/storage", + "//vendor/github.com/Azure/azure-storage-blob-go/azblob", + "//vendor/github.com/aws/aws-sdk-go/aws", + "//vendor/github.com/aws/aws-sdk-go/aws/awserr", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials", + "//vendor/github.com/aws/aws-sdk-go/aws/session", + "//vendor/github.com/aws/aws-sdk-go/service/kms", + "//vendor/github.com/aws/aws-sdk-go/service/s3", + "//vendor/github.com/aws/aws-sdk-go/service/s3/s3manager", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/oauth2/google", + "//vendor/google.golang.org/api/iterator", + "//vendor/google.golang.org/api/option", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/status", + ], +) diff --git a/pkg/storage/cloudimpl/cloudimpltests/BUILD.bazel b/pkg/storage/cloudimpl/cloudimpltests/BUILD.bazel new file mode 100644 index 000000000000..758048d899a4 --- /dev/null +++ b/pkg/storage/cloudimpl/cloudimpltests/BUILD.bazel @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "cloudimpltests_test", + srcs = [ + "aws_kms_test.go", + "azure_storage_test.go", + "external_storage_test.go", + "file_table_storage_test.go", + "gcs_storage_test.go", + "http_storage_test.go", + "kms_test.go", + "main_test.go", + "nodelocal_storage_test.go", + "s3_storage_test.go", + ], + deps = [ + "//pkg/base", + "//pkg/blobs", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/sql", + "//pkg/sql/tests", + "//pkg/storage/cloud", + "//pkg/storage/cloudimpl", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/util/ctxgroup", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/retry", + "//pkg/util/sysutil", + "//pkg/workload", + "//pkg/workload/bank", + "//vendor/github.com/aws/aws-sdk-go/aws/credentials", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/oauth2/google", + ], +) diff --git a/pkg/storage/cloudimpl/filetable/BUILD.bazel b/pkg/storage/cloudimpl/filetable/BUILD.bazel new file mode 100644 index 000000000000..c8425c7b3605 --- /dev/null +++ b/pkg/storage/cloudimpl/filetable/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "filetable", + srcs = ["file_table_read_writer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/cloudimpl/filetable", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/security", + "//pkg/sql", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + "//pkg/storage/cloud", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/storage/cloudimpl/filetable/filetabletest/BUILD.bazel b/pkg/storage/cloudimpl/filetable/filetabletest/BUILD.bazel new file mode 100644 index 000000000000..fba346ad1b39 --- /dev/null +++ b/pkg/storage/cloudimpl/filetable/filetabletest/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "filetabletest_test", + srcs = [ + "file_table_read_writer_test.go", + "main_test.go", + ], + deps = [ + "//pkg/kv", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql", + "//pkg/sql/tests", + "//pkg/storage/cloudimpl/filetable", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/storage/enginepb/BUILD.bazel b/pkg/storage/enginepb/BUILD.bazel new file mode 100644 index 000000000000..f3ed6e4006a0 --- /dev/null +++ b/pkg/storage/enginepb/BUILD.bazel @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "enginepb", + srcs = [ + "decode.go", + "engine.go", + "engine.pb.go", + "file_registry.pb.go", + "mvcc.go", + "mvcc.pb.go", + "mvcc3.go", + "mvcc3.pb.go", + "rocksdb.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/enginepb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + ], +) + +go_test( + name = "enginepb_test", + srcs = [ + "decode_test.go", + "mvcc_test.go", + ], + deps = [ + ":enginepb", + "//pkg/roachpb", + "//pkg/storage", + "//pkg/util/hlc", + "//pkg/util/uuid", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/storage/fs/BUILD.bazel b/pkg/storage/fs/BUILD.bazel new file mode 100644 index 000000000000..18f619fb6384 --- /dev/null +++ b/pkg/storage/fs/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fs", + srcs = ["fs.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/fs", + visibility = ["//visibility:public"], +) diff --git a/pkg/storage/metamorphic/BUILD.bazel b/pkg/storage/metamorphic/BUILD.bazel new file mode 100644 index 000000000000..3f45f2c8d371 --- /dev/null +++ b/pkg/storage/metamorphic/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metamorphic", + srcs = [ + "deck.go", + "generator.go", + "operands.go", + "operations.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/storage/metamorphic", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/storage/enginepb", + "//pkg/util/hlc", + "//pkg/util/syncutil", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/pebble", + ], +) + +go_test( + name = "metamorphic_test", + srcs = [ + "main_test.go", + "meta_test.go", + ], + embed = [":metamorphic"], + deps = [ + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util/leaktest", + "//pkg/util/log", + ], +) diff --git a/pkg/testutils/BUILD.bazel b/pkg/testutils/BUILD.bazel new file mode 100644 index 000000000000..3945358adf53 --- /dev/null +++ b/pkg/testutils/BUILD.bazel @@ -0,0 +1,50 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testutils", + srcs = [ + "base.go", + "dir.go", + "error.go", + "files.go", + "keys.go", + "net.go", + "pprof.go", + "soon.go", + "sort.go", + "subtest.go", + "trace.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/roachpb", + "//pkg/security", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/fileutil", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "testutils_test", + srcs = [ + "net_test.go", + "soon_test.go", + ], + embed = [":testutils"], + deps = [ + "//pkg/util", + "//pkg/util/grpcutil", + "//pkg/util/leaktest", + "//pkg/util/netutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/testutils/buildutil/BUILD.bazel b/pkg/testutils/buildutil/BUILD.bazel new file mode 100644 index 000000000000..9d5c8b9ef9dc --- /dev/null +++ b/pkg/testutils/buildutil/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "buildutil", + srcs = ["build.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/buildutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/testutils/skip", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/testutils/colcontainerutils/BUILD.bazel b/pkg/testutils/colcontainerutils/BUILD.bazel new file mode 100644 index 000000000000..df75d69b8cfb --- /dev/null +++ b/pkg/testutils/colcontainerutils/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "colcontainerutils", + srcs = ["diskqueuecfg.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/colcontainerutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/sql/colcontainer", + "//pkg/storage", + "//pkg/storage/fs", + "//pkg/testutils", + ], +) diff --git a/pkg/testutils/diagutils/BUILD.bazel b/pkg/testutils/diagutils/BUILD.bazel new file mode 100644 index 000000000000..f8af3b1cae9d --- /dev/null +++ b/pkg/testutils/diagutils/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "diagutils", + srcs = ["diag_test_server.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/diagutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/server/diagnosticspb", + "//pkg/util/protoutil", + "//pkg/util/syncutil", + ], +) diff --git a/pkg/testutils/distsqlutils/BUILD.bazel b/pkg/testutils/distsqlutils/BUILD.bazel new file mode 100644 index 000000000000..7dd2e8384c64 --- /dev/null +++ b/pkg/testutils/distsqlutils/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "distsqlutils", + srcs = ["row_buffer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/distsqlutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/execinfra", + "//pkg/sql/execinfrapb", + "//pkg/sql/rowenc", + "//pkg/sql/types", + "//pkg/util/log", + "//pkg/util/syncutil", + ], +) diff --git a/pkg/testutils/gossiputil/BUILD.bazel b/pkg/testutils/gossiputil/BUILD.bazel new file mode 100644 index 000000000000..96bf4dbf2f7d --- /dev/null +++ b/pkg/testutils/gossiputil/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "gossiputil", + srcs = ["store_gossiper.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/gossiputil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/gossip", + "//pkg/roachpb", + "//pkg/util/syncutil", + ], +) diff --git a/pkg/testutils/jobutils/BUILD.bazel b/pkg/testutils/jobutils/BUILD.bazel new file mode 100644 index 000000000000..4c2bc8fe1efa --- /dev/null +++ b/pkg/testutils/jobutils/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "jobutils", + srcs = ["jobs_verification.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/jobutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/jobs", + "//pkg/jobs/jobspb", + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/testutils/sqlutils", + "//pkg/util/protoutil", + "//pkg/util/retry", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/lib/pq", + ], +) diff --git a/pkg/testutils/keysutils/BUILD.bazel b/pkg/testutils/keysutils/BUILD.bazel new file mode 100644 index 000000000000..919f547fcda2 --- /dev/null +++ b/pkg/testutils/keysutils/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "keysutils", + srcs = ["pretty_scanner.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/keysutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/util/encoding", + "//pkg/util/keysutil", + ], +) + +go_test( + name = "keysutils_test", + srcs = ["pretty_scanner_test.go"], + embed = [":keysutils"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/encoding", + ], +) diff --git a/pkg/testutils/kvclientutils/BUILD.bazel b/pkg/testutils/kvclientutils/BUILD.bazel new file mode 100644 index 000000000000..074d3ec7adf7 --- /dev/null +++ b/pkg/testutils/kvclientutils/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kvclientutils", + srcs = [ + "api.go", + "txn_recovery.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/kvclientutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv", + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/testutils/lint/BUILD.bazel b/pkg/testutils/lint/BUILD.bazel new file mode 100644 index 000000000000..f7429be9dd40 --- /dev/null +++ b/pkg/testutils/lint/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "lint", + srcs = ["lint.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/descriptormarshal/BUILD.bazel b/pkg/testutils/lint/passes/descriptormarshal/BUILD.bazel new file mode 100644 index 000000000000..91ff80826d95 --- /dev/null +++ b/pkg/testutils/lint/passes/descriptormarshal/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "descriptormarshal", + srcs = ["descriptor_marshal.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/descriptormarshal", + visibility = ["//visibility:public"], + deps = [ + "//pkg/testutils/lint/passes/passesutil", + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) + +go_test( + name = "descriptormarshal_test", + srcs = ["descriptormarshal_test.go"], + deps = [ + ":descriptormarshal", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/descriptormarshal/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/descriptormarshal/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..3ce7ed095e48 --- /dev/null +++ b/pkg/testutils/lint/passes/descriptormarshal/testdata/src/a/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/descriptormarshal/testdata/src/a", + visibility = ["//visibility:public"], + deps = ["//pkg/sql/catalog/descpb"], +) diff --git a/pkg/testutils/lint/passes/descriptormarshal/testdata/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb/BUILD.bazel b/pkg/testutils/lint/passes/descriptormarshal/testdata/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb/BUILD.bazel new file mode 100644 index 000000000000..9e9220ac92e4 --- /dev/null +++ b/pkg/testutils/lint/passes/descriptormarshal/testdata/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "descpb", + srcs = ["test_descriptor_lint.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/descriptormarshal/testdata/src/github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/errcmp/BUILD.bazel b/pkg/testutils/lint/passes/errcmp/BUILD.bazel new file mode 100644 index 000000000000..f2c5d4a4bcb0 --- /dev/null +++ b/pkg/testutils/lint/passes/errcmp/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "errcmp", + srcs = ["errcmp.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/errcmp", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) diff --git a/pkg/testutils/lint/passes/fmtsafe/BUILD.bazel b/pkg/testutils/lint/passes/fmtsafe/BUILD.bazel new file mode 100644 index 000000000000..34c89bac358e --- /dev/null +++ b/pkg/testutils/lint/passes/fmtsafe/BUILD.bazel @@ -0,0 +1,28 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fmtsafe", + srcs = [ + "fmtsafe.go", + "functions.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + "//vendor/golang.org/x/tools/go/types/typeutil", + ], +) + +go_test( + name = "fmtsafe_test", + srcs = ["fmtsafe_test.go"], + deps = [ + ":fmtsafe", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/fmtsafe/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/fmtsafe/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..3c0cb35fd283 --- /dev/null +++ b/pkg/testutils/lint/passes/fmtsafe/testdata/src/a/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe/testdata/src/a", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/go.etcd.io/etcd/raft", + ], +) + +go_test( + name = "a_test", + srcs = ["a_test.go"], + embed = [":a"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/cockroach/pkg/util/log/BUILD.bazel b/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/cockroach/pkg/util/log/BUILD.bazel new file mode 100644 index 000000000000..c8bb559b1b0b --- /dev/null +++ b/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/cockroach/pkg/util/log/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "log", + srcs = ["log.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/cockroach/pkg/util/log", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/errors/BUILD.bazel b/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/errors/BUILD.bazel new file mode 100644 index 000000000000..3619cf222125 --- /dev/null +++ b/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/errors/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "errors", + srcs = ["errors.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe/testdata/src/github.com/cockroachdb/errors", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/fmtsafe/testdata/src/go.etcd.io/etcd/raft/BUILD.bazel b/pkg/testutils/lint/passes/fmtsafe/testdata/src/go.etcd.io/etcd/raft/BUILD.bazel new file mode 100644 index 000000000000..830c21cd654e --- /dev/null +++ b/pkg/testutils/lint/passes/fmtsafe/testdata/src/go.etcd.io/etcd/raft/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "raft", + srcs = ["log.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/fmtsafe/testdata/src/go.etcd.io/etcd/raft", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/hash/BUILD.bazel b/pkg/testutils/lint/passes/hash/BUILD.bazel new file mode 100644 index 000000000000..0bb7da3221c7 --- /dev/null +++ b/pkg/testutils/lint/passes/hash/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hash", + srcs = ["hash.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/hash", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + ], +) + +go_test( + name = "hash_test", + srcs = ["hash_test.go"], + deps = [ + ":hash", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/hash/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/hash/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..89b0c70d11b2 --- /dev/null +++ b/pkg/testutils/lint/passes/hash/testdata/src/a/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/hash/testdata/src/a", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/nocopy/BUILD.bazel b/pkg/testutils/lint/passes/nocopy/BUILD.bazel new file mode 100644 index 000000000000..ada35a738104 --- /dev/null +++ b/pkg/testutils/lint/passes/nocopy/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "nocopy", + srcs = ["nocopy.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/nocopy", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) + +go_test( + name = "nocopy_test", + srcs = ["nocopy_test.go"], + deps = [ + ":nocopy", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/nocopy/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/nocopy/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..56fdf6fe08c5 --- /dev/null +++ b/pkg/testutils/lint/passes/nocopy/testdata/src/a/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/nocopy/testdata/src/a", + visibility = ["//visibility:public"], + deps = ["//pkg/util"], +) diff --git a/pkg/testutils/lint/passes/nocopy/testdata/src/github.com/cockroachdb/cockroach/pkg/util/BUILD.bazel b/pkg/testutils/lint/passes/nocopy/testdata/src/github.com/cockroachdb/cockroach/pkg/util/BUILD.bazel new file mode 100644 index 000000000000..e77ea0d1e52b --- /dev/null +++ b/pkg/testutils/lint/passes/nocopy/testdata/src/github.com/cockroachdb/cockroach/pkg/util/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "util", + srcs = ["nocopy.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/nocopy/testdata/src/github.com/cockroachdb/cockroach/pkg/util", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/passesutil/BUILD.bazel b/pkg/testutils/lint/passes/passesutil/BUILD.bazel new file mode 100644 index 000000000000..ccc94baf358c --- /dev/null +++ b/pkg/testutils/lint/passes/passesutil/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "passesutil", + srcs = ["passes_util.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/passesutil", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/ast/astutil", + ], +) + +go_test( + name = "passesutil_test", + srcs = ["passes_util_test.go"], + deps = [ + "//pkg/testutils/lint/passes/descriptormarshal", + "//pkg/testutils/lint/passes/unconvert", + "//pkg/testutils/skip", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/returnerrcheck/BUILD.bazel b/pkg/testutils/lint/passes/returnerrcheck/BUILD.bazel new file mode 100644 index 000000000000..2d48eb9845b5 --- /dev/null +++ b/pkg/testutils/lint/passes/returnerrcheck/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "returnerrcheck", + srcs = ["returnerrcheck.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/returnerrcheck", + visibility = ["//visibility:public"], + deps = [ + "//pkg/testutils/lint/passes/passesutil", + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/astutil", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) + +go_test( + name = "returnerrcheck_test", + srcs = ["returnerrcheck_test.go"], + deps = [ + ":returnerrcheck", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/returnerrcheck/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/returnerrcheck/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..963887b6cbc5 --- /dev/null +++ b/pkg/testutils/lint/passes/returnerrcheck/testdata/src/a/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/returnerrcheck/testdata/src/a", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/timer/BUILD.bazel b/pkg/testutils/lint/passes/timer/BUILD.bazel new file mode 100644 index 000000000000..8a473c87098e --- /dev/null +++ b/pkg/testutils/lint/passes/timer/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "timer", + srcs = ["timer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/timer", + visibility = ["//visibility:public"], + deps = [ + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) + +go_test( + name = "timer_test", + srcs = ["timer_test.go"], + deps = [ + ":timer", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/timer/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/timer/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..6d2923600fcf --- /dev/null +++ b/pkg/testutils/lint/passes/timer/testdata/src/a/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/timer/testdata/src/a", + visibility = ["//visibility:public"], + deps = ["//pkg/util/timeutil"], +) diff --git a/pkg/testutils/lint/passes/timer/testdata/src/github.com/cockroachdb/cockroach/pkg/util/timeutil/BUILD.bazel b/pkg/testutils/lint/passes/timer/testdata/src/github.com/cockroachdb/cockroach/pkg/util/timeutil/BUILD.bazel new file mode 100644 index 000000000000..2be817ec24b5 --- /dev/null +++ b/pkg/testutils/lint/passes/timer/testdata/src/github.com/cockroachdb/cockroach/pkg/util/timeutil/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "timeutil", + srcs = ["timer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/timer/testdata/src/github.com/cockroachdb/cockroach/pkg/util/timeutil", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/lint/passes/unconvert/BUILD.bazel b/pkg/testutils/lint/passes/unconvert/BUILD.bazel new file mode 100644 index 000000000000..197a2b6b2103 --- /dev/null +++ b/pkg/testutils/lint/passes/unconvert/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "unconvert", + srcs = ["unconvert.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/unconvert", + visibility = ["//visibility:public"], + deps = [ + "//pkg/testutils/lint/passes/passesutil", + "//vendor/golang.org/x/tools/go/analysis", + "//vendor/golang.org/x/tools/go/analysis/passes/inspect", + "//vendor/golang.org/x/tools/go/ast/inspector", + ], +) + +go_test( + name = "unconvert_test", + srcs = ["unconvert_test.go"], + deps = [ + ":unconvert", + "//pkg/testutils/skip", + "//vendor/golang.org/x/tools/go/analysis/analysistest", + ], +) diff --git a/pkg/testutils/lint/passes/unconvert/testdata/src/a/BUILD.bazel b/pkg/testutils/lint/passes/unconvert/testdata/src/a/BUILD.bazel new file mode 100644 index 000000000000..7b21506e4b96 --- /dev/null +++ b/pkg/testutils/lint/passes/unconvert/testdata/src/a/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "a", + srcs = ["a.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/lint/passes/unconvert/testdata/src/a", + visibility = ["//visibility:public"], +) diff --git a/pkg/testutils/localtestcluster/BUILD.bazel b/pkg/testutils/localtestcluster/BUILD.bazel new file mode 100644 index 000000000000..c589a27d7b4c --- /dev/null +++ b/pkg/testutils/localtestcluster/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "localtestcluster", + srcs = ["local_test_cluster.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/localtestcluster", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/clusterversion", + "//pkg/config", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/settings/cluster", + "//pkg/sql/catalog/bootstrap", + "//pkg/storage", + "//pkg/util", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/stop", + "//vendor/github.com/opentracing/opentracing-go", + ], +) diff --git a/pkg/testutils/pgtest/BUILD.bazel b/pkg/testutils/pgtest/BUILD.bazel new file mode 100644 index 000000000000..009e02c42927 --- /dev/null +++ b/pkg/testutils/pgtest/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "pgtest", + srcs = [ + "datadriven.go", + "pgtest.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/pgtest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/testutils/skip", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgproto3/v2:pgproto3", + ], +) diff --git a/pkg/testutils/physicalplanutils/BUILD.bazel b/pkg/testutils/physicalplanutils/BUILD.bazel new file mode 100644 index 000000000000..19c51df72c15 --- /dev/null +++ b/pkg/testutils/physicalplanutils/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "physicalplanutils", + srcs = ["fake_resolver.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/physicalplanutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/sql/physicalplan", + "//pkg/testutils/serverutils", + "//pkg/util", + ], +) diff --git a/pkg/testutils/reduce/BUILD.bazel b/pkg/testutils/reduce/BUILD.bazel new file mode 100644 index 000000000000..d0b432890641 --- /dev/null +++ b/pkg/testutils/reduce/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "reduce", + srcs = [ + "datadriven.go", + "pass.go", + "reduce.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/reduce", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/ctxgroup", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/datadriven", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "reduce_test", + srcs = ["reduce_test.go"], + data = glob(["testdata/**"]), + deps = [":reduce"], +) diff --git a/pkg/testutils/reduce/reducesql/BUILD.bazel b/pkg/testutils/reduce/reducesql/BUILD.bazel new file mode 100644 index 000000000000..1b87a4ad9e45 --- /dev/null +++ b/pkg/testutils/reduce/reducesql/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "reducesql", + srcs = ["reducesql.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/reduce/reducesql", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/parser", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/testutils/reduce", + ], +) + +go_test( + name = "reducesql_test", + srcs = ["reducesql_test.go"], + data = glob(["testdata/**"]), + deps = [ + ":reducesql", + "//pkg/base", + "//pkg/security", + "//pkg/server", + "//pkg/testutils/reduce", + "//pkg/testutils/skip", + "//vendor/github.com/jackc/pgx", + ], +) diff --git a/pkg/testutils/serverutils/BUILD.bazel b/pkg/testutils/serverutils/BUILD.bazel new file mode 100644 index 000000000000..89f913add20e --- /dev/null +++ b/pkg/testutils/serverutils/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "serverutils", + srcs = [ + "test_cluster_shim.go", + "test_server_shim.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/serverutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/kv", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/settings/cluster", + "//pkg/testutils/sqlutils", + "//pkg/util/hlc", + "//pkg/util/httputil", + "//pkg/util/protoutil", + "//pkg/util/stop", + "//pkg/util/uuid", + ], +) diff --git a/pkg/testutils/skip/BUILD.bazel b/pkg/testutils/skip/BUILD.bazel new file mode 100644 index 000000000000..4ea8aaececc7 --- /dev/null +++ b/pkg/testutils/skip/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "skip", + srcs = [ + "skip.go", + "stress.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/skip", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util", + "//pkg/util/envutil", + ], +) diff --git a/pkg/testutils/sqlutils/BUILD.bazel b/pkg/testutils/sqlutils/BUILD.bazel new file mode 100644 index 000000000000..94a24d7eacb0 --- /dev/null +++ b/pkg/testutils/sqlutils/BUILD.bazel @@ -0,0 +1,50 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sqlutils", + srcs = [ + "name_resolution_testutils.go", + "pg_url.go", + "pretty.go", + "scrub.go", + "sql_runner.go", + "table_gen.go", + "table_id.go", + "zone.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/sqlutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/config/zonepb", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/sql/lex", + "//pkg/sql/parser", + "//pkg/sql/sem/tree", + "//pkg/testutils", + "//pkg/util/fileutil", + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "sqlutils_test", + srcs = [ + "main_test.go", + "sql_runner_test.go", + "table_gen_test.go", + ], + embed = [":sqlutils"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + ], +) diff --git a/pkg/testutils/storageutils/BUILD.bazel b/pkg/testutils/storageutils/BUILD.bazel new file mode 100644 index 000000000000..f2972731bcae --- /dev/null +++ b/pkg/testutils/storageutils/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "storageutils", + srcs = ["mocking.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/storageutils", + visibility = ["//visibility:public"], + deps = [ + "//pkg/kv/kvserver/kvserverbase", + "//pkg/roachpb", + "//pkg/util/syncutil", + "//pkg/util/syncutil/singleflight", + ], +) diff --git a/pkg/testutils/testcluster/BUILD.bazel b/pkg/testutils/testcluster/BUILD.bazel new file mode 100644 index 000000000000..b0a981ee2ef0 --- /dev/null +++ b/pkg/testutils/testcluster/BUILD.bazel @@ -0,0 +1,55 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testcluster", + srcs = ["testcluster.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/testcluster", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/gossip", + "//pkg/keys", + "//pkg/kv/kvserver", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/retry", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "testcluster_test", + srcs = [ + "main_test.go", + "testcluster_test.go", + ], + embed = [":testcluster"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/server/serverpb", + "//pkg/sql/catalog/catalogkv", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/util/httputil", + "//pkg/util/leaktest", + "//pkg/util/log", + ], +) diff --git a/pkg/testutils/zerofields/BUILD.bazel b/pkg/testutils/zerofields/BUILD.bazel new file mode 100644 index 000000000000..0bb99ff8aa5b --- /dev/null +++ b/pkg/testutils/zerofields/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "zerofields", + srcs = ["no_zero_field.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/testutils/zerofields", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "zerofields_test", + srcs = ["no_zero_field_test.go"], + embed = [":zerofields"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/ts/BUILD.bazel b/pkg/ts/BUILD.bazel new file mode 100644 index 000000000000..fd01525b4236 --- /dev/null +++ b/pkg/ts/BUILD.bazel @@ -0,0 +1,91 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ts", + srcs = [ + "db.go", + "doc.go", + "keys.go", + "maintenance.go", + "memory.go", + "metrics.go", + "pruning.go", + "query.go", + "resolution.go", + "rollup.go", + "server.go", + "timespan.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ts", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/kv", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/settings", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/ts/tspb", + "//pkg/util/encoding", + "//pkg/util/hlc", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/mon", + "//pkg/util/quotapool", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "ts_test", + srcs = [ + "db_test.go", + "iterator_test.go", + "keys_test.go", + "main_test.go", + "memory_test.go", + "metrics_test.go", + "model_test.go", + "pruning_test.go", + "query_test.go", + "rollup_test.go", + "server_test.go", + "timeseries_test.go", + ], + embed = [":ts"], + deps = [ + "//pkg/base", + "//pkg/keys", + "//pkg/kv/kvclient/kvcoord", + "//pkg/kv/kvserver", + "//pkg/roachpb", + "//pkg/rpc", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/storage", + "//pkg/testutils", + "//pkg/testutils/localtestcluster", + "//pkg/testutils/serverutils", + "//pkg/ts/testmodel", + "//pkg/ts/tspb", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/mon", + "//pkg/util/stop", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/kr/pretty", + ], +) diff --git a/pkg/ts/catalog/BUILD.bazel b/pkg/ts/catalog/BUILD.bazel new file mode 100644 index 000000000000..d67a340793a9 --- /dev/null +++ b/pkg/ts/catalog/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "catalog", + srcs = [ + "catalog_generator.go", + "chart_catalog.go", + "chart_catalog.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ts/catalog", + visibility = ["//visibility:public"], + deps = [ + "//pkg/ts/tspb", + "//pkg/util/metric", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/prometheus/client_model/go", + ], +) diff --git a/pkg/ts/testmodel/BUILD.bazel b/pkg/ts/testmodel/BUILD.bazel new file mode 100644 index 000000000000..a994ba4207af --- /dev/null +++ b/pkg/ts/testmodel/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testmodel", + srcs = [ + "data.go", + "db.go", + "functions.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ts/testmodel", + visibility = ["//visibility:public"], + deps = ["//pkg/ts/tspb"], +) + +go_test( + name = "testmodel_test", + srcs = [ + "data_test.go", + "db_test.go", + "functions_test.go", + ], + embed = [":testmodel"], + deps = ["//pkg/ts/tspb"], +) diff --git a/pkg/ts/tspb/BUILD.bazel b/pkg/ts/tspb/BUILD.bazel new file mode 100644 index 000000000000..c8d030b3c87e --- /dev/null +++ b/pkg/ts/tspb/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tspb", + srcs = [ + "timeseries.go", + "timeseries.pb.go", + "timeseries.pb.gw.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/ts/tspb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/golang/protobuf/descriptor", + "//vendor/github.com/golang/protobuf/proto", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/utilities", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/grpclog", + "//vendor/google.golang.org/grpc/status", + ], +) diff --git a/pkg/ui/BUILD.bazel b/pkg/ui/BUILD.bazel new file mode 100644 index 000000000000..d2c4ac6d7868 --- /dev/null +++ b/pkg/ui/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ui", + srcs = ["ui.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/ui", + visibility = ["//visibility:public"], + deps = [ + "//pkg/base", + "//pkg/build", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/elazarl/go-bindata-assetfs", + ], +) diff --git a/pkg/util/BUILD.bazel b/pkg/util/BUILD.bazel new file mode 100644 index 000000000000..d07f43ac3d13 --- /dev/null +++ b/pkg/util/BUILD.bazel @@ -0,0 +1,54 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "util", + srcs = [ + "constants.go", + "every_n.go", + "fast_int_map.go", + "fast_int_set.go", + "fast_int_set_str.go", + "hash.go", + "metamorphic_off.go", + "nocopy.go", + "pluralize.go", + "race_off.go", + "race_on.go", + "reflect.go", + "smalltrace.go", + "strings.go", + "testaddr_default.go", + "testaddr_random.go", + "topk.go", + "unresolved_addr.go", + "unresolved_addr.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/randutil", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/golang.org/x/tools/container/intsets", + ], +) + +go_test( + name = "util_test", + srcs = [ + "every_n_test.go", + "fast_int_map_test.go", + "fast_int_set_test.go", + "smalltrace_test.go", + "strings_test.go", + "topk_test.go", + "unresolved_addr_test.go", + ], + embed = [":util"], + deps = [ + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/arith/BUILD.bazel b/pkg/util/arith/BUILD.bazel new file mode 100644 index 000000000000..3dae0d7ac535 --- /dev/null +++ b/pkg/util/arith/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "arith", + srcs = ["arith.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/arith", + visibility = ["//visibility:public"], +) diff --git a/pkg/util/binfetcher/BUILD.bazel b/pkg/util/binfetcher/BUILD.bazel new file mode 100644 index 000000000000..ebf0eb311f2c --- /dev/null +++ b/pkg/util/binfetcher/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "binfetcher", + srcs = [ + "binfetcher.go", + "extract.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/binfetcher", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/httputil", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "binfetcher_test", + srcs = ["binfetcher_test.go"], + embed = [":binfetcher"], + deps = [ + "//pkg/testutils", + "//pkg/testutils/skip", + ], +) diff --git a/pkg/util/bitarray/BUILD.bazel b/pkg/util/bitarray/BUILD.bazel new file mode 100644 index 000000000000..dda4433f9467 --- /dev/null +++ b/pkg/util/bitarray/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bitarray", + srcs = ["bitarray.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/bitarray", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "bitarray_test", + srcs = ["bitarray_test.go"], + embed = [":bitarray"], + deps = ["//pkg/util/randutil"], +) diff --git a/pkg/util/bufalloc/BUILD.bazel b/pkg/util/bufalloc/BUILD.bazel new file mode 100644 index 000000000000..2380a37e7849 --- /dev/null +++ b/pkg/util/bufalloc/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "bufalloc", + srcs = ["byte_allocator.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/bufalloc", + visibility = ["//visibility:public"], +) diff --git a/pkg/util/cache/BUILD.bazel b/pkg/util/cache/BUILD.bazel new file mode 100644 index 000000000000..e1526cf637f1 --- /dev/null +++ b/pkg/util/cache/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cache", + srcs = ["cache.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/cache", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/interval", + "//pkg/util/log", + "//vendor/github.com/biogo/store/llrb", + ], +) + +go_test( + name = "cache_test", + srcs = ["cache_test.go"], + embed = [":cache"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/biogo/store/llrb", + ], +) diff --git a/pkg/util/caller/BUILD.bazel b/pkg/util/caller/BUILD.bazel new file mode 100644 index 000000000000..4d600938a0a5 --- /dev/null +++ b/pkg/util/caller/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "caller", + srcs = ["resolver.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/caller", + visibility = ["//visibility:public"], + deps = ["//pkg/util/syncutil"], +) + +go_test( + name = "caller_test", + srcs = [ + "main_test.go", + "resolver_test.go", + ], + embed = [":caller"], + deps = ["//pkg/util/log"], +) diff --git a/pkg/util/cancelchecker/BUILD.bazel b/pkg/util/cancelchecker/BUILD.bazel new file mode 100644 index 000000000000..921248063961 --- /dev/null +++ b/pkg/util/cancelchecker/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "cancelchecker", + srcs = ["cancel_checker.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/cancelchecker", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + ], +) diff --git a/pkg/util/cgroups/BUILD.bazel b/pkg/util/cgroups/BUILD.bazel new file mode 100644 index 000000000000..05d93030bd27 --- /dev/null +++ b/pkg/util/cgroups/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cgroups", + srcs = ["cgroups.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/cgroups", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "cgroups_test", + srcs = ["cgroups_test.go"], + embed = [":cgroups"], + deps = [ + "//pkg/testutils", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/cloudinfo/BUILD.bazel b/pkg/util/cloudinfo/BUILD.bazel new file mode 100644 index 000000000000..a5fbaac879af --- /dev/null +++ b/pkg/util/cloudinfo/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cloudinfo", + srcs = ["cloudinfo.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/cloudinfo", + visibility = ["//visibility:public"], + deps = ["//pkg/util/httputil"], +) + +go_test( + name = "cloudinfo_test", + srcs = ["cloudinfo_test.go"], + embed = [":cloudinfo"], + deps = [ + "//pkg/util/httputil", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/util/contextutil/BUILD.bazel b/pkg/util/contextutil/BUILD.bazel new file mode 100644 index 000000000000..83e19e97707f --- /dev/null +++ b/pkg/util/contextutil/BUILD.bazel @@ -0,0 +1,22 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "contextutil", + srcs = ["context.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/contextutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "contextutil_test", + srcs = ["context_test.go"], + embed = [":contextutil"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/util/ctxgroup/BUILD.bazel b/pkg/util/ctxgroup/BUILD.bazel new file mode 100644 index 000000000000..c7d8fa46b712 --- /dev/null +++ b/pkg/util/ctxgroup/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ctxgroup", + srcs = ["ctxgroup.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/ctxgroup", + visibility = ["//visibility:public"], + deps = ["//vendor/golang.org/x/sync/errgroup"], +) + +go_test( + name = "ctxgroup_test", + srcs = ["ctxgroup_test.go"], + embed = [":ctxgroup"], + deps = [ + "//pkg/testutils", + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/util/duration/BUILD.bazel b/pkg/util/duration/BUILD.bazel new file mode 100644 index 000000000000..dea1450f55a3 --- /dev/null +++ b/pkg/util/duration/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "duration", + srcs = ["duration.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/duration", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/arith", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "duration_test", + srcs = ["duration_test.go"], + embed = [":duration"], + deps = ["//pkg/util/log"], +) diff --git a/pkg/util/encoding/BUILD.bazel b/pkg/util/encoding/BUILD.bazel new file mode 100644 index 000000000000..ad6f60069bc4 --- /dev/null +++ b/pkg/util/encoding/BUILD.bazel @@ -0,0 +1,59 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "encoding", + srcs = [ + "complement_fast.go", + "complement_safe.go", + "decimal.go", + "encoding.go", + "float.go", + "type_string.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/encoding", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/ipaddr", + "//pkg/util/protoutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "encoding_test", + srcs = [ + "decimal_test.go", + "encoding_test.go", + "float_test.go", + "main_test.go", + "printer_test.go", + ], + embed = [":encoding"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/roachpb", + "//pkg/util/bitarray", + "//pkg/util/duration", + "//pkg/util/ipaddr", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/timeofday", + "//pkg/util/timetz", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/encoding/csv/BUILD.bazel b/pkg/util/encoding/csv/BUILD.bazel new file mode 100644 index 000000000000..42f17a8a1e99 --- /dev/null +++ b/pkg/util/encoding/csv/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "csv", + srcs = [ + "reader.go", + "writer.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/encoding/csv", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "csv_test", + srcs = [ + "example_test.go", + "reader_test.go", + "writer_test.go", + ], + embed = [":csv"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/util/envutil/BUILD.bazel b/pkg/util/envutil/BUILD.bazel new file mode 100644 index 000000000000..dbde2e8e6054 --- /dev/null +++ b/pkg/util/envutil/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "envutil", + srcs = ["env.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/envutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/humanizeutil", + "//pkg/util/syncutil", + ], +) + +go_test( + name = "envutil_test", + srcs = ["env_test.go"], + embed = [":envutil"], +) diff --git a/pkg/util/errorutil/BUILD.bazel b/pkg/util/errorutil/BUILD.bazel new file mode 100644 index 000000000000..793fddf3d46f --- /dev/null +++ b/pkg/util/errorutil/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "errorutil", + srcs = [ + "catch.go", + "error.go", + "tenant.go", + "tenant_deprecated_wrapper.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/errorutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "errorutil_test", + srcs = ["error_test.go"], + embed = [":errorutil"], +) diff --git a/pkg/util/errorutil/unimplemented/BUILD.bazel b/pkg/util/errorutil/unimplemented/BUILD.bazel new file mode 100644 index 000000000000..9e33b5719184 --- /dev/null +++ b/pkg/util/errorutil/unimplemented/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "unimplemented", + srcs = ["unimplemented.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/errorutil/unimplemented", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "unimplemented_test", + srcs = ["unimplemented_test.go"], + embed = [":unimplemented"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/util/fileutil/BUILD.bazel b/pkg/util/fileutil/BUILD.bazel new file mode 100644 index 000000000000..5669738f7b5a --- /dev/null +++ b/pkg/util/fileutil/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "fileutil", + srcs = [ + "copy.go", + "escape.go", + "move.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/fileutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/sysutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/util/flagutil/BUILD.bazel b/pkg/util/flagutil/BUILD.bazel new file mode 100644 index 000000000000..d8c6f8661f0d --- /dev/null +++ b/pkg/util/flagutil/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "flagutil", + srcs = ["flagutil.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/flagutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/spf13/pflag", + ], +) + +go_test( + name = "flagutil_test", + srcs = ["flagutil_test.go"], + embed = [":flagutil"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/util/fsm/BUILD.bazel b/pkg/util/fsm/BUILD.bazel new file mode 100644 index 000000000000..ef96ce922bc5 --- /dev/null +++ b/pkg/util/fsm/BUILD.bazel @@ -0,0 +1,24 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fsm", + srcs = [ + "debug.go", + "doc.go", + "fsm.go", + "match.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/fsm", + visibility = ["//visibility:public"], +) + +go_test( + name = "fsm_test", + srcs = [ + "example_test.go", + "fsm_test.go", + "match_test.go", + ], + embed = [":fsm"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/util/growstack/BUILD.bazel b/pkg/util/growstack/BUILD.bazel new file mode 100644 index 000000000000..33f91c20971a --- /dev/null +++ b/pkg/util/growstack/BUILD.bazel @@ -0,0 +1,11 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "growstack", + srcs = [ + "growstack.go", + "growstack.s", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/growstack", + visibility = ["//visibility:public"], +) diff --git a/pkg/util/grpcutil/BUILD.bazel b/pkg/util/grpcutil/BUILD.bazel new file mode 100644 index 000000000000..2e168ce8d1c1 --- /dev/null +++ b/pkg/util/grpcutil/BUILD.bazel @@ -0,0 +1,41 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "grpcutil", + srcs = [ + "grpc_util.go", + "log.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/grpcutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/netutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/codes", + "//vendor/google.golang.org/grpc/connectivity", + "//vendor/google.golang.org/grpc/grpclog", + "//vendor/google.golang.org/grpc/status", + ], +) + +go_test( + name = "grpcutil_test", + srcs = [ + "grpc_util_test.go", + "log_test.go", + ], + embed = [":grpcutil"], + deps = [ + "//pkg/testutils", + "//pkg/testutils/skip", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/google.golang.org/grpc", + "//vendor/google.golang.org/grpc/health/grpc_health_v1", + ], +) diff --git a/pkg/util/hlc/BUILD.bazel b/pkg/util/hlc/BUILD.bazel new file mode 100644 index 000000000000..79d9c2a4d8c7 --- /dev/null +++ b/pkg/util/hlc/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hlc", + srcs = [ + "hlc.go", + "hlc_clock_device_linux.go", + "hlc_clock_device_stub.go", + "legacy_timestamp.pb.go", + "timestamp.go", + "timestamp.pb.go", + ], + cgo = True, + importpath = "github.com/cockroachdb/cockroach/pkg/util/hlc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + ], +) + +go_test( + name = "hlc_test", + srcs = [ + "hlc_test.go", + "timestamp_test.go", + ], + embed = [":hlc"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + ], +) diff --git a/pkg/util/httputil/BUILD.bazel b/pkg/util/httputil/BUILD.bazel new file mode 100644 index 000000000000..b3190afe81f5 --- /dev/null +++ b/pkg/util/httputil/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "httputil", + srcs = [ + "client.go", + "http.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/httputil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/protoutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/jsonpb", + ], +) diff --git a/pkg/util/humanizeutil/BUILD.bazel b/pkg/util/humanizeutil/BUILD.bazel new file mode 100644 index 000000000000..a7b1635082b8 --- /dev/null +++ b/pkg/util/humanizeutil/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "humanizeutil", + srcs = ["humanize.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/humanizeutil", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/dustin/go-humanize", + "//vendor/github.com/spf13/pflag", + ], +) + +go_test( + name = "humanizeutil_test", + srcs = ["humanize_test.go"], + deps = [ + ":humanizeutil", + "//pkg/util/leaktest", + ], +) diff --git a/pkg/util/interval/BUILD.bazel b/pkg/util/interval/BUILD.bazel new file mode 100644 index 000000000000..c6c8731de422 --- /dev/null +++ b/pkg/util/interval/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "interval", + srcs = [ + "btree_based_interval.go", + "bu23.go", + "interval.go", + "llrb_based_interval.go", + "range_group.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/interval", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/envutil", + "//pkg/util/syncutil", + "//vendor/github.com/biogo/store/llrb", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "interval_test", + srcs = [ + "btree_based_interval_test.go", + "range_group_test.go", + ], + embed = [":interval"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/util/interval/generic/BUILD.bazel b/pkg/util/interval/generic/BUILD.bazel new file mode 100644 index 000000000000..2666b55579b6 --- /dev/null +++ b/pkg/util/interval/generic/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "generic", + srcs = [ + "doc.go", + "example_interval_btree.go", + "example_t.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/interval/generic", + visibility = ["//visibility:public"], + deps = ["//pkg/roachpb"], +) + +go_test( + name = "generic_test", + srcs = ["example_interval_btree_test.go"], + embed = [":generic"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/interval/generic/internal/BUILD.bazel b/pkg/util/interval/generic/internal/BUILD.bazel new file mode 100644 index 000000000000..4433df727147 --- /dev/null +++ b/pkg/util/interval/generic/internal/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "internal", + srcs = ["contract.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/interval/generic/internal", + visibility = ["//pkg/util/interval/generic:__subpackages__"], +) diff --git a/pkg/util/ipaddr/BUILD.bazel b/pkg/util/ipaddr/BUILD.bazel new file mode 100644 index 000000000000..f13bf55516b9 --- /dev/null +++ b/pkg/util/ipaddr/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ipaddr", + srcs = ["ipaddr.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/ipaddr", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/uint128", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "ipaddr_test", + srcs = ["ipaddr_test.go"], + embed = [":ipaddr"], + deps = ["//pkg/util/uint128"], +) diff --git a/pkg/util/iterutil/BUILD.bazel b/pkg/util/iterutil/BUILD.bazel new file mode 100644 index 000000000000..77fcd9fe220b --- /dev/null +++ b/pkg/util/iterutil/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "iterutil", + srcs = ["iterutil.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/iterutil", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/util/json/BUILD.bazel b/pkg/util/json/BUILD.bazel new file mode 100644 index 000000000000..c041090b69f0 --- /dev/null +++ b/pkg/util/json/BUILD.bazel @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "json", + srcs = [ + "contains.go", + "contains_testers.go", + "encode.go", + "encoded.go", + "iterator.go", + "jentry.go", + "json.go", + "random.go", + "tables.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/json", + visibility = ["//visibility:public"], + deps = [ + "//pkg/geo", + "//pkg/geo/geopb", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/encoding", + "//pkg/util/syncutil", + "//pkg/util/unique", + "//vendor/github.com/cockroachdb/apd/v2:apd", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "json_test", + srcs = [ + "encode_test.go", + "json_test.go", + ], + data = glob(["testdata/**"]), + embed = [":json"], + deps = [ + "//pkg/sql/pgwire/pgerror", + "//pkg/util/encoding", + "//pkg/util/timeutil", + "//pkg/util/unique", + "//vendor/github.com/cockroachdb/apd/v2:apd", + ], +) diff --git a/pkg/util/keysutil/BUILD.bazel b/pkg/util/keysutil/BUILD.bazel new file mode 100644 index 000000000000..27fe942eea0f --- /dev/null +++ b/pkg/util/keysutil/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "keysutil", + srcs = ["keys.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/keysutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/util/leaktest/BUILD.bazel b/pkg/util/leaktest/BUILD.bazel new file mode 100644 index 000000000000..edbb3f8b37c8 --- /dev/null +++ b/pkg/util/leaktest/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "leaktest", + srcs = ["leaktest.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/leaktest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/petermattis/goid", + ], +) diff --git a/pkg/util/limit/BUILD.bazel b/pkg/util/limit/BUILD.bazel new file mode 100644 index 000000000000..16ec57448d36 --- /dev/null +++ b/pkg/util/limit/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "limit", + srcs = [ + "limiter.go", + "rate_limiter.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/limit", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/tracing", + "//vendor/github.com/marusama/semaphore", + "//vendor/golang.org/x/time/rate", + ], +) + +go_test( + name = "limit_test", + srcs = [ + "limiter_test.go", + "rate_limiter_test.go", + ], + embed = [":limit"], + deps = [ + "//pkg/util/leaktest", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/golang.org/x/time/rate", + ], +) diff --git a/pkg/util/log/BUILD.bazel b/pkg/util/log/BUILD.bazel new file mode 100644 index 000000000000..bbe20b0debe4 --- /dev/null +++ b/pkg/util/log/BUILD.bazel @@ -0,0 +1,196 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "log", + srcs = [ + "ambient_context.go", + "clog.go", + "crash_reporting.go", + "doc.go", + "every_n.go", + "exit_override.go", + "file.go", + "flags.go", + "get_stacks.go", + "intercept.go", + "log.go", + "log.pb.go", + "log_bridge.go", + "log_buffer.go", + "log_entry.go", + "log_flush.go", + "log_gc.go", + "loggers.go", + "redact.go", + "secondary_log.go", + "severity.go", + "stderr_redirect.go", + "stderr_redirect_unix.go", + "stderr_redirect_windows.go", + "structured.go", + "sync_buffer.go", + "test_log_scope.go", + "trace.go", + "tracebacks.go", + "vmodule.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/log", + visibility = ["//visibility:public"], + deps = [ + "//pkg/build", + "//pkg/cli/cliflags", + "//pkg/settings", + "//pkg/util", + "//pkg/util/caller", + "//pkg/util/envutil", + "//pkg/util/fileutil", + "//pkg/util/log/logflags", + "//pkg/util/syncutil", + "//pkg/util/sysutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//pkg/util/tracing/tracingpb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/cockroachdb/sentry-go", + "//vendor/github.com/cockroachdb/ttycolor", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/opentracing/opentracing-go/log", + "//vendor/github.com/petermattis/goid", + "//vendor/golang.org/x/net/trace", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/golang.org/x/sys/windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "log_test", + srcs = [ + "ambient_context_test.go", + "clog_test.go", + "crash_reporting_packet_test.go", + "crash_reporting_test.go", + "crash_reporting_unix_test.go", + "file_test.go", + "log_gc_test.go", + "main_test.go", + "redact_test.go", + "secondary_log_test.go", + "trace_test.go", + ], + embed = [":log"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/settings/cluster", + "//pkg/testutils", + "//pkg/testutils/serverutils", + "//pkg/util", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/cockroachdb/redact", + "//vendor/github.com/cockroachdb/sentry-go", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/pmezard/go-difflib/difflib", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/golang.org/x/net/trace", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) diff --git a/pkg/util/log/logflags/BUILD.bazel b/pkg/util/log/logflags/BUILD.bazel new file mode 100644 index 000000000000..3db5313b53ae --- /dev/null +++ b/pkg/util/log/logflags/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "logflags", + srcs = ["logflags.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/log/logflags", + visibility = ["//visibility:public"], + deps = ["//pkg/util/humanizeutil"], +) diff --git a/pkg/util/log/testshout/BUILD.bazel b/pkg/util/log/testshout/BUILD.bazel new file mode 100644 index 000000000000..02e0a0a9885a --- /dev/null +++ b/pkg/util/log/testshout/BUILD.bazel @@ -0,0 +1,10 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_test") + +go_test( + name = "testshout_test", + srcs = ["shout_test.go"], + deps = [ + "//pkg/util/log", + "//pkg/util/log/logflags", + ], +) diff --git a/pkg/util/metric/BUILD.bazel b/pkg/util/metric/BUILD.bazel new file mode 100644 index 000000000000..3fc5fe17baab --- /dev/null +++ b/pkg/util/metric/BUILD.bazel @@ -0,0 +1,45 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metric", + srcs = [ + "doc.go", + "graphite_exporter.go", + "metric.go", + "metric.pb.go", + "prometheus_exporter.go", + "registry.go", + "sliding_histogram.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/metric", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/VividCortex/ewma", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/codahale/hdrhistogram", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/prometheus/client_golang/prometheus", + "//vendor/github.com/prometheus/client_golang/prometheus/graphite", + "//vendor/github.com/prometheus/client_model/go", + "//vendor/github.com/prometheus/common/expfmt", + "//vendor/github.com/rcrowley/go-metrics", + ], +) + +go_test( + name = "metric_test", + srcs = [ + "metric_test.go", + "prometheus_exporter_test.go", + "registry_test.go", + ], + embed = [":metric"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/kr/pretty", + "//vendor/github.com/prometheus/client_model/go", + ], +) diff --git a/pkg/util/metric/aggmetric/BUILD.bazel b/pkg/util/metric/aggmetric/BUILD.bazel new file mode 100644 index 000000000000..fc2080b65a38 --- /dev/null +++ b/pkg/util/metric/aggmetric/BUILD.bazel @@ -0,0 +1,32 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "aggmetric", + srcs = [ + "agg_metric.go", + "counter.go", + "gauge.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/metric/aggmetric", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/metric", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/google/btree", + "//vendor/github.com/prometheus/client_model/go", + ], +) + +go_test( + name = "aggmetric_test", + srcs = ["agg_metric_test.go"], + deps = [ + ":aggmetric", + "//pkg/roachpb", + "//pkg/util/leaktest", + "//pkg/util/metric", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/mon/BUILD.bazel b/pkg/util/mon/BUILD.bazel new file mode 100644 index 000000000000..bc182f86d59c --- /dev/null +++ b/pkg/util/mon/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "mon", + srcs = [ + "bytes_usage.go", + "resource.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/mon", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings/cluster", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util", + "//pkg/util/envutil", + "//pkg/util/humanizeutil", + "//pkg/util/log", + "//pkg/util/metric", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "mon_test", + srcs = ["bytes_usage_test.go"], + embed = [":mon"], + deps = [ + "//pkg/settings/cluster", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + ], +) diff --git a/pkg/util/netutil/BUILD.bazel b/pkg/util/netutil/BUILD.bazel new file mode 100644 index 000000000000..81afab8355ca --- /dev/null +++ b/pkg/util/netutil/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "netutil", + srcs = [ + "addr.go", + "net.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/netutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/stop", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/cmux", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/net/http2", + "//vendor/google.golang.org/grpc", + ], +) + +go_test( + name = "netutil_test", + srcs = ["addr_test.go"], + deps = [ + ":netutil", + "//pkg/testutils", + ], +) diff --git a/pkg/util/pretty/BUILD.bazel b/pkg/util/pretty/BUILD.bazel new file mode 100644 index 000000000000..d2a3e675705f --- /dev/null +++ b/pkg/util/pretty/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pretty", + srcs = [ + "document.go", + "pretty.go", + "util.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/pretty", + visibility = ["//visibility:public"], +) + +go_test( + name = "pretty_test", + srcs = ["pretty_test.go"], + deps = [":pretty"], +) diff --git a/pkg/util/protoutil/BUILD.bazel b/pkg/util/protoutil/BUILD.bazel new file mode 100644 index 000000000000..22ef58ba94c1 --- /dev/null +++ b/pkg/util/protoutil/BUILD.bazel @@ -0,0 +1,37 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "protoutil", + srcs = [ + "clone.go", + "clone.pb.go", + "jsonpb_marshal.go", + "marshal.go", + "marshaler.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/protoutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/syncutil", + "//pkg/util/uuid", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/gogo/protobuf/jsonpb", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/grpc-ecosystem/grpc-gateway/runtime", + ], +) + +go_test( + name = "protoutil_test", + srcs = ["clone_test.go"], + deps = [ + ":protoutil", + "//pkg/config/zonepb", + "//pkg/gossip", + "//pkg/kv/kvserver/kvserverpb", + "//pkg/roachpb", + "//pkg/sql/catalog/descpb", + "//pkg/storage/enginepb", + "//vendor/github.com/gogo/protobuf/proto", + ], +) diff --git a/pkg/util/quotapool/BUILD.bazel b/pkg/util/quotapool/BUILD.bazel new file mode 100644 index 000000000000..037c9c7fd154 --- /dev/null +++ b/pkg/util/quotapool/BUILD.bazel @@ -0,0 +1,43 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "quotapool", + srcs = [ + "config.go", + "int_rate.go", + "intpool.go", + "notify_queue.go", + "quotapool.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/quotapool", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "quotapool_test", + srcs = [ + "bench_test.go", + "example_test.go", + "int_rate_test.go", + "intpool_test.go", + "node_size_test.go", + "notify_queue_test.go", + ], + embed = [":quotapool"], + deps = [ + "//pkg/testutils", + "//pkg/util/ctxgroup", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/sync/errgroup", + ], +) diff --git a/pkg/util/randutil/BUILD.bazel b/pkg/util/randutil/BUILD.bazel new file mode 100644 index 000000000000..a088a0dcc504 --- /dev/null +++ b/pkg/util/randutil/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "randutil", + srcs = ["rand.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/randutil", + visibility = ["//visibility:public"], + deps = ["//pkg/util/envutil"], +) + +go_test( + name = "randutil_test", + srcs = ["rand_test.go"], + deps = [ + ":randutil", + "//pkg/util/log", + ], +) diff --git a/pkg/util/retry/BUILD.bazel b/pkg/util/retry/BUILD.bazel new file mode 100644 index 000000000000..cd76eb42a30d --- /dev/null +++ b/pkg/util/retry/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "retry", + srcs = ["retry.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/retry", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "retry_test", + srcs = [ + "main_test.go", + "retry_test.go", + ], + embed = [":retry"], + deps = [ + "//pkg/util/log", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/ring/BUILD.bazel b/pkg/util/ring/BUILD.bazel new file mode 100644 index 000000000000..dfc5cc66a390 --- /dev/null +++ b/pkg/util/ring/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ring", + srcs = ["ring_buffer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/ring", + visibility = ["//visibility:public"], +) + +go_test( + name = "ring_test", + srcs = ["ring_buffer_test.go"], + embed = [":ring"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/util/sdnotify/BUILD.bazel b/pkg/util/sdnotify/BUILD.bazel new file mode 100644 index 000000000000..cfcab4fb0cde --- /dev/null +++ b/pkg/util/sdnotify/BUILD.bazel @@ -0,0 +1,69 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sdnotify", + srcs = [ + "sdnotify.go", + "sdnotify_unix.go", + "sdnotify_windows.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/sdnotify", + visibility = ["//visibility:public"], + deps = select({ + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/github.com/cockroachdb/errors", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "sdnotify_test", + srcs = ["sdnotify_unix_test.go"], + embed = [":sdnotify"], + deps = select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//pkg/util/log", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//pkg/util/log", + ], + "//conditions:default": [], + }), +) diff --git a/pkg/util/search/BUILD.bazel b/pkg/util/search/BUILD.bazel new file mode 100644 index 000000000000..da02a518a1b5 --- /dev/null +++ b/pkg/util/search/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "search", + srcs = ["search.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/search", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "search_test", + srcs = ["search_test.go"], + embed = [":search"], + deps = [ + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/sequence/BUILD.bazel b/pkg/util/sequence/BUILD.bazel new file mode 100644 index 000000000000..7c493936c42c --- /dev/null +++ b/pkg/util/sequence/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sequence", + srcs = ["sequence.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/sequence", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/sem/builtins", + "//pkg/sql/sem/tree", + "//pkg/sql/sessiondata", + ], +) diff --git a/pkg/util/shuffle/BUILD.bazel b/pkg/util/shuffle/BUILD.bazel new file mode 100644 index 000000000000..135f2fc11363 --- /dev/null +++ b/pkg/util/shuffle/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "shuffle", + srcs = ["shuffle.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/shuffle", + visibility = ["//visibility:public"], +) + +go_test( + name = "shuffle_test", + srcs = ["shuffle_test.go"], + embed = [":shuffle"], + deps = ["//pkg/util/leaktest"], +) diff --git a/pkg/util/sort/BUILD.bazel b/pkg/util/sort/BUILD.bazel new file mode 100644 index 000000000000..be6621098d13 --- /dev/null +++ b/pkg/util/sort/BUILD.bazel @@ -0,0 +1,9 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sort", + srcs = ["sort.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/sort", + visibility = ["//visibility:public"], + deps = ["//pkg/util/cancelchecker"], +) diff --git a/pkg/util/span/BUILD.bazel b/pkg/util/span/BUILD.bazel new file mode 100644 index 000000000000..5469e36f0531 --- /dev/null +++ b/pkg/util/span/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "span", + srcs = ["frontier.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/span", + visibility = ["//visibility:public"], + deps = [ + "//pkg/keys", + "//pkg/roachpb", + "//pkg/sql/covering", + "//pkg/util/hlc", + "//pkg/util/interval", + ], +) + +go_test( + name = "span_test", + srcs = ["frontier_test.go"], + embed = [":span"], + deps = [ + "//pkg/roachpb", + "//pkg/util/hlc", + "//pkg/util/leaktest", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/stop/BUILD.bazel b/pkg/util/stop/BUILD.bazel new file mode 100644 index 000000000000..95bbb8a299d6 --- /dev/null +++ b/pkg/util/stop/BUILD.bazel @@ -0,0 +1,39 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stop", + srcs = ["stopper.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/stop", + visibility = ["//visibility:public"], + deps = [ + "//pkg/roachpb", + "//pkg/settings", + "//pkg/util/caller", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/quotapool", + "//pkg/util/syncutil", + "//pkg/util/tracing", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/opentracing/opentracing-go", + ], +) + +go_test( + name = "stop_test", + srcs = [ + "main_test.go", + "stopper_test.go", + ], + deps = [ + ":stop", + "//pkg/roachpb", + "//pkg/testutils", + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/quotapool", + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/stringarena/BUILD.bazel b/pkg/util/stringarena/BUILD.bazel new file mode 100644 index 000000000000..ae9619f80b6a --- /dev/null +++ b/pkg/util/stringarena/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "stringarena", + srcs = ["arena.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/stringarena", + visibility = ["//visibility:public"], + deps = ["//pkg/util/mon"], +) + +go_test( + name = "stringarena_test", + srcs = ["arena_test.go"], + embed = [":stringarena"], +) diff --git a/pkg/util/stringencoding/BUILD.bazel b/pkg/util/stringencoding/BUILD.bazel new file mode 100644 index 000000000000..56ff8e9ed9df --- /dev/null +++ b/pkg/util/stringencoding/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "stringencoding", + srcs = ["string_encoding.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/stringencoding", + visibility = ["//visibility:public"], +) diff --git a/pkg/util/syncutil/BUILD.bazel b/pkg/util/syncutil/BUILD.bazel new file mode 100644 index 000000000000..5c682698299f --- /dev/null +++ b/pkg/util/syncutil/BUILD.bazel @@ -0,0 +1,26 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "syncutil", + srcs = [ + "atomic.go", + "int_map.go", + "mutex_sync.go", + "mutex_sync_race.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/syncutil", + visibility = ["//visibility:public"], +) + +go_test( + name = "syncutil_test", + srcs = [ + "atomic_test.go", + "int_map_bench_test.go", + "int_map_reference_test.go", + "int_map_test.go", + "mutex_sync_race_test.go", + ], + embed = [":syncutil"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/util/syncutil/singleflight/BUILD.bazel b/pkg/util/syncutil/singleflight/BUILD.bazel new file mode 100644 index 000000000000..9d5126a37d45 --- /dev/null +++ b/pkg/util/syncutil/singleflight/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "singleflight", + srcs = ["singleflight.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/syncutil/singleflight", + visibility = ["//visibility:public"], + deps = ["//pkg/util/syncutil"], +) + +go_test( + name = "singleflight_test", + srcs = ["singleflight_test.go"], + embed = [":singleflight"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) diff --git a/pkg/util/sysutil/BUILD.bazel b/pkg/util/sysutil/BUILD.bazel new file mode 100644 index 000000000000..25c855e50b56 --- /dev/null +++ b/pkg/util/sysutil/BUILD.bazel @@ -0,0 +1,118 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sysutil", + srcs = [ + "large_file_linux.go", + "large_file_naive.go", + "sysutil.go", + "sysutil_unix.go", + "sysutil_windows.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/sysutil", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "sysutil_test", + srcs = [ + "large_file_test.go", + "sysutil_test.go", + "sysutil_unix_test.go", + ], + embed = [":sysutil"], + deps = [ + "//vendor/github.com/cockroachdb/errors", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) diff --git a/pkg/util/timeofday/BUILD.bazel b/pkg/util/timeofday/BUILD.bazel new file mode 100644 index 000000000000..fb9dc46897ff --- /dev/null +++ b/pkg/util/timeofday/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "timeofday", + srcs = ["time_of_day.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/timeofday", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/duration", + "//pkg/util/timeutil", + ], +) + +go_test( + name = "timeofday_test", + srcs = ["time_of_day_test.go"], + embed = [":timeofday"], + deps = ["//pkg/util/duration"], +) diff --git a/pkg/util/timetz/BUILD.bazel b/pkg/util/timetz/BUILD.bazel new file mode 100644 index 000000000000..2a1748779285 --- /dev/null +++ b/pkg/util/timetz/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "timetz", + srcs = ["timetz.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/timetz", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/timeofday", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + ], +) + +go_test( + name = "timetz_test", + srcs = ["timetz_test.go"], + embed = [":timetz"], + deps = [ + "//pkg/util/timeofday", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/timeutil/BUILD.bazel b/pkg/util/timeutil/BUILD.bazel new file mode 100644 index 000000000000..a377451b77c7 --- /dev/null +++ b/pkg/util/timeutil/BUILD.bazel @@ -0,0 +1,49 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "timeutil", + srcs = [ + "manual_time.go", + "now_unix.go", + "now_windows.go", + "stopwatch.go", + "time.go", + "time_source.go", + "time_zone_util.go", + "timer.go", + "timeutil.go", + "zoneinfo.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/timeutil", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/syncutil", + "//vendor/github.com/cockroachdb/errors", + ] + select({ + "@io_bazel_rules_go//go/platform:windows": [ + "//vendor/golang.org/x/sys/windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "timeutil_test", + srcs = [ + "main_test.go", + "manual_time_test.go", + "now_test.go", + "stopwatch_test.go", + "time_test.go", + "time_zone_util_test.go", + "timer_test.go", + ], + embed = [":timeutil"], + deps = [ + "//pkg/util/leaktest", + "//pkg/util/log", + "//pkg/util/randutil", + "//vendor/github.com/stretchr/testify/assert", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/timeutil/pgdate/BUILD.bazel b/pkg/util/timeutil/pgdate/BUILD.bazel new file mode 100644 index 000000000000..a79e3abeecca --- /dev/null +++ b/pkg/util/timeutil/pgdate/BUILD.bazel @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pgdate", + srcs = [ + "field_extract.go", + "field_string.go", + "fields.go", + "math.go", + "parsemode_string.go", + "parsing.go", + "pgdate.go", + "setters.go", + "zone_cache.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/timeutil/pgdate", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/util/arith", + "//pkg/util/errorutil/unimplemented", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "pgdate_test", + srcs = [ + "field_extract_test.go", + "fields_test.go", + "parsing_test.go", + "pgdate_test.go", + ], + embed = [":pgdate"], + deps = [ + "//pkg/util/timeutil", + "//vendor/github.com/lib/pq", + ], +) diff --git a/pkg/util/tracing/BUILD.bazel b/pkg/util/tracing/BUILD.bazel new file mode 100644 index 000000000000..e7c95c20c75a --- /dev/null +++ b/pkg/util/tracing/BUILD.bazel @@ -0,0 +1,56 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tracing", + srcs = [ + "annotate.go", + "annotate_nocgo.go", + "shadow.go", + "tags.go", + "test_utils.go", + "tracer.go", + "tracer_span.go", + ], + cgo = True, + importpath = "github.com/cockroachdb/cockroach/pkg/util/tracing", + visibility = ["//visibility:public"], + deps = [ + "//pkg/settings", + "//pkg/util", + "//pkg/util/caller", + "//pkg/util/envutil", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/tracing/tracingpb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/types", + "//vendor/github.com/jaegertracing/jaeger/model/json", + "//vendor/github.com/lightstep/lightstep-tracer-go", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/opentracing/opentracing-go/log", + "//vendor/github.com/openzipkin-contrib/zipkin-go-opentracing", + "//vendor/golang.org/x/net/trace", + ], +) + +go_test( + name = "tracing_test", + srcs = [ + "helpers_test.go", + "tags_test.go", + "tracer_span_test.go", + "tracer_test.go", + ], + embed = [":tracing"], + deps = [ + "//pkg/util/tracing/tracingpb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/cockroachdb/logtags", + "//vendor/github.com/lightstep/lightstep-tracer-go", + "//vendor/github.com/opentracing/opentracing-go", + "//vendor/github.com/opentracing/opentracing-go/log", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/util/tracing/tracingpb/BUILD.bazel b/pkg/util/tracing/tracingpb/BUILD.bazel new file mode 100644 index 000000000000..6330c8edbb63 --- /dev/null +++ b/pkg/util/tracing/tracingpb/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tracingpb", + srcs = [ + "recorded_span.go", + "recorded_span.pb.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/tracing/tracingpb", + visibility = ["//visibility:public"], + deps = [ + "//vendor/github.com/gogo/protobuf/proto", + "//vendor/github.com/gogo/protobuf/sortkeys", + "//vendor/github.com/gogo/protobuf/types", + ], +) diff --git a/pkg/util/treeprinter/BUILD.bazel b/pkg/util/treeprinter/BUILD.bazel new file mode 100644 index 000000000000..33bf7e3a9158 --- /dev/null +++ b/pkg/util/treeprinter/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "treeprinter", + srcs = ["tree_printer.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/treeprinter", + visibility = ["//visibility:public"], +) + +go_test( + name = "treeprinter_test", + srcs = ["tree_printer_test.go"], + embed = [":treeprinter"], +) diff --git a/pkg/util/uint128/BUILD.bazel b/pkg/util/uint128/BUILD.bazel new file mode 100644 index 000000000000..832f30fc9e6c --- /dev/null +++ b/pkg/util/uint128/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "uint128", + srcs = ["uint128.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/uint128", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "uint128_test", + srcs = ["uint128_test.go"], + embed = [":uint128"], +) diff --git a/pkg/util/unaccent/BUILD.bazel b/pkg/util/unaccent/BUILD.bazel new file mode 100644 index 000000000000..659bbcc508cb --- /dev/null +++ b/pkg/util/unaccent/BUILD.bazel @@ -0,0 +1,8 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "unaccent", + srcs = ["unaccent.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/unaccent", + visibility = ["//visibility:public"], +) diff --git a/pkg/util/unique/BUILD.bazel b/pkg/util/unique/BUILD.bazel new file mode 100644 index 000000000000..54b4017a8cfe --- /dev/null +++ b/pkg/util/unique/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "unique", + srcs = ["unique.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/unique", + visibility = ["//visibility:public"], +) + +go_test( + name = "unique_test", + srcs = ["unique_test.go"], + embed = [":unique"], +) diff --git a/pkg/util/uuid/BUILD.bazel b/pkg/util/uuid/BUILD.bazel new file mode 100644 index 000000000000..9e33c746f393 --- /dev/null +++ b/pkg/util/uuid/BUILD.bazel @@ -0,0 +1,38 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "uuid", + srcs = [ + "codec.go", + "generator.go", + "sql.go", + "uuid.go", + "uuid_wrapper.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/util/uuid", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uint128", + "//vendor/github.com/cockroachdb/errors", + ], +) + +go_test( + name = "uuid_test", + srcs = [ + "benchmark_fast_test.go", + "codec_test.go", + "generator_test.go", + "sql_test.go", + "uuid_test.go", + ], + data = glob(["testdata/**"]), + embed = [":uuid"], + deps = [ + "//pkg/testutils/skip", + "//pkg/util/timeutil", + "//vendor/github.com/cockroachdb/errors", + ], +) diff --git a/pkg/util/version/BUILD.bazel b/pkg/util/version/BUILD.bazel new file mode 100644 index 000000000000..948c1b27d5c1 --- /dev/null +++ b/pkg/util/version/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "version", + srcs = ["version.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/util/version", + visibility = ["//visibility:public"], + deps = ["//vendor/github.com/cockroachdb/errors"], +) + +go_test( + name = "version_test", + srcs = ["version_test.go"], + embed = [":version"], +) diff --git a/pkg/workload/BUILD.bazel b/pkg/workload/BUILD.bazel new file mode 100644 index 000000000000..ed2163772afd --- /dev/null +++ b/pkg/workload/BUILD.bazel @@ -0,0 +1,66 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workload", + srcs = [ + "connection.go", + "csv.go", + "driver.go", + "pgx_helpers.go", + "round_robin.go", + "sql_runner.go", + "stats.go", + "workload.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/col/typeconv", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/encoding/csv", + "//pkg/util/timeutil", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/lib/pq", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_test( + name = "workload_test", + srcs = [ + "bench_test.go", + "csv_test.go", + "dep_test.go", + "main_test.go", + "pgx_helpers_test.go", + "stats_test.go", + "workload_test.go", + ], + embed = [":workload"], + deps = [ + "//pkg/col/coldata", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/sql/types", + "//pkg/testutils", + "//pkg/testutils/buildutil", + "//pkg/testutils/serverutils", + "//pkg/testutils/skip", + "//pkg/testutils/testcluster", + "//pkg/util/bufalloc", + "//pkg/util/httputil", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/workload/bank", + "//pkg/workload/tpcc", + "//pkg/workload/tpch", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/workload/bank/BUILD.bazel b/pkg/workload/bank/BUILD.bazel new file mode 100644 index 000000000000..2b9b7fc28358 --- /dev/null +++ b/pkg/workload/bank/BUILD.bazel @@ -0,0 +1,40 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "bank", + srcs = ["bank.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/bank", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/exp/rand", + ], +) + +go_test( + name = "bank_test", + srcs = [ + "bank_test.go", + "main_test.go", + ], + embed = [":bank"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/workload/workloadsql", + ], +) diff --git a/pkg/workload/bulkingest/BUILD.bazel b/pkg/workload/bulkingest/BUILD.bazel new file mode 100644 index 000000000000..3358df6847c3 --- /dev/null +++ b/pkg/workload/bulkingest/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "bulkingest", + srcs = ["bulkingest.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/bulkingest", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/cli/BUILD.bazel b/pkg/workload/cli/BUILD.bazel new file mode 100644 index 000000000000..cb8e304a6ac1 --- /dev/null +++ b/pkg/workload/cli/BUILD.bazel @@ -0,0 +1,86 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "cli", + srcs = [ + "bash_complete.go", + "check.go", + "cli.go", + "csv_server.go", + "format.go", + "run.go", + "run_unix.go", + "run_windows.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/cli", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/envutil", + "//pkg/util/log", + "//pkg/util/log/logflags", + "//pkg/util/retry", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//pkg/workload/workloadsql", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/time/rate", + ] + select({ + "@io_bazel_rules_go//go/platform:aix": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:android": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:darwin": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:dragonfly": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:freebsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:illumos": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:ios": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:js": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:linux": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:nacl": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:netbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:openbsd": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:plan9": [ + "//vendor/golang.org/x/sys/unix", + ], + "@io_bazel_rules_go//go/platform:solaris": [ + "//vendor/golang.org/x/sys/unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "cli_test", + srcs = ["format_test.go"], + embed = [":cli"], + deps = [ + "//pkg/util/leaktest", + "//pkg/workload/histogram", + "//vendor/github.com/stretchr/testify/require", + ], +) diff --git a/pkg/workload/debug/BUILD.bazel b/pkg/workload/debug/BUILD.bazel new file mode 100644 index 000000000000..5f1270365fdd --- /dev/null +++ b/pkg/workload/debug/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "debug", + srcs = [ + "debug.go", + "tpcc_results.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/debug", + visibility = ["//visibility:public"], + deps = [ + "//pkg/workload/cli", + "//pkg/workload/histogram", + "//pkg/workload/tpcc", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/cobra", + ], +) diff --git a/pkg/workload/examples/BUILD.bazel b/pkg/workload/examples/BUILD.bazel new file mode 100644 index 000000000000..05a568ff7bf2 --- /dev/null +++ b/pkg/workload/examples/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "examples", + srcs = [ + "intro.go", + "startrek.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/examples", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/types", + "//pkg/workload", + ], +) diff --git a/pkg/workload/faker/BUILD.bazel b/pkg/workload/faker/BUILD.bazel new file mode 100644 index 000000000000..2d5371b10346 --- /dev/null +++ b/pkg/workload/faker/BUILD.bazel @@ -0,0 +1,25 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "faker", + srcs = [ + "address.go", + "dict.go", + "faker.go", + "lorem.go", + "name.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/faker", + visibility = ["//visibility:public"], + deps = ["//vendor/golang.org/x/exp/rand"], +) + +go_test( + name = "faker_test", + srcs = ["faker_test.go"], + embed = [":faker"], + deps = [ + "//vendor/github.com/stretchr/testify/assert", + "//vendor/golang.org/x/exp/rand", + ], +) diff --git a/pkg/workload/geospatial/BUILD.bazel b/pkg/workload/geospatial/BUILD.bazel new file mode 100644 index 000000000000..77d21c035cb0 --- /dev/null +++ b/pkg/workload/geospatial/BUILD.bazel @@ -0,0 +1,12 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "geospatial", + srcs = ["geospatial.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/geospatial", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/types", + "//pkg/workload", + ], +) diff --git a/pkg/workload/histogram/BUILD.bazel b/pkg/workload/histogram/BUILD.bazel new file mode 100644 index 000000000000..dcb8e1accb6b --- /dev/null +++ b/pkg/workload/histogram/BUILD.bazel @@ -0,0 +1,13 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "histogram", + srcs = ["histogram.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/histogram", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//vendor/github.com/codahale/hdrhistogram", + ], +) diff --git a/pkg/workload/indexes/BUILD.bazel b/pkg/workload/indexes/BUILD.bazel new file mode 100644 index 000000000000..345ab1c20d4c --- /dev/null +++ b/pkg/workload/indexes/BUILD.bazel @@ -0,0 +1,17 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "indexes", + srcs = ["indexes.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/indexes", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/interleavebench/BUILD.bazel b/pkg/workload/interleavebench/BUILD.bazel new file mode 100644 index 000000000000..c8bd5536136f --- /dev/null +++ b/pkg/workload/interleavebench/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "interleavebench", + srcs = ["interleavebench.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/interleavebench", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/interleavedpartitioned/BUILD.bazel b/pkg/workload/interleavedpartitioned/BUILD.bazel new file mode 100644 index 000000000000..e70245aa5b2c --- /dev/null +++ b/pkg/workload/interleavedpartitioned/BUILD.bazel @@ -0,0 +1,21 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "interleavedpartitioned", + srcs = ["interleavedpartitioned.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/interleavedpartitioned", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/log", + "//pkg/util/randutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/jsonload/BUILD.bazel b/pkg/workload/jsonload/BUILD.bazel new file mode 100644 index 000000000000..d3e80b52ab15 --- /dev/null +++ b/pkg/workload/jsonload/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "jsonload", + srcs = ["json.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/jsonload", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/json", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/kv/BUILD.bazel b/pkg/workload/kv/BUILD.bazel new file mode 100644 index 000000000000..b90378085723 --- /dev/null +++ b/pkg/workload/kv/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "kv", + srcs = [ + "kv.go", + "zipfian.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/kv", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/ledger/BUILD.bazel b/pkg/workload/ledger/BUILD.bazel new file mode 100644 index 000000000000..49f7242b96d7 --- /dev/null +++ b/pkg/workload/ledger/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "ledger", + srcs = [ + "balance.go", + "ddls.go", + "deposit.go", + "generate.go", + "ledger.go", + "ops_util.go", + "random.go", + "reversal.go", + "withdrawal.go", + "worker.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/ledger", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/types", + "//pkg/util/timeutil", + "//pkg/util/uint128", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/sync/syncmap", + ], +) diff --git a/pkg/workload/movr/BUILD.bazel b/pkg/workload/movr/BUILD.bazel new file mode 100644 index 000000000000..ba3f5378596a --- /dev/null +++ b/pkg/workload/movr/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "movr", + srcs = [ + "movr.go", + "rand.go", + "workload.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/movr", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/faker", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/exp/rand", + ], +) + +go_test( + name = "movr_test", + srcs = ["movr_test.go"], + embed = [":movr"], + deps = ["//vendor/github.com/stretchr/testify/require"], +) diff --git a/pkg/workload/querybench/BUILD.bazel b/pkg/workload/querybench/BUILD.bazel new file mode 100644 index 000000000000..181db1509026 --- /dev/null +++ b/pkg/workload/querybench/BUILD.bazel @@ -0,0 +1,15 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "querybench", + srcs = ["query_bench.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/querybench", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/querylog/BUILD.bazel b/pkg/workload/querylog/BUILD.bazel new file mode 100644 index 000000000000..cfb4a5b4f472 --- /dev/null +++ b/pkg/workload/querylog/BUILD.bazel @@ -0,0 +1,23 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "querylog", + srcs = ["querylog.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/querylog", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/log", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/histogram", + "//pkg/workload/rand", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/queue/BUILD.bazel b/pkg/workload/queue/BUILD.bazel new file mode 100644 index 000000000000..d0ef0f1289d4 --- /dev/null +++ b/pkg/workload/queue/BUILD.bazel @@ -0,0 +1,14 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "queue", + srcs = ["queue.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/queue", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/rand/BUILD.bazel b/pkg/workload/rand/BUILD.bazel new file mode 100644 index 000000000000..5d211d64207d --- /dev/null +++ b/pkg/workload/rand/BUILD.bazel @@ -0,0 +1,20 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "rand", + srcs = ["rand.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/rand", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/lib/pq", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/schemachange/BUILD.bazel b/pkg/workload/schemachange/BUILD.bazel new file mode 100644 index 000000000000..4da0ad9323e8 --- /dev/null +++ b/pkg/workload/schemachange/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "schemachange", + srcs = [ + "deck.go", + "optype_string.go", + "schemachange.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/schemachange", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/parser", + "//pkg/sql/pgwire/pgcode", + "//pkg/sql/pgwire/pgerror", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/sql/types", + "//pkg/util/encoding", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/lib/pq/oid", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/sqlsmith/BUILD.bazel b/pkg/workload/sqlsmith/BUILD.bazel new file mode 100644 index 000000000000..7da4bcfe3ca3 --- /dev/null +++ b/pkg/workload/sqlsmith/BUILD.bazel @@ -0,0 +1,18 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "sqlsmith", + srcs = ["sqlsmith.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/sqlsmith", + visibility = ["//visibility:public"], + deps = [ + "//pkg/internal/sqlsmith", + "//pkg/sql/rowenc", + "//pkg/sql/sem/tree", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/tpcc/BUILD.bazel b/pkg/workload/tpcc/BUILD.bazel new file mode 100644 index 000000000000..de7c8b676c4a --- /dev/null +++ b/pkg/workload/tpcc/BUILD.bazel @@ -0,0 +1,57 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tpcc", + srcs = [ + "audit.go", + "checks.go", + "ddls.go", + "delivery.go", + "generate.go", + "new_order.go", + "order_status.go", + "partition.go", + "payment.go", + "random.go", + "result.go", + "stock_level.go", + "tpcc.go", + "worker.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/tpcc", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/log", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/histogram", + "//pkg/workload/workloadimpl", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/codahale/hdrhistogram", + "//vendor/github.com/jackc/pgx", + "//vendor/github.com/jackc/pgx/pgtype", + "//vendor/github.com/lib/pq", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/exp/rand", + "//vendor/golang.org/x/sync/errgroup", + ], +) + +go_test( + name = "tpcc_test", + srcs = [ + "partition_test.go", + "stats_test.go", + ], + embed = [":tpcc"], + deps = [ + "//pkg/testutils", + "//pkg/workload", + ], +) diff --git a/pkg/workload/tpccchecks/BUILD.bazel b/pkg/workload/tpccchecks/BUILD.bazel new file mode 100644 index 000000000000..d7e515669376 --- /dev/null +++ b/pkg/workload/tpccchecks/BUILD.bazel @@ -0,0 +1,16 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tpccchecks", + srcs = ["checks_generator.go"], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/tpccchecks", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//pkg/workload/tpcc", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/tpcds/BUILD.bazel b/pkg/workload/tpcds/BUILD.bazel new file mode 100644 index 000000000000..3c44e16967cc --- /dev/null +++ b/pkg/workload/tpcds/BUILD.bazel @@ -0,0 +1,19 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tpcds", + srcs = [ + "queries.go", + "tpcds.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/tpcds", + visibility = ["//visibility:public"], + deps = [ + "//pkg/util/log", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + ], +) diff --git a/pkg/workload/tpch/BUILD.bazel b/pkg/workload/tpch/BUILD.bazel new file mode 100644 index 000000000000..21467da541e6 --- /dev/null +++ b/pkg/workload/tpch/BUILD.bazel @@ -0,0 +1,29 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "tpch", + srcs = [ + "expected_rows.go", + "generate.go", + "queries.go", + "random.go", + "tpch.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/tpch", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/encoding", + "//pkg/util/log", + "//pkg/util/timeutil", + "//pkg/util/timeutil/pgdate", + "//pkg/workload", + "//pkg/workload/faker", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/exp/rand", + ], +) diff --git a/pkg/workload/workloadimpl/BUILD.bazel b/pkg/workload/workloadimpl/BUILD.bazel new file mode 100644 index 000000000000..324776953f47 --- /dev/null +++ b/pkg/workload/workloadimpl/BUILD.bazel @@ -0,0 +1,27 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workloadimpl", + srcs = [ + "doc.go", + "precomputedrand.go", + "random.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/workloadimpl", + visibility = ["//visibility:public"], + deps = ["//vendor/golang.org/x/exp/rand"], +) + +go_test( + name = "workloadimpl_test", + srcs = [ + "precomputedrand_test.go", + "random_test.go", + ], + deps = [ + ":workloadimpl", + "//pkg/util/timeutil", + "//vendor/github.com/stretchr/testify/require", + "//vendor/golang.org/x/exp/rand", + ], +) diff --git a/pkg/workload/workloadsql/BUILD.bazel b/pkg/workload/workloadsql/BUILD.bazel new file mode 100644 index 000000000000..e1c47486b87e --- /dev/null +++ b/pkg/workload/workloadsql/BUILD.bazel @@ -0,0 +1,46 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workloadsql", + srcs = [ + "dataload.go", + "workloadsql.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/workloadsql", + visibility = ["//visibility:public"], + deps = [ + "//pkg/sql/lex", + "//pkg/util/ctxgroup", + "//pkg/util/log", + "//pkg/util/timeutil", + "//pkg/util/version", + "//pkg/workload", + "//vendor/github.com/cockroachdb/errors", + "//vendor/golang.org/x/sync/errgroup", + "//vendor/golang.org/x/time/rate", + ], +) + +go_test( + name = "workloadsql_test", + srcs = [ + "main_test.go", + "sliceslice_test.go", + "workloadsql_test.go", + ], + embed = [":workloadsql"], + deps = [ + "//pkg/base", + "//pkg/security", + "//pkg/security/securitytest", + "//pkg/server", + "//pkg/testutils/serverutils", + "//pkg/testutils/sqlutils", + "//pkg/testutils/testcluster", + "//pkg/util/leaktest", + "//pkg/util/randutil", + "//pkg/util/uuid", + "//pkg/workload", + "//pkg/workload/bank", + ], +) diff --git a/pkg/workload/ycsb/BUILD.bazel b/pkg/workload/ycsb/BUILD.bazel new file mode 100644 index 000000000000..a27894fce51d --- /dev/null +++ b/pkg/workload/ycsb/BUILD.bazel @@ -0,0 +1,42 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ycsb", + srcs = [ + "acknowledged_counter.go", + "skewed_latest_generator.go", + "uniform_generator.go", + "ycsb.go", + "zipfgenerator.go", + ], + importpath = "github.com/cockroachdb/cockroach/pkg/workload/ycsb", + visibility = ["//visibility:public"], + deps = [ + "//pkg/col/coldata", + "//pkg/sql/types", + "//pkg/util/bufalloc", + "//pkg/util/syncutil", + "//pkg/util/timeutil", + "//pkg/workload", + "//pkg/workload/histogram", + "//vendor/github.com/cockroachdb/cockroach-go/crdb", + "//vendor/github.com/cockroachdb/errors", + "//vendor/github.com/spf13/pflag", + "//vendor/golang.org/x/exp/rand", + ], +) + +go_test( + name = "ycsb_test", + srcs = [ + "main_test.go", + "zipfgenerator_test.go", + ], + embed = [":ycsb"], + deps = [ + "//pkg/testutils/skip", + "//pkg/util/leaktest", + "//pkg/util/timeutil", + "//vendor/golang.org/x/exp/rand", + ], +) diff --git a/vendor b/vendor index 66b499b93b5d..de6966a081e7 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 66b499b93b5d5e2a6e0750b5e6e4a364bfebb587 +Subproject commit de6966a081e7bf79eba40dfde3a574aa098664b6