[package]
name = "tici"
edition = "2024"

[workspace]
members = ["components/*"]

[workspace.dependencies]
anyhow = "1.0.80"
arc-swap = "1.7.1"
arrow = "55.0.0"
async-channel = "2.1.1"
async-stream = "0.3.3"
async-trait = "0.1.74"
aws-config = "1.8.6"
aws-sdk-s3 = { version = "1.106.0", features = ["behavior-version-latest"] }
aws-types = "1.3.8"
backon = "1.6"
# remove this when https://github.com/rust-lang/backtrace-rs/pull/503 is merged.
backtrace = { git = 'https://github.com/hehechen/backtrace-rs', branch = "v0.3.61" }
base64 = "0.22"
binary-heap-plus = "0.5.0"
byteorder = "1.2"
bytes = "1.5.0"
chrono = { version = "0.4.34", features = ["serde", "clock"] }
clap = { version = "4.5.40", features = ["derive", "string"] }
console-subscriber = "0.1"
crc32c = "0.6.8"
criterion = "0.3"
dashmap = "6.1.0"
derivative = "2.2.0"
derive_more = "0.99.3"
etcd-client = { version = "0.15", features = ["tls"] }
fail = "0.5"
fake = { version = "4.3", features = ["derive", "always-true-rng"] }
fastfield_codecs = "0.3.1"
flate2 = { version = "1.0", default-features = false, features = ["zlib"] }
flexi_logger = { version = "0.31.8", features = ["compress"] }
fs2 = "0.4"
futures = { version = "0.3.28", features = [
  "thread-pool",
  "compat",
  "executor",
] }
google-cloud-auth = "1.4.0"
google-cloud-gax = "1.5.0"
google-cloud-storage = "1.6.0"
google-cloud-wkt = "1.2.0"
grpcio = { version = "0.10.4", default-features = false, features = [
  "openssl-vendored",
  "nightly",
] }
# Neither `je_malloc_usable_size` nor `_rjem_je_malloc_usable_size` can be found. Workaround.
heapsize = { git = "https://github.com/CalvinNeo/heapsize.git", rev = "bb476a2f73cb036aa5510c9817aab07f5760571f" }
hex = "0.4"
http = "0.2.0"
http-body = "1.0.1"
http-body-util = "0.1.3"
hyper = { version = "0.14", features = ["full"] }
intervaltree = "0.2.7"
itertools = "0.14"
lazy_static = "1.5"
libc = "0.2"
log = "0.4.17"
mysql_async = { version = "0.32", default-features = false, features = [
  "minimal",
] }
nix = "0.24"
num-traits = "0.2.14"
num_cpus = "1"
once_cell = "1.21.1"
online_config = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "online_config" }
panic_hook = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f" }
parking_lot = "0.12.5"
parquet = "55.0.0"
pd_client = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "pd_client" }
pd_security = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "security" }
portable-atomic = { version = "0.3", features = ["float"] }
pprof = { version = "0.14", default-features = false, features = [
  "flamegraph",
  "protobuf-codec",
] }
prometheus = { version = "0.13", features = ["nightly"] }
prometheus-static-metric = "0.5"
prost = "0.12.3"
prost-build = "0.12.3"
quick_cache = { version = "0.6.21", features = ["stats"] }
rand = "0.9"
redb = "2.6.3"
regex = "1.10.2"
roaring = "0.10.1"
scopeguard = "1.2.0"
serde = { version = "1.0.193", features = ["derive"] }
serde_json = "1.0.108"
serde_repr = "0.1.20"
simple-error = "0.1.9"
simple-logging = "2.0.2"
static_assertions = "1.1.0"
storage_backend = { path = "components/storage_backend" }
strum = "0.24"
strum_macros = "0.24"
sysinfo = "0.26"
tantivy = { git = "https://github.com/pingcap/tantivy", rev = "0285db72433b70b9155a1ab2ea7611bb113ac858" }
tantivy-common = { git = "https://github.com/pingcap/tantivy", rev = "0285db72433b70b9155a1ab2ea7611bb113ac858", package = "tantivy-common" }
tempfile = "3.0"
thiserror = "2.0.12"
tici = { path = "." }
tici-search-lib = { path = "components/searchlib" }
tici_common = { path = "components/tici_common" }
tici_grpc = { path = "components/tici_grpc" }
tici_import = { path = "components/tici_import" }
tici_service_discovery = { path = "components/tici_service_discovery" }
tici_shard = { path = "components/tici_shard" }
tici_system = { path = "components/tici_system" }
tici_test_utils = { path = "components/tici_test_utils" }
tidb_query_datatype = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "tidb_query_datatype" }
tikv_alloc = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "tikv_alloc" }
tikv_codec = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "codec" }
tikv_log_wrappers = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "log_wrappers" }
time = "0.1"
tipb = { git = "https://github.com/pingcap/tipb.git", default-features = false, features = [
  "protobuf-codec",
] }
tokio = { version = "1.28.2", features = ["full", "tracing"] }
tokio-executor = { git = "https://github.com/tikv/tokio", branch = "tokio-timer-hotfix" }
tokio-stream = "0.1.14"
tokio-timer = { git = "https://github.com/tikv/tokio", branch = "tokio-timer-hotfix" }
tokio-util = "0.7.15"
toml = "0.8.8"
tonic = { version = "0.10.2" }
txn_types = { git = "https://github.com/tikv/tikv", rev = "95cb1366bf9416ca0aa344489b38914336b42b4f", package = "txn_types" }
url = "2"
uuid = { version = "1.4", features = ["v4"] }
vergen-git2 = { version = "1.0.0", features = ["build", "cargo", "rustc"] }
walkdir = "2.3.3"
zip = { version = "3.0.0", default-features = false, features = [
  "deflate",
  "time",
] }

[[bin]]
name = "tici-server"
path = "src/main.rs"

[features]
default = ["jemalloc", "mem-profiling"]
testexport = []
failpoints = ["fail/failpoints"]
openssl-vendored = ["openssl/vendored"]
external-jemalloc = []
jemalloc = ["tikv_alloc/jemalloc"]
mem-profiling = ["tikv_alloc/mem-profiling"]
get_manifest_from_writer = ["tici_shard/get_manifest_from_writer"]

[dependencies]
anyhow = { workspace = true }
arc-swap = { workspace = true }
arrow = { workspace = true }
async-channel = { workspace = true }
async-stream = { workspace = true }
async-trait = { workspace = true }
aws-config = { workspace = true }
aws-sdk-s3 = { workspace = true }
aws-types = { workspace = true }
backon = { workspace = true }
backtrace = { workspace = true }
byteorder = { workspace = true }
bytes = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true }
dashmap = { workspace = true }
derivative = { workspace = true }
derive_more = { workspace = true }
either = "1.13"
etcd-client = { workspace = true }
fail = { workspace = true }
fastfield_codecs = { workspace = true }
flate2 = { workspace = true }
flexi_logger = { workspace = true }
fs2 = { workspace = true }
futures = { workspace = true }
heapsize = { workspace = true }
hex = { workspace = true }
http = { workspace = true }
hyper = { workspace = true }
itertools = { workspace = true }
lazy_static = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
mime = "0.3.13"
mysql_async = { version = "0.32", default-features = false, features = [
  "native-tls-tls",
] }
nix = { workspace = true }
num-traits = { workspace = true }
num_cpus = { workspace = true }
once_cell = { workspace = true }
online_config = { workspace = true }
openssl = "0.10"
openssl-sys = "0.9"
parking_lot = { workspace = true }
parquet = { workspace = true }
pin-project = "1.0"
portable-atomic = { workspace = true }
pprof = { workspace = true }
priority-queue = "2.5"
prometheus = { workspace = true }
prometheus-static-metric = { workspace = true }
prost = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
roaring = { workspace = true }
rustls = { version = "0.23", features = ["aws-lc-rs"] }
scopeguard = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
simple-error = { workspace = true }
simple-logging = { workspace = true }
static_assertions = { workspace = true }
storage_backend = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }
sysinfo = { workspace = true }
tantivy = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tici_common = { workspace = true }
tici_grpc = { workspace = true }
tici_import = { workspace = true }
tici_service_discovery = { workspace = true }
tici_shard = { workspace = true }
tici_system = { workspace = true }
tidb_query_datatype = { workspace = true }
tikv_alloc = { workspace = true }
tikv_codec = { workspace = true }
tikv_log_wrappers = { workspace = true }
time = { workspace = true }
tipb = { workspace = true }
tokio = { workspace = true }
tokio-openssl = "0.6"
tokio-stream = { workspace = true }
toml = { workspace = true }
tonic = { workspace = true }
txn_types = { workspace = true }
url = { workspace = true }
walkdir = { workspace = true }

[target.'cfg(target_os = "linux")'.dependencies]
page_size = "0.4"
procfs = { version = "0.12", default-features = false }
procinfo = { git = "https://github.com/tikv/procinfo-rs", rev = "7693954bd1dd86eb1709572fd7b62fd5f7ff2ea1" }

[build-dependencies]
prost-build = { workspace = true }
tonic-build = "0.10.2"

[dev-dependencies]
tici_test_utils = { workspace = true }
zip = "3.0.0"

[patch.crates-io]
fs2 = { git = "https://github.com/tikv/fs2-rs", branch = "tikv" }
sysinfo = { git = "https://github.com/tikv/sysinfo", branch = "0.26-fix-cpu" }
raft = { git = "https://github.com/tikv/raft-rs", branch = "master" }
raft-proto = { git = "https://github.com/tikv/raft-rs", branch = "master" }
protobuf = { git = "https://github.com/pingcap/rust-protobuf", branch = "v2.8" }
protobuf-codegen = { git = "https://github.com/pingcap/rust-protobuf", branch = "v2.8" }
grpcio = { git = "https://github.com/tikv/grpc-rs", branch = "v0.10.x" }

[profile.dev]
opt-level = 0
debug = true
codegen-units = 4
lto = false
incremental = true
panic = 'unwind'
debug-assertions = true
overflow-checks = false
rpath = false

[profile.release]
opt-level = 3
debug = true
codegen-units = 1
lto = "thin"
incremental = false
panic = 'unwind'
debug-assertions = false
overflow-checks = false
rpath = false

[profile.test]
opt-level = 0
debug = true
codegen-units = 16
lto = false
incremental = true
debug-assertions = true
overflow-checks = true
rpath = false
