You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotnet-install.sh doesn't work on Alpine Linux v3.7 #9171
docker run -it alpine:latest
# in container
apk update
apk add curl bash
curl -O https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh
chmod 777 dotnet-install.sh
./dotnet-install.sh
# errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue
apk add libunwind-dev openssl-dev icu-libs curl-dev
./dotnet-install.sh
# same errors
dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue
dotnet_install: Error: Unable to locate libssl. Install libssl to continue
dotnet_install: Error: Unable to locate libicu. Install libicu to continue
dotnet_install: Error: Unable to locate libcurl. Install libcurl to continue
Expected behavior
it installs dotnet.
Actual behavior
it doesn't install dotnet.
Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs (although i can find all of these under /usr/bin). According to maintainers in alpine's IRC channel (cc @ncopa), this script is not meant to locate the libs reliably (but its purpose is to create some symlinks). The correct way is to use scanelf -qS /usr/lib | grep libunwind etc.
Reason is we are using /sbin/ldconfig, which on alpine does not locate the installed libs
Perhaps we should add a flag to dotnet-install.sh to not check for pre-requisites, or only warn, not abort, if they are not found. Or maybe we can try both approaches in dotnet-install.sh: see if scanelf is around and prefer that, then fall back to ldconfig.
Should we add the same kind of helper script next to dotnet-install.sh and use it in alpine?
That makes sense, at least in the short term.
One note on scanelf vs ldconfig: On most Linux distributions, ldconfig is part of the libc package, so it is very very likely to be installed by default on those systems. scanelf is part of pax, which is much less likely to be already installed. So switching from ldconfig to scanelf will break those use cases because dotnet-install.sh will fail on those systems because scanelf will not be found.
Activity
livarcocc commentedon Mar 14, 2018
dup of https://github.com/dotnet/cli/issues/8738.
omajid commentedon Mar 14, 2018
(Not speaking on behalf of anyone but myself)
Perhaps we should add a flag to
dotnet-install.shto not check for pre-requisites, or only warn, not abort, if they are not found. Or maybe we can try both approaches indotnet-install.sh: see if scanelf is around and prefer that, then fall back toldconfig.That makes sense, at least in the short term.
One note on
scanelfvsldconfig: On most Linux distributions,ldconfigis part of thelibcpackage, so it is very very likely to be installed by default on those systems.scanelfis part ofpax, which is much less likely to be already installed. So switching fromldconfigtoscanelfwill break those use cases becausedotnet-install.shwill fail on those systems becausescanelfwill not be found.