frontend: 后端装载名/目录平台感知(macOS 修复 connect 恒 NULL) - #18
Merged
Merged
Conversation
macOS 上 kvspaceConnect 必然返回 NULL: - backend_soname 硬编码 libkvspace-c.so.1 / libkvspace_durable.so.1, 而 macOS 产物是 .dylib - backend_path 默认目录硬编码 /usr/lib/kvspace,而 macOS 装 /usr/local/lib/kvspace(/usr 受 SIP 保护) 改为按 __APPLE__ 分支取 .dylib 与 /usr/local/lib/kvspace; KVSPACE_BACKEND_PATH 覆盖能力保留。Linux 行为不变(本地实测 shm:// 与 fs:// 两条 DSN 均 connect 成功)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
macOS CI 原来只构建本仓(无后端),测不出 frontend 的 dlopen 平台差异。
补:源码构建 blockmalloc / slotsboxmalloc / kvspace-c 装 /usr/local,
再实际 kvspaceConnect("shm://…") 断言非 NULL。
Co-Authored-By: Claude Code <noreply@anthropic.com>
libkvspace 装在 /usr/local/lib/kvspace,测试程序自身加载它失败 (@rpath/libkvspace.1.dylib)。fallback 路径补上该目录;后端依赖的 libblockmalloc 仍走 /usr/local/lib。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
macOS 上 所有 DSN 的
kvspaceConnect都返回 NULL:backend_soname()硬编码libkvspace-c.so.1/libkvspace_durable.so.1,而 macOS 上 CMake 产出的是.dylib(版本号在中间:libkvspace-c.1.dylib)backend_path()默认目录硬编码/usr/lib/kvspace,而 macOS 只能装/usr/local/lib/kvspace(/usr受 SIP 保护)两者叠加 →
dlopen必然失败 → 前端直接return NULL。修法
按
__APPLE__分支取平台名与平台目录:KVSPACE_BACKEND_PATH覆盖能力保留;Linux 行为不变(本地实测shm://与fs://两条 DSN 均 connect 成功)。🤖 Generated with Claude Code