Fix lookup of coreclr.dll in .deps.json to not rely on relative paths (dotnet/core...
authorVitek Karas <vitek.karas@microsoft.com>
Tue, 29 Jan 2019 09:10:56 +0000 (01:10 -0800)
committerGitHub <noreply@github.com>
Tue, 29 Jan 2019 09:10:56 +0000 (01:10 -0800)
commit09b5d391139e336ca5076226da842f4f36d4023b
treeb87adfd592de1d863589dcf256ae97067983831f
parent21d58ec9b161e60af2eb82361bd98e685b317dce
Fix lookup of coreclr.dll in .deps.json to not rely on relative paths (dotnet/core-setup#5050)

The existing code expects the .deps.json record for coreclr.dll (and clrjit.dll) to have at least one directory separator, since that was always the case up until now.
With recent changes to targeting packs, these records are just file names, and the above logic breaks.

Fix the logic by lookup at the resolved absolute path, which is guaranteed to have a directory separator before the library name (we need the separator to match whole file names).

Added a test which validates the new scenario.

Commit migrated from https://github.com/dotnet/core-setup/commit/988132f2a89decd7203d665d26df53bc1c8f9eec
src/installer/corehost/cli/deps_resolver.cpp
src/installer/test/HostActivationTests/GivenThatICareAboutSharedFxLookup.cs
src/installer/test/TestUtils/RuntimeInformationExtensions.cs