Skip to content

[.NET] Bundled copilot cli not found on some linux distros #424

@chrisradek

Description

@chrisradek

When using the .NET Copilot SDK, version 0.1.23, I run into an issue with the bundled copilot cli when running in Ubuntu (within wslv2).

The Copilot SDK is unable to find the copilot installation, because it is looking for it at runtimes/ubuntu.24.04-x64/native/copilot, but it is located at runtimes/linux-x64/native/copilot. I do have the copilot CLI installed globally, but it does not fall back to the global installation in this case.

I am able to workaround this by specifying the cli path in the config options, but it's a regression compared version 0.1.22 where the SDK wasn't throwing because it used the globally installed version.

I wonder if this could be solved by falling back to the portable RID for linux if the copilot cli isn't found with the specific RID, and if the SDK should also support the option of falling back to the globally installed copilot cli.

I think this likely is a problem for other linux distributions as well. I found these docs on the RuntimeIdentifier API used:

https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.runtimeinformation.runtimeidentifier?view=net-10.0#remarks

Microsoft-built runtimes use portable RIDs like linux-x64 that can run on multiple Linux distributions. However, some Linux distributions provide their own packages built specifically for that distribution and version, which may return more specific RIDs like ubuntu.24.10-x64.

https://learn.microsoft.com/en-us/dotnet/core/install/linux#packages

The following Linux distributions publish their own .NET packages:

Alpine
CentOS Stream
Fedora
Red Hat Enterprise Linux (RHEL)
Ubuntu

Edit: Setting CliPath to copilot does go back to the globally installed version, it just isn't the default anymore. That feels like a reasonable workaround for now to get back to the pre 0.1.23 state.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions