Skip to content

Commit

Permalink
remove libzstd/rs_zstd.h and fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
colinlyguo committed May 7, 2024
1 parent 90c40f2 commit eced2d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions encoding/codecv2/codecv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package codecv2

/*
#cgo LDFLAGS: -lm -ldl -lscroll_zstd
#include <stdlib.h>
#include "../../libzstd/rs_zstd.h"
#include <stdint.h>
char* compress_scroll_batch_bytes(uint8_t* src, uint64_t src_size, uint8_t* output_buf, uint64_t *output_buf_size);
*/
import "C"

Expand Down
4 changes: 0 additions & 4 deletions libzstd/rs_zstd.h

This file was deleted.

12 changes: 5 additions & 7 deletions run_test.sh
Original file line number Diff line number Diff line change
@@ -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 ./...

0 comments on commit eced2d8

Please sign in to comment.