Fix DuckDB integration failure during out-of-source builds
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- cmake, cpp
- Domain
- build-system
Research direction
Find the CMake file defining MYSQL_USE_BUNDLED_DUCKDB and inspect MY_DUCKDB_LIB alongside the BUILD_COMMAND and DUCKDB_SOURCE_DIR/BINARY_DIR variables. Reproduce with an out-of-source Debug build using the stated cmake and make commands, then verify that mysqld links successfully without the missing libduckdb_bundle.a error.
Written by the indexing model from the issue text.
Description
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}.
- Dominant language
- C++
- Stars
- 6k
- Forks
- 902
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from alibaba/AliSQL
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
infiniflow/infinity#3502 ·