From 75d5ce792d26df539b8c37945635c6ae5fde10c8 Mon Sep 17 00:00:00 2001 From: colinlyguo Date: Mon, 13 May 2024 18:19:54 +0800 Subject: [PATCH] remove Dockerfile --- Makefile | 6 ------ README.md | 3 ++- run_test.sh | 9 +++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index fc798d5..6eb5c69 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,5 @@ fmt: goimports -w . gofumpt -l -w . -build: - docker build -t my-dev-container --platform linux/amd64 . - -run: build - docker run -it --rm -v "$(PWD):/workspace" -w /workspace my-dev-container - test: ./run_test.sh diff --git a/README.md b/README.md index cbd7d54..c21dcac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ ## Running unit tests ``` -make run +docker pull scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 --platform linux/amd64 +docker run -it --rm -v "$(PWD):/workspace" -w /workspace scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 cd libzstd make libzstd cd .. diff --git a/run_test.sh b/run_test.sh index 15ef84b..99f3a6f 100755 --- a/run_test.sh +++ b/run_test.sh @@ -2,12 +2,13 @@ # Compile 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 mkdir -p /scroll/lib/ +sudo cp -f $(pwd)/libzstd/target/release/libscroll_zstd.so /scroll/lib/ +find $(pwd)/libzstd/target/release -name 'libzktrie.so' | xargs -I{} sudo cp -f {} /scroll/lib/ # Set the environment variable -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd) -export CGO_LDFLAGS="-L$(pwd) -Wl,-rpath=$(pwd)" +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/scroll/lib +export CGO_LDFLAGS="-L/scroll/lib/ -Wl,-rpath=/scroll/lib/" # Run module tests go test -v -race -gcflags="-l" -ldflags="-s=false" -coverprofile=coverage.txt -covermode=atomic ./...