1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-04 20:37:56 +00:00

fix(install): switch to install the musl binaries by default (#1590)

We have had a few issues where users haave run the install script and
have ended up with a non-functioning version of starship because their
system doesn't have a required lib that we link against. To avoid these
problems it seems the easiest solution is to default to using the
statically compiled musl binaries. If a user knows that they are doing
they can use the non-statically compiled binaries by supplying the `-p`
argument to the installer. Note this is what other rust based tools such
as ripgrep do.
This commit is contained in:
Thomas O'Donnell 2020-08-16 17:30:10 +02:00 committed by GitHub
parent f219d310cf
commit 2e14d1af5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,20 +170,14 @@ detect_platform() {
local platform
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
# check for MUSL
if [ "${platform}" = "linux" ]; then
if ldd /bin/sh | grep -i musl >/dev/null; then
platform=unknown-linux-musl
fi
fi
# mingw is Git-Bash
if echo "${platform}" | grep -i mingw >/dev/null; then
platform=pc-windows-msvc
fi
if [ "${platform}" = "linux" ]; then
platform=unknown-linux-gnu
# use the statically compiled musl bins on linux to avoid linking issues.
platform=unknown-linux-musl
fi
if [ "${platform}" = "darwin" ]; then