Fix DuckDB integration failure during out-of-source builds

オープン 初心者向け
#142 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
cmake, cpp
領域
build-system

調査の方向性

MYSQL_USE_BUNDLED_DUCKDB を定義している CMake ファイルを見つけ、BUILD_COMMAND および DUCKDB_SOURCE_DIR/BINARY_DIR 変数と併せて MY_DUCKDB_LIB を調べます。指定された cmake コマンドと make コマンドを使用して out-of-source の Debug ビルドで再現し、その後、libduckdb_bundle.a が見つからないエラーなしで mysqld のリンクが正常に成功することを確認します。

索引モデルが 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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alibaba/AliSQL のほかの issue

alibaba/AliSQL の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。