-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relative/absolute path issues in shim after installing donet tool #9414
Comments
I'll investigate this immediately. |
I have a repo. Use full path as workaround can mitigate it for now.
|
digging why |
I was also able to reproduce and I suspect you're right that something is tripping up |
Should unblock you for now |
Thanks for the workarounds 👍 |
@wli3 it appears the shim path passed to |
@peterhuene i see. I am not sure corefx GetRelativePath is available yet. By the time it was not. /~https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs#L78 I should add more tests before using a util i find deep in our code base. |
We should also be using I've also tested that |
|
did Path.GetRelativePath flowed to cli? |
it is for 2.1.4xx . i guess this will goes to 2.1.4xx. So this should be fine |
I just changed |
There is no test covering relative path in Path.GetRelativePath /~https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Extensions/tests/System/IO/Path.GetRelativePath.cs#L78 Maybe we need to getfullpath anyway |
@livarcocc @KathleenDollard I think we'll need an RTM known issue entry for this. If users specify a relative tool path on Linux and macOS, the generated shim will not work properly. The workaround is to specify a full path to |
I'm fine with |
And according the comment on GetRelativePath, the first argument is a directory. We need to make a getdirectory call. Let's make all of them fullpath. Just to be safe. I should play around Path.GetRelativePath for a while. To make sure I do not assume more. |
And after I resolve this immediate issue. I need to make DirectoryPath and FilePath take a DI Path class. And always store FullPath in these 2 classes.(without DI Path class, test can only run on Windows or Unix) These 2 are almost functions. But they are actually not. Path still depends heavily on filesystem (/home means different stuff on windows and unix.) And put Path into mock file system like IFile. This should also resolve the weird test issue on mock file system. Ideally we should abstract Path away. But we have so many operation rely on specific file layout. I don't have a better solution for it |
BTW no repo on Windows |
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 @livarcocc do we have a place to record 2.1.3xx servicing fixes? |
There is no need to store relative path today. But some part of the system does not accept relative path and there is no indication if it is storing full path or not. This is the root cause of /~https://github.com/dotnet/cli/issues/9319 “someplace” means different full path for Path class on unix and Windows. And the mock file system uses real Path class. Change tests' setup to use essentially “TEMPATH/someplace” instead of “someplace”
There is no need to store relative path today. But some part of the system does not accept relative path and there is no indication if it is storing full path or not. This is the root cause of /~https://github.com/dotnet/cli/issues/9319 “someplace” means different full path for Path class on unix and Windows. And the mock file system uses real Path class. Change tests' setup to use essentially “TEMPATH/someplace” instead of “someplace”
- On netcoreapp2.0 seems to have some issue with the "current working dir".
After 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
Example Results on appveyor:
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
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 windowsEnvironment data
dotnet --info
output:The text was updated successfully, but these errors were encountered: