-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The version of titan and rocksdb submodules are the same as master branch of rust-rocksdb. xtask crate is copied from grpc-rs. Build script is refactored. Compared to rust-rocksdb, the main differences are: 1. Use cargo command and bindgen to maintain bindings just like grpc-rs: ``` cargo xtask bindgen ``` 2. Titan and rocksdb are maintained in one crate instead of two. Because compiling titan requires rocksdb, so it's impossible to publish a crate that only includes the source of titan. And compiling crocksdb also requires the source of titan. So it's easier to maintain to just put rocksdb and titan into one crate. 3. bindgen is completely removed from dependency tree unless we want to regenerate bindings. So compiling tirocks doesn't requires clang and llvm. It's safe for every platform to share the same bindings as all structs are opaque types and libc is used to cover the platform differences. 4. Released version of snappy-sys is used by default so we can publish tirocks in the future. Signed-off-by: Jay Lee <[email protected]>
- Loading branch information
Showing
18 changed files
with
15,511 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[alias] | ||
xtask = "run --manifest-path ./xtask/Cargo.toml --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tirocks-sys/rocksdb/.clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ Cargo.lock | |
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "titan-sys/titan"] | ||
path = tirocks-sys/titan | ||
url = https://github.com/tikv/titan.git | ||
[submodule "tirocks-sys/rocksdb"] | ||
path = tirocks-sys/rocksdb | ||
url = https://github.com/tikv/rocksdb.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[workspace] | ||
members = [ | ||
"tirocks", | ||
"tirocks-sys", | ||
"xtask", | ||
] | ||
|
||
[patch.crates-io] | ||
# Use cmake to build the binary, so it can be compiled on all supported platform. | ||
snappy-sys = { git = "https://github.com/busyjay/rust-snappy.git", branch = "static-link" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
# tirocks | ||
RocksDB bindings and wrappers in Rust | ||
|
||
This library has been tested against RocksDB 6.4 on Linux and macOS. | ||
|
||
Feedback and pull requests welcome! If a particular feature of RocksDB is important to you, please let us know by opening an issue, and we will prioritize it. | ||
|
||
## Build | ||
|
||
``` | ||
$ cargo xtask submodule # if you just cloned the repository | ||
$ cargo build | ||
``` | ||
|
||
Bindings are pre-generated, if the content in librocksdb_sys/crocksdb/crocksdb/c.h is updated, you may need to regenerate bindings: | ||
|
||
``` | ||
$ cargo xtask bindgen | ||
``` | ||
|
||
And running linting against C files: | ||
|
||
``` | ||
$ cargo xtask clang-lint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[package] | ||
name = "tirocks-sys" | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["The TiKV Project Developers"] | ||
license = "Apache-2.0" | ||
keywords = ["rocksdb", "bindings"] | ||
links = "tirocks" | ||
|
||
[dependencies] | ||
# native library >=1.0.8 | ||
bzip2-sys = { version = "0.1.11", features = ["static"] } | ||
libc = "0.2.11" | ||
libz-sys = { version = "1.1", features = ["static"] } | ||
openssl-sys = { version = "0.9.54", optional = true, features = ["vendored"] } | ||
# native library >= 1.4.8 | ||
zstd-sys = "1.4.19" | ||
lz4-sys = "1.9" | ||
snappy-sys = "0.1" | ||
|
||
[features] | ||
default = [] | ||
encryption = ["openssl-sys"] | ||
jemalloc = ["tikv-jemalloc-sys"] | ||
sse = [] | ||
static-libcpp = [] | ||
|
||
# portable doesn't require static link, though it's meaningless | ||
# when not using with static-link right now in this crate. | ||
portable = [] | ||
# If this feature is enabled, bindings will be regenerated. | ||
update-bindings = ["bindgen"] | ||
|
||
[build-dependencies] | ||
cc = "1.0" | ||
cmake = "0.1" | ||
# Because of rust-lang/cargo#5237, bindgen should not be upgraded until a minor or major release. | ||
bindgen = { version = "0.57.0", default-features = false, optional = true, features = ["runtime"] } | ||
|
||
[dependencies.tikv-jemalloc-sys] | ||
version = "0.4.0" | ||
optional = true | ||
features = ["unprefixed_malloc_on_supported_platforms"] |
Oops, something went wrong.