corehost fails to find libcoreclr when installed with the debian nightly package
Repro steps:
- On an Ubuntu machine (distro information below), install the nightly .deb with
dpkg. - Somewhere, create a new project:
mkdir project && cd project && dotnet new dotnet restoredotnet run
The output of dotnet run is Could not resolve coreclr path.
strace reveals that it's looking in these locations:
stat("/home/sean/Documents/workspace/csharp/project/bin/Debug/dnxcore50/libcoreclr.so", 0x7ffec2972f78) = -1 ENOENT (No such file or directory)
stat("/usr/share/dotnet/runtime/coreclr/libcoreclr.so", 0x7ffec2972f78) = -1 ENOENT (No such file or directory)
stat("/usr/share/dotnet/runtime/coreclr/libcoreclr.so", 0x7ffec2972f48) = -1 ENOENT (No such file or directory)
stat("/usr/local/share/dotnet/runtime/coreclr/libcoreclr.so", 0x7ffec2972f48) = -1 ENOENT (No such file or directory)
That isn't right - the debian package installed to /usr/share/dotnet-nightly, not /usr/share/dotnet. corehost should probe those directories as well.
Distro information:
$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.10
DISTRIB_CODENAME=wily
DISTRIB_DESCRIPTION="Ubuntu 15.10"
NAME="Ubuntu"
VERSION="15.10 (Wily Werewolf)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 15.10"
VERSION_ID="15.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
I have a potential fix here but I can't get the cli project to bootstrap right on Ubuntu 15, so I haven't been able to validate it at all.
Thanks @swgillespie!
We do need to solve this issue.
Currently as a workaround you can do this:
sudo ln -s /usr/share/dotnet-nightly /usr/share/dotnet
@schellap There are some steps we could take in packaging to prevent this, like creating the above symlink during install time.
But would it be feasible to bake the search path into the host at build time, based on what the produced debian package name will be?
Could you tell me if there is an environment variable that tells that this is a nightly build?
There is RELEASE_SUFFIX on the unix builds, and ReleaseSuffix on the windows build.
The package name is determined like so:
determine_package_name(){
if [[ "$RELEASE_SUFFIX" == "dev" ]]; then
DOTNET_DEB_PACKAGE_NAME=dotnet-nightly
elif [[ "beta rc1 rc2 rtm" =~ (^| )"$RELEASE_SUFFIX"($| ) ]]; then
DOTNET_DEB_PACKAGE_NAME=dotnet
elif [[ "$RELEASE_SUFFIX" == "" ]]; then
DOTNET_DEB_PACKAGE_NAME=dotnet
else
DOTNET_DEB_PACKAGE_NAME=dotnet-nightly
fi
}
Let me know a couple of things, NIGHTLY_PACKAGE_NAME if set, should be used. If not default to the current location?
We should ideally specify overrides to default probe paths in runtime.config.json file that is coming up soon rather than baking such data at compile time into the host. Till then, as we discussed offline, we should keep this workaround.
@brthor @schellap are we going to get this fixed today?
@piotrpMSFT PR in