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

BUG: Error while using metacall_load_from_package_export #547

Open
inclinedadarsh opened this issue Feb 15, 2025 · 0 comments
Open

BUG: Error while using metacall_load_from_package_export #547

inclinedadarsh opened this issue Feb 15, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@inclinedadarsh
Copy link
Contributor

🐛 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)

@inclinedadarsh inclinedadarsh added the bug Something isn't working label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant