matrix-org / matrix-rust-sdk-crypto-nodejs

Apache License 2.0
3 stars 5 forks source link

linking problem on alpine with matrix-sdk-crypto-nodejs #19

Open eburghar opened 1 year ago

eburghar commented 1 year ago

On alpine 3.16 I had to rebuild matrix-sdk-crypto-nodejs (v0.1.0-beta.1) and overwrite the matrix-sdk-crypto.linux-x64-musl.node which is downloaded by download-lib.js when trying to run matrix-hookshot, because of that dynamic linking error :

Error: Error relocating /usr/share/matrix-hookshot/node_modules/@matrix-org/matrix-sdk-crypto-nodejs/matrix-sdk-crypto.linux-x64-musl.node: __register_atfork: symbol not found

Specifically this is object dependencies of the the original lib

ldd matrix-sdk-crypto.linux-x64-musl.node 
        /lib/ld-musl-x86_64.so.1 (0x7f941bb4c000)
        /lib/libmimalloc.so.2.0 => /lib/libmimalloc.so.2.0 (0x7f941b3c7000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f941b3ae000)
        libc.so.6 => /lib/ld-musl-x86_64.so.1 (0x7f941bb4c000)
        ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f941b3a8000)

And this is for the rebuilt one

ldd matrix-sdk-crypto.linux-x64-musl.node 
        /lib/ld-musl-x86_64.so.1 (0x7f40c6de5000)
        /lib/libmimalloc.so.2.0 => /lib/libmimalloc.so.2.0 (0x7f40c5353000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f40c533a000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f40c6de5000)

Is this a cross-compile issue ?

Hywan commented 1 year ago

Hello,

Sorry for the late reply. Did you compile matrix-sdk-crypto-nodejs by hand, or has it been downloaded?

eburghar commented 1 year ago

I download it, compile and replace the dir matrix-sdk-crypto-nodejs in node_modules (so the .so got overwritten)

It is a kind of ugly hack as it needs to be manually synchronized with the version appearing in package.json at each new revision, but this works and it is stable on alpine.

to-kn commented 10 months ago

as i am running into the same problem, how can it be fixed? We don't event need it, at the moment, but since it is a dependency of matrix-bot-sdk, i would like to get it working somehow :)