Repository navigation
Replies: 1 comment
|
Hi! Not through the RuntimeIdentifier, unfortunately. NuGet builds the dependency graph per target framework, not per RID, so every package in that graph is downloaded to the global packages folder no matter which RID you build for. The RID only decides which native files get copied to your build/publish output. There are still a few things you can do, though. What actually gets pulled Looking at the SkiaSharp nuspec (I checked 4.154.0 and 3.119.4), the dependency groups are:
There is no Why it is so big Most of the size comes from native PDBs. Since 3.119.2, This is tracked in #3519, #4165 and #4259, and there is an open PR by the maintainer (#5424, "Keep native PDBs out of runtime packages") that moves the PDBs to the symbols package. According to the PR description, Win32 goes down to about 15 MB with that change. Once it ships, most of the problem should go away. Options in the meantime
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<SkiaSharpVersion>4.154.0</SkiaSharpVersion>
<!-- on by default for net10.0+ with the .NET 10 SDK, needed for older TFMs -->
<RestoreEnablePackagePruning>true</RestoreEnablePackagePruning>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="$(SkiaSharpVersion)" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="$(SkiaSharpVersion)" />
<PrunePackageReference Include="SkiaSharp.NativeAssets.Win32" Version="$(SkiaSharpVersion)" />
<PrunePackageReference Include="SkiaSharp.NativeAssets.macOS" Version="$(SkiaSharpVersion)" />
</ItemGroup>The
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: 10.0.x
cache: true
- run: dotnet restore --locked-modeOn other CI systems the idea is the same: point Hope this helps! |
Uh oh!
There was an error while loading. Please reload this page.
hi,
is it possible to have skiasharp use only download and use the matching architecture.
Currently we always download the 800MB on every build etc
thank you for your time
All reactions