microsoft / artifacts-keyring

Keyring backend for Azure Artifacts
MIT License
32 stars 18 forks source link

Breaking change in dotnet CLI? #51

Closed Bjoernolav closed 5 months ago

Bjoernolav commented 2 years ago

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? https://github.com/microsoft/artifacts-keyring/blob/949691b15fc402a868b127cf457b7ed75c8a34eb/src/artifacts_keyring/plugin.py#L36-L37

embetten commented 6 months ago

Please try the 0.3.5 version that should fix this issue

embetten commented 5 months ago

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