bogdanfinn / tls-client

net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests.
BSD 4-Clause "Original" or "Old" License
670 stars 134 forks source link

cannot load on linux #2

Open Rattle-15236 opened 1 year ago

Rattle-15236 commented 1 year ago

i'm trying to use the pre-built files from dist on linux. const ffi = require('ffi-napi'); const tlsClientLibrary = ffi.Library(goPath, { 'request': ['string', ['string']] });

when i try to load the lib i get this error:

"Dynamic Symbol Retrieval Error: /usr/lib/libc.so.6: undefined symbol: request"

I'm on manjaro arch linux

bogdanfinn commented 1 year ago

@Rattle-15236 i misconfigured something in my build step to create the prebuilt binaries on release. You can easily fix that for now by running the build command for Linux from the build.sh file inside the cffi directory on the machine you want to use the library (Linux). Please remove the CC Parameter from the build command when executing it because you won’t cross compile. Will fix that in the next release.

bogdanfinn commented 1 year ago

@Rattle-15236 i updated the prebuilt libraries. could you maybe try if you now can open the linux one without the need to compile it yourself?

Rattle-15236 commented 1 year ago

I'm getting a new error when using the pre-built .so lib

Error: ENOENT: no such file or directory, open 'libc.musl-x86_64.so.1'
    at Object.openSync (node:fs:585:3)
    at Object.func [as openSync] (node:electron/js2c/asar_bundle:5:1812)
    at readFileSync (node:fs:453:35)
    at e.readFileSync (node:electron/js2c/asar_bundle:5:9160)
    at new DynamicLibrary (/node_modules/ffi-napi/lib/dynamic_library.js:68:23)
    at Object.Library (/node_modules/ffi-napi/lib/library.js:47:10)
...
bogdanfinn commented 1 year ago

@Rattle-15236

apt-get install musl-dev

Rattle-15236 commented 1 year ago

manjaro arch doesn't have apt. i was able to install musl but the error is still the same. plz note that building locally still works, it's just the pre-built binaries that have the error

bogdanfinn commented 1 year ago

@Rattle-15236 can you maybe tell me the command you are using when building it yourself? or do you just execute the build.sh?

Rattle-15236 commented 1 year ago

i just run the build.sh script without the CC= just followed your response

AndreaVitale commented 10 months ago

@Rattle-15236 you should already have solved but I ran into this issue today on a VM I have on GCP. I solved it by installing musl and musl-dev packages and make a symbolic link to the relative lib.

sudo apt-get install musl musl-dev
sudo ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1