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

Bun Fails to Load sodium-native NAPI #4170

Open
1 of 6 tasks
pcfreak30 opened this issue Aug 15, 2023 · 7 comments
Open
1 of 6 tasks

Bun Fails to Load sodium-native NAPI #4170

pcfreak30 opened this issue Aug 15, 2023 · 7 comments
Labels
bug Something isn't working napi Compatibility with the native layer of Node.js

Comments

@pcfreak30
Copy link

pcfreak30 commented Aug 15, 2023

What version of Bun is running?

0.7.4

What platform is your computer?

Linux 5.15.0-78-generic x86_64 x86_64

What steps can reproduce the bug?

Use the repo https://github.com/LumeWeb/bun-sodium-native-bug

What is the expected behavior?

The NAPI addon loads successfully and exports all object symbols

What do you see instead?

An empty js object

Additional information

this may be due to one or more API's not implemented, a list i gathered that may/may not be accurate.

  • napi_detach_arraybuffer
  • napi_get_element
  • napi_get_global
  • napi_close_handle_scope
  • napi_delete_reference
  • napi_get_reference_value
@pcfreak30 pcfreak30 added the bug Something isn't working label Aug 15, 2023
@pcfreak30
Copy link
Author

This bug still applies on 0.8.0

@pcfreak30
Copy link
Author

Also based on #4259, running bun install --build-from-source in sodium-native and the main project does not help, to rule that out.

@xhyrom
Copy link
Collaborator

xhyrom commented Aug 24, 2023

You can remove napi_close_handle_scope from the list, it is implemented unlike other

@pcfreak30
Copy link
Author

You can remove napi_close_handle_scope from the list, it is implemented unlike other

done

@pcfreak30
Copy link
Author

Based on discord chats, https://github.com/sodium-friends/sodium-native/blob/master/binding.c#L3309C1-L3313C40

we dont handle returning an napi_vaue
only mutating exports

@paperdave

Recording here for reference

@robobun robobun added the napi Compatibility with the native layer of Node.js label Sep 9, 2023
@ansarizafar
Copy link

Is there any solution?

@pcfreak30
Copy link
Author

🤷 I have been waiting, but it seems this bug isn't high on the team's priority list. UDP is also still waiting and has many more people begging for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working napi Compatibility with the native layer of Node.js
Projects
None yet
Development

No branches or pull requests

4 participants