Fix DuckDB integration failure during out-of-source builds

未关闭 适合新手
#142 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 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:

  1. 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/).
  2. 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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

alibaba/AliSQL 的其他 Issue

查看 alibaba/AliSQL 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。