Skip to content

dotnet tool install fails for some paths on Linux #16462

@premun

Description

@premun

.NET 6 preview 2 fails to install dotnet tools on Linux in some paths and succeeds in other. I wasn't able to determine the key.

It succeeds to install to /mnt/d/a non-existent folder, it fails to install do /mnt/d/a/b. I verified that long path support is on and it also succeeded to install to /mnt/d/aaaa which is a longer path than /mnt/d/a/b.
I also tried creating /mnt/d/a and installing into /mnt/d/a/b and it also failed.

Repro steps:

$ dotnet tool install --tool-path /mnt/d/a --version 1.0.0-prerelease.21162.1 --add-source https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet-eng/nuget/v3/index.json Microsoft.DotNet.XHarness.CLI
You can invoke the tool using the following command: xharness
Tool 'microsoft.dotnet.xharness.cli' (version '1.0.0-prerelease.21162.1') was successfully installed.
$ rm -rf /mnt/d/a
$ dotnet tool install --tool-path /mnt/d/a/b --version 1.0.0-prerelease.21162.1 --add-source https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet-eng/nuget/v3/index.json Microsoft.DotNet.XHarness.CLI
/mnt/d/github/arcade/.dotnet/sdk/6.0.100-preview.2.21155.3/NuGet.targets(131,5): error : Input/output error [/tmp/tkfebrrh.0kq/restore.csproj]
The tool package could not be restored.
Tool 'microsoft.dotnet.xharness.cli' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

dotnet --info returns:

.NET SDK (reflecting any global.json):
 Version:   6.0.100-preview.2.21155.3
 Commit:    1a9103db2d

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.04
 OS Platform: Linux
 RID:         ubuntu.20.04-x64
 Base Path:   /mnt/d/github/arcade/.dotnet/sdk/6.0.100-preview.2.21155.3/

Host (useful for support):
  Version: 6.0.0-preview.2.21154.6
  Commit:  3eaf1f316b

.NET SDKs installed:
  6.0.100-preview.2.21155.3 [/mnt/d/github/arcade/.dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0-preview.2.21154.6 [/mnt/d/github/arcade/.dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0-preview.2.21154.6 [/mnt/d/github/arcade/.dotnet/shared/Microsoft.NETCore.App]

I see this happening across different machines and platforms (WSL, MacOS, AzDO Linux agents) but I still failed to determine when it would fail and when not. Path length doesn't seem to matter, I tried removing segments matching the package name or package version but the examples above show that these also doesn't matter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions