Skip to content

libduckdb-sys/build.rs looks for libduckdb.a instead of libduckdb_static.a #651

@brunal

Description

@brunal

Playing with building a statically linked program that embeds duckdb.

When I build duckdb, it produces build/release/src/libduckdb.so and build/release/src/libduckdb_static.a (amongst other things).

Then I build libduckdb-sys ("manually", without vcpkg):

$ DUCKDB_LIB_DIR=/home/bru/code/3p/duckdb/build/release/src DUCKDB_STATIC=1 cargo build --no-default-features
[...]
error: could not find native static library `duckdb`, perhaps an -L flag is missing?

I can fix it with a symlink:

$ ln -s $DUCKDB_LIB_DIR/libduckdb_static.a $DUCKDB_LIB_DIR/libduckdb.a
$ DUCKDB_LIB_DIR=/home/bru/code/3p/duckdb/build/release/src DUCKDB_STATIC=1 cargo build --no-default-features
<success!>

If you agree with the issue, I can contribute a fix to the build script. But then I want to nuke lib_name()/env_prefix() to make emitted directives more explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixUsed for auto generate changeloggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions