Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[DNM]Using bazel as building tool #3539

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .bazelrc
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ tags
temp_parser_file
y.output
profile.coverprofile

bazel*
83 changes: 83 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_prefix", "go_test")

go_prefix("github.com/pingcap/tidb")

go_library(
name = "go_default_library",
srcs = [
"bootstrap.go",
"metrics.go",
"session.go",
"tidb.go",
],
visibility = ["//visibility:public"],
deps = [
"//ast:go_default_library",
"//context:go_default_library",
"//ddl:go_default_library",
"//domain:go_default_library",
"//executor:go_default_library",
"//infoschema:go_default_library",
"//kv:go_default_library",
"//meta:go_default_library",
"//mysql:go_default_library",
"//parser:go_default_library",
"//perfschema:go_default_library",
"//privilege:go_default_library",
"//privilege/privileges:go_default_library",
"//sessionctx:go_default_library",
"//sessionctx/binloginfo:go_default_library",
"//sessionctx/variable:go_default_library",
"//sessionctx/varsutil:go_default_library",
"//statistics:go_default_library",
"//store/localstore:go_default_library",
"//store/localstore/engine:go_default_library",
"//store/localstore/goleveldb:go_default_library",
"//store/tikv/oracle:go_default_library",
"//terror:go_default_library",
"//util:go_default_library",
"//util/types:go_default_library",
"//vendor/github.com/juju/errors:go_default_library",
"//vendor/github.com/ngaut/log:go_default_library",
"//vendor/github.com/ngaut/pools:go_default_library",
"//vendor/github.com/pingcap/tipb/go-binlog:go_default_library",
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
"//vendor/golang.org/x/net/context:go_default_library",
],
)

go_test(
name = "go_default_test",
size = "medium",
srcs = [
"bench_test.go",
"bootstrap_test.go",
"session_test.go",
"tidb_test.go",
],
library = ":go_default_library",
deps = [
"//ast:go_default_library",
"//context:go_default_library",
"//domain:go_default_library",
"//executor:go_default_library",
"//kv:go_default_library",
"//meta:go_default_library",
"//model:go_default_library",
"//mysql:go_default_library",
"//parser:go_default_library",
"//plan:go_default_library",
"//privilege/privileges:go_default_library",
"//sessionctx:go_default_library",
"//sessionctx/variable:go_default_library",
"//store/localstore:go_default_library",
"//table/tables:go_default_library",
"//terror:go_default_library",
"//util:go_default_library",
"//util/testleak:go_default_library",
"//util/types:go_default_library",
"//vendor/github.com/juju/errors:go_default_library",
"//vendor/github.com/ngaut/log:go_default_library",
"//vendor/github.com/pingcap/check:go_default_library",
],
)
172 changes: 0 additions & 172 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions Makefile
1 change: 1 addition & 0 deletions WORKSPACE
36 changes: 36 additions & 0 deletions ast/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "go_default_library",
srcs = [
"ast.go",
"base.go",
"ddl.go",
"dml.go",
"expressions.go",
"flag.go",
"functions.go",
"misc.go",
],
visibility = ["//visibility:public"],
deps = [
"//context:go_default_library",
"//model:go_default_library",
"//mysql:go_default_library",
"//parser/opcode:go_default_library",
"//util/types:go_default_library",
],
)

go_test(
name = "go_default_xtest",
srcs = [
"flag_test.go",
"misc_test.go",
],
deps = [
":go_default_library",
"//parser:go_default_library",
"//vendor/github.com/pingcap/check:go_default_library",
],
)
9 changes: 9 additions & 0 deletions build/root/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Show us information about failures.
build --verbose_failures
test --test_output=errors

# Include git version info
build --workspace_status_command hack/print-workspace-status.sh

# Make /tmp hermetic
build --sandbox_tmpfs_path=/tmp
Loading