Skip to content
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

.NET local tool install not working with .NET 8 RC2 SDK #36539

Closed
martincostello opened this issue Oct 28, 2023 · 12 comments
Closed

.NET local tool install not working with .NET 8 RC2 SDK #36539

martincostello opened this issue Oct 28, 2023 · 12 comments
Assignees

Comments

@martincostello
Copy link
Member

Describe the bug

Attempting to install a .NET local tool with the .NET 8 RC2 SDK apparently succeeds, but then when trying to run the tool the command fails and the user is prompted to run dotnet tool install.

$ dotnet tool restore
Skipping NuGet package signature verification.
Tool 'docfx' (version '2.72.0') was restored. Available commands: docfx

Restore was successful.
$ dotnet docfx --version
Run "dotnet tool restore" to make the "docfx" command available.

To Reproduce

A self-contained repro repository using GitHub Actions can be found at https://github.com/martincostello/docfx-dotnet-8-repro.

Exceptions (if any)

None.

Further technical details

$ dotnet --info
.NET SDK:
 Version:   8.0.100-rc.2.23502.2
 Commit:    0abacfc2b6

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /usr/share/dotnet/sdk/8.0.100-rc.2.23502.2/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.0-rc.2.23479.6
  Architecture: x64
  Commit:       0b25e38ad3

.NET SDKs installed:
  6.0.416 [/usr/share/dotnet/sdk]
  7.0.113 [/usr/share/dotnet/sdk]
  7.0.203 [/usr/share/dotnet/sdk]
  7.0.310 [/usr/share/dotnet/sdk]
  7.0.403 [/usr/share/dotnet/sdk]
  8.0.100-rc.2.23502.2 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet]

global.json file:
  /home/runner/work/docfx-dotnet-8-repro/docfx-dotnet-8-repro/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
@martincostello
Copy link
Member Author

Also appears to fail with a global tool: error.

@martincostello
Copy link
Member Author

Also tried dotnet tool run docfx and running dotnet tool restore a second time and neither work.

Running dotnet tool --list after restore shows it is installed:

$ dotnet tool --list
Package Id      Version      Commands      Manifest                                                                             
--------------------------------------------------------------------------------------------------------------------------------
docfx           2.72.0       docfx         /home/runner/work/docfx-dotnet-8-repro/docfx-dotnet-8-repro/.config/dotnet-tools.json

@martincostello
Copy link
Member Author

For my specific use case I've been able to workaround the issue by executing the tool directly from where it's restored to:

$target = "net8.0"
$version = (Get-Content ".config/dotnet-tools.json" | Out-String | ConvertFrom-Json).tools.docfx.version
$docfx = Join-Path ($env:USERPROFILE ?? "~") ".nuget" "packages" "docfx" $version "tools" $target "any" "docfx.dll"
dotnet $docfx

@baronfel
Copy link
Member

Hey @martincostello - thanks for reporting. I see this is on Ubuntu - have you seen similar behavior on any other platforms?

@martincostello
Copy link
Member Author

Looks like it's broken for macOS and Windows too in GitHub Actions: workflow run.

@baronfel
Copy link
Member

bizarre - at least on Windows docfx works for me on rc2, and Ubuntu 23.10 on WSL similarly worked on a 'install'. Yet the workflows you have clearly show failure.

@JL03-Yue
Copy link
Member

@martincostello Could you try running without dotnet when running the tool? I'm looking into the problem

@martincostello
Copy link
Member Author

@dsplaisted
Copy link
Member

This look like it's probably caused by this RC2 known issue: https://github.com/dotnet/core/blob/main/release-notes/8.0/known-issues.md#-80100-rc2-dotnet-tool-restore-will-always-install-the-latest-version-of-a-specific-tool

The repro specifies version 2.72.0 of the tool, but because of the bug the SDK restores the latest available version (2.72.1) instead. But then when the SDK goes to run the tool it is looking for 2.72.0 and can't find it. A workaround would be to update the tools manifest to use the latest version of the tool (2.72.1 right now).

@martincostello
Copy link
Member Author

I'll try that now, but I think I opened this issue before the .1 release shipped on Friday, and then when I saw there was a newer version available I updated Polly and rebased my branch for .NET 8 there and it was still broken.

@martincostello
Copy link
Member Author

Yep, that was it. It's fixed now.

Must have been a very unfortunate sequence of timing that meant the new docfx release came out just as I fixed the issues we had in that branch and then I must not have rebased it to include the tool update in that branch until after I'd applied the workaround I posted earlier.

@JL03-Yue JL03-Yue removed the untriaged Request triage from a team member label Oct 31, 2023
@JL03-Yue JL03-Yue self-assigned this Oct 31, 2023
@marcpopMSFT
Copy link
Member

Thanks for confirming. Closing as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants