Skip to content

BUG: Error while using metacall_load_from_package_export #547

@inclinedadarsh

Description

@inclinedadarsh

🐛 Bug Report

metacall_load_from_package_export errors while using it with a C library file.

The following code should work without any error:

const { metacall_execution_path, metacall_load_from_package_export } = require('metacall');

metacall_execution_path('c', '/usr/include');
metacall_execution_path('c', '/usr/lib/x86_64-linux-gnu')

const { sqlite3_libversion } = metacall_load_from_package_export('c', 'sqlite3');

console.log(sqlite3_libversion());

Given that sqlite3.h is present in /usr/include and libsqlite3.so is present in /usr/lib/x86_64-linux-gnu

Expected Behavior

It should output the current version of sqlite.

Current Behavior

Throws the following error:

Error: Failed to parse type sqlite3_uint64
Error: Function closure from parameter 'xProfile' has failed to be prepared
Error: Failed to parse type unsigned int
Error: Function closure from parameter 'xCallback' has failed to be prepared
Error: Failed to parse type sqlite3_int64
Error: Function closure from parameter '' has failed to be prepared
Error: Failed to parse type unsigned int
Error: Function closure from parameter '' has failed to be prepared
Error: Failed to parse type sqlite3_int64
Error: Function closure from parameter '' has failed to be prepared
m ��

Steps to Reproduce

  1. Build metacall from source along with the cli
  2. Write the above given code
  3. Run it using metacallcli main.js

Development environment

I'm using Debian (WSL2)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions