duckdb / duckdb-wasm

WebAssembly version of DuckDB
https://shell.duckdb.org
MIT License
1.22k stars 131 forks source link

Failed to build for duckdb_wasm sub-project test (tester) #1888

Open ritalin opened 1 week ago

ritalin commented 1 week ago

What happens?

I've challenged to run duckdb_wasm sub-project test (tester).

Following README, I've tried to build but failed.

$ cmake --build .
...
Undefined symbols for architecture x86_64:
  "duckdb_skiplistlib::skip_list::_throw_exceeds_size(unsigned long)", referenced from:

This is because of not specifying libduckdb_skiplistlib.a to a cmake configuration (lib/cmake/duckdb.cmake).

To Reproduce

mkdir -p build
cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../lib
cmake --build .

Expect behavior: Build process is Succes.

Actual behavior: Build failed.

Browser/Environment:

MacOS Ventura 13.6.9 / Apple clang version 14.0.3

Device:

Macbook Air 2020 (Intel Core i7 1.2GHz)

DuckDB-Wasm Version:

1.29.0 (currently main stream)

DuckDB-Wasm Deployment:

None (because of unittest problem)

Full Name:

Kazuhiko TAMURA

Affiliation:

have no job

ritalin commented 1 week ago

Putting libduckdb_skiplistlib.a dependency to target_link_libraries of lib/cmake/duckdb.cmake led to resolve this build probjem.

target_link_libraries(
  duckdb
  INTERFACE ${install_dir}/lib/libduckdb_re2.a
  ...
  INTERFACE ${install_dir}/lib/libduckdb_skiplistlib.a  # <- put this line
  ...)

But many test cases has failed... And in DEBUG build, Address sanitizer has reported error.

ritalin commented 1 week ago

But many test cases has failed...

14/102 test cases have failed.

Following test has not contained some types.

Types is:

    "uhugeint",
    "fixed_int_array",
    "fixed_varchar_array",
    "fixed_nested_int_array",
    "fixed_nested_varchar_array",
    "fixed_struct_array",
    "struct_of_fixed_array",
    "fixed_array_of_int_list",
    "list_of_fixed_int_array",

Following tests have failed at

file->Release();
ASSERT_FALSE(buffer->BuffersFile(file_path.c_str())); // <- There

Fllowing tests is because of DuckDB extensions support enabled by default.

it calls duckdb_web_parquet_init(&db->database()). C++ exception with description "{"exception_type":"Catalog","exception_message":"Table Function with name \"read_parquet\" already exists!","name":"read_parquet","type":"Table Function","error_subtype":"ENTRY_ALREADY_EXISTS"}" thrown in the test body. reported.


Following test has no make sense for reason.

{"exception_type":"Not implemented","exception_message":"Unsupported compression type for default file system"} reported.

EDIT: This test case is created WebDB with NATIVE mode. A NATIVE uses duckdb::LocalFileSystem as the filesystem. It seems that duckdb::LocalFileSystem does not support duckdb::FileCompressionType::AUTO_DETECT. It may need to create with WEB mode.

ritalin commented 1 week ago

I'm ready for PR for this issue.

carlopi commented 1 week ago

A PR is very welcome