Skip to content

postgres_scanner at commit 03eaed75… (DuckDB 1.1.3) lacks extension_config.cmake and static target — cannot bundle without DONT_LINK #366

@nadirgozcu

Description

@nadirgozcu

What happens?

Context

I’m building a custom libduckdb_bundle.a for DuckDB 1.1.3, bundling with extensions (duckpgq and postgres_scanner / duckdb-postgres) to produce a fully static binary (FROM scratch). The target commit for Postgres is 03eaed7. According to:
https://github.com/duckdb/duckdb/blob/v1.1.3/.github/config/out_of_tree_extensions.cmake#L96

Issue

At this commit:

There is no extension_config.cmake in duckdb-postgres, so the DuckDB can’t discover a static target out-of-the-box.

I manually created the extension_config.cmake file as in main branch:

duckdb_extension_load(postgres_scanner
    SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
    DONT_LINK
    LOAD_TESTS
)

The extension’s CMake path uses DONT_LINK, which forces a loadable (.duckdb_extension) build only.

If I remove DONT_LINK, the superbuild expects a static target named postgres_scanner_extension, but link fails with:

cannot find -lpostgres_scanner_extension

If I keep DONT_LINK, the extension builds as loadable, but it is not included in libduckdb_bundle.a. Verifying the bundle:

ar -t libduckdb_bundle.a | grep -i postgres || true
(no output)

So I cannot statically link it.

What I need

One of the following for the 03eaed7… line (DuckDB 1.1.3 target):

An extension_config.cmake plus a static library target (e.g., postgres_scanner_extension) so the DuckDB can link it into libduckdb_bundle.a, or

Official confirmation that static linking is not supported for this commit (an also in main version?), with guidance on a tag/commit that does support static, or the minimal patch needed to add a static target.

Why this matters

I need a fully static final binary (no dlopen at runtime) to run on FROM scratch. Loadable-only (DONT_LINK) forces a dynamic base image (or shipping many runtime libs), which we’re trying to avoid.

To Reproduce

Repro (simplified)

Core: DuckDB v1.1.3

Extensions: duckdb-postgres (03eaed7…)

Build:

make bundle-library DUCKDB_PLATFORM=any \
  EXTENSION_CONFIGS="/path/to/duckdb-postgres/extension_config.cmake"

With DONT_LINK removed → link error (-lpostgres_scanner_extension not found).

With DONT_LINK present → build succeeds but libduckdb_bundle.a contains no postgres_scanner objects (ar -t check above).

OS:

Linux (Debian 12 “bookworm” container; glibc 2.36)

PostgreSQL Version:

15.13

DuckDB Version:

v1.1.3

DuckDB Client:

Go (github.com/marcboeker/go-duckdb, CGO, static bundle)

Full Name:

Nadir Gozcu

Affiliation:

HPE

Have you tried this on the latest main branch?

  • I agree

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

  • I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions