Skip to content

Commit

Permalink
Add how to build redis_api module
Browse files Browse the repository at this point in the history
  • Loading branch information
yangcancai committed Apr 8, 2022
1 parent 760f3f8 commit df10776
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions crates/build_crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -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 <command> :"
Expand Down

0 comments on commit df10776

Please sign in to comment.