From fe8941654aa0dd21e5ee13baaae8659db28ca84c Mon Sep 17 00:00:00 2001 From: Lazar Date: Fri, 11 Oct 2024 15:38:39 +0200 Subject: [PATCH 1/3] wip: amd static not working --- .goreleaser.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index d7d2e50..7c35d6e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,18 +8,26 @@ builds: binary: vigilante hooks: pre: - - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/libwasmvm_muslc.x86_64.a + - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.x86_64.a goos: - linux goarch: - amd64 env: - GO111MODULE=on + - CGO_ENABLED=1 + - CC=x86_64-linux-gnu-gcc + ldflags: + - -w -s + - -linkmode=external + - -extldflags '-Wl,-z,muldefs -static' flags: - -mod=readonly - -trimpath tags: - netgo + - ledger + - muslc - osusergo - id: vigilante-darwin-arm64 From 423da4983a77cad10ee40761bcf021c1f53d15f1 Mon Sep 17 00:00:00 2001 From: Lazar Date: Fri, 11 Oct 2024 17:49:32 +0200 Subject: [PATCH 2/3] progress but struggle --- .goreleaser.yml | 58 +++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 7c35d6e..fdc8a9d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,6 +8,11 @@ builds: binary: vigilante hooks: pre: + - apt update && apt install -y wget libc6-dev libc6-dev-static musl-tools + - find /usr -name 'libm.a' + - find /usr -name 'libmvec.a' + - mv /usr/x86_64-linux-gnu/lib/libm.a /usr/x86_64-linux-gnu/libm-2.31.a + - mv /usr/x86_64-linux-gnu/lib/libmvec.a /usr/lib/x86_64-linux-gnu/libmvec.a - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.x86_64.a goos: - linux @@ -20,7 +25,7 @@ builds: ldflags: - -w -s - -linkmode=external - - -extldflags '-Wl,-z,muldefs -static' + - -extldflags '-Wl,-z,muldefs -static -lpthread -lm' flags: - -mod=readonly - -trimpath @@ -30,31 +35,32 @@ builds: - muslc - osusergo - - id: vigilante-darwin-arm64 - main: ./cmd/vigilante/main.go - binary: vigilante - hooks: - pre: - - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a - goos: - - darwin - goarch: - - arm64 - env: - - GO111MODULE=on - - CGO_ENABLED=1 - - CC=oa64-clang - - CGO_LDFLAGS=-L/lib -Wl,-rpath,/lib - ldflags: - - -w -s - - -linkmode=external - flags: - - -mod=readonly - - -trimpath - tags: - - netgo - - ledger - - static_wasm +# todo uncomment +# - id: vigilante-darwin-arm64 +# main: ./cmd/vigilante/main.go +# binary: vigilante +# hooks: +# pre: +# - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvmstatic_darwin.a -O /lib/libwasmvmstatic_darwin.a +# goos: +# - darwin +# goarch: +# - arm64 +# env: +# - GO111MODULE=on +# - CGO_ENABLED=1 +# - CC=oa64-clang +# - CGO_LDFLAGS=-L/lib -Wl,-rpath,/lib +# ldflags: +# - -w -s +# - -linkmode=external +# flags: +# - -mod=readonly +# - -trimpath +# tags: +# - netgo +# - ledger +# - static_wasm archives: - id: zipped From c814db08c45387e77e3d0efbf9ca38cc79e84056 Mon Sep 17 00:00:00 2001 From: Lazar Date: Sat, 12 Oct 2024 22:21:53 +0200 Subject: [PATCH 3/3] todo see if it works on debian? --- .goreleaser.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index fdc8a9d..5ddca64 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,11 +8,6 @@ builds: binary: vigilante hooks: pre: - - apt update && apt install -y wget libc6-dev libc6-dev-static musl-tools - - find /usr -name 'libm.a' - - find /usr -name 'libmvec.a' - - mv /usr/x86_64-linux-gnu/lib/libm.a /usr/x86_64-linux-gnu/libm-2.31.a - - mv /usr/x86_64-linux-gnu/lib/libmvec.a /usr/lib/x86_64-linux-gnu/libmvec.a - wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /usr/lib/x86_64-linux-gnu/libwasmvm_muslc.x86_64.a goos: - linux @@ -25,7 +20,7 @@ builds: ldflags: - -w -s - -linkmode=external - - -extldflags '-Wl,-z,muldefs -static -lpthread -lm' + - -extldflags '-Wl,-z,muldefs -static -lm' flags: - -mod=readonly - -trimpath