Skip to content

Preserve and pack the Android symbols#3374

Merged
mattleibow merged 3 commits intomainfrom
dev/android-symbols
Oct 10, 2025
Merged

Preserve and pack the Android symbols#3374
mattleibow merged 3 commits intomainfrom
dev/android-symbols

Conversation

@mattleibow
Copy link
Collaborator

This pull request refactors the native asset packaging logic for SkiaSharp and HarfBuzzSharp to unify and modernize how native binaries and debug symbols are handled across platforms, especially for Android and Windows. The changes introduce a new, consistent property and item group for native asset projects, update build scripts to extract and package debug symbols, and streamline symbol handling in NuGet packaging.

Native asset packaging unification:

  • Replaced platform-specific project property IsWindowsNativeAssets with a unified IsNativeAssetsProject property in all relevant .csproj files, and standardized the item group from NativeWindowsPackageFile/PackageFile to NativeAssetPackageFile for both Android and Windows projects. (binding/SkiaSharp.NativeAssets.Win32/SkiaSharp.NativeAssets.Win32.csproj, binding/SkiaSharp.NativeAssets.WinUI/SkiaSharp.NativeAssets.WinUI.csproj, binding/SkiaSharp.NativeAssets.NanoServer/SkiaSharp.NativeAssets.NanoServer.csproj, binding/HarfBuzzSharp.NativeAssets.Win32/HarfBuzzSharp.NativeAssets.Win32.csproj, binding/HarfBuzzSharp.NativeAssets.Android/HarfBuzzSharp.NativeAssets.Android.csproj, binding/SkiaSharp.NativeAssets.Android/SkiaSharp.NativeAssets.Android.csproj) [1] [2] [3] [4] [5] [6]

  • Updated NativeAssets.Build.targets to use the new property and item group, ensuring all platforms use the same logic for including native binaries and symbols in NuGet packages. This includes improved symbol file handling for both .pdb and .dbg files. (binding/NativeAssets.Build.targets)

Android build and symbol extraction improvements:

  • Refactored the Android build script to use a shared ndk.cake module, which now provides functions for alignment checking, symbol extraction, and stripping. The build process now extracts debug symbols into .dbg files and links them to the stripped binaries, improving debugging support. (native/android/build.cake, scripts/cake/ndk.cake) [1] [2] [3] [4]

  • Updated Android native build flags to disable automatic stripping, and added debug info flags (-g -ggdb3) to both SkiaSharp and HarfBuzzSharp builds, ensuring debug symbols are available for extraction. (native/android/libHarfBuzzSharp/jni/Application.mk, native/android/libHarfBuzzSharp/jni/HarfBuzzSharp.mk) [1] [2]

NuGet packaging and symbol file support:

  • Modified SkiaSharp.NuGet.targets to always allow .pdb and .so files in the package output, and to include .dbg files in the symbols package, ensuring that debug symbols extracted during the build are properly packaged. (source/SkiaSharp.NuGet.targets)

Dependency update:

  • Updated the Skia submodule to a newer commit, likely pulling in upstream changes or fixes. (externals/skia)

These changes collectively improve the maintainability and debugging experience for native assets across platforms, and provide a more consistent packaging workflow.

@github-actions
Copy link

Triage Summary

Labels will be applied to indicate improvements and changes on theAndroid and Windows platforms, specifically in relation to the native asset packaging and symbol extraction process, as well as refactoring for SkiaSharp.

This issue is not identified as a regression as it does not mention compatibility issues with previous versions or reliability concerns.

Additional remarks:

  • The main focus of this issue is on refactoring and improving the asset packaging logic and symbol extraction, with no explicit concerns about performance or compatibility raised.
Detailed Summary and Actions

Summary of the triage:

  • The issue involves improvements and changes for the Android platform, particularly in native asset packaging and symbol extraction.
  • The issue also addresses updates to the Windows platform's build process, indicating support for Windows projects.
  • Additionally, it involves specific refactoring related to SkiaSharp, the C# binding for this graphics library.

Summary of the actions that will be performed:

Action Item Description
Apply Label backend/Android The issue involves improvements specifically for the Android platform's asset packaging process.
Apply Label os/Android The issue relates to changes in the Android build scripts and symbol extraction modifications.
Apply Label os/Windows-Universal-UWP The issue indicates updates and changes for Windows projects, showing support for Windows.
Apply Label area/SkiaSharp The issue involves refactoring the native asset packaging logic for SkiaSharp specifically.

This entire triage process was automated by AI and mistakes may have been made. Please let us know so we can continue to improve.

@github-actions github-actions bot added area/SkiaSharp Issues that relate to the C# binding of SkiaSharp. os/Android os/Windows-Universal-UWP backend/Android labels Sep 22, 2025
@mattleibow mattleibow merged commit 6a7a452 into main Oct 10, 2025
1 of 2 checks passed
@mattleibow mattleibow deleted the dev/android-symbols branch October 10, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/SkiaSharp Issues that relate to the C# binding of SkiaSharp. os/Android

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants