Skip to content

Fix AOT Compiler Compatibility Issues #1575

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

Merged
merged 8 commits into from
Mar 15, 2021
Merged

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Includes the work by @UltraNamahage to fix the AOT compiler issues when using the library with Xamarin iOS and Unity Android IL2CPP. Fixes #946

@JimBobSquarePants JimBobSquarePants added this to the 1.1.0 milestone Mar 13, 2021
@JimBobSquarePants JimBobSquarePants requested a review from a team March 13, 2021 23:28
@codecov
Copy link

codecov bot commented Mar 13, 2021

Codecov Report

Merging #1575 (0152586) into master (ae8e5e4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1575   +/-   ##
=======================================
  Coverage   83.65%   83.65%           
=======================================
  Files         746      746           
  Lines       32991    32991           
  Branches     3680     3680           
=======================================
  Hits        27597    27597           
  Misses       4680     4680           
  Partials      714      714           
Flag Coverage Δ
unittests 83.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...essors/Dithering/PaletteDitherProcessor{TPixel}.cs 93.54% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae8e5e4...0152586. Read the comment docs.

@UltraNamahage
Copy link
Contributor

I have just confirmed the milestone.
You may need to seed for webp and tiff.

@brianpopow
Copy link
Collaborator

You may need to seed for webp and tiff.

I will do that once this is merged.

/// If you are getting the above error, you need to call this method, which will pre-seed the AoT compiler with the
/// necessary methods to complete the SaveAsGif call. That's it, otherwise you should NEVER need this method!!!
/// </remarks>
[Preserve]
private static void SeedEverything()
Copy link
Collaborator

Choose a reason for hiding this comment

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

the only nitpick i have is, this method could be called something else like SeedPixelImplementations or SeedPIxelTypes

Copy link
Member Author

Choose a reason for hiding this comment

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

Feel free to change it once we do the WebP/Tiff updates.

@JimBobSquarePants JimBobSquarePants merged commit 08b0320 into master Mar 15, 2021
@JimBobSquarePants JimBobSquarePants deleted the js/aot-experiments branch March 15, 2021 11:50
@mackayn
Copy link

mackayn commented Apr 26, 2022

@JimBobSquarePants I'm still getting this issue in release config with version 2.1.1 on iOS, Xamarin Forms 5.0.0.2.0.41

iPhone XS Max, iOS 15.4.1

System.ExecutionEngineException: Attempting to JIT compile method 'void SixLabors.ImageSharp.Formats.Png.PngScanlineProcessor:ProcessRgbaScanline<SixLabors.ImageSharp.PixelFormats.Rgba32> (SixLabors.ImageSharp.Configuration,SixLabors.ImageSharp.Formats.Png.PngHeader&,System.ReadOnlySpan1,System.Span1<SixLabors.ImageSharp.PixelFormats.Rgba32>,int,int)' while running in aot-only mode. See https://docs.microsoft.com/xamarin/ios/internals/limitations for more information. at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.ProcessDefilteredScanline[TPixel] (System.ReadOnlySpan1[T] defilteredScanline, SixLabors.ImageSharp.ImageFrame1[TPixel] pixels, SixLabors.ImageSharp.Formats.Png.PngMetadata pngMetadata) <0x1067dd280 + 0x00614> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0 at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.DecodePixelData[TPixel] (System.IO.Compression.DeflateStream compressedStream, SixLabors.ImageSharp.ImageFrame1[TPixel] image, SixLabors.ImageSharp.Formats.Png.PngMetadata pngMetadata) <0x1067dc920 + 0x00337> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.ReadScanlines[TPixel] (SixLabors.ImageSharp.Formats.Png.PngChunk chunk, SixLabors.ImageSharp.ImageFrame1[TPixel] image, SixLabors.ImageSharp.Formats.Png.PngMetadata pngMetadata) <0x1067dc6a0 + 0x001f7> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0 at SixLabors.ImageSharp.Formats.Png.PngDecoderCore.Decode[TPixel] (SixLabors.ImageSharp.IO.BufferedReadStream stream, System.Threading.CancellationToken cancellationToken) <0x1067db790 + 0x00537> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0 at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel] (SixLabors.ImageSharp.Formats.IImageDecoderInternals decoder, SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream, System.Func3[T1,T2,TResult] largeImageExceptionFactory) <0x107733960 + 0x0009b> 48466 in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Formats.ImageDecoderUtilities.Decode[TPixel] (SixLabors.ImageSharp.Formats.IImageDecoderInternals decoder, SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream) <0x106b27740 + 0x00087> 21367 in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode[TPixel] (SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream) <0x106809e10 + 0x00053> 10940 in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Formats.Png.PngDecoder.Decode (SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream) <0x10667d7f0 + 0x0002f> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.Decode (System.IO.Stream stream, SixLabors.ImageSharp.Configuration config) <0x10647bc00 + 0x0009b> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image+<>c__DisplayClass137_0.b__0 (System.IO.Stream s) <0x106487380 + 0x00027> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.WithSeekableStream[T] (SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream, System.Func`2[T,TResult] action) <0x1067f43b0 + 0x000e7> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.Load (SixLabors.ImageSharp.Configuration configuration, System.IO.Stream stream, SixLabors.ImageSharp.Formats.IImageFormat& format) <0x106480cb0 + 0x00167> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.Load (SixLabors.ImageSharp.Configuration configuration, System.String path, SixLabors.ImageSharp.Formats.IImageFormat& format) <0x10647e810 + 0x000b7> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.Load (SixLabors.ImageSharp.Configuration configuration, System.String path) <0x10647dc10 + 0x00023> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0
at SixLabors.ImageSharp.Image.Load (System.String path) <0x10647db70 + 0x0003b> in <face1fef1e124017bd2bd47b1c654a67#5c93716510ec001c2ff02230372d65b5>:0

`

@JimBobSquarePants
Copy link
Member Author

Tell Microsoft. They’re the ones breaking things not us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintain Xamarin iOS support by keeping the library "AOT-proof"
4 participants