Skip to content

Commit 2e14d1a

Browse files
authored
fix(install): switch to install the musl binaries by default (starship#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.
1 parent f219d31 commit 2e14d1a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

install/install.sh

+2-8
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,14 @@ detect_platform() {
170170
local platform
171171
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
172172

173-
# check for MUSL
174-
if [ "${platform}" = "linux" ]; then
175-
if ldd /bin/sh | grep -i musl >/dev/null; then
176-
platform=unknown-linux-musl
177-
fi
178-
fi
179-
180173
# mingw is Git-Bash
181174
if echo "${platform}" | grep -i mingw >/dev/null; then
182175
platform=pc-windows-msvc
183176
fi
184177

185178
if [ "${platform}" = "linux" ]; then
186-
platform=unknown-linux-gnu
179+
# use the statically compiled musl bins on linux to avoid linking issues.
180+
platform=unknown-linux-musl
187181
fi
188182

189183
if [ "${platform}" = "darwin" ]; then

0 commit comments

Comments
 (0)