From 0ab532f25325f75e4eba3d5389c4f29ce4eb4988 Mon Sep 17 00:00:00 2001 From: Kirill Date: Mon, 21 Oct 2024 15:45:15 +0400 Subject: [PATCH] Pass required libbz2 to linker to fix compilation error on macOS (#2228) --- .dockerignore | 3 +++ .github/workflows/juno-test.yml | 2 +- Dockerfile | 2 +- vm/vm.go | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..2f579965df --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +# do not copy local database files +p2p-dbs/ +juno/ \ No newline at end of file diff --git a/.github/workflows/juno-test.yml b/.github/workflows/juno-test.yml index 125b2047f0..beb885d78e 100644 --- a/.github/workflows/juno-test.yml +++ b/.github/workflows/juno-test.yml @@ -40,7 +40,7 @@ jobs: - name: Install Jemalloc (Linux) if: runner.os == 'Linux' - run: sudo apt-get update -qq && sudo apt-get install -y libjemalloc-dev libjemalloc2 -y + run: sudo apt-get update -qq && sudo apt-get install -y libjemalloc-dev libjemalloc2 libbz2-dev - name: Install dependencies (macOS) if: runner.os == 'macOS' diff --git a/Dockerfile b/Dockerfile index 30b0c4b551..cb6e537a46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ ARG VM_DEBUG RUN apt-get -qq update && \ - apt-get -qq install curl build-essential git golang upx-ucl libjemalloc-dev libjemalloc2 -y + apt-get -qq install curl build-essential git golang upx-ucl libjemalloc-dev libjemalloc2 libbz2-dev RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -q -y WORKDIR /app diff --git a/vm/vm.go b/vm/vm.go index dd3b29fc66..f4754f635f 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -39,8 +39,8 @@ extern void cairoVMExecute(char* txns_json, char* classes_json, char* paid_fees_ extern char* setVersionedConstants(char* json); extern void freeString(char* str); -#cgo vm_debug LDFLAGS: -L./rust/target/debug -ljuno_starknet_rs -#cgo !vm_debug LDFLAGS: -L./rust/target/release -ljuno_starknet_rs +#cgo vm_debug LDFLAGS: -L./rust/target/debug -ljuno_starknet_rs -lbz2 +#cgo !vm_debug LDFLAGS: -L./rust/target/release -ljuno_starknet_rs -lbz2 */ import "C"