From eced2d82f320f0e3459a1c815db169afff650c4c Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Tue, 7 May 2024 21:35:10 +0800 Subject: [PATCH] remove libzstd/rs_zstd.h and fix CI --- Dockerfile | 2 +- encoding/codecv2/codecv2.go | 4 ++-- libzstd/rs_zstd.h | 4 ---- run_test.sh | 12 +++++------- 4 files changed, 8 insertions(+), 14 deletions(-) delete mode 100644 libzstd/rs_zstd.h diff --git a/Dockerfile b/Dockerfile index fa4c924..8d9e484 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,4 +36,4 @@ RUN wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz RUN tar -C /usr/local -xzf go${GO_VERSION}.linux-amd64.tar.gz RUN rm go${GO_VERSION}.linux-amd64.tar.gz ENV PATH="/usr/local/go/bin:${PATH}" -ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ +ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib diff --git a/encoding/codecv2/codecv2.go b/encoding/codecv2/codecv2.go index e2f3cda..1add55c 100644 --- a/encoding/codecv2/codecv2.go +++ b/encoding/codecv2/codecv2.go @@ -2,8 +2,8 @@ package codecv2 /* #cgo LDFLAGS: -lm -ldl -lscroll_zstd -#include -#include "../../libzstd/rs_zstd.h" +#include +char* compress_scroll_batch_bytes(uint8_t* src, uint64_t src_size, uint8_t* output_buf, uint64_t *output_buf_size); */ import "C" diff --git a/libzstd/rs_zstd.h b/libzstd/rs_zstd.h deleted file mode 100644 index bdadb5e..0000000 --- a/libzstd/rs_zstd.h +++ /dev/null @@ -1,4 +0,0 @@ -#include - -char* compress_scroll_batch_bytes(uint8_t* src, uint64_t src_size, - uint8_t* output_buf, uint64_t *output_buf_size); diff --git a/run_test.sh b/run_test.sh index 903231b..30b6b7d 100755 --- a/run_test.sh +++ b/run_test.sh @@ -1,15 +1,13 @@ #!/bin/bash -# Save the root directory of the project -ROOT_DIR=$(pwd) - # Compile libzstd -cd $ROOT_DIR/libzstd -make libzstd +cd libzstd && cargo build --release && cd .. +sudo cp -f $(pwd)/libzstd/target/release/libscroll_zstd.so $(pwd)/ +find $(pwd)/libzstd/target/release | grep libzktrie.so | xargs -I{} cp -f {} $(pwd)/ +sudo cp -f libscroll_zstd.so libzktrie.so /usr/local/lib # Set the environment variable -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/ +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib # Run module tests -cd $ROOT_DIR env GO111MODULE=on go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./...