Skip to content

Fix PackAsTool runtime asset publishing - #2557

Open
kondv wants to merge 1 commit into
github:mainfrom
kondv:dev/kondv/packastool-runtime-assets
Open

Fix PackAsTool runtime asset publishing#2557
kondv wants to merge 1 commit into
github:mainfrom
kondv:dev/kondv/packastool-runtime-assets

Conversation

@kondv

@kondv kondv commented Sep 7, 2026

Copy link
Copy Markdown

Fixes #2067

Summary

Make PackAsTool publish Copilot CLI runtime assets into RID-specific tool packages instead of leaving them only in build output.

The targets now preserve explicit CLI precedence, replace changed explicit binaries regardless of timestamps, package the compatibility marker, and include each requested runtime. The runtime restores Unix execute permissions through a netstandard2.0-compatible native fallback. Tests and CI cover Windows, Linux, and macOS packages plus .NET 6/7/8 Unix launch behavior.

Validation

  • CFS restore and .NET formatting passed
  • Focused tests: 22/22 on net8.0 and 16/16 on net472
  • Built a uniquely versioned SDK package and consumed it from a fresh external PackAsTool project
  • Verified root plus win-x64, linux-x64, and osx-x64 packages and their runtime/marker entries
  • Verified an older-timestamp explicit CLI replaces the previous packaged payload
  • Installed the tool into an isolated path, deleted source/build/package directories, and removed CLI overrides from the environment
  • The installed tool launched the bundled real Copilot CLI from its NuGet runtime assets and completed RPC ping using protocol 3

@kondv
kondv requested a review from a team as a code owner September 7, 2026 05:17
Copilot AI balanced review requested due to automatic review settings September 7, 2026 05:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The Windows net472 test build cannot resolve ZipFile without System.IO.Compression.FileSystem.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes PackAsTool publishing so RID-specific packages include usable Copilot CLI runtime assets.

Changes:

  • Publishes runtime assets and compatibility markers.
  • Restores Unix executable permissions.
  • Adds cross-platform packaging, launch tests, and CI coverage.
File summaries
File Description
dotnet/test/Unit/RuntimeWrapperTests.cs Tests CLI precedence and Unix executable restoration.
dotnet/test/Unit/MSBuildTargetsTests.cs Tests RID-specific tool packaging.
dotnet/test/GitHub.Copilot.SDK.Test.csproj Updates test-project compression references, but lacks the required System.IO.Compression.FileSystem reference for net472.
dotnet/src/Client.cs Handles compatibility markers and Unix permissions.
dotnet/src/build/GitHub.Copilot.SDK.targets Publishes RID-specific runtime assets.
.github/workflows/dotnet-sdk-tests.yml Adds Unix .NET 6–8 compatibility coverage.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

<Compile Include="..\src\Polyfills\*.cs" Link="Polyfills\%(Filename)%(Extension)" />
<PackageReference Include="Microsoft.Bcl.Memory" />
<PackageReference Include="System.Net.Http.Json" />
<Reference Include="System.IO.Compression" />
@kondv
kondv force-pushed the dev/kondv/packastool-runtime-assets branch from fcb3eaa to e68a27a Compare September 7, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PackAsTool: Copilot CLI binary not included in NuGet tool package (cross-platform)

2 participants