Skip to content

[BUG]: Octokit.net is not trim compatible #2737

@hach-que

Description

@hach-que

What happened?

When you build a .NET executable with trimming enabled, the linker will produce trim warnings about Octokit because it is not trim compatible:

C:\Users\jrhod\.nuget\packages\octokit\6.2.1\lib\netstandard2.0\Octokit.dll : error IL2104: Assembly 'Octokit' produced trim warnings. For more information see https://aka.ms/dotnet-illink/libraries [C:\Work\unreal-engine-tool\UET\uet\uet.csproj]
C:\Program Files\dotnet\sdk\7.0.302\Sdks\Microsoft.NET.ILLink.Tasks\build\Microsoft.NET.ILLink.targets(86,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [C:\Work\unreal-engine-
tool\UET\uet\uet.csproj]

To fix this, Octokit needs to add the following properties to the C# project files:

  <PropertyGroup>
    <IsTrimmable>true</IsTrimmable>
    <EnableTrimAnalyzer>true</EnableTrimAnalyzer>
    <EnableSingleFileAnalyzer>true</EnableSingleFileAnalyzer>
  </PropertyGroup>

Versions

6.2.1

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleUsed by stalebot to clean houseStatus: Up for grabsIssues that are ready to be worked on by anyoneType: BugSomething isn't working as documentedhacktoberfestIssues for participation in Hacktoberfest

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions