m1guelpf / plz-cli

Copilot for your terminal
MIT License
1.59k stars 78 forks source link

Fix build scripts on Linux #4

Closed igorrhamon closed 1 year ago

igorrhamon commented 1 year ago

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"

m1guelpf commented 1 year ago

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

noobosaurus-r3x commented 1 year ago

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

maximofn commented 1 year ago

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

FreezyEx commented 1 year ago

Same error on wsl2

bjoern247 commented 1 year ago

Same error for me on Ubuntu 20.04

m1guelpf commented 1 year ago

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)

culda commented 1 year ago

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

scheMeZa commented 1 year ago

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 -

culda commented 1 year ago

@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/openssl@1.1/1.1.1s/lib

0xempire commented 1 year ago

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

m1guelpf commented 1 year ago

Should be fixed in the newest release