diff --git a/.github/workflows/goreleaser-build-publish-develop.yml b/.github/workflows/goreleaser-build-publish-develop.yml index 2d9cb1a9cb6..f0145e351ba 100644 --- a/.github/workflows/goreleaser-build-publish-develop.yml +++ b/.github/workflows/goreleaser-build-publish-develop.yml @@ -35,7 +35,7 @@ jobs: goreleaser-exec: ./tools/bin/goreleaser_wrapper goreleaser-config: .goreleaser.develop.yaml goreleaser-key: ${{ secrets.GORELEASER_KEY }} - zig-version: 0.8.1 + zig-version: 0.11.0 - name: Collect Metrics if: always() id: collect-gha-metrics diff --git a/.goreleaser.develop.yaml b/.goreleaser.develop.yaml index 28d0d14f0f9..60949eee72e 100644 --- a/.goreleaser.develop.yaml +++ b/.goreleaser.develop.yaml @@ -63,6 +63,7 @@ dockers: goarch: amd64 extra_files: - tmp/linux_amd64/libs + - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/amd64" - "--pull" @@ -85,6 +86,7 @@ dockers: goarch: arm64 extra_files: - tmp/linux_arm64/libs + - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/arm64" - "--pull" @@ -107,6 +109,7 @@ dockers: goarch: amd64 extra_files: - tmp/linux_amd64/libs + - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/amd64" - "--pull" @@ -130,6 +133,7 @@ dockers: goarch: arm64 extra_files: - tmp/linux_arm64/libs + - tools/bin/ldd_fix build_flag_templates: - "--platform=linux/arm64" - "--pull" diff --git a/.tool-versions b/.tool-versions index d8230564de3..2ec4cde8ad1 100644 --- a/.tool-versions +++ b/.tool-versions @@ -3,6 +3,5 @@ mockery 2.38.0 nodejs 16.16.0 postgres 13.3 helm 3.10.3 -# zig 0.12.0-dev.2619+5cf138e51 -zig 0.10.1 +zig 0.11.0 golangci-lint 1.55.2 diff --git a/core/chainlink.Dockerfile b/core/chainlink.Dockerfile index f992ee76166..c3b2b20c446 100644 --- a/core/chainlink.Dockerfile +++ b/core/chainlink.Dockerfile @@ -38,7 +38,7 @@ FROM ubuntu:20.04 ARG CHAINLINK_USER=root ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl +RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl patchelf # Install Postgres for CLI tools, needed specifically for DB backups RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ diff --git a/core/chainlink.devspace.Dockerfile b/core/chainlink.devspace.Dockerfile index c639190a80f..c3b9fad6b28 100644 --- a/core/chainlink.devspace.Dockerfile +++ b/core/chainlink.devspace.Dockerfile @@ -38,7 +38,7 @@ FROM golang:1.21-bullseye ARG CHAINLINK_USER=chainlink ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl +RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl patchelf # Install Postgres for CLI tools, needed specifically for DB backups RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ diff --git a/core/chainlink.goreleaser.Dockerfile b/core/chainlink.goreleaser.Dockerfile index 9e208b1907b..364b7c81765 100644 --- a/core/chainlink.goreleaser.Dockerfile +++ b/core/chainlink.goreleaser.Dockerfile @@ -6,7 +6,7 @@ FROM ubuntu:20.04 ARG CHAINLINK_USER=root ARG TARGETARCH ENV DEBIAN_FRONTEND noninteractive -RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl +RUN apt-get update && apt-get install -y ca-certificates gnupg lsb-release curl patchelf # Install Postgres for CLI tools, needed specifically for DB backups RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ @@ -18,6 +18,9 @@ RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \ COPY ./chainlink /usr/local/bin/ # Copy native libs if cgo is enabled COPY ./tmp/linux_${TARGETARCH}/libs /usr/local/bin/libs +COPY ./tools/bin/ldd_fix /usr/local/bin/ldd_fix +RUN chmod +x /usr/local/bin/ldd_fix +RUN /usr/local/bin/ldd_fix RUN if [ ${CHAINLINK_USER} != root ]; then \ useradd --uid 14933 --create-home ${CHAINLINK_USER}; \ diff --git a/tools/bin/ldd_fix b/tools/bin/ldd_fix new file mode 100755 index 00000000000..59e159997a1 --- /dev/null +++ b/tools/bin/ldd_fix @@ -0,0 +1,24 @@ +#!/bin/bash + +chainlink_path="/usr/local/bin/chainlink" +libs_path="/usr/local/bin/libs" + +line=$(ldd ${chainlink_path} | grep "github.com/!cosm!wasm/wasmvm") + +if [ -z "$line" ]; then + echo "Error: Path containing 'github.com/!cosm!wasm/wasmvm' not found in the ldd output." + exit 1 +fi + +path=$(echo "$line" | awk '{print $1}') + +if [ -z "$path" ]; then + echo "Error: Failed to extract the path from the line." + exit 1 +fi + +trimmed_path=${path%.so*}.so +cosm_file=$(ls ${libs_path} | grep "\.so$" | head -n 1) + +patchelf --remove-needed "${trimmed_path}" "$chainlink_path" +patchelf --add-needed "$cosm_file" "$chainlink_path"