duckdb / extension-template

Template for DuckDB extensions to help you develop, test and deploy a custom extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when loading the extension with the official duckdb binary!

jrosskopf opened this issue · comments

When I follow the Readme to checkout and compile the extensions-template, I get binary of the quack extension under extension-template/build/release/extension/quack/quack.duckdb_extension. This extension can be successfully loaded and used with the duckdb build at the same time (extension-template/build/release/duckdb).

I currently build against the duckdb tag v0.9.1 (which is the default of the submodule currently). If I download the binary from https://github.com/duckdb/duckdb/releases/download/v0.9.1/duckdb_cli-linux-amd64.zip and use the duckdb binary used there I get the following error when I try to LOAD 'quack';:

D INSTALL 'quack.duckdb_extension';
D LOAD 'quack';
Error: Invalid Input Error: Initialization function "quack_init" from file "/home/jr/.duckdb/extensions/v0.9.1/linux_amd64_gcc4/quack.duckdb_extension" threw an exception: "INTERNAL Error: Missing DB manager"
D

I tried this with several Linux based build environments, and always have the same issue. I also have the same problem with a different custom extension. It works with the duckdb binary built at the same time with the extension, but does not work with the release version (most of the users have). This prevents distribution of the binary.

Any idea how to fix that?

hi @jrosskopf thanks for reporting. I can indeed reproduce this error.

The way DuckDB extensions are currently built means they are a quite sensitive to compiling with different toolchains / environments. For this reason, this repository includes preconfigured GitHub actions workflows to build your extensions with the same toolchain as DuckDB own distributed binaries: https://github.com/duckdb/extension-template/blob/main/.github/workflows/MainDistributionPipeline.yml.

These are actually run for every push to main branch of the extension template as you can see here https://github.com/duckdb/extension-template/actions/runs/6492558951. The results are uploaded to our nightly extensions bucket here. You can install this binary from all platforms using INSTALL quack FROM 'http://nightly-extensions.duckdb.org'; LOAD quack;

So to distribute your extension, we advise using the GH actions based CI defined in the template. Check out https://github.com/duckdb/duckdb_azure for an example of how we use it.

If you have any questions feel free to ping me directly on the duckdb discord

Thanks. I try that out, and give feedback.

@samansmink I changed my build process such that it resembles closely the process from template. Now it works for me with 0.9.2 as well as 0.91. I think we can close the issue.

@jrosskopf thats great to hear, thanks!