Simplify recipes

next
Sayan Nandan 3 years ago
parent b1123a6de9
commit e9369a40ef
No known key found for this signature in database
GPG Key ID: 8BC07A0A4D41DD52

203
Cargo.lock generated

@ -31,6 +31,17 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "async-trait"
version = "0.1.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "atty" name = "atty"
version = "0.2.14" version = "0.2.14"
@ -44,9 +55,22 @@ dependencies = [
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.0.1" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bb8"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e9f4fa9768efd269499d8fba693260cfc670891cf6de3adc935588447a77cc8"
dependencies = [
"async-trait",
"futures-channel",
"futures-util",
"parking_lot 0.11.2",
"tokio",
]
[[package]] [[package]]
name = "bincode" name = "bincode"
@ -150,9 +174,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.9.6" version = "0.9.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"crossbeam-utils", "crossbeam-utils",
@ -163,9 +187,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.6" version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"lazy_static", "lazy_static",
@ -311,28 +335,39 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
[[package]]
name = "futures-channel"
version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010"
dependencies = [
"futures-core",
]
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.19" version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3"
[[package]] [[package]]
name = "futures-task" name = "futures-task"
version = "0.3.19" version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a"
[[package]] [[package]]
name = "futures-util" name = "futures-util"
version = "0.3.19" version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a"
dependencies = [ dependencies = [
"futures-channel",
"futures-core", "futures-core",
"futures-task", "futures-task",
"pin-project-lite", "pin-project-lite",
"pin-utils", "pin-utils",
"slab",
] ]
[[package]] [[package]]
@ -423,20 +458,20 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.116" version = "0.2.117"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "565dbd88872dbe4cc8a46e527f26483c1d1f7afa6b884a3bd6cd893d4f98da74" checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c"
[[package]] [[package]]
name = "libsky" name = "libsky"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"termcolor", "termcolor",
] ]
[[package]] [[package]]
name = "libstress" name = "libstress"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"crossbeam-channel", "crossbeam-channel",
"log", "log",
@ -530,9 +565,9 @@ dependencies = [
[[package]] [[package]]
name = "ntapi" name = "ntapi"
version = "0.3.6" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f"
dependencies = [ dependencies = [
"winapi", "winapi",
] ]
@ -627,7 +662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58"
dependencies = [ dependencies = [
"lock_api", "lock_api",
"parking_lot_core 0.9.0", "parking_lot_core 0.9.1",
] ]
[[package]] [[package]]
@ -646,15 +681,15 @@ dependencies = [
[[package]] [[package]]
name = "parking_lot_core" name = "parking_lot_core"
version = "0.9.0" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2f4f894f3865f6c0e02810fc597300f34dc2510f66400da262d8ae10e75767d" checksum = "28141e0cc4143da2443301914478dc976a61ffdb3f043058310c70df2fed8954"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
"redox_syscall", "redox_syscall",
"smallvec", "smallvec",
"windows-sys 0.29.0", "windows-sys 0.32.0",
] ]
[[package]] [[package]]
@ -699,6 +734,17 @@ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "r2d2"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "545c5bc2b880973c9c10e4067418407a0ccaa3091781d1671d46eb35107cb26f"
dependencies = [
"log",
"parking_lot 0.11.2",
"scheduled-thread-pool",
]
[[package]] [[package]]
name = "radix_trie" name = "radix_trie"
version = "0.2.1" version = "0.2.1"
@ -854,6 +900,15 @@ 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 = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
[[package]]
name = "scheduled-thread-pool"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc6f74fd1204073fa02d5d5d68bec8021be4c38690b61264b2fdb48083d0e7d7"
dependencies = [
"parking_lot 0.11.2",
]
[[package]] [[package]]
name = "scopeguard" name = "scopeguard"
version = "1.1.0" version = "1.1.0"
@ -923,7 +978,7 @@ dependencies = [
[[package]] [[package]]
name = "sky-bench" name = "sky-bench"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"clap", "clap",
"devtimer", "devtimer",
@ -931,23 +986,23 @@ dependencies = [
"rand", "rand",
"serde", "serde",
"serde_json", "serde_json",
"skytable 0.6.2 (git+https://github.com/skytable/client-rust?branch=next)", "skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
] ]
[[package]] [[package]]
name = "sky-migrate" name = "sky-migrate"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"bincode", "bincode",
"clap", "clap",
"env_logger", "env_logger",
"log", "log",
"skytable 0.6.2 (git+https://github.com/skytable/client-rust.git)", "skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust.git)",
] ]
[[package]] [[package]]
name = "sky_macros" name = "sky_macros"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -957,7 +1012,7 @@ dependencies = [
[[package]] [[package]]
name = "skyd" name = "skyd"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"ahash", "ahash",
"bincode", "bincode",
@ -979,7 +1034,7 @@ dependencies = [
"regex", "regex",
"serde", "serde",
"sky_macros", "sky_macros",
"skytable 0.6.2 (git+https://github.com/skytable/client-rust?branch=next)", "skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"tokio", "tokio",
"tokio-openssl", "tokio-openssl",
"toml", "toml",
@ -988,31 +1043,43 @@ dependencies = [
[[package]] [[package]]
name = "skysh" name = "skysh"
version = "0.7.2" version = "0.7.3-alpha.1"
dependencies = [ dependencies = [
"clap", "clap",
"crossterm", "crossterm",
"libsky", "libsky",
"rustyline", "rustyline",
"skytable 0.6.2 (git+https://github.com/skytable/client-rust?branch=next)", "skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"tokio", "tokio",
] ]
[[package]] [[package]]
name = "skytable" name = "skytable"
version = "0.6.2" version = "0.7.0-alpha.4"
source = "git+https://github.com/skytable/client-rust?branch=next#b471f5098e29c6ac7311820ade0b5bb706689e77" source = "git+https://github.com/skytable/client-rust?branch=next#07c5e9e0c05d7859f016067f3691d2e05655306d"
dependencies = [ dependencies = [
"async-trait",
"bb8",
"bytes", "bytes",
"openssl", "openssl",
"r2d2",
"tokio", "tokio",
"tokio-openssl", "tokio-openssl",
] ]
[[package]] [[package]]
name = "skytable" name = "skytable"
version = "0.6.2" version = "0.7.0-alpha.4"
source = "git+https://github.com/skytable/client-rust.git#b471f5098e29c6ac7311820ade0b5bb706689e77" source = "git+https://github.com/skytable/client-rust.git#07c5e9e0c05d7859f016067f3691d2e05655306d"
dependencies = [
"r2d2",
]
[[package]]
name = "slab"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
[[package]] [[package]]
name = "smallvec" name = "smallvec"
@ -1037,7 +1104,7 @@ dependencies = [
"log", "log",
"num_cpus", "num_cpus",
"rand", "rand",
"skytable 0.6.2 (git+https://github.com/skytable/client-rust?branch=next)", "skytable 0.7.0-alpha.4 (git+https://github.com/skytable/client-rust?branch=next)",
"sysinfo", "sysinfo",
] ]
@ -1060,9 +1127,9 @@ dependencies = [
[[package]] [[package]]
name = "sysinfo" name = "sysinfo"
version = "0.23.0" version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e757000a4bed2b1be9be65a3f418b9696adf30bb419214c73997422de73a591" checksum = "6bb29fc86b56b6d432ecdbbff2e5726aeaa69bf1bb48ddd994432b60d8bccd01"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"core-foundation-sys", "core-foundation-sys",
@ -1155,9 +1222,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-segmentation" name = "unicode-segmentation"
version = "1.8.0" version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99"
[[package]] [[package]]
name = "unicode-width" name = "unicode-width"
@ -1232,19 +1299,6 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceb069ac8b2117d36924190469735767f0990833935ab430155e71a44bafe148"
dependencies = [
"windows_aarch64_msvc 0.29.0",
"windows_i686_gnu 0.29.0",
"windows_i686_msvc 0.29.0",
"windows_x86_64_gnu 0.29.0",
"windows_x86_64_msvc 0.29.0",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.30.0" version = "0.30.0"
@ -1259,10 +1313,17 @@ dependencies = [
] ]
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows-sys"
version = "0.29.0" version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d027175d00b01e0cbeb97d6ab6ebe03b12330a35786cbaca5252b1c4bf5d9b" checksum = "3df6e476185f92a12c072be4a189a0210dcdcf512a1891d6dff9edb874deadc6"
dependencies = [
"windows_aarch64_msvc 0.32.0",
"windows_i686_gnu 0.32.0",
"windows_i686_msvc 0.32.0",
"windows_x86_64_gnu 0.32.0",
"windows_x86_64_msvc 0.32.0",
]
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
@ -1271,10 +1332,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca" checksum = "29277a4435d642f775f63c7d1faeb927adba532886ce0287bd985bffb16b6bca"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_aarch64_msvc"
version = "0.29.0" version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8793f59f7b8e8b01eda1a652b2697d87b93097198ae85f823b969ca5b89bba58" checksum = "d8e92753b1c443191654ec532f14c199742964a061be25d77d7a96f09db20bf5"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
@ -1283,10 +1344,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8" checksum = "1145e1989da93956c68d1864f32fb97c8f561a8f89a5125f6a2b7ea75524e4b8"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_gnu"
version = "0.29.0" version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8602f6c418b67024be2996c512f5f995de3ba417f4c75af68401ab8756796ae4" checksum = "6a711c68811799e017b6038e0922cb27a5e2f43a2ddb609fe0b6f3eeda9de615"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
@ -1295,10 +1356,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6" checksum = "d4a09e3a0d4753b73019db171c1339cd4362c8c44baf1bcea336235e955954a6"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_i686_msvc"
version = "0.29.0" version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f3d615f419543e0bd7d2b3323af0d86ff19cbc4f816e6453f36a2c2ce889c354" checksum = "146c11bb1a02615db74680b32a68e2d61f553cc24c4eb5b4ca10311740e44172"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
@ -1307,10 +1368,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a" checksum = "8ca64fcb0220d58db4c119e050e7af03c69e6f4f415ef69ec1773d9aab422d5a"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_gnu"
version = "0.29.0" version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11d95421d9ed3672c280884da53201a5c46b7b2765ca6faf34b0d71cf34a3561" checksum = "c912b12f7454c6620635bbff3450962753834be2a594819bd5e945af18ec64bc"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
@ -1318,6 +1379,12 @@ version = "0.30.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1" checksum = "08cabc9f0066848fef4bc6a1c1668e6efce38b661d2aeec75d18d8617eebb5f1"
[[package]]
name = "windows_x86_64_msvc"
version = "0.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "504a2476202769977a040c6364301a3f65d0cc9e3fb08600b2bda150a0488316"
[[package]] [[package]]
name = "yaml-rust" name = "yaml-rust"
version = "0.3.5" version = "0.3.5"

@ -1,168 +1,142 @@
# set ROOT_DIR as our test suite uses it
export ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) export ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
ADDITIONAL_SOFTWARE= # no additional software note
# (DEF) Either prepare --target triple-x-y OR have an empty value NO_ADDITIONAL_SOFTWARE := echo "No additional software required for this target"
TARGET_ARG = # target argument
TARGET_ARG :=
# target folder path
TARGET_FOLDER := target/
# additional software installation
ADDITIONAL_SOFTWARE :=
# update variables depending on target
ifneq ($(origin TARGET),undefined) ifneq ($(origin TARGET),undefined)
TARGET_ARG +=--target ${TARGET}
ifeq ($(TARGET),x86_64-unknown-linux-musl) ifeq ($(TARGET),x86_64-unknown-linux-musl)
# we need musl-tools for 64-bit musl targets # for MUSL builds, we need to install musl-tools
ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install musl-tools -y ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install musl-tools -y
endif else ifeq ($(TARGET),i686-unknown-linux-gnu)
ifeq ($(TARGET),i686-unknown-linux-gnu) # for 32-bit we need multilib
# we need gcc-multilib on 32-bit linux targets
ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install gcc-multilib -y ADDITIONAL_SOFTWARE += sudo apt-get update && sudo apt install gcc-multilib -y
else
ADDITIONAL_SOFTWARE += ${NO_ADDITIONAL_SOFTWARE}
endif endif
TARGET_ARG += --target ${TARGET}
TARGET_FOLDER := $(addsuffix ${TARGET}/,${TARGET_FOLDER})
else
ADDITIONAL_SOFTWARE += ${NO_ADDITIONAL_SOFTWARE}
endif endif
# (DEF) display a message if no additional packages are required for this target TARGET_FOLDER := $(addsuffix release/,${TARGET_FOLDER})
ifeq ($(ADDITIONAL_SOFTWARE),) # cargo build
ADDITIONAL_SOFTWARE += echo "info: No additional software required for this target" CBUILD := cargo build $(TARGET_ARG)
endif # cargo test
CTEST := cargo test $(TARGET_ARG)
BUILD_VERBOSE = cargo build --verbose $(TARGET_ARG)
# (DEF) Create empty commands # binary file paths
STOP_SERVER = BINARY_SKYSH := $(TARGET_FOLDER)skysh
BUILD_COMMAND = BINARY_SKYD := $(TARGET_FOLDER)skyd
BUILD_SERVER_COMMAND = BINARY_SKYBENCH := $(TARGET_FOLDER)sky-bench
TEST_COMMAND = BINARY_SKYMIGRATE := $(TARGET_FOLDER)sky-migrate
RELEASE_COMMAND = # archive command
START_COMMAND = ARCHIVE :=
# start background server command
START_SERVER := cargo run $(TARGET_ARG) -p skyd -- --noart --sslchain cert.pem --sslkey key.pem
STOP_SERVER :=
# (DEF) Add cmd /c for windows due to OpenSSL issues or just add cargo run for non-windows
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
# export windows specifc rustflags # on windows, so we need exe
ARCHIVE += 7z a ourbundle.zip $(BINARY_SKYSH).exe $(BINARY_SKYD).exe $(BINARY_SKYBENCH).exe $(BINARY_SKYMIGRATE).exe
# also add RUSTFLAGS
export RUSTFLAGS = -Ctarget-feature=+crt-static export RUSTFLAGS = -Ctarget-feature=+crt-static
# add command to use cmd because OpenSSL can't build on Windows bash # now add start command
BUILD_COMMAND += cmd /C set RUSTFLAGS = -Ctarget-feature=+crt-static START_SERVER := cmd /C START /B $(START_SERVER)
# same thing here # windows is funky with OpenSSL, so add these
BUILD_SERVER_COMMAND += cmd /C CBUILD := cmd /C $(CBUILD)
TEST_COMMAND += cmd /C CTEST := cmd /C $(CTEST)
STOP_SERVER += taskkill.exe /F /IM skyd.exe # finally add stop command
RELEASE_COMMAND += cmd /C STOP_SERVER := taskkill.exe /F /IM skyd.exe
START_COMMAND += cmd /C START /B
else else
STOP_SERVER += pkill skyd # not windows, so archive is easy
# make sure to set executable permissions ARCHIVE += zip -j ourbundle.zip $(BINARY_SKYSH) $(BINARY_SKYD) $(BINARY_SKYBENCH) $(BINARY_SKYMIGRATE)
# now add start command
START_SERVER := $(START_SERVER) &
# add stop command
STOP_SERVER := pkill skyd
endif endif
# (DEF) Assemble the commands # update the archive command if we have a version and artifact name
BUILD_SERVER_COMMAND += $(BUILD_VERBOSE) RENAME_ARTIFACT :=
BUILD_SERVER_COMMAND += -p skyd ifneq ($(origin ARTIFACT),undefined)
RELEASE_SERVER_COMMAND = # so we have an artifact name
RELEASE_SERVER_COMMAND += $(BUILD_SERVER_COMMAND) ifneq ($(origin VERSION),undefined)
RELEASE_SERVER_COMMAND += --release # we also have the version name
RELEASE_COMMAND += cargo build --release $(TARGET_ARG) RENAME_ARTIFACT := sky-bundle-${VERSION}-${ARTIFACT}.zip
BUILD_COMMAND += $(BUILD_VERBOSE)
TEST_COMMAND += cargo test $(TARGET_ARG)
START_COMMAND += cargo run $(TARGET_ARG) -p skyd
START_COMMAND_RELEASE =
START_COMMAND_RELEASE += ${START_COMMAND}
START_COMMAND_RELEASE += --release
START_COMMAND += -- --noart --nosave
START_COMMAND += --sslchain cert.pem --sslkey key.pem
START_COMMAND_RELEASE += -- --noart --nosave
ifneq ($(OS),Windows_NT)
START_COMMAND += &
START_COMMAND_RELEASE += &
endif
# (DEF) Prepare release bundle commands
BUNDLE=
ifeq ($(origin TARGET),undefined)
# no target defined. but check for windows
ifeq ($(OS),Windows_NT)
# windows, so we need exe
BUNDLE += cd target/release &&
BUNDLE += 7z a ../../../bundle.zip skysh.exe skyd.exe sky-bench.exe sky-migrate.exe
else else
# not windows, so no exe # no version name
BUNDLE+=zip -j bundle.zip target/release/skysh target/release/skyd target/release/sky-bench target/release/sky-migrate RENAME_ARTIFACT := sky-bundle-${ARTIFACT}.zip
endif endif
else else
# target was defined, but check for windows # no artifact (hack)
ifeq ($(OS),Windows_NT) RENAME_ARTIFACT := bundle.zip
# windows, so we need exe
BUNDLE += cd target/${TARGET}/release &&
BUNDLE+=7z a ../../../sky-bundle-${VERSION}-${ARTIFACT}.zip skysh.exe skyd.exe sky-bench.exe sky-migrate.exe
else
# not windows, so no exe
ifneq ($(origin CARGO_TARGET_DIR),undefined)
# target defined and target dir. use this instead of target/
BUNDLE+=zip -j sky-bundle-${VERSION}-${ARTIFACT}.zip ${CARGO_TARGET_DIR}/${TARGET}/release/skysh ${CARGO_TARGET_DIR}/${TARGET}/release/skyd ${CARGO_TARGET_DIR}/${TARGET}/release/sky-bench ${CARGO_TARGET_DIR}/${TARGET}/release/sky-migrate
else
# just the plain old target/${TARGET} path
BUNDLE+=zip -j sky-bundle-${VERSION}-${ARTIFACT}.zip target/${TARGET}/release/skysh target/${TARGET}/release/skyd target/${TARGET}/release/sky-bench target/${TARGET}/release/sky-migrate
endif
endif
endif endif
RENAME_ARTIFACT := $(addprefix mv ourbundle.zip ,${RENAME_ARTIFACT})
# cargo build (debug)
DEBUG := $(CBUILD)
# cargo test
TEST := $(CTEST)
# cargo build (release)
RELEASE := $(CBUILD) --release
# cargo build (release) for skyd,skysh,sky-migrate and sky-bench
RELEASE_BUNDLE := $(RELEASE) -p skyd -p sky-bench -p skysh -p sky-migrate
SEP=echo "============================================================"
.pre: .pre:
@echo "====================================================================" @${SEP}
@echo "Installing any additional dependencies" @echo "Installing additional dependencies ..."
@echo "====================================================================" @${ADDITIONAL_SOFTWARE}
@$(ADDITIONAL_SOFTWARE) @${SEP}
deb: release
@echo "===================================================================="
@echo "Building Debian package (optimized)"
@echo "===================================================================="
@cargo $(TARGET_ARG) install cargo-deb
@cargo deb $(TARGET_ARG) --manifest-path=server/Cargo.toml --output .
build: .pre build: .pre
@echo "====================================================================" @${SEP}
@echo "Building all binaries in debug mode (unoptimized)" @echo "Building all binaries (debug) ..."
@echo "====================================================================" @${DEBUG}
@$(BUILD_COMMAND) @${SEP}
.build-server: .pre
@echo "===================================================================="
@echo "Building server binary in debug mode (unoptimized)"
@echo "===================================================================="
@$(BUILD_SERVER_COMMAND)
release: .pre release: .pre
@echo "====================================================================" @${SEP}
@echo "Building all binaries in release mode (optimized)" @echo "Building all binaries (release) ..."
@echo "====================================================================" @${RELEASE}
cargo build --release --verbose $(TARGET_ARG) @${SEP}
.release-server: release-bundle: .pre
@echo "====================================================================" @${SEP}
@echo "Building server binary in release mode (optimized)" @echo "Building binaries for packaging (release) ..."
@echo "====================================================================" @${RELEASE_BUNDLE}
@$(RELEASE_SERVER_COMMAND) @${SEP}
test: .build-server bundle: release-bundle
@echo "====================================================================" @${SEP}
@echo "Starting database server in background" @echo "Building and packaging bundle (release) ..."
@echo "====================================================================" @${ARCHIVE}
@chmod +x ci/ssl.sh && bash ci/ssl.sh @-${RENAME_ARTIFACT}
@${START_COMMAND} @${SEP}
# sleep for 5s to let the server start up test: .pre
@sleep 5 @${SEP}
@echo "====================================================================" @echo "Building and starting server in debug mode ..."
@echo "Running all tests" @${CBUILD} -p skyd
@echo "===================================================================="
cargo test $(TARGET_ARG)
@$(STOP_SERVER)
@sleep 2
@rm -f .sky_pid cert.pem key.pem
stress: .release-server
@echo "===================================================================="
@echo "Starting database server in background"
@echo "===================================================================="
@chmod +x ci/ssl.sh && bash ci/ssl.sh @chmod +x ci/ssl.sh && bash ci/ssl.sh
@${START_COMMAND_RELEASE} @${START_SERVER}
# sleep for 5s to let the server start up @echo "Sleeping for 10 seconds to let the server start up ..."
@sleep 5 @sleep 10
cargo run $(TARGET_ARG) --release -p stress-test @echo "Finished sleeping"
@echo "====================================================================" @${SEP}
@echo "Stress testing (all)" @${SEP}
@echo "====================================================================" @echo "Running all tests ..."
@$(STOP_SERVER) @${TEST}
@echo "Waiting for server to shut down ..."
@${STOP_SERVER}
@echo "Removing temporary files ..."
@rm -f .sky_pid cert.pem key.pem @rm -f .sky_pid cert.pem key.pem
bundle: release @${SEP}
@echo "===================================================================="
@echo "Creating bundle for platform"
@echo "===================================================================="
@$(BUNDLE)
clean: clean:
@echo "====================================================================" @${SEP}
@echo "Cleaning up target folder" @echo "Cleaning up target folder ..."
@echo "===================================================================="
cargo clean cargo clean
@${SEP}

@ -10,7 +10,7 @@ edition = "2021"
# internal deps # internal deps
libsky = { path = "../libsky" } libsky = { path = "../libsky" }
skytable = { git = "https://github.com/skytable/client-rust", branch = "next", features = [ skytable = { git = "https://github.com/skytable/client-rust", branch = "next", features = [
"async", "aio",
"aio-sslv", "aio-sslv",
], default-features = false } ], default-features = false }
# external deps # external deps

@ -42,7 +42,7 @@ cc = "1.0.72"
# internal deps # internal deps
libstress = { path = "../libstress" } libstress = { path = "../libstress" }
skytable = { git = "https://github.com/skytable/client-rust", features = [ skytable = { git = "https://github.com/skytable/client-rust", features = [
"async", "aio",
"aio-ssl", "aio-ssl",
], default-features = false, branch = "next" } ], default-features = false, branch = "next" }
# external deps # external deps

@ -9,7 +9,9 @@ version = "0.7.3-alpha.1"
[dependencies] [dependencies]
# internal deps # internal deps
libstress = { path = "../libstress" } libstress = { path = "../libstress" }
skytable = { git = "https://github.com/skytable/client-rust", branch = "next" } skytable = { git = "https://github.com/skytable/client-rust", branch = "next", features = [
"dbg",
] }
# external deps # external deps
clap = { version = "2", features = ["yaml"] } clap = { version = "2", features = ["yaml"] }
devtimer = "4.0.1" devtimer = "4.0.1"

Loading…
Cancel
Save