New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build a static library with extensions #2176
Comments
Managed to get most of the way there, by:
Not sure if it is the way to go though. |
Going with the path outlined in the previous comment ended up a bit problematic as well, as the FOSSology based scanner used by my employer takes issue with the full source tree. That appears to be due to some non-free software components included in the repository (namely: I think it would be highly useful if one of the release artifacts was a source tarball that has amalgamations for the core DuckDB library and the main extensions. If you think it is something good, I can try and update the amalgamating script to that end. |
Those components are indeed not required at all for using DuckDB.
That sounds good to me. There is already some code to create a separate parquet amalgamation ( |
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. |
This issue was closed because it has been stale for 30 days with no activity. |
What does happen?
The released official source amalgamation (
libduckdb-src.zip
) doesn't include the source to any of the extensions. For that matter, also the pre-built shared library packages do not include any of them.To the best of my observation, only the Python / R packages and the CLI tool are built with extensions, but those aren't as usable from a C++ program.
What should happen?
My goal is to create a static build of DuckDB C++ library which also includes extensions (in particular, Parquet and httpfs). Ideally, as a single .a file plus minimal header files. A shared object would be acceptable as well. However there doesn't seem to be a straightforward way to do so.
To Reproduce
I tried building from the full source tree, by configuring CMake with
-DBUILD_PARQUET_EXTENSION=1 -DBUILD_HTTPFS_EXTENSION=1
. This does build those extensions, but the result of trying to create a re-distributable with amake install
is that:The static libraries created for the extensions are not installed, neither are the headers that are needed to be able to call
duckdb::DuckDB::LoadExtension<>()
for them.There is a separate static library for each extension, which has a somewhat problematic name like
libparquet_extension.a
(it would have been better if there was a "duckdb" somewhere in the name)Archive files for the DuckDB mangled versions of vendored third party dependencies are also installed, with names that may collide with existing files (e.g.
libfmt.a
, which is not compatible)I also noticed that there is a script for generating a Parquet source amalgamation. Did that in conjunction with generating an extended core amalgamation. Together with the extension/include/parquet-extension.hpp header file, it does make it possible to easily build a combined static library. However it looks like that wasn't the purpose of it, and it does not cover other extensions.
Is this use case intended to be supported, and how to best achieve it? Thank you!
Environment (please complete the following information):
Before submitting
master
branch? In case you cannot compile, you may find some binaries here: https://github.com/duckdb/duckdb/releases/tag/master-buildsThe text was updated successfully, but these errors were encountered: