plz-cli icon indicating copy to clipboard operation
plz-cli copied to clipboard

Fix build scripts on Linux

Open igorrhamon opened this issue 2 years ago • 9 comments

Trying to use plz on Ubuntu WSL. During the installation, the same error occurred.

"error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory"

igorrhamon avatar Dec 15 '22 00:12 igorrhamon

Are you building from scratch, or using one of the provided binaries?

m1guelpf avatar Dec 15 '22 13:12 m1guelpf

using : curl -fsSL https://raw.githubusercontent.com/m1guelpf/plz-cli/main/install.sh | sh - on Debian, I receive the same error message

noobosaurus-r3x avatar Dec 15 '22 17:12 noobosaurus-r3x

I have the same problem, i use

curl -fsSL https://raw.githubusercontent.com/m1guelpf/plz-cli/main/install.sh | sh -

on Ubuntu 20.04 and get same error

maximofn avatar Dec 16 '22 07:12 maximofn

Same error on wsl2

FreezyEx avatar Dec 16 '22 09:12 FreezyEx

Same error for me on Ubuntu 20.04

bjoern247 avatar Dec 16 '22 11:12 bjoern247

hmm, seems like the way we build the binary might be broken for linux. Would love a PR to address this (since I'm not an expert on building Rust for Linux)

m1guelpf avatar Dec 16 '22 11:12 m1guelpf

FYI I'm on Ubuntu 22.10 and it works perfectly. The only tiny issue is executing with the sh doesn't like the [[ ]] syntax (I think because of zshell, but not sure). But if you execute the script directly with the ./ prefix, no errors

culda avatar Dec 17 '22 11:12 culda

FYI I'm on Ubuntu 22.10 and it works perfectly. The only tiny issue is executing with the sh doesn't like the [[ ]] syntax (I think because of zshell, but not sure). But if you execute the script directly with the ./ prefix, no errors

Are you referring to the install script? I'm trying to run it directly by running ./install.sh but the error still persists: image

/.bin/plz: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory installed -

scheMeZa avatar Dec 18 '22 14:12 scheMeZa

@scheMeZa You need to have libssl-dev installed, and then you need an env LD_LIBRARY_PATH pointed at the lib folder. It's a typical issue you'll find details on google if you get stuck. I used brew so mine is /home/linuxbrew/.linuxbrew/Cellar/[email protected]/1.1.1s/lib

culda avatar Dec 18 '22 17:12 culda

issue

The actual problem derives from the feature default-tls of reqwest, that has openssl-sys as underlying dep thus the compiled binary will look for libssl.so.3 installed in Linux.

bin-rustls-tls

solution(s)

In a scalable solution users shouldn't have to install anything additional: a) You can try to compile the deps in the bin either with rustls-tls as below, or bundling with "vendored" openssl. b) Use another HTTP client if you encounter speed issues in the benchmarks e.g. hyper/ureq/other always keeping in mind that any lib depending on rust-native-tls will have the same issue.

bin-rustls-tls

# Cargo.toml
# ...
reqwest = { version = "0.11.13", default-features = false, features = ["json", "blocking", "rustls-tls"] }

rustls-tls bin size diff: +2.1MB

0xempire avatar Dec 18 '22 19:12 0xempire

Should be fixed in the newest release

m1guelpf avatar Dec 20 '22 02:12 m1guelpf