matrix-org / matrix-rust-sdk-bindings

Language bindings for matrix-rust-sdk
Apache License 2.0
3 stars 5 forks source link

Binaries aren't built for non-standard platforms when pulled from NPM #6

Open Half-Shot opened 2 years ago

Half-Shot commented 2 years ago

https://github.com/matrix-org/matrix-rust-sdk-bindings/blob/main/crates/matrix-sdk-crypto-nodejs/check-exists.js supposedly should be attempting to build fresh binaries if the existing ones do not load properly, but in practise it seems like this check is being missed. We have a person trying to use matrix-hookshot on arm64 linux but finding that they only have

index.linux-ia32-gnu.node
index.linux-x64-gnu.node

built, which seems surprising on a arm architecture. I would imagine the error checking code in check-exists is not sufficient, as the error they are reporting is:

May 06 11:31:42 ocfree2 systemd[1]: Started A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA..
May 06 11:31:43 ocfree2 matrix-hookshot[1378257]: /bin/matrix-hookshot/node_modules/@turt2live/matrix-sdk-crypto-nodejs/lib/napi-module.js:208
May 06 11:31:43 ocfree2 matrix-hookshot[1378257]:     throw loadError
May 06 11:31:43 ocfree2 matrix-hookshot[1378257]:     ^
May 06 11:31:43 ocfree2 matrix-hookshot[1378257]: Error: Cannot find module '@turt2live/matrix-sdk-crypto-nodejs-linux-arm64-gnu'
May 06 11:31:43 ocfree2 matrix-hookshot[1378257]: Require stack:
turt2live commented 2 years ago

If the package manager fails to build the arm-specific bindings then it still continues with package install, annoyingly. Check earlier logs to see if the build failed or was incomplete.