Fix DuckDB integration failure during out-of-source builds
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- cmake, cpp
- 领域
- build-system
调研方向
找到定义 MYSQL_USE_BUNDLED_DUCKDB 的 CMake 文件,并检查 MY_DUCKDB_LIB 以及 BUILD_COMMAND 和 DUCKDB_SOURCE_DIR/BINARY_DIR 变量。使用所述的 cmake 和 make 命令,通过 out-of-source Debug 构建重现该问题,然后验证 mysqld 是否能够成功链接,且不会出现缺少 libduckdb_bundle.a 的错误。
由索引模型根据 Issue 内容生成。
描述
When performing an out-of-source build (e.g., building in a /build directory), the AliSQL compilation fails because it cannot find libduckdb_bundle.a.
The root cause is a discrepancy between the DuckDB build location and the path defined in CMake:
- The BUILD_COMMAND in MYSQL_USE_BUNDLED_DUCKDB uses make -C "${DUCKDB_SOURCE_DIR}", which forces DuckDB to be built inside the source tree (extra/duckdb/build/).
- However, the MY_DUCKDB_LIB variable is defined using ${CMAKE_BINARY_DIR}, which points to the build directory.
This results in the following error during the linking stage of mysqld:
make[2]: *** No rule to make target 'extra/duckdb/build/debug/libduckdb_bundle.a', needed by 'runtime_output_directory/mysqld'. Stop.
Steps to Reproduce:
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug [other_args]
make
Suggested Fix:
In the CMake file defining MYSQL_USE_BUNDLED_DUCKDB, the MY_DUCKDB_LIB path should be updated to point to the actual output location in the source directory to ensure consistency with the make -C command.
replace
SET(MY_DUCKDB_LIB "${BINARY_DIR}/${DUCKDB_BUILD_DIR}/libduckdb_bundle.a")
to
SET(MY_DUCKDB_LIB "${DUCKDB_SOURCE_DIR}/build/${DUCKDB_BUILD_DIR}/libduckdb_bundle.a")`
Alternatively, the BUILD_COMMAND should be refactored to perform a proper out-of-source build within ${BINARY_DIR}.
- 主要语言
- C++
- 星标
- 6k
- 派生
- 902
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
alibaba/AliSQL 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
难度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
AXERA-TECH/ax-llm#77 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
games-on-whales/wolf#509 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
bug-unconfirmed
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 74/100
NVIDIA/cuda-samples#453 ·