From 5f888b89bc3949931a00768fe085d49c0fb38ee7 Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:59:40 +1100 Subject: [PATCH 1/2] update for updated rpath - @rpath removed libs/ so we no longer need to specify the root path as the cwd - now macos and linux use the same flags - remove comments --- Makefile | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 791e00a..850c2ca 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,8 @@ LIBS_DIR := $(abspath ./libs) # Flags for CGO to find the headers and the shared library UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Darwin) - CGO_CFLAGS := -I$(LIBS_DIR) - CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,@executable_path -else - CGO_CFLAGS := -I$(LIBS_DIR) - CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) -endif +CGO_CFLAGS := -I$(LIBS_DIR) +CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) ifeq ($(OS),Windows_NT) BIN_NAME := example.exe @@ -30,10 +25,6 @@ fetch: curl -fSL --create-dirs -o $(LIBS_DIR)/codex-${OS}-${ARCH}.zip ${DOWNLOAD_URL} unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR) rm -f $(LIBS_DIR)/*.zip -# Update the path to the shared library on macOS -# ifeq ($(UNAME_S),Darwin) -# install_name_tool -id @rpath/libcodex.dylib $(LIBS_DIR)/libcodex.dylib -# endif build: CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go From bcfb27822b6fe0b400e54138b935e025d4e8e40d Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 16 Oct 2025 07:54:59 +0200 Subject: [PATCH 2/2] Update Go binding version --- Makefile | 6 +----- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 850c2ca..c68a37a 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ endif # Configuration for fetching the right binary OS ?= "linux" ARCH ?= "amd64" -VERSION ?= "v0.0.20" +VERSION ?= "v0.0.21" DOWNLOAD_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip" all: run @@ -32,10 +32,6 @@ build: run: ifeq ($(OS),Windows_NT) pwsh -File $(CURDIR)/.github/scripts/run-windows.ps1 -BinaryName $(BIN_NAME) -else ifeq ($(UNAME_S),Darwin) -# Instead of relying on install_name_tool, we can define DYLD_LIBRARY_PATH -# DYLD_LIBRARY_PATH=$(LIBS_DIR) ./$(BIN_NAME) - ./$(BIN_NAME) else ./$(BIN_NAME) endif diff --git a/go.mod b/go.mod index b09b2d8..f9af808 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module example go 1.25.1 -require github.com/codex-storage/codex-go-bindings v0.0.20 +require github.com/codex-storage/codex-go-bindings v0.0.21 diff --git a/go.sum b/go.sum index 4029950..006782d 100644 --- a/go.sum +++ b/go.sum @@ -20,3 +20,5 @@ github.com/codex-storage/codex-go-bindings v0.0.19 h1:zhEhwzcavvYdfkHpB5BH+PaqYv github.com/codex-storage/codex-go-bindings v0.0.19/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg= github.com/codex-storage/codex-go-bindings v0.0.20 h1:vK9jU8vafSJkMpOEHdPiQ9S8owSGUaPGVUxb7hKaIck= github.com/codex-storage/codex-go-bindings v0.0.20/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg= +github.com/codex-storage/codex-go-bindings v0.0.21 h1:DAwXw2Xq7wyKyI5j3Jk8ZYBruFP9dOpqEeVMOyEsJxA= +github.com/codex-storage/codex-go-bindings v0.0.21/go.mod h1:8yC11Vr1Mu5sqZyQ33GaSCr0uUIbQnGkm0aWqZj62Kg=