relative/absolute path issues in shim after installing donet tool
See original GitHub issueAfter installing dotnet-sdk-2.1.300-rc1-008673
on Linux, Installed packages using --tool-path
produces a shim that cannot locate the actual tool dll correctly.
Steps to reproduce
sudo apt-get install dotnet-sdk-2.1.300-rc1-008673 -y
dotnet tool install coveralls.net --version 1.0.0-beta0003 --tool-path tools
.\tools\csmacnz.Coveralls --help
Example Results on appveyor:
- https://ci.appveyor.com/project/MarkClearwater/dotnettoolsbugrepro
- https://github.com/csMACnz/dotnettoolsbugrepro/tree/master
Expected behavior
The application dll executes via the shim application (equivalent to dotnet csmacnz.Coveralls.dll
)
Actual behavior
The shim trys to use the wrong path on linux
The application to execute does not exist: '/home/appveyor/projects/dotnettoolsbugrepro/tools/..//home/appveyor/projects/dotnettoolsbugrepro/tools/.store/coveralls.net/1.0.0-beta0003/coveralls.net/1.0.0-beta0003/tools/netcoreapp2.1/any/csmacnz.Coveralls.dll'.
162
Command exited with code 154
This path looks like it is incorrectly appending an absolute path in place of a relative one. (I don’t know about the ../
part though.)
Broken build example here
I have also verified that /home/appveyor/projects/dotnettoolsbugrepro/tools/.store/coveralls.net/1.0.0-beta0003/coveralls.net/1.0.0-beta0003/tools/netcoreapp2.1/any/csmacnz.Coveralls.dll
does exist.
Note also that this worked fine on build dotnet-sdk-2.1.300-preview2-008533
on Linux (see Previous passing build in test repo) and this also works with the rc1 version running under windows
Environment data
dotnet --info
output:
.NET Core SDK (reflecting any global.json):
Version: 2.1.300-rc1-008673
Commit: f5e3ddbe73
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.300-rc1-008673/
Host (useful for support):
Version: 2.1.0-rc1
Commit: eb9bc92051
.NET Core SDKs installed:
1.1.5 [/usr/share/dotnet/sdk]
1.1.6 [/usr/share/dotnet/sdk]
1.1.7 [/usr/share/dotnet/sdk]
2.0.0 [/usr/share/dotnet/sdk]
2.0.2 [/usr/share/dotnet/sdk]
2.0.3 [/usr/share/dotnet/sdk]
2.1.2 [/usr/share/dotnet/sdk]
2.1.3 [/usr/share/dotnet/sdk]
2.1.4 [/usr/share/dotnet/sdk]
2.1.101 [/usr/share/dotnet/sdk]
2.1.300-rc1-008673 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0-rc1-final [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 1.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0-rc1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 5 years ago
- Comments:22 (11 by maintainers)
Top GitHub Comments
Closed as fixed with dotnet/cli#9330. Thanks again @csMACnz for reporting this issue for us! It made it a little too late to get it into the RTM of 2.1.300 (the upcoming .NET Core 2.1 release), but we hope to port this fix from
release/2.1.4xx
into a service release for 2.1.3xx. For now, the workaround is to use an absolute path for the--tool-path
option on macOS and Linux.@livarcocc do we have a place to record 2.1.3xx servicing fixes?
I was also able to reproduce and I suspect you’re right that something is tripping up
GetRelativePath
. Assigning this over to you for now.