Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Publish SkiaSharp package specifically for use in (ASP).NET Core #1241

Closed
ryanelian opened this issue Apr 18, 2020 · 5 comments
Closed

Comments

@ryanelian
Copy link

ryanelian commented Apr 18, 2020

Is your feature request related to a problem? Please describe.

SkiaSharp package size is MASSIVE.

At 88MB + 3MB Linux native package, it's quite taxing on developer machine and build system (CI/CD), often times causing build times to be delayed due to the package download size AND eating build time quota (e.g. GitHub Actions minutes per month).

Also, the final app publish size will also be larger by default, (unless the developer uses self-contained build with explicit Runtime ID) which is not ideal:

image

Example above: Tizen folders contains only SkiaSharp native assets!

Describe the solution you'd like

I wish there is another SkiaSharp package by the Mono / SkiaSharp / Microsoft team for use specifically in ASP.NET Core. (e.g. SkiaSharp.AspNetCore)

This new package should just consist of these native assets:

And the package should just target .NET Standard for optimal package size. (No .NET Framework and other junks, since the unified .NET 5 is coming up anyway. In the future change the target to .NET 5)

I did a rough estimate of the .nupkg size with only those runtime IDs and only .NET Standard. It should come out at only 12MB total ❗ ❗ ❗

This new package should play nicely with .NET Core Runtime Deps for Docker: https://hub.docker.com/_/microsoft-dotnet-core-runtime-deps/ or ASP.NET Core for Docker: https://hub.docker.com/_/microsoft-dotnet-core-aspnet/ images for building general web apps and microservices.

It'll also be nice if this happens, as there will be a image processing library "blessed" for use in ASP.NET Core apps.

Describe alternatives you've considered

Magick.NET offers such package at 21 MB size https://www.nuget.org/packages/Magick.NET-Q8-x64/ or 46 MB size https://www.nuget.org/packages/Magick.NET-Q8-AnyCPU/

Additional context

Related issue #453

@Gillibald
Copy link
Contributor

Even better. Make native assets an extra package like the Linux version. Problem solved.

@mattleibow
Copy link
Contributor

Make native assets an extra package like the Linux version. Problem solved.

That is the plan.

@mattleibow
Copy link
Contributor

The future with net5 will only have a single assembly and we will do something about the multiple native assets.

For now, yeah, we could split the packages. Can you not just publish for a specific runtime? You already know where you are going to be running, so no need to have it all. Or are you not creating the docker image?

@ryanelian
Copy link
Author

ryanelian commented Apr 18, 2020

Can you not just publish for a specific runtime?

That is what is happening today.

But this thread is about "tomorrow". I would like to be able to dotnet publish -c Release when SkiaSharp is installed into the project AND not worry about the whole app publish size. (e.g. Hand over that folder to customer and say "run this using dotnet in Linux or Windows or Mac OS up to you")

Let's just say that we want to optimize publish size for newbies who are not familiar / care with runtime identifiers.

@mattleibow
Copy link
Contributor

mattleibow commented Jun 27, 2020

Closing this as a duplicate of #1301

Even though this issue was first, it was around the idea of ASP.NET. Some changes were made to no longer embed the native files inside the assemblies (#1296) but this actually made this issue worse unfortunately. However, the actual work was done so we can either move files around or into separate packages.

I am not sure exactly why the process will be, but I hope to do some cleanup in v2.80.1.

The other reason this is not so easy with the case of "remove non-ASP.NET" is that .NET 6 is also going to be a dotnet publish and then use the runtimes folder. We can't go to crazy and split everything up, but we also must do something.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants