Archlinux - mscorlib build is failing because of dotnet cli native
Problem Summary
I'm trying to enable the support of building corecrl on ArchLinux. The build of all the native library is working, however mscorelib.dll is failing because it cannot get the dependency using dotnet cli. This is the same problem for building corefx managed library
Root Cause
The package dotnetcli used is build again Ubuntu 14.4 which is using two old libraries. They are a longer thread on the cli issue about the same problem cli dotnet/coreclr#674
- libicu : The linked version that System.Globalization.Native.so is using is libicuuc.so.52 whereas the latest available in archlinux is libicuuc.so.57. This join this #2834
- libcurl : if you look on the download page of libcurl you can see that they are a big discrepancy of version for this library that are used in Linux distribution
I could downgrade all this this library to the same version as Ubuntu, however this is breaking a lot of other application on my machine. This will be a problem with Linux distribution which have a rolling-release model of the latest version, and could even make it hard to update only one lib without breaking the build.
Solutions
Because of the rolling model of the archlinux distribution, I can see for the moment two solution
- Statically linking Native lib : This would avoid to have the problem we have with the dynamically link library which can have different version.
- Updating Init-tools.sh : The idea would be that when we extract the dotnetcli we are replacing the native lib with the one from the current build. This is tricky and need to be accross coreclr and corefx.
- any other
Some additional requirements/conditions for your possible solution:
Statically linking native libraries should be optional (e.g., $ build.sh static) and the bootstrapping binaries should be guaranteed to be built static. For embedded devices, we cannot accept the burden of building a key component such as DotNet Core static due to the storage and memory overhead.
Updating init-tools.sh accordingly is sort of workaround because there will be other Linux distros or Linux-based software platforms with different versions of libraries or different build options for libraries (e.g., some use version suffixes for ICU APIs and some do not add version suffixes. With suffixes, it would be "icu_blahblah_54()", without them, it would be "icu_blahblah()".)
Anyway, supporting No. 1. (static build) optionally will help a lot of issues for ARM/Linux side of CoreCLR as well. :) (even including dotnet CLI)
Look like we are on the same page. I like your idea of adding the static on the command line to allow to have two package, one for bootstrapping and one for each distribution. I created a new issue to add the static param #4436. Let me know if you want to help
Note that we already have basic support for (2) in the system today. If you set BUILDTOOLS_OVERRIDE_RUNTIME to a path, we will copy every file in there into the runtime folders that init-tools.sh lays out. We used this in the past to help bootstrap other systems.
See an example here: https://github.com/dotnet/corefx/blob/master/init-tools.sh#L62
In general we are hesitant to ship production versions of coreclr/corefx where we statically link to native libraries. However, I do think it would be good to explore some sort of static linking only for the runtime used by the build tools as a general fallback.
Usually shared libraries have version in file name. It allows to have several versions of the same shared library to be installed simultaneously.
If for bootstrapping purposes build procedure needs some pre-built binaries then it would be preferable to include all dependency shared libraries into the same package with those pre-built binaries.
@ellismg, I will try using the BUILDTOOLS_OVERRIDE_RUNTIME env variable to get it working and keep you updated.Regarding the idea of statically linked lib, the idea is to generate the bootstrapping package of dotnetcli with that, not the package that would be deploy to your machine.
@mkborg, I agree that the shared library have version on the file name, however most linux would replace the old one with the new one. Which is the problem here. Usually you have as we ll a symlink to a version without version that could be used, however this is not the case. Regarding your idea of including the shared libraries with the package, I like this idea and will explore that on the side as well
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of the experimental issue cleanup initiative we are currently trialing. Please share any feedback you might have in the linked issue.
This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.