microsoft/artifacts-keyring

Breaking change in dotnet CLI?

Bjoernolav opened this issue · 2 comments

On a fresh install of Ubuntu 22.04 with dotnet installed, the --version option is not supported anymore:

ros@d665bfb9c57c:/$ dotnet --version
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application '--version' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
ros@d665bfb9c57c:/$ dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.

Having set up index-url to point to a Azure artifact, I get the following output when attempting to run pip install:

ros@d665bfb9c57c:/$ pip install foo
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: <removed-the-path>
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application '--version' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
WARNING: Keyring is skipped due to an exception: Unable to find dependency dotnet, please manually install the .NET SDK and ensure 'dotnet' is in your PATH. Error: Command '['dotnet', '--version']' returned non-zero exit status 145.
User for pkgs.dev.azure.com:

It seems like the --version option is only used to check that dotnet is installed (sys_version is not used anywhere) - could it simply be replaced with dotnet or dotnet --help?

sys_version = tuple(int(i) for i in
subprocess.check_output(["dotnet", "--version"]).decode().strip().partition("-")[0].split("."))

Please try the 0.3.5 version that should fix this issue

closing please reopen if version 0.3.5 or later do not fix the issue.