Skip to content

Commit

Permalink
*: remove prost support (tikv#11099)
Browse files Browse the repository at this point in the history
* *: remove prost support

Since it's not used in production, remove it to reduce dependencies and
codes.

To fully remove prost, we still need pprof to support protobuf-codec.

See also tikv#10905.

Signed-off-by: Jay Lee <[email protected]>

* remove unnecessary features

Signed-off-by: Jay Lee <[email protected]>

* further cleanup

Signed-off-by: Jay Lee <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
  • Loading branch information
BusyJay and ti-chi-bot authored Nov 2, 2021
1 parent e298e93 commit 8a16a5b
Show file tree
Hide file tree
Showing 90 changed files with 152 additions and 1,737 deletions.
289 changes: 0 additions & 289 deletions Cargo.lock

Large diffs are not rendered by default.

86 changes: 7 additions & 79 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"
publish = false

[features]
default = ["protobuf-codec", "test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
default = ["test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
tcmalloc = ["tikv_alloc/tcmalloc"]
jemalloc = ["tikv_alloc/jemalloc", "engine_rocks/jemalloc"]
mimalloc = ["tikv_alloc/mimalloc"]
Expand All @@ -34,76 +34,6 @@ cloud-gcp = [
"encryption_export/cloud-gcp",
"sst_importer/cloud-gcp",
]
protobuf-codec = [
"protobuf/bytes",
"batch-system/protobuf-codec",
"codec/protobuf-codec",
"concurrency_manager/protobuf-codec",
"encryption_export/protobuf-codec",
"engine_panic/protobuf-codec",
"engine_rocks/protobuf-codec",
"engine_test/protobuf-codec",
"engine_traits/protobuf-codec",
"engine_traits_tests/protobuf-codec",
"error_code/protobuf-codec",
"grpcio/protobuf-codec",
"into_other/protobuf-codec",
"keys/protobuf-codec",
"kvproto/protobuf-codec",
"pd_client/protobuf-codec",
"raft/protobuf-codec",
"raftstore/protobuf-codec",
"raft_log_engine/protobuf-codec",
"security/protobuf-codec",
"sst_importer/protobuf-codec",
"tidb_query_aggr/protobuf-codec",
"tidb_query_common/protobuf-codec",
"tidb_query_datatype/protobuf-codec",
"tidb_query_executors/protobuf-codec",
"tidb_query_expr/protobuf-codec",
"tipb/protobuf-codec",
"tikv_kv/protobuf-codec",
"tikv_util/protobuf-codec",
"txn_types/protobuf-codec",
"grpcio-health/protobuf-codec",
"file_system/protobuf-codec",
"resource_metering/protobuf-codec",
"protobuf/bytes",
]
prost-codec = [
"batch-system/prost-codec",
"codec/prost-codec",
"concurrency_manager/prost-codec",
"encryption_export/prost-codec",
"engine_panic/prost-codec",
"engine_rocks/prost-codec",
"engine_test/prost-codec",
"engine_traits/prost-codec",
"engine_traits_tests/prost-codec",
"error_code/prost-codec",
"grpcio/prost-codec",
"into_other/prost-codec",
"keys/prost-codec",
"kvproto/prost-codec",
"pd_client/prost-codec",
"raft/prost-codec",
"raftstore/prost-codec",
"raft_log_engine/prost-codec",
"security/prost-codec",
"sst_importer/prost-codec",
"tidb_query_aggr/prost-codec",
"tidb_query_common/prost-codec",
"tidb_query_datatype/prost-codec",
"tidb_query_executors/prost-codec",
"tidb_query_expr/prost-codec",
"tipb/prost-codec",
"tikv_kv/prost-codec",
"tikv_util/prost-codec",
"txn_types/prost-codec",
"grpcio-health/prost-codec",
"file_system/prost-codec",
"resource_metering/prost-codec",
]
testexport = ["raftstore/testexport"]
test-engines-rocksdb = [
"engine_test/test-engines-rocksdb",
Expand All @@ -128,7 +58,6 @@ name = "tikv"
anyhow = "1.0"
async-stream = "0.2"
async-trait = "0.1"
async-std = "1.10"
backtrace = "0.3"
batch-system = { path = "components/batch-system", default-features = false }
byteorder = "1.2"
Expand All @@ -152,8 +81,8 @@ fs2 = "0.4"
futures = { version = "0.3", features = ["thread-pool", "compat"] }
futures-executor = "0.3.1"
futures-util = { version = "0.3.1", default-features = false, features = ["io", "async-await"] }
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored"] }
grpcio-health = { version = "0.9", default-features = false }
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored", "protobuf-codec"] }
grpcio-health = { version = "0.9", default-features = false, features = ["protobuf-codec"] }
hex = "0.4"
hyper-tls = "0.5"
itertools = "0.10"
Expand All @@ -163,7 +92,7 @@ hyper-openssl = "0.9"
http = "0"
into_other = { path = "components/into_other", default-features = false }
keys = { path = "components/keys", default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git", default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git" }
lazy_static = "1.3"
libc = "0.2"
libloading = "0.7"
Expand All @@ -179,10 +108,9 @@ num_cpus = "1"
pd_client = { path = "components/pd_client", default-features = false }
pin-project = "1.0"
pnet_datalink = "0.23"
prost = "0.7"
pprof = { version = "^0.4", default-features = false, features = ["flamegraph", "protobuf"] }
protobuf = "2.8"
raft = { version = "0.6.0-alpha", default-features = false }
protobuf = { version = "2.8", features = ["bytes"] }
raft = { version = "0.6.0-alpha", default-features = false, features = ["protobuf-codec"] }
raftstore = { path = "components/raftstore", default-features = false }
raft_log_engine = { path = "components/raft_log_engine", default-features = false }
rand = "0.7.3"
Expand Down Expand Up @@ -218,7 +146,7 @@ tikv_util = { path = "components/tikv_util", default-features = false }
collections = { path = "components/collections" }
coprocessor_plugin_api = { path = "components/coprocessor_plugin_api" }
time = "0.1"
tipb = { git = "https://github.com/pingcap/tipb.git", default-features = false }
tipb = { git = "https://github.com/pingcap/tipb.git" }
tokio = { version = "1.12", features = ["full"] }
tokio-timer = "0.2"
tokio-openssl = "0.6"
Expand Down
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ ifeq ($(BCC_IOSNOOP),1)
ENABLE_FEATURES += bcc-iosnoop
endif

# Use Prost instead of rust-protobuf to encode and decode protocol buffers.
ifeq ($(PROST),1)
ENABLE_FEATURES += prost-codec
else
ENABLE_FEATURES += protobuf-codec
endif

# Set the storage engines used for testing
ifneq ($(NO_DEFAULT_TEST_ENGINES),1)
ENABLE_FEATURES += test-engines-rocksdb
Expand Down Expand Up @@ -328,7 +321,7 @@ ctl:
# Actually use make to track dependencies! This saves half a second.
error_code_files := $(shell find $(PROJECT_DIR)/components/error_code/ -type f )
etc/error_code.toml: $(error_code_files)
cargo run --manifest-path components/error_code/Cargo.toml --features protobuf-codec
cargo run --manifest-path components/error_code/Cargo.toml

error-code: etc/error_code.toml

Expand Down
53 changes: 5 additions & 48 deletions cmd/tikv-ctl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
publish = false

[features]
default = ["protobuf-codec", "test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
default = ["test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
tcmalloc = ["tikv/tcmalloc"]
jemalloc = ["tikv/jemalloc"]
mimalloc = ["tikv/mimalloc"]
Expand All @@ -26,49 +26,6 @@ cloud-gcp = [
]
cloud-storage-grpc = [ "backup/cloud-storage-grpc" ]
cloud-storage-dylib = [ "backup/cloud-storage-dylib" ]
protobuf-codec = [
"protobuf/bytes",
"backup/protobuf-codec",
"cdc/protobuf-codec",
"concurrency_manager/protobuf-codec",
"encryption_export/protobuf-codec",
"engine_rocks/protobuf-codec",
"engine_traits/protobuf-codec",
"error_code/protobuf-codec",
"grpcio/protobuf-codec",
"keys/protobuf-codec",
"kvproto/protobuf-codec",
"pd_client/protobuf-codec",
"raft/protobuf-codec",
"raftstore/protobuf-codec",
"raft_log_engine/protobuf-codec",
"security/protobuf-codec",
"tikv/protobuf-codec",
"tikv_util/protobuf-codec",
"txn_types/protobuf-codec",
"file_system/protobuf-codec",
]
prost-codec = [
"backup/prost-codec",
"cdc/prost-codec",
"concurrency_manager/prost-codec",
"encryption_export/prost-codec",
"engine_rocks/prost-codec",
"engine_traits/prost-codec",
"error_code/prost-codec",
"grpcio/prost-codec",
"keys/prost-codec",
"kvproto/prost-codec",
"pd_client/prost-codec",
"raft/prost-codec",
"raftstore/prost-codec",
"raft_log_engine/prost-codec",
"security/prost-codec",
"tikv/prost-codec",
"tikv_util/prost-codec",
"txn_types/prost-codec",
"file_system/prost-codec",
]
test-engines-rocksdb = [
"tikv/test-engines-rocksdb",
]
Expand All @@ -94,10 +51,10 @@ error_code = { path = "../../components/error_code", default-features = false }
file_system = { path = "../../components/file_system", default-features = false }
fs2 = "0.4"
futures = "0.3"
kvproto = { git = "https://github.com/pingcap/kvproto.git", default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git" }
tokio = { version = "1.5", features = ["rt-multi-thread", "time"] }
gag = "0.1"
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored"] }
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored", "protobuf-codec"] }
hex = "0.4"
keys = { path = "../../components/keys", default-features = false }
libc = "0.2"
Expand All @@ -107,8 +64,8 @@ nix = "0.19"
pd_client = { path = "../../components/pd_client", default-features = false }
prometheus = { version = "0.12", features = ["nightly"] }
promptly = "0.3.0"
protobuf = "2.8"
raft = { version = "0.6.0-alpha", default-features = false }
protobuf = { version = "2.8", features = ["bytes"] }
raft = { version = "0.6.0-alpha", default-features = false, features = ["protobuf-codec"] }
raft_log_engine = { path = "../../components/raft_log_engine", default-features = false }
raftstore = { path = "../../components/raftstore", default-features = false }
rand = "0.8"
Expand Down
4 changes: 1 addition & 3 deletions cmd/tikv-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
publish = false

[features]
default = ["protobuf-codec", "test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
default = ["test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
tcmalloc = ["server/tcmalloc"]
jemalloc = ["server/jemalloc"]
mimalloc = ["server/mimalloc"]
Expand All @@ -17,8 +17,6 @@ failpoints = ["server/failpoints"]
bcc-iosnoop = ["server/bcc-iosnoop"]
cloud-aws = ["server/cloud-aws"]
cloud-gcp = ["server/cloud-gcp"]
protobuf-codec = ["server/protobuf-codec"]
prost-codec = ["server/prost-codec"]
test-engines-rocksdb = ["server/test-engines-rocksdb"]
test-engines-panic = ["server/test-engines-panic"]

Expand Down
48 changes: 4 additions & 44 deletions components/backup/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,11 @@ edition = "2018"
publish = false

[features]
default = ["protobuf-codec", "test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
default = ["test-engines-rocksdb", "cloud-aws", "cloud-gcp"]
cloud-aws = ["external_storage_export/cloud-aws"]
cloud-gcp = ["external_storage_export/cloud-gcp"]
cloud-storage-grpc = ["external_storage_export/cloud-storage-grpc"]
cloud-storage-dylib = ["external_storage_export/cloud-storage-dylib"]
protobuf-codec = [
"concurrency_manager/protobuf-codec",
"engine_rocks/protobuf-codec",
"engine_traits/protobuf-codec",
"error_code/protobuf-codec",
"external_storage_export/protobuf-codec",
"grpcio/protobuf-codec",
"keys/protobuf-codec",
"kvproto/protobuf-codec",
"pd_client/protobuf-codec",
"raft/protobuf-codec",
"raftstore/protobuf-codec",
"security/protobuf-codec",
"tidb_query_common/protobuf-codec",
"tikv/protobuf-codec",
"tikv_util/protobuf-codec",
"txn_types/protobuf-codec",
"file_system/protobuf-codec",
"encryption/protobuf-codec",
]
prost-codec = [
"concurrency_manager/prost-codec",
"engine_rocks/prost-codec",
"engine_traits/prost-codec",
"error_code/prost-codec",
"external_storage_export/prost-codec",
"grpcio/prost-codec",
"keys/prost-codec",
"kvproto/prost-codec",
"pd_client/prost-codec",
"raft/prost-codec",
"raftstore/prost-codec",
"security/prost-codec",
"tidb_query_common/prost-codec",
"tikv/prost-codec",
"tikv_util/prost-codec",
"txn_types/prost-codec",
"file_system/prost-codec",
"encryption/prost-codec",
]
test-engines-rocksdb = [
"tikv/test-engines-rocksdb",
]
Expand Down Expand Up @@ -78,15 +38,15 @@ file_system = { path = "../file_system", default-features = false }
encryption = {path = "../encryption", default-features = false}
futures = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["io"] }
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored"] }
grpcio = { version = "0.9", default-features = false, features = ["openssl-vendored", "protobuf-codec"] }
hex = "0.4"
keys = { path = "../keys", default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git", default-features = false }
kvproto = { git = "https://github.com/pingcap/kvproto.git" }
lazy_static = "1.3"
log_wrappers = { path = "../log_wrappers" }
pd_client = { path = "../pd_client", default-features = false }
prometheus = { version = "0.12", default-features = false, features = ["nightly"] }
raft = { version = "0.6.0-alpha", default-features = false }
raft = { version = "0.6.0-alpha", default-features = false, features = ["protobuf-codec"] }
raftstore = { path = "../raftstore", default-features = false }
security = { path = "../security", default-features = false }
serde = "1.0"
Expand Down
10 changes: 1 addition & 9 deletions components/batch-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ version = "0.1.0"
edition = "2018"

[features]
default = ["test-runner", "protobuf-codec"]
default = ["test-runner"]
test-runner = ["derive_more"]
protobuf-codec = [
"tikv_util/protobuf-codec",
"file_system/protobuf-codec",
]
prost-codec = [
"tikv_util/prost-codec",
"file_system/prost-codec",
]

[dependencies]
crossbeam = "0.8"
Expand Down
Loading

0 comments on commit 8a16a5b

Please sign in to comment.