Add Tizen x64 and arm64 native build support#3607
Conversation
0e22619 to
93d059c
Compare
93d059c to
09cd7f3
Compare
Build system: - Add TFMMinimum=net6.0 for platforms where device runtime lags behind SDK - Add TPVTizenMinimum=8.0 and PlatformTargetFrameworksMinimum block - Update Tizen Studio to 6.1 with MOBILE-6.0 + TIZEN-8.0 native dev Native build: - Refactor build.cake with helper functions (GetTizenProfile, GetTizenRootstrap, GetTizenArch, GetTizenOutputDir) following the iOS pattern - Dynamically set project_def.prop profile per architecture (mobile-6.0 for 32-bit, tizen-8.0 for 64-bit) since tizen build-native has no --profile flag - Clean build output between arch builds to avoid stale artifacts - Add x64/arm64 to Skia GN BUILDCONFIG with tizen-8.0 rootstrap paths Packaging: - Add tizen-x64 and tizen-arm64 RIDs (from Samsung RuntimeIdentifierGraph) - Fix x86 RID from linux-x86 to tizen-x86 Binding: - Add #if NET7_0_OR_GREATER guard for LibraryImport in GRGlInterface.cs Verified: Windows and macOS CI Tizen builds pass (build 156464). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
09cd7f3 to
3ddddef
Compare
There was a problem hiding this comment.
Pull request overview
Adds 64-bit native build and packaging support for Tizen (x64/arm64) alongside existing 32-bit builds, including build-system tweaks to support Tizen’s on-device .NET/runtime constraints and updated Tizen Studio tooling.
Changes:
- Introduces
TFMMinimum/TPVTizenMinimumto enable building a net6.0 Tizen TFM where device runtimes lag behind current SDK TFMs. - Refactors Tizen native build Cake script to build 4 architectures (armel, i586, x86_64, aarch64) and switches Tizen installation to Studio 6.1 with both 32/64-bit package sets.
- Updates NuGet packaging and app-include targets to add
tizen-x64/tizen-arm64and fixes the x86 RID mapping (linux-x86→tizen-x86); adds a net6-friendlyDllImportfallback for Tizen Evas GL loading.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
source/SkiaSharp.Build.props |
Adds minimum TFM/TPV support and includes net6.0 Tizen TFMs when enabled. |
source/SkiaSharp.Build.Override.in.props |
Documents overriding TFMMinimum locally. |
scripts/install-tizen.ps1 |
Updates installer to Tizen Studio 6.1 and installs both 32/64-bit package sets. |
native/tizen/build.cake |
Refactors Tizen builds with helper function and adds x64/arm64 builds. |
binding/SkiaSharp/GRGlInterface.cs |
Uses DllImport on net6 and LibraryImport on net7+ for Tizen Evas GL P/Invokes. |
binding/IncludeNativeAssets.SkiaSharp.targets |
Updates Tizen RID paths and adds tizen-x64/tizen-arm64 TPK inclusions. |
binding/IncludeNativeAssets.HarfBuzzSharp.targets |
Same as above for HarfBuzzSharp. |
binding/SkiaSharp.NativeAssets.Tizen/SkiaSharp.NativeAssets.Tizen.csproj |
Adds net6 Tizen TFM and packages x64/arm64 native libs. |
binding/HarfBuzzSharp.NativeAssets.Tizen/HarfBuzzSharp.NativeAssets.Tizen.csproj |
Adds net6 Tizen TFM and packages x64/arm64 native libs. |
| # clean up any previous install (the 6.1 installer fails if the directory already exists) | ||
| if (Test-Path "$ts") { | ||
| Write-Host "Removing previous installation at '$ts'..." | ||
| Remove-Item -Path "$ts" -Recurse -Force | ||
| } |
There was a problem hiding this comment.
The script unconditionally deletes the existing $ts directory. If -InstallDestination is set incorrectly (or points somewhere shared), this can delete arbitrary paths recursively. Add a safety guard (e.g., only auto-delete when using the default $HOME_DIR\tizen-studio, or require an explicit -ForceReinstall flag / path sanity check) before calling Remove-Item -Recurse -Force.
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-x64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-arm64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> |
There was a problem hiding this comment.
The new tizen-x64/tizen-arm64 entries are gated on Exists(...), so a Tizen app build can succeed while silently omitting the required native library for those architectures (leading to runtime load failures). Prefer conditioning these items on the active $(RuntimeIdentifier) (e.g., include x86_64 only for tizen-x64, aarch64 only for tizen-arm64) and/or failing the build if the expected file is missing, rather than skipping the item entirely.
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libHarfBuzzSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libHarfBuzzSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-x64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> | ||
| <TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libHarfBuzzSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libHarfBuzzSharp.so')"> | ||
| <Visible>false</Visible> | ||
| <TizenTpkSubDir>bin\runtimes\tizen-arm64\native\</TizenTpkSubDir> | ||
| <TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName> | ||
| </TizenTpkFiles> |
There was a problem hiding this comment.
The new tizen-x64/tizen-arm64 entries are gated on Exists(...), so a Tizen app build can succeed while silently omitting the required native library for those architectures (leading to runtime load failures). Prefer conditioning these items on the active $(RuntimeIdentifier) (e.g., include x86_64 only for tizen-x64, aarch64 only for tizen-arm64) and/or failing the build if the expected file is missing, rather than skipping the item entirely.
| var propContent = System.IO.File.ReadAllText(propFile); | ||
| propContent = System.Text.RegularExpressions.Regex.Replace( | ||
| propContent, @"^profile = .+$", $"profile = {profile}", | ||
| System.Text.RegularExpressions.RegexOptions.Multiline); | ||
| System.IO.File.WriteAllText(propFile, propContent); |
There was a problem hiding this comment.
SetProjectProfile rewrites project_def.prop in-place but doesn’t verify that the profile = ... line was actually found/replaced. If the file format ever changes (or the line is missing), the build will silently keep the old profile and produce the wrong binaries. Consider checking for a successful match (and failing fast if not), and restoring the original file content after each build (try/finally) to avoid leaving the working tree dirty when running the Cake script locally.
8e8f748 to
b5d3c40
Compare
- install-tizen.ps1: Add -Force flag; require it when using custom InstallDestination - azure-templates-jobs-bootstrapper.yml: Pass -Force on CI - build.cake: SetProjectProfile fails fast if profile line not found - IncludeNativeAssets targets: Remove Exists() guards on x64/arm64 entries for consistency with other platforms Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b5d3c40 to
f2a8ef9
Compare
Tizen build infrastructure (from PR #3607, without submodule bump): - Upgrade Tizen Studio from 5.6 to 6.1 in install-tizen.ps1 - Install both MOBILE-6.0 and TIZEN-8.0 NativeAppDevelopment packages - Add TFMMinimum=net6.0 and TPVTizenMinimum to SkiaSharp.Build.props - Refactor native/tizen/build.cake with helper functions for 4 archs - Add x64/arm64 entries to IncludeNativeAssets targets (with Exists guards) - Add x64/arm64 PackageFile entries to NativeAssets.Tizen csproj files - Add NET7_0_OR_GREATER guard for LibraryImport in GRGlInterface.cs - Add Tizen native build tasks to build.cake Tizen sample (3-page TabView): - App.cs — Thin shell with NUI TabView and back-key handler - CpuPage.cs — Software-rendered gradient, circles, text with FPS counter - GpuPage.cs — Animated SkSL lava lamp shader with touch and FPS counter - DrawingPage.cs — Freehand touch drawing with 6-color palette and clear - FpsCounter.cs — Shared FPS counter utility (same as other platform samples) - SamplePage.cs — Page enum (Cpu, Gpu, Drawing) - Update tizen-manifest.xml api-version to 10 for net10.0-tizen Note: x64/arm64 native compilation requires the skia submodule GN config update (deferred to avoid conflicts with upcoming Skia bump). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Update Tizen support: Studio 6.1, TFM fixes, and 3-tab sample Tizen build infrastructure (from PR #3607, without submodule bump): - Upgrade Tizen Studio from 5.6 to 6.1 in install-tizen.ps1 - Install both MOBILE-6.0 and TIZEN-8.0 NativeAppDevelopment packages - Add TFMMinimum=net6.0 and TPVTizenMinimum to SkiaSharp.Build.props - Refactor native/tizen/build.cake with helper functions for 4 archs - Add x64/arm64 entries to IncludeNativeAssets targets (with Exists guards) - Add x64/arm64 PackageFile entries to NativeAssets.Tizen csproj files - Add NET7_0_OR_GREATER guard for LibraryImport in GRGlInterface.cs - Add Tizen native build tasks to build.cake Tizen sample (3-page TabView): - App.cs — Thin shell with NUI TabView and back-key handler - CpuPage.cs — Software-rendered gradient, circles, text with FPS counter - GpuPage.cs — Animated SkSL lava lamp shader with touch and FPS counter - DrawingPage.cs — Freehand touch drawing with 6-color palette and clear - FpsCounter.cs — Shared FPS counter utility (same as other platform samples) - SamplePage.cs — Page enum (Cpu, Gpu, Drawing) - Update tizen-manifest.xml api-version to 10 for net10.0-tizen Note: x64/arm64 native compilation requires the skia submodule GN config update (deferred to avoid conflicts with upcoming Skia bump). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove x64/arm64 native asset references (deferred to next PR) Remove tizen-x64 and tizen-arm64 entries from IncludeNativeAssets targets and NativeAssets.Tizen csproj files. These require the skia submodule GN config update and will be added back with the x64/arm64 native build support PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Add 64-bit (x86_64, aarch64) native library builds for Tizen alongside existing 32-bit (arm, x86) builds. Upgrade Tizen Studio from 5.6 to 6.1 to get the required toolchains and rootstraps.
What changed
Build infrastructure:
MOBILE-6.0-NativeAppDevelopment(32-bit) andTIZEN-8.0-NativeAppDevelopment(64-bit)TFMMinimum=net6.0toSkiaSharp.Build.propsfor platforms where device runtime lags behind SDKNative build — refactored with helper functions (iOS pattern):
tizen-armelmobile-6.0-device.coremobile-6.0tizen-x86mobile-6.0-emulator.coremobile-6.0tizen-x64tizen-8.0-emulator64.coretizen-8.0tizen-arm64tizen-8.0-device64.coretizen-8.0RIDs match Samsung's official
RuntimeIdentifierGraph.json. Theproject_def.propprofile is set dynamically per architecture sincetizen build-nativehas no--profileCLI flag.Packaging:
tizen-x64andtizen-arm64entries toIncludeNativeAssetstargets andNativeAssets.Tizencsprojslinux-x86totizen-x86Binding:
#if NET7_0_OR_GREATERguard forLibraryImportinGRGlInterface.cs(net6.0 usesDllImportfallback)CI Verification
Build 156464 on xamarin/public:
Files changed (10)
source/SkiaSharp.Build.props— TFMMinimum, TPVTizenMinimumsource/SkiaSharp.Build.Override.in.props— TFMMinimum commentexternals/skia— GN BUILDCONFIG x64/arm64 branchesnative/tizen/build.cake— Refactored with helper functions, 4 architecturesscripts/install-tizen.ps1— Studio 6.1, both package sets, clean existing dirbinding/IncludeNativeAssets.SkiaSharp.targets— tizen-x64, tizen-arm64 RIDsbinding/IncludeNativeAssets.HarfBuzzSharp.targets— samebinding/SkiaSharp.NativeAssets.Tizen/*.csproj— x64/arm64 PackageFile entriesbinding/HarfBuzzSharp.NativeAssets.Tizen/*.csproj— samebinding/SkiaSharp/GRGlInterface.cs— NET7_0_OR_GREATER guard