diff --git a/Makefile b/Makefile index ac05fcd..6c9242a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,11 @@ export PROFILE=release co:compile compile: ./rebar3 compile - +redis_api: + ## debug + cargo build -p redis_api + ## release + cargo build -p redis_api --release es:escriptize escriptize: clean ./rebar3 escriptize diff --git a/README.md b/README.md index fed9b5d..da9842a 100644 --- a/README.md +++ b/README.md @@ -356,6 +356,8 @@ dtrace: system integrity protection is on, some features will not be available dtrace: description 'profile-997 ' matched 1 probe ``` #### Start redis-server +First of all build redis_api `make redis_api` then output library to `target/debug/libredis_api.dylib` or +`target/release/libredis_api.dylib`. The below command to load redis module ```shell $ redis-server --loadmodule target/debug/libredis_api.dylib 42527:C 11 Jan 2022 17:24:07.942 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo diff --git a/crates/build_crates.sh b/crates/build_crates.sh index 3decc8c..0284135 100755 --- a/crates/build_crates.sh +++ b/crates/build_crates.sh @@ -5,6 +5,7 @@ touch crates/big_data/build.rs build(){ mkdir -p ./priv cargo build --manifest-path=crates/big_data/Cargo.toml --release + cargo build --manifest-path=crates/big_data/redis_api/Cargo.toml --release sh -c "cp $(cat crates/big_data/libpath) ./priv/libbig_data.so " } test(){ @@ -17,6 +18,7 @@ clippy(){ clean(){ rm -rf crates/big_data/libpath cargo clean --manifest-path=crates/big_data/Cargo.toml + cargo clean --manifest-path=crates/big_data/redis_api/Cargo.toml } help(){ echo "sh build_crates.sh :"