From 4f9c1bd92eeba6ff50450cca294adcf9054b1f6e Mon Sep 17 00:00:00 2001 From: "peng.li24" <734991033@qq.com> Date: Sat, 12 Sep 2026 18:52:16 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20=E5=A2=9E=E5=8A=A0=20macOS=20?= =?UTF-8?q?=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit macos-latest 上 cargo build --release + cargo test;测试所需 redis 用 brew 安装后 daemonize 启动(macOS runner 无 service container)。 Co-Authored-By: Claude Code --- .github/workflows/ci-macos.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/ci-macos.yml diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml new file mode 100644 index 0000000..4a7062b --- /dev/null +++ b/.github/workflows/ci-macos.yml @@ -0,0 +1,16 @@ +name: ci-macos +on: [push, pull_request] +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: 构建 + run: cargo build --release + - name: 测试(macOS runner 无 service container,用 brew 起 redis) + run: | + brew install redis + redis-server --daemonize yes + for i in $(seq 1 30); do redis-cli ping >/dev/null 2>&1 && break; sleep 1; done + redis-cli ping + cargo test From c5e0fd4af79ebb757cfb793cb3801af6fdc03c89 Mon Sep 17 00:00:00 2001 From: "peng.li24" <734991033@qq.com> Date: Sat, 12 Sep 2026 18:57:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?build:=20macOS=20=E8=B7=B3=E8=BF=87=20-sona?= =?UTF-8?q?me=EF=BC=88ld64=20=E6=97=A0=E6=AD=A4=E9=80=89=E9=A1=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cargo:rustc-cdylib-link-arg=-Wl,-soname,... 是 GNU ld 选项,macOS 报 "ld: unknown options: -soname"。macOS 用默认 install_name(@rpath)即可。 Co-Authored-By: Claude Code --- build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index c62b97c..9601736 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,7 @@ // 给 cdylib 设 SONAME:libkvspace_durable.so.1,供 kvspace dispatch 前端按名 dlopen。 +// macOS 的 ld64 无 -soname 选项(对应 -install_name,默认 @rpath 已可用),跳过。 fn main() { - println!("cargo:rustc-cdylib-link-arg=-Wl,-soname,libkvspace_durable.so.1"); + if !cfg!(target_os = "macos") { + println!("cargo:rustc-cdylib-link-arg=-Wl,-soname,libkvspace_durable.so.1"); + } }