Skip to content
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

build loadable ext #149

Merged
merged 6 commits into from
Apr 25, 2023
Merged

build loadable ext #149

merged 6 commits into from
Apr 25, 2023

Conversation

wangfenjin
Copy link
Collaborator

@wangfenjin wangfenjin commented Apr 19, 2023

Address #148

Build example:
cargo build --example hello-ext --features="vtab bundled"

There is one issue when load in duckdb cli:

./build/debug/duckdb -unsigned

D load "/path/to/libhello_ext.dylib";
/path/to/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp:8:79: runtime error: member access within address 0x7ff7bbe317c8 which does not point to an object of type 'duckdb::CreateFunctionInfo'
0x7ff7bbe317c8: note: object is of type 'duckdb::CreateTableFunctionInfo'
 00 00 00 00  58 63 8e 29 01 00 00 00  19 96 04 00 10 61 00 00  00 00 e3 bb f7 7f 00 00  20 17 e3 bb
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'duckdb::CreateTableFunctionInfo'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /path/to/duckdb/src/catalog/catalog_entry/table_function_catalog_entry.cpp:8:79 in

Seems related to https://stackoverflow.com/a/57304113/1203241 , but haven't figure out the solution.

From https://github.com/Mause/duckdb-deltatable-extension/blob/main/CMakeLists.txt , seems by using build_loadable_extension may work, but not sure if we have a "cleaner" way to achieve this.

@Mause Any suggestion?

@wangfenjin
Copy link
Collaborator Author

If I download the cli from duckdb release page, it works

@codecov
Copy link

codecov bot commented Apr 25, 2023

Codecov Report

Merging #149 (a3f454e) into main (80a492c) will decrease coverage by 0.27%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #149      +/-   ##
==========================================
- Coverage   58.03%   57.76%   -0.27%     
==========================================
  Files          34       34              
  Lines        2035     2041       +6     
==========================================
- Hits         1181     1179       -2     
- Misses        854      862       +8     
Impacted Files Coverage Δ
src/lib.rs 72.54% <66.66%> (-4.54%) ⬇️

... and 3 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wangfenjin wangfenjin merged commit b310e9b into main Apr 25, 2023
@wangfenjin wangfenjin deleted the loadable-ext branch April 25, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant