Skip to content

*: bazel hackweek#55258

Closed
irfansharif wants to merge 4 commits intocockroachdb:masterfrom
irfansharif:201006.bazel-hackweek
Closed

*: bazel hackweek#55258
irfansharif wants to merge 4 commits intocockroachdb:masterfrom
irfansharif:201006.bazel-hackweek

Conversation

@irfansharif
Copy link
Copy Markdown
Contributor

No description provided.

@irfansharif irfansharif requested a review from otan October 6, 2020 15:36
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@irfansharif irfansharif force-pushed the 201006.bazel-hackweek branch from 03fe230 to 0997dd7 Compare October 6, 2020 19:38
@irfansharif irfansharif requested review from a team October 6, 2020 19:38
@irfansharif irfansharif requested review from a team as code owners October 6, 2020 19:38
@irfansharif irfansharif requested review from miretskiy and removed request for a team October 6, 2020 19:38
@otan otan marked this pull request as draft October 6, 2020 19:42
@irfansharif irfansharif force-pushed the 201006.bazel-hackweek branch 2 times, most recently from 82cdb84 to 016fb55 Compare October 6, 2020 21:51
@irfansharif irfansharif removed request for a team, miretskiy and otan October 7, 2020 14:59
@irfansharif irfansharif force-pushed the 201006.bazel-hackweek branch from 016fb55 to c799fbe Compare October 9, 2020 01:19
@irfansharif irfansharif force-pushed the 201006.bazel-hackweek branch 5 times, most recently from 0570ebe to 8ebc174 Compare October 16, 2020 23:53
rocksdb: elide usage of __DATE__
jemalloc: fix JEMALLOC_MUTEX_INIT_CB to only be set if OSS_PINLOCK is false

Release note: None
vendor: bazel-ify vendor

vendor: pick up vendor bazil changes
Should let us use:

  make bazel-clean
  make bazel-generate

(I'm not checking in the generated bazel build files just yet. They'll
come in subsequent commits.)

*: check in individual BUILD.bazel files

This still does not fully work, some of the include paths (relative to
the repo root) don't pick up the right C/C++ headers correctly. In the
next commit we'll hardcode them to (my) local paths.

*: manual include path resolution

The relative path directives don't seem to work, so we pin them here.

*: get execgen working

*: get optgen+stringer working

*: pick up libproto directives

*:introduce build targets for c-deps

*: keep gen code

*: run autofmt

*: disable global proto for deps

*: point to latest rules_go

*: libroachccl + engineccl

*: proj stuff

*: point to different go-libedit

*: updating all BUILD files after rebase

*: remove unnecessary keeps
@irfansharif irfansharif force-pushed the 201006.bazel-hackweek branch from 8ebc174 to 1a51cb1 Compare October 16, 2020 23:56
Release note (<category, see below>): <what> <show> <why>
@irfansharif
Copy link
Copy Markdown
Contributor Author

Subsumed by #55687.

@irfansharif
Copy link
Copy Markdown
Contributor Author

(Intentionally not deleting the branch here on GitHub, we have a summary doc that holds on to these references).

irfansharif added a commit to irfansharif/cockroach that referenced this pull request Oct 26, 2020
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 cockroachdb#52824,
which resulted in a week long effort (with otan@, jamesl@, and myself) to
wrap it up in earnest in cockroachdb#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
craig bot pushed a commit that referenced this pull request Oct 26, 2020
54896: cli: add import pgdump/mysqldump CLI command r=miretskiy,knz a=adityamaru

This change introduces a new CLI command to import
locally saved PGDUMP or MYSQLDUMP files into a running
cockroach cluster.

The underlying logic relies on user scoped userfile
storage to upload the local dump file to, and subsequently
import data from. Most of the heavy lifting was already
completed during the development of the userfile storage.

We can only support bundle formats that have the table
schemas to be imported, baked into the dump files. The newly
added CLI commands support the same options as IMPORT PGDUMP
and IMPORT MYSQLDUMP from the SQL shell do. These options
are to be passed in as CLI flags.

Following are the CLI examples:
`./cockroach import db <format> <source>`
`./cockroach import table <tablename> <format> <source>`

Release note (cli change): Adds an import CLI command which
allows users to upload and import local dump files into a
running cockroach cluster. We currently support PGDUMP and
MYSQLDUMP formats.

55687: *: bazel-ify cockroachdb r=irfansharif a=irfansharif

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
http://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:

```
	new file:   .bazelrc
	modified:   .gitattributes
	modified:   .gitignore
	new file:   BUILD.bazel
	new file:   DEPS.bzl
	modified:   Makefile
	new file:   WORKSPACE
	new file:   pkg/ccl/gssapiccl/BUILD.bazel
	new file:   pkg/ccl/storageccl/engineccl/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
	modified:   pkg/geo/geoproj/geoproj.go
	modified:   pkg/geo/geoproj/proj.cc
	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
	modified:   pkg/sql/colexec/and_or_projection_tmpl.go
	modified:   pkg/sql/colexec/any_not_null_agg_tmpl.go
	modified:   pkg/sql/colexec/avg_agg_tmpl.go
	modified:   pkg/sql/colexec/bool_and_or_agg_tmpl.go
	modified:   pkg/sql/colexec/cast_tmpl.go
	new file:   pkg/sql/colexec/colbuilder/BUILD.bazel
	new file:   pkg/sql/colexec/colexec.go
	modified:   pkg/sql/colexec/concat_agg_tmpl.go
	modified:   pkg/sql/colexec/const_tmpl.go
	modified:   pkg/sql/colexec/count_agg_tmpl.go
	modified:   pkg/sql/colexec/default_agg_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_expr_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_proj_ops_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_sel_ops_tmpl.go
	modified:   pkg/sql/colexec/distinct_tmpl.go
	modified:   pkg/sql/colexec/hash_aggregator_tmpl.go
	modified:   pkg/sql/colexec/hash_utils_tmpl.go
	modified:   pkg/sql/colexec/hashjoiner_tmpl.go
	modified:   pkg/sql/colexec/hashtable_tmpl.go
	modified:   pkg/sql/colexec/is_null_ops_tmpl.go
	modified:   pkg/sql/colexec/mergejoinbase_tmpl.go
	modified:   pkg/sql/colexec/mergejoiner_tmpl.go
	modified:   pkg/sql/colexec/min_max_agg_tmpl.go
	modified:   pkg/sql/colexec/ordered_synchronizer_tmpl.go
	modified:   pkg/sql/colexec/proj_const_ops_tmpl.go
	modified:   pkg/sql/colexec/proj_non_const_ops_tmpl.go
	modified:   pkg/sql/colexec/quicksort_tmpl.go
	modified:   pkg/sql/colexec/rank_tmpl.go
	modified:   pkg/sql/colexec/relative_rank_tmpl.go
	modified:   pkg/sql/colexec/row_number_tmpl.go
	modified:   pkg/sql/colexec/rowstovec_tmpl.go
	modified:   pkg/sql/colexec/select_in_tmpl.go
	modified:   pkg/sql/colexec/selection_ops_tmpl.go
	modified:   pkg/sql/colexec/sort_tmpl.go
	modified:   pkg/sql/colexec/substring_tmpl.go
	modified:   pkg/sql/colexec/sum_agg_tmpl.go
	modified:   pkg/sql/colexec/utils_tmpl.go
	modified:   pkg/sql/colexec/values_differ_tmpl.go
	modified:   pkg/sql/colexec/vec_comparators_tmpl.go
	modified:   pkg/sql/colexec/window_peer_grouper_tmpl.go
	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
	modified:   pkg/sql/parser/sql.y
	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


55827: sql: stub ALTER TABLE ... SET LOCALITY/AFFINITY related commands r=ajstorm a=otan

Following the doc on proposed ideas and fleshed them all out. They
default to displaying REGIONAL AFFINITY for now.

Release note (sql change): Implemented ALTER TABLE ... SET
LOCALITY/REGIONAL AFFINITY commands that allow users to configure
multiregion properties of given tables. These may change later.

Co-authored-by: Aditya Maru <adityamaru@gmail.com>
Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
irfansharif added a commit to irfansharif/cockroach that referenced this pull request Oct 26, 2020
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 cockroachdb#52824,
which resulted in a week long effort (with otan@, jamesl@, and myself) to
wrap it up in earnest in cockroachdb#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
craig bot pushed a commit that referenced this pull request Oct 26, 2020
55687: *: bazel-ify cockroachdb r=irfansharif a=irfansharif

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
http://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:

```
	new file:   .bazelrc
	modified:   .gitattributes
	modified:   .gitignore
	new file:   BUILD.bazel
	new file:   DEPS.bzl
	modified:   Makefile
	new file:   WORKSPACE
	new file:   pkg/ccl/gssapiccl/BUILD.bazel
	new file:   pkg/ccl/storageccl/engineccl/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
	modified:   pkg/geo/geoproj/geoproj.go
	modified:   pkg/geo/geoproj/proj.cc
	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
	modified:   pkg/sql/colexec/and_or_projection_tmpl.go
	modified:   pkg/sql/colexec/any_not_null_agg_tmpl.go
	modified:   pkg/sql/colexec/avg_agg_tmpl.go
	modified:   pkg/sql/colexec/bool_and_or_agg_tmpl.go
	modified:   pkg/sql/colexec/cast_tmpl.go
	new file:   pkg/sql/colexec/colbuilder/BUILD.bazel
	new file:   pkg/sql/colexec/colexec.go
	modified:   pkg/sql/colexec/concat_agg_tmpl.go
	modified:   pkg/sql/colexec/const_tmpl.go
	modified:   pkg/sql/colexec/count_agg_tmpl.go
	modified:   pkg/sql/colexec/default_agg_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_expr_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_proj_ops_tmpl.go
	modified:   pkg/sql/colexec/default_cmp_sel_ops_tmpl.go
	modified:   pkg/sql/colexec/distinct_tmpl.go
	modified:   pkg/sql/colexec/hash_aggregator_tmpl.go
	modified:   pkg/sql/colexec/hash_utils_tmpl.go
	modified:   pkg/sql/colexec/hashjoiner_tmpl.go
	modified:   pkg/sql/colexec/hashtable_tmpl.go
	modified:   pkg/sql/colexec/is_null_ops_tmpl.go
	modified:   pkg/sql/colexec/mergejoinbase_tmpl.go
	modified:   pkg/sql/colexec/mergejoiner_tmpl.go
	modified:   pkg/sql/colexec/min_max_agg_tmpl.go
	modified:   pkg/sql/colexec/ordered_synchronizer_tmpl.go
	modified:   pkg/sql/colexec/proj_const_ops_tmpl.go
	modified:   pkg/sql/colexec/proj_non_const_ops_tmpl.go
	modified:   pkg/sql/colexec/quicksort_tmpl.go
	modified:   pkg/sql/colexec/rank_tmpl.go
	modified:   pkg/sql/colexec/relative_rank_tmpl.go
	modified:   pkg/sql/colexec/row_number_tmpl.go
	modified:   pkg/sql/colexec/rowstovec_tmpl.go
	modified:   pkg/sql/colexec/select_in_tmpl.go
	modified:   pkg/sql/colexec/selection_ops_tmpl.go
	modified:   pkg/sql/colexec/sort_tmpl.go
	modified:   pkg/sql/colexec/substring_tmpl.go
	modified:   pkg/sql/colexec/sum_agg_tmpl.go
	modified:   pkg/sql/colexec/utils_tmpl.go
	modified:   pkg/sql/colexec/values_differ_tmpl.go
	modified:   pkg/sql/colexec/vec_comparators_tmpl.go
	modified:   pkg/sql/colexec/window_peer_grouper_tmpl.go
	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
	modified:   pkg/sql/parser/sql.y
	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


Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com>
@irfansharif irfansharif deleted the 201006.bazel-hackweek branch December 17, 2021 14:17
@irfansharif irfansharif restored the 201006.bazel-hackweek branch December 17, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants