duckdb icon indicating copy to clipboard operation
duckdb copied to clipboard

Building static library for Conan produces a version stub instead of the corresponding DuckDB version

Open abba-kovner opened this issue 2 years ago • 3 comments

What happens?

Conan is a software package manager for C++. Specifically, for DuckDB it uses the dedicate recipe (a Python file) to configure and build the DuckDB project. Currently, the generated static library for Linux contains the stub 0.0.1-dev0 version. For the latest DuckDB version that is present on Conan, i.e. 0.9.2, the DuckDB inside the generated static library should be 0.9.2 as well. Otherwise the incorrect versioning impedes using DuckDB extensions, e.g. the SQLite extension.

The screenshot illustrates the generated DuckDB version in the static library file libduckdb_static.a: libduckdb_static Please see the bottom right corner.

To Reproduce

  1. pip install conan
  2. conan profile new default --detect
  3. echo [requires] >> conanfile.txt
  4. echo duckdb/0.9.2 >> conanfile.txt

Add the following to CMakeLists.txt:

if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
    message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
    file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake" "${CMAKE_BINARY_DIR}/conan.cmake" TLS_VERIFY ON)
endif ()

include(${CMAKE_BINARY_DIR}/conan.cmake)
                                                                                                                                                                              
conan_cmake_install(PATH_OR_REFERENCE ../conanfile.txt BUILD missing PROFILE default)

OS:

x86_64 GNU/Linux

DuckDB Version:

0.9.2

DuckDB Client:

C++

Full Name:

Igor Bronshtein

Affiliation:

MSAID GmbH

Have you tried this on the latest nightly build?

I have tested with a release build (and could not test with a nightly build)

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • [X] Yes, I have

abba-kovner avatar Feb 26 '24 10:02 abba-kovner

Hi there, we don't actually maintain the Conan package. Is this something you're expecting us to fix on the DuckDB side?

Mause avatar Feb 26 '24 10:02 Mause

Hi @Mause, thanks for the note about not maintaining the Conan package. I inspected the Conan's recipe for building DuckDB: https://github.com/conan-io/conan-center-index/blob/18ffa8f5bac259862e5ccf1964ce6ee4c7852cc2/recipes/duckdb/all/conanfile.py#L105

It looks like the Conan folks don't set DUCKDB_VERSION that is used in DuckdDB's code base. Please correct me if I am wrong. So either DUCKDB_VERSION should be corrected on their side or alternatively the DUCKDB_VERSION should be set in CMakeLists.txt as concatenation of DUCKDB_MAJOR_VERSION, DUCKDB_MINOR_VERSION, etc.

abba-kovner avatar Mar 08 '24 14:03 abba-kovner

I think this needs to be raised with the conan maintainers, and there have been recently some changes that should make it work correctly for version 0.10.1/0.10.2 (I think).

Can you try whether more recent versions work correctly ?

carlopi avatar Apr 23 '24 09:04 carlopi

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Jul 23 '24 00:07 github-actions[bot]

Fixed for duckdb/1.0.0 in the Conan repository (v1.0.0 can be seen in the binary file) https://conan.io/center/recipes/duckdb image

abba-kovner avatar Jul 26 '24 15:07 abba-kovner