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 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"); + } }