-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
cargo test
throw undefined reference to 'napi_create_object'
on Linux CI
#1099
Comments
I met the same problem https://github.com/ice-lab/swc/runs/6876966157?check_suite_focus=true |
@chenjun1011 Have you tried install Nodejs before running - uses: actions/setup-node@v3 |
Still have the same problem, after setup node. https://github.com/ice-lab/swc/runs/6877711481?check_suite_focus=true |
I think the problem is that Nodejs does not provide a shared library (libnode.so) but only a Unfortunately there isn't a embedding API for N-API right now, so I think the easiest way forward is making Cargo.toml:
Or you can split your project into two crates, a Nodejs independent crate and a N-API extension crate. |
Fixed on ice-lab/swc#24 , /cc @wre232114 |
@Brooooooklyn Thank you for your PR, it's ok now https://github.com/ice-lab/swc/runs/6891561403?check_suite_focus=true |
@messense Thank you for sharing that solution! It fixes the problem on Linux, but I'm still getting "undefined reference" errors on MacOS. Do you have any idea if that might be because MacOS doesn't allow undefined external symbols, and if there's any way to get around that problem? |
When running
cargo test
on CI(Linux), following error occurs:The same
cargo test
works fine on MacOSThe text was updated successfully, but these errors were encountered: