Skip to content

Installation on Alpine misses some prerequisites, so dotnet won't run #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danmoseley opened this issue Aug 20, 2020 · 8 comments
Closed
Assignees
Labels

Comments

@danmoseley
Copy link
Member

Alpine 3.11.3 on WSL2

danmose3:~/git/tmp# cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.11.3
PRETTY_NAME="Alpine Linux v3.11"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"

Installing 5.0 with dotnet-install.sh leaves me with a broken dotnet:

[2020/08/20 21:03:10][INFO] $ /root/git/performance/tools/dotnet/x64/dotnet-install.sh -InstallDir /root/git/performance/tools/dotnet/x64 -Architecture x64 -Channel master
[2020/08/20 21:03:11][INFO] dotnet_install: Warning: Unable to locate libintl. Probable prerequisite missing; install libintl (or gettext).
[2020/08/20 21:03:11][INFO] dotnet_install: Warning: Unable to locate zlib. Probable prerequisite missing; install zlib.
[2020/08/20 21:03:11][INFO] dotnet_install: Warning: Unable to locate libicu. Probable prerequisite missing; install libicu.
[2020/08/20 21:03:11][INFO] dotnet_install: Warning: Unable to locate liblttng. Probable prerequisite missing; install libcurl.
[2020/08/20 21:03:11][INFO] dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rc.1.20420.14/dotnet-sdk-5.0.100-rc.1.20420.14-linux-musl-x64.tar.gz
...
[2020/08/20 21:03:14][INFO]
[2020/08/20 21:03:15][INFO] dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.100-rc.1.20420.14/dotnet-sdk-5.0.100-rc.1.20420.14-linux-musl-x64.tar.gz
[2020/08/20 21:03:18][INFO] dotnet-install: Adding to current process PATH: `/root/git/performance/tools/dotnet/x64`. Note: This change will be visible only when sourcing script.
[2020/08/20 21:03:18][INFO] dotnet-install: Installation finished successfully.
...
[2020/08/20 21:03:26][INFO] $ dotnet --info
[2020/08/20 21:03:26][INFO] Error loading shared library libstdc++.so.6: No such file or directory (needed by /root/git/performance/tools/dotnet/x64/dotnet)
[2020/08/20 21:03:26][INFO] Error loading shared library libgcc_s.so.1: No such file or directory (needed by /root/git/performance/tools/dotnet/x64/dotnet)
[2020/08/20 21:03:26][INFO] Error relocating /root/git/performance/tools/dotnet/x64/dotnet: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7reserveEm: symbol not found
[2020/08/20 21:03:26][INFO] Error relocating /root/git/performance/tools/dotnet/x64/dotnet: _ZNKSt5ctypeIcE13_M_widen_initEv: symbol not found
[2020/08/20 21:03:26][INFO] Error relocating /root/git/performance/tools/dotnet/x64/dotnet: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE14_M_replace_auxEmmmc: symbol not found
.. etc...

By running these commands, I fixed it:

danmose3:~/git/tmp# apk add libstdc++
danmose3:~/git/tmp# apk add libgcc

BUG: It should warn me that libstdc++ and libgcc are missing since apparently these are required for dotnet to run on Alpine.

POSSIBLE OTHER ISSUE: When I try to install the prerequisites it does recommend, two don't install:

danmose3:~/git/tmp# apk add libintl zlib libicu liblttng
ERROR: unsatisfiable constraints:
  libicu (missing):
    required by: world[libicu]
  liblttng (missing):
    required by: world[liblttng]
@danmoseley
Copy link
Member Author

Per https://github.com/dotnet/dotnet-buildtools-prereqs-docker/blob/master/src/alpine/3.12/helix/amd64/Dockerfile#L41

So in summary, for Alpine, dotnet-install should recommend

  • icu or maybe icu-libs instead of libicu
  • lttng-usg apparently instead of liblttng
  • libstdc++
  • libgcc

Also consider moving these warnings to install dependencies AFTER the download, at teh END of dotnet-install.sh. At least on Alpine, the download creates 100's and 100's of lines of progress messages. After that it untars and tries to run and fails as above. It's likely most people won't scroll way back and spot the warnings about dependencies.

@bekir-ozturk
Copy link
Contributor

@danmosemsft This is not just an install script issue, but can also be seen if one downloads the archive from downloads page and extracts it, right? I don't see how we are communicating these requirements to the people visiting our downloads page.

@danmoseley
Copy link
Member Author

I don't see how we are communicating these requirements to the people visiting our downloads page.

Agreed - I suggest you reach out to @leecow for his thoughts about that page when he returns next week. However, I don't think that should prevent us improving the script. We are never going to prevent every missed dependency scenario but if we can make some effort to help people be successful, within reason we should. Folks running the install script are obviously customers we care a great deal about (and worked hard to get to this point) and in many cases they aren't dedicated to the .NET platform yet -- if they run the script and doing quickly get to successfully running dotnet, some proportion will give up and do something else. Of course, you're well aware of that and I realize that argument can apply to almost any improvement we make to the scripts. 😸

My other argument is that the script already attempts to remind folks of missing dependencies, we should at least not do it inaccurately such as suggesting they install something that does not exist on their distro and we should know does not exist.

@AR-May AR-May self-assigned this Oct 7, 2020
@AR-May
Copy link
Member

AR-May commented Oct 23, 2020

@danmosemsft, @bozturkMSFT and I thought a bit about how to resolve this problem.

I see that we actually have a lot of problems checking for the prerequisites: it seems they are listed only for ubuntu, and even for ubuntu they are out of date. As you said, checking all prerequisites for each possible case is not actually desired. Moreover, I am not sure I like how we check that we do have a prerequisite: we try to check that there is a command word installed with the prerequisite (for example, lttng for liblttng). This does not work in the case of libraries that do not install any command.

So, what if we remove these checks and instead at the very end of the installation (right before "Installation finished successfully."), we always will say something like "Please check the dependencies: <link to docs, depending on OS>"?
For Alpine, for example, we could show the following link to the docs: "https://docs.microsoft.com/en-us/dotnet/core/install/linux-alpine#dependencies". I believe this should be the right place for checking the dependencies. What do you think of this?

@AR-May
Copy link
Member

AR-May commented Oct 26, 2020

I got it wrong, nevermind the comment above.
@grinrag, could you please take a look at this issue?

@genalt
Copy link

genalt commented Oct 26, 2020

@danmosemsft this dotnet-install.sh script has a developer purpose. If we would install dotnet via a package manager, it will resolve all the dependencies. So, it just checks the library cache and tries to find all the necessary libraries by their names.
Again, we just check that the required libraries, to link with dotnet, present on the system. Developers should prepare their system themselves before running this script.

If there is any missing library, we print a warning with the name of this library. For some distros, the name of a library and package, which provides this library can mismatch. I'm not experienced with Alpine Linux, but looks like this is the case here. It's similar to CentOS when you need to install openssl-libs RPM package to get libssl installed.

@danmoseley
Copy link
Member Author

I think it would be fine to no longer check for dependencies (since as you say it's always going to be incomplete/not easy) and just link to the docs with a reminder to check dependencies. That could be https://docs.microsoft.com/en-us/dotnet/core/install/linux or it could be the specific distro's doc.

AR-May added a commit to AR-May/install-scripts that referenced this issue Oct 27, 2020
…dding a message with the link to documentation page
AR-May added a commit to AR-May/install-scripts that referenced this issue Oct 29, 2020
…dding a message with the link to documentation page
@AR-May
Copy link
Member

AR-May commented Nov 2, 2020

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants