dir change

main
Ziyang Hu 2 years ago
parent 7afc7e968f
commit 04d2fdf123

14
.gitmodules vendored

@ -1,15 +1,3 @@
[submodule "cozorocks/deps/gflags"]
path = cozorocks/deps/gflags
url = https://github.com/gflags/gflags.git
[submodule "cozorocks/deps/lz4"]
path = cozorocks/deps/lz4
url = https://github.com/lz4/lz4.git
[submodule "cozorocks/deps/zstd"]
path = cozorocks/deps/zstd
url = https://github.com/facebook/zstd.git
[submodule "cozorocks/deps/rocksdb"] [submodule "cozorocks/deps/rocksdb"]
path = cozorocks/deps/rocksdb path = cozorocks/rocksdb
url = https://github.com/facebook/rocksdb.git url = https://github.com/facebook/rocksdb.git
[submodule "cozorocks/deps/jemalloc"]
path = cozorocks/deps/jemalloc
url = https://github.com/jemalloc/jemalloc.git

238
Cargo.lock generated

@ -116,7 +116,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7"
dependencies = [ dependencies = [
"addr2line", "addr2line",
"cc", "cc",
"cfg-if", "cfg-if 1.0.0",
"libc", "libc",
"miniz_oxide", "miniz_oxide",
"object", "object",
@ -129,6 +129,25 @@ version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bindgen"
version = "0.60.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
dependencies = [
"bitflags",
"cexpr",
"clang-sys",
"lazy_static",
"lazycell",
"peeking_take_while",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
]
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "1.3.2" version = "1.3.2"
@ -205,6 +224,17 @@ version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "bzip2-sys"
version = "0.1.11+1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc"
dependencies = [
"cc",
"libc",
"pkg-config",
]
[[package]] [[package]]
name = "casey" name = "casey"
version = "0.3.3" version = "0.3.3"
@ -219,6 +249,24 @@ name = "cc"
version = "1.0.73" version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
dependencies = [
"jobserver",
]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]]
name = "cfg-if"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
@ -269,6 +317,17 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e"
[[package]]
name = "clang-sys"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]] [[package]]
name = "clap" name = "clap"
version = "3.2.22" version = "3.2.22"
@ -363,6 +422,7 @@ dependencies = [
"smallvec", "smallvec",
"smartstring", "smartstring",
"thiserror", "thiserror",
"tikv-jemallocator-global",
"unicode-normalization", "unicode-normalization",
"uuid", "uuid",
] ]
@ -373,6 +433,7 @@ version = "0.1.0"
dependencies = [ dependencies = [
"cxx", "cxx",
"cxx-build", "cxx-build",
"librocksdb-sys",
"miette", "miette",
] ]
@ -391,7 +452,7 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
] ]
[[package]] [[package]]
@ -400,7 +461,7 @@ version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"crossbeam-utils", "crossbeam-utils",
] ]
@ -410,7 +471,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"crossbeam-epoch", "crossbeam-epoch",
"crossbeam-utils", "crossbeam-utils",
] ]
@ -422,7 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if", "cfg-if 1.0.0",
"crossbeam-utils", "crossbeam-utils",
"memoffset", "memoffset",
"scopeguard", "scopeguard",
@ -434,7 +495,7 @@ version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
] ]
[[package]] [[package]]
@ -567,7 +628,7 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"libc", "libc",
"redox_syscall", "redox_syscall",
"windows-sys", "windows-sys",
@ -582,6 +643,12 @@ dependencies = [
"percent-encoding", "percent-encoding",
] ]
[[package]]
name = "fs_extra"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.6" version = "0.14.6"
@ -598,7 +665,7 @@ version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"libc", "libc",
"wasi 0.11.0+wasi-snapshot-preview1", "wasi 0.11.0+wasi-snapshot-preview1",
] ]
@ -609,6 +676,12 @@ version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d"
[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "gzip-header" name = "gzip-header"
version = "1.0.0" version = "1.0.0"
@ -710,7 +783,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
] ]
[[package]] [[package]]
@ -740,6 +813,15 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"
[[package]]
name = "jobserver"
version = "0.1.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b"
dependencies = [
"libc",
]
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.60" version = "0.3.60"
@ -755,12 +837,55 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "lazycell"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.135" version = "0.2.135"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c"
[[package]]
name = "libloading"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
dependencies = [
"cfg-if 1.0.0",
"winapi",
]
[[package]]
name = "librocksdb-sys"
version = "0.8.0+7.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d"
dependencies = [
"bindgen",
"bzip2-sys",
"cc",
"glob",
"libc",
"libz-sys",
"tikv-jemalloc-sys",
"zstd-sys",
]
[[package]]
name = "libz-sys"
version = "1.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf"
dependencies = [
"cc",
"pkg-config",
"vcpkg",
]
[[package]] [[package]]
name = "link-cplusplus" name = "link-cplusplus"
version = "1.0.7" version = "1.0.7"
@ -776,7 +901,7 @@ version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
] ]
[[package]] [[package]]
@ -850,6 +975,12 @@ dependencies = [
"unicase", "unicase",
] ]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.5.4" version = "0.5.4"
@ -917,6 +1048,16 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "nom"
version = "7.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]] [[package]]
name = "num-complex" name = "num-complex"
version = "0.4.2" version = "0.4.2"
@ -1026,6 +1167,12 @@ version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1"
[[package]]
name = "peeking_take_while"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.2.0" version = "2.2.0"
@ -1115,6 +1262,12 @@ dependencies = [
"uncased", "uncased",
] ]
[[package]]
name = "pkg-config"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.16" version = "0.2.16"
@ -1358,6 +1511,12 @@ version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
[[package]]
name = "rustc-hash"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]] [[package]]
name = "rustls" name = "rustls"
version = "0.20.6" version = "0.20.6"
@ -1456,11 +1615,17 @@ version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"cpufeatures", "cpufeatures",
"digest", "digest",
] ]
[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]] [[package]]
name = "simba" name = "simba"
version = "0.7.2" version = "0.7.2"
@ -1570,7 +1735,7 @@ version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"fastrand", "fastrand",
"libc", "libc",
"redox_syscall", "redox_syscall",
@ -1637,6 +1802,37 @@ dependencies = [
"num_cpus", "num_cpus",
] ]
[[package]]
name = "tikv-jemalloc-sys"
version = "0.5.2+5.3.0-patched"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3"
dependencies = [
"cc",
"fs_extra",
"libc",
]
[[package]]
name = "tikv-jemallocator"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979"
dependencies = [
"libc",
"tikv-jemalloc-sys",
]
[[package]]
name = "tikv-jemallocator-global"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28047b535f87b21a79b0b450c5aed8235b32a5aaf8dcc6706b638c1eadea11f"
dependencies = [
"cfg-if 0.1.10",
"tikv-jemallocator",
]
[[package]] [[package]]
name = "time" name = "time"
version = "0.1.44" version = "0.1.44"
@ -1789,6 +1985,12 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.4" version = "0.9.4"
@ -1813,7 +2015,7 @@ version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [ dependencies = [
"cfg-if", "cfg-if 1.0.0",
"wasm-bindgen-macro", "wasm-bindgen-macro",
] ]
@ -1973,3 +2175,13 @@ name = "windows_x86_64_msvc"
version = "0.36.1" version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
[[package]]
name = "zstd-sys"
version = "2.0.1+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b"
dependencies = [
"cc",
"libc",
]

@ -43,6 +43,7 @@ unicode-normalization = "0.1.21"
thiserror = "1.0.34" thiserror = "1.0.34"
uuid = { version = "1.1.2", features = ["v1", "v4", "serde"] } uuid = { version = "1.1.2", features = ["v1", "v4", "serde"] }
csv = "1.1.6" csv = "1.1.6"
tikv-jemallocator-global = "0.5.0"
cozorocks = { path = "cozorocks" } cozorocks = { path = "cozorocks" }
clap = { version = "3.2.8", features = ["derive"] } clap = { version = "3.2.8", features = ["derive"] }

@ -9,6 +9,7 @@ license = "AGPL-3.0-or-later"
[dependencies] [dependencies]
cxx = "1.0.69" cxx = "1.0.69"
miette = "5.3.0" miette = "5.3.0"
librocksdb-sys = { version = "=0.8.0", features = ["static", "jemalloc", "lz4", "zstd", "rtti"] }
[build-dependencies] [build-dependencies]
cxx-build = "1.0.69" cxx-build = "1.0.69"

@ -6,7 +6,7 @@ fn main() {
let mut builder = cxx_build::bridge("src/bridge/mod.rs"); let mut builder = cxx_build::bridge("src/bridge/mod.rs");
builder builder
.files(["bridge/status.cpp", "bridge/db.cpp", "bridge/tx.cpp"]) .files(["bridge/status.cpp", "bridge/db.cpp", "bridge/tx.cpp"])
.include("deps/rocksdb/include") .include("rocksdb/include")
.include("bridge"); .include("bridge");
if target.contains("msvc") { if target.contains("msvc") {
builder.flag_if_supported("-std:c++17"); builder.flag_if_supported("-std:c++17");
@ -14,31 +14,9 @@ fn main() {
builder.flag_if_supported("-std=c++17"); builder.flag_if_supported("-std=c++17");
}; };
builder.compile("cozorocks"); builder.compile("cozorocks");
println!("cargo:rustc-link-lib=static=rocksdb");
let manifest_dir = var("CARGO_MANIFEST_DIR").unwrap(); println!("cargo:rustc-link-lib=static=zstd");
println!("cargo:rustc-link-lib=static=lz4");
if target.contains("msvc") {
println!("cargo:rustc-link-search={}/deps/zstd/build/VS2010/bin/x64_Release", manifest_dir);
println!("cargo:rustc-link-search={}/deps/lz4/build/VS2017/bin/x64_Release", manifest_dir);
println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/Release", manifest_dir);
println!("cargo:rustc-link-search={}/deps/gflags/cmake_build/lib/Release", manifest_dir);
println!("cargo:rustc-link-lib=static=rocksdb");
println!("cargo:rustc-link-lib=static=gflags_static");
println!("cargo:rustc-link-lib=libzstd");
println!("cargo:rustc-link-lib=static=liblz4_static");
println!("cargo:rustc-link-lib=rpcrt4");
println!("cargo:rustc-link-lib=shlwapi");
} else {
println!("cargo:rustc-link-search={}/deps/rocksdb/cmake_build/", manifest_dir);
println!("cargo:rustc-link-search={}/deps/zstd/lib/", manifest_dir);
println!("cargo:rustc-link-search={}/deps/lz4/lib/", manifest_dir);
println!("cargo:rustc-link-search={}/deps/jemalloc/lib/", manifest_dir);
println!("cargo:rustc-link-lib=static=zstd");
println!("cargo:rustc-link-lib=static=rocksdb");
println!("cargo:rustc-link-lib=static=lz4");
println!("cargo:rustc-link-lib=static=jemalloc");
}
println!("cargo:rerun-if-changed=src/bridge/mod.rs"); println!("cargo:rerun-if-changed=src/bridge/mod.rs");
println!("cargo:rerun-if-changed=bridge/bridge.h"); println!("cargo:rerun-if-changed=bridge/bridge.h");

@ -1,10 +0,0 @@
# Building on Windows
* Refer to https://github.com/facebook/rocksdb/wiki/Building-on-Windows, with the following changes.
* Build zlib using cmake instead of whatever was in the above instruction
* Copy `zconf.h` to the base directory after building
* Edit `thirdparty.inc` appropriately
* `set THIRDPARTY_HOME=C:\Users\zh217\cozo\cozorocks\deps`
* `cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 -DGFLAGS=1 -DLZ4=1 -DZSTD=1 -DUSE_RTTI=1 ..`
* `msbuild rocksdb.sln /m /p:Configuration=Release`
* Need to copy some dll files so that they could be found

@ -1,71 +0,0 @@
#!/usr/bin/env bash
set -e
#if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# export CC=/usr/bin/clang-12
# export CPP=/usr/bin/clang-cpp-12
# export CXX=/usr/bin/clang++-12
# export LD=/usr/bin/ld.lld-12
# if [ ! -f ${CC} ]; then echo "${CC} not found"; exit; fi
# if [ ! -f ${CPP} ]; then echo "${CPP} not found"; exit; fi
# if [ ! -f ${CXX} ]; then echo "${CXX} not found"; exit; fi
# if [ ! -f ${LD} ]; then echo "${LD} not found"; exit; fi
#fi
N_CORES=$(getconf _NPROCESSORS_ONLN)
export CFLAGS=-fPIE
export CXXFLAGS=-fPIE
# gflags
cd gflags
rm -fr cmake_build
mkdir cmake_build && cd cmake_build
cmake ..
make -j $N_CORES
cd ../..
# lz4
cd lz4
make clean
make -j $N_CORES
cd ..
# zstd
cd zstd
make clean
make -j $N_CORES
cd ..
# jemalloc
cd jemalloc
./autogen.sh --disable-debug --with-jemalloc-prefix=''
make -j $N_CORES
cd ..
# rocksdb
cd rocksdb
rm -fr cmake_build
mkdir cmake_build && cd cmake_build
# cp ../../thirdparty.inc ../thirdparty.inc
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MODULE_PATH="${PWD}/../../lz4;${PWD}/../../zstd" \
-DROCKSDB_BUILD_SHARED=0 \
-DGFLAGS_INCLUDE_DIR=${PWD}/../../gflags/cmake_build/include \
-DGFLAGS_LIBRARIES=${PWD}/../../gflags/cmake_build/lib \
-Dlz4_INCLUDE_DIRS=${PWD}/../../lz4/lib \
-Dlz4_LIBRARIES=${PWD}/../../lz4/lib \
-Dzstd_INCLUDE_DIRS=${PWD}/../../zstd/lib \
-Dzstd_LIBRARIES=${PWD}/../../zstd/lib \
-DJeMalloc_INCLUDE_DIRS=${PWD}/../../jemalloc/include \
-DJeMalloc_LIBRARIES=${PWD}/../../jemalloc/lib \
-DFAIL_ON_WARNINGS=0 \
-DCMAKE_CXX_STANDARD=20 -DWITH_GFLAGS=1 -DWITH_LZ4=1 -DWITH_ZSTD=1 -DUSE_RTTI=1 -DWITH_TESTS=0 \
-DWITH_JEMALLOC=1 -DWITH_BENCHMARK_TOOLS=0 -DWITH_CORE_TOOLS=0 -DWITH_TOOLS=0 -DWITH_TRACE_TOOLS=0 ..
make -j $N_CORES
cd ..

@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
cd gflags
rm -fr cmake_build
cd ..
cd lz4
make clean
cd ..
cd zstd
make clean
cd ..
cd jemalloc
make clean
rm -f 'configure~'
cd ..
cd rocksdb
rm -fr cmake_build
cd ..

@ -1 +0,0 @@
Subproject commit a738fdf9338412f83ab3f26f31ac11ed3f3ec4bd

@ -1 +0,0 @@
Subproject commit 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c

@ -1 +0,0 @@
Subproject commit 5ff839680134437dbf4678f3d0c7b371d84f4964

@ -1 +0,0 @@
Subproject commit 59495ff26a410eab30dab4f76b76ec5ba4ad293b

@ -1,268 +0,0 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
# Edit definitions below to specify paths to include files and libraries of all 3rd party libraries
# TODO: Make this work with find_package and/or get rid of it
#
# This example assumes all the libraries locate in directories under THIRDPARTY_HOME environment variable
# Set environment variable THIRDPARTY_HOME to point to your third party libraries home (Unix style dir separators)
# or change the paths below to reflect where the libraries actually reside
#
set (THIRDPARTY_LIBS "") # Initialization, don't touch
#
# Defaults
#
set(GFLAGS_HOME $ENV{THIRDPARTY_HOME}/gflags/cmake_build)
set(GFLAGS_INCLUDE ${GFLAGS_HOME}/include)
set(GFLAGS_LIB_DEBUG ${GFLAGS_HOME}/lib/Release/gflags_static.lib)
set(GFLAGS_LIB_RELEASE ${GFLAGS_HOME}/lib/Release/gflags_static.lib)
# ================================================== GFLAGS ==================================================
# For compatibility
if (GFLAGS)
set(WITH_GFLAGS ON)
endif ()
if (WITH_GFLAGS)
message(STATUS "GFLAGS library is enabled")
if(DEFINED ENV{GFLAGS_INCLUDE})
set(GFLAGS_INCLUDE $ENV{GFLAGS_INCLUDE})
endif()
if(DEFINED ENV{GFLAGS_LIB_DEBUG})
set(GFLAGS_LIB_DEBUG $ENV{GFLAGS_LIB_DEBUG})
endif()
if(DEFINED ENV{GFLAGS_LIB_RELEASE})
set(GFLAGS_LIB_RELEASE $ENV{GFLAGS_LIB_RELEASE})
endif()
set(GFLAGS_CXX_FLAGS -DGFLAGS=gflags)
set(GFLAGS_LIBS debug ${GFLAGS_LIB_DEBUG} optimized ${GFLAGS_LIB_RELEASE})
add_definitions(${GFLAGS_CXX_FLAGS})
include_directories(${GFLAGS_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${GFLAGS_LIBS})
else ()
message(STATUS "GFLAGS library is disabled")
endif ()
# ================================================== SNAPPY ==================================================
#
# Edit these 4 lines to define paths to Snappy
#
set(SNAPPY_HOME $ENV{THIRDPARTY_HOME}/Snappy.Library)
set(SNAPPY_INCLUDE ${SNAPPY_HOME}/build/native/inc/inc)
set(SNAPPY_LIB_DEBUG ${SNAPPY_HOME}/lib/native/debug/amd64/snappy.lib)
set(SNAPPY_LIB_RELEASE ${SNAPPY_HOME}/lib/native/retail/amd64/snappy.lib)
# For compatibility
if(SNAPPY)
set(WITH_SNAPPY ON)
endif ()
if (WITH_SNAPPY)
message(STATUS "SNAPPY library is enabled")
if(DEFINED ENV{SNAPPY_INCLUDE})
set(SNAPPY_INCLUDE $ENV{SNAPPY_INCLUDE})
endif()
if(DEFINED ENV{SNAPPY_LIB_DEBUG})
set(SNAPPY_LIB_DEBUG $ENV{SNAPPY_LIB_DEBUG})
endif()
if(DEFINED ENV{SNAPPY_LIB_RELEASE})
set(SNAPPY_LIB_RELEASE $ENV{SNAPPY_LIB_RELEASE})
endif()
set(SNAPPY_CXX_FLAGS -DSNAPPY)
set(SNAPPY_LIBS debug ${SNAPPY_LIB_DEBUG} optimized ${SNAPPY_LIB_RELEASE})
add_definitions(${SNAPPY_CXX_FLAGS})
include_directories(${SNAPPY_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${SNAPPY_LIBS})
else ()
message(STATUS "SNAPPY library is disabled")
endif ()
# ================================================== LZ4 ==================================================
#
# Edit these 4 lines to define paths to LZ4
#
set(LZ4_HOME $ENV{THIRDPARTY_HOME}/lz4)
set(LZ4_INCLUDE ${LZ4_HOME}/lib)
set(LZ4_LIB_DEBUG ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib)
set(LZ4_LIB_RELEASE ${LZ4_HOME}/build/VS2017/bin/x64_Release/liblz4.lib)
# For compatibility
if (LZ4)
set(WITH_LZ4 ON)
endif ()
if (WITH_LZ4)
message(STATUS "LZ4 library is enabled")
if(DEFINED ENV{LZ4_INCLUDE})
set(LZ4_INCLUDE $ENV{LZ4_INCLUDE})
endif()
if(DEFINED ENV{LZ4_LIB_DEBUG})
set(LZ4_LIB_DEBUG $ENV{LZ4_LIB_DEBUG})
endif()
if(DEFINED ENV{LZ4_LIB_RELEASE})
set(LZ4_LIB_RELEASE $ENV{LZ4_LIB_RELEASE})
endif()
set(LZ4_CXX_FLAGS -DLZ4)
set(LZ4_LIBS debug ${LZ4_LIB_DEBUG} optimized ${LZ4_LIB_RELEASE})
add_definitions(${LZ4_CXX_FLAGS})
include_directories(${LZ4_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${LZ4_LIBS})
else ()
message(STATUS "LZ4 library is disabled")
endif ()
# ================================================== ZLIB ==================================================
#
# Edit these 4 lines to define paths to ZLIB
#
set(ZLIB_HOME $ENV{THIRDPARTY_HOME}/ZLIB.Library)
set(ZLIB_INCLUDE ${ZLIB_HOME}/build/native/inc/inc)
set(ZLIB_LIB_DEBUG ${ZLIB_HOME}/lib/native/debug/amd64/zlib.lib)
set(ZLIB_LIB_RELEASE ${ZLIB_HOME}/lib/native/retail/amd64/zlib.lib)
# For compatibilty
if (ZLIB)
set(WITH_ZLIB ON)
endif ()
if (WITH_ZLIB)
message(STATUS "ZLIB library is enabled")
if(DEFINED ENV{ZLIB_INCLUDE})
set(ZLIB_INCLUDE $ENV{ZLIB_INCLUDE})
endif()
if(DEFINED ENV{ZLIB_LIB_DEBUG})
set(ZLIB_LIB_DEBUG $ENV{ZLIB_LIB_DEBUG})
endif()
if(DEFINED ENV{ZLIB_LIB_RELEASE})
set(ZLIB_LIB_RELEASE $ENV{ZLIB_LIB_RELEASE})
endif()
set(ZLIB_CXX_FLAGS -DZLIB)
set(ZLIB_LIBS debug ${ZLIB_LIB_DEBUG} optimized ${ZLIB_LIB_RELEASE})
add_definitions(${ZLIB_CXX_FLAGS})
include_directories(${ZLIB_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZLIB_LIBS})
else ()
message(STATUS "ZLIB library is disabled")
endif ()
# ================================================== XPRESS ==================================================
# This makes use of built-in Windows API, no additional includes, links to a system lib
# For compatibilty
if (XPRESS)
set(WITH_XPRESS ON)
endif ()
if (WITH_XPRESS)
message(STATUS "XPRESS is enabled")
add_definitions(-DXPRESS)
# We are using the implementation provided by the system
set (SYSTEM_LIBS ${SYSTEM_LIBS} Cabinet.lib)
else ()
message(STATUS "XPRESS is disabled")
endif ()
# ================================================== ZSTD ==================================================
#
# Edit these 4 lines to define paths to ZSTD
#
set(ZSTD_HOME $ENV{THIRDPARTY_HOME}/zstd)
set(ZSTD_INCLUDE ${ZSTD_HOME}/lib)
set(ZSTD_LIB_DEBUG ${ZSTD_HOME}/build/VS2010/bin/x64_Release/libzstd.lib)
set(ZSTD_LIB_RELEASE ${ZSTD_HOME}//build/VS2010/bin/x64_Release/libzstd.lib)
# For compatibility
if (ZSTD)
set(WITH_ZSTD ON)
endif ()
if (WITH_ZSTD)
message(STATUS "ZSTD library is enabled")
if(DEFINED ENV{ZSTD_INCLUDE})
set(ZSTD_INCLUDE $ENV{ZSTD_INCLUDE})
endif()
if(DEFINED ENV{ZSTD_LIB_DEBUG})
set(ZSTD_LIB_DEBUG $ENV{ZSTD_LIB_DEBUG})
endif()
if(DEFINED ENV{ZSTD_LIB_RELEASE})
set(ZSTD_LIB_RELEASE $ENV{ZSTD_LIB_RELEASE})
endif()
# ZSTD_STATIC_LINKING_ONLY only allows us to create an allocation functions override
# When jemalloc is in use
set(ZSTD_LIBS debug ${ZSTD_LIB_DEBUG} optimized ${ZSTD_LIB_RELEASE})
add_definitions(-DZSTD -DZSTD_STATIC_LINKING_ONLY)
include_directories(${ZSTD_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${ZSTD_LIBS})
else ()
message(STATUS "ZSTD library is disabled")
endif ()
#
# Edit these 4 lines to define paths to Jemalloc
#
set(JEMALLOC_HOME $ENV{THIRDPARTY_HOME}/Jemalloc.Library)
set(JEMALLOC_INCLUDE ${JEMALLOC_HOME}/build/native/inc)
set(JEMALLOC_LIB_DEBUG ${JEMALLOC_HOME}/lib/native/debug/amd64/jemalloc.lib)
set(JEMALLOC_LIB_RELEASE ${JEMALLOC_HOME}/lib/native/retail/amd64/jemalloc.lib)
# ================================================== JEMALLOC ==================================================
if(JEMALLOC)
set(WITH_JEMALLOC ON)
endif()
if (WITH_JEMALLOC)
message(STATUS "JEMALLOC library is enabled")
set(JEMALLOC_CXX_FLAGS "-DROCKSDB_JEMALLOC -DJEMALLOC_EXPORT= -DJEMALLOC_NO_RENAME")
if(DEFINED ENV{JEMALLOC_INCLUDE})
set(JEMALLOC_INCLUDE $ENV{JEMALLOC_INCLUDE})
endif()
if(DEFINED ENV{JEMALLOC_LIB_DEBUG})
set(JEMALLOC_LIB_DEBUG $ENV{JEMALLOC_LIB_DEBUG})
endif()
if(DEFINED ENV{JEMALLOC_LIB_RELEASE})
set(JEMALLOC_LIB_RELEASE $ENV{JEMALLOC_LIB_RELEASE})
endif()
set(JEMALLOC_LIBS debug ${JEMALLOC_LIB_DEBUG} optimized ${JEMALLOC_LIB_RELEASE})
add_definitions(${JEMALLOC_CXX_FLAGS})
include_directories(${JEMALLOC_INCLUDE})
set (THIRDPARTY_LIBS ${THIRDPARTY_LIBS} ${JEMALLOC_LIBS})
set (ARTIFACT_SUFFIX "_je")
else ()
set (ARTIFACT_SUFFIX "")
message(STATUS "JEMALLOC library is disabled")
endif ()

@ -1 +0,0 @@
Subproject commit e47e674cd09583ff0503f0f6defd6d23d8b718d3
Loading…
Cancel
Save