sdk icon indicating copy to clipboard operation
sdk copied to clipboard

corehost fails to find libcoreclr when installed with the debian nightly package

Open swgillespie opened this issue 10 years ago • 8 comments

Repro steps:

  1. On an Ubuntu machine (distro information below), install the nightly .deb with dpkg.
  2. Somewhere, create a new project: mkdir project && cd project && dotnet new
  3. dotnet restore
  4. dotnet 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.

swgillespie avatar Jan 15 '16 02:01 swgillespie

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

brthor avatar Jan 15 '16 02:01 brthor

@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?

brthor avatar Jan 15 '16 02:01 brthor

Could you tell me if there is an environment variable that tells that this is a nightly build?

schellap avatar Jan 15 '16 02:01 schellap

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
}

brthor avatar Jan 15 '16 02:01 brthor

Let me know a couple of things, NIGHTLY_PACKAGE_NAME if set, should be used. If not default to the current location?

schellap avatar Jan 15 '16 02:01 schellap

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.

schellap avatar Jan 15 '16 03:01 schellap

@brthor @schellap are we going to get this fixed today?

TheRealPiotrP avatar Jan 15 '16 20:01 TheRealPiotrP

@piotrpMSFT PR in

brthor avatar Jan 15 '16 20:01 brthor