Skip to content

Uno.WinUI - #1960

Closed
anpin wants to merge 14 commits into
mono:mainfrom
anpin:main
Closed

Uno.WinUI #1960
anpin wants to merge 14 commits into
mono:mainfrom
anpin:main

Conversation

@anpin

@anpin anpin commented Feb 20, 2022

Copy link
Copy Markdown
Contributor

Description of Change

Added views for Uno.WinUI #1787

Bugs Fixed

Fixed breaking changes in MAUI handlers (they renamed Native views to Platform views)

API Changes
None

Behavioral Changes

None

PR Checklist

  • Has tests (For some reason none of the Uno views has tests, so I haven't done one either)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation

@anpin

anpin commented Feb 20, 2022

Copy link
Copy Markdown
Contributor Author

At the moment I'm experiencing a strange issue with SkiaSharp.Views.Uno.WinUI.Mobile project. Compiling it to targets other than net6.0-android fails due to ignored conditional compilation symbols

@mattleibow

Copy link
Copy Markdown
Contributor

To speed up the CI bulds and skip the unmanaged builds, change the number from 0 to 5768468 https://github.com/mono/SkiaSharp/blob/main/scripts/azure-pipelines.yml#L15

That number is just a last green build here. It expires after a while and it may not work if you change unmanaged files, but it is the best I have now. I need to write some yaml to allow you to somehow (maybe with a github tag) to skip the unmnaged builds. But for now, numbers!!!

@mattleibow

Copy link
Copy Markdown
Contributor

The rename from native to platform is in maui preview 14. Is that the version you are wanting to target? only preview 13 is out right now. We can totally release a new p13 build of skia with uno.ui and then update to p14 once that is closer to release

@mattleibow

Copy link
Copy Markdown
Contributor

CI iscurrently failing because of a missing package in our dotnet-puyblic feed. Asked them to add that now.

@anpin

anpin commented Feb 21, 2022

Copy link
Copy Markdown
Contributor Author

The rename from native to platform is in maui preview 14. Is that the version you are wanting to target? only preview 13 is out right now. We can totally release a new p13 build of skia with uno.ui and then update to p14 once that is closer to release

I wanted to target Uno WinUI 3, so we can exclude the MAUI changes. I renamed them just so I won't get an error in latest VS2022 preview.

@mattleibow

Copy link
Copy Markdown
Contributor

Seems the skip does not work for forks 😢

I thinkn this is the next thing I need to get working on CI. But for the time being, back to square 0 it seems.

@anpin

anpin commented Mar 1, 2022

Copy link
Copy Markdown
Contributor Author

@mattleibow is there anything else I can do to help merge this?

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR adds net6 targets for samples and gallery, which cannot work unless the referenced SkiaSharp.Views.Uno.WinUI libraries also reference net6.0-android, ios, etc..

There's also a need for Uno to be updated to the latest preview 14 bits (because of iOS/mac breaking changes), which will be happening in the next few days.

using Windows.UI;

#if WINDOWS
#if WINDOWS || WINUI

@jeromelaban jeromelaban Mar 17, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's likely that changing all references to WINUI would make more sense, which means adding WINUI as a constant in the existing WinUI project.

@jeromelaban

Copy link
Copy Markdown
Contributor

The Uno Platform release 4.1.9 now supports net6.0-ios, net6.0-android, net6.0-maccatalyst and net6.0-macos. It can be used to add the new targets compatible with the mobile template used in this PR.

@anpin

anpin commented Apr 5, 2022

Copy link
Copy Markdown
Contributor Author

It seems to me that Uno.WinUI packages are still missing on the CI nuget feed, so it only compiles when I add public feed to nuget.config. Plus there is still something wrong with net6.0-ios and net6.0-maccatalyast targets and you ca n follow discussion in the msbuild issue linked above.

@jeromelaban

Copy link
Copy Markdown
Contributor

Yes, the Uno.WinUI.* packages need to be approved by the SkiaSharp team for the build to go further.

@jeromelaban

Copy link
Copy Markdown
Contributor

Here are the uno packages for this PR:

  • uno.core
  • uno.core.extensions
  • uno.core.extensions.collections
  • uno.core.extensions.compatibility
  • uno.core.extensions.disposables
  • uno.core.extensions.equality
  • uno.core.extensions.logging
  • uno.core.extensions.logging.singleton
  • uno.core.extensions.threading
  • uno.diagnostics.eventing
  • uno.extensions.core
  • uno.extensions.logging.oslog
  • uno.extensions.logging.webassembly.console
  • uno.extensions.logging.winui
  • uno.foundation.logging
  • uno.foundation.runtime.webassembly
  • uno.sourcegenerationtasks
  • uno.ui.adapter.microsoft.extensions.logging
  • uno.universalimageloader
  • uno.wasm.bootstrap
  • uno.wasm.bootstrap.devserver
  • uno.wasm.websockets
  • uno.winui
  • uno.winui.remotecontrol
  • uno.winui.runtime.skia.gtk
  • uno.winui.runtime.skia.wpf
  • uno.winui.runtime.webassembly
  • uno.winui.skia.gtk
  • uno.winui.skia.wpf
  • uno.winui.webassembly
  • commonservicelocator

@mattleibow

Copy link
Copy Markdown
Contributor

Should be available now. I asked for the latest, so maybe we need some older versions too. When you remove the nuget.config we will know.

@anpin

anpin commented Apr 6, 2022 via email

Copy link
Copy Markdown
Contributor Author

@mattleibow

Copy link
Copy Markdown
Contributor

There are the nuget.configs in the samples folders. We can't have any nuget.configs anywhere in the repo that have nuget.org or any other non-azure feeds.

@anpin

anpin commented Apr 6, 2022 via email

Copy link
Copy Markdown
Contributor Author

@mattleibow

mattleibow commented Apr 9, 2022

Copy link
Copy Markdown
Contributor

There is 1 more: samples/Basic/Uno/NuGet.config

Starting: Nuget Security Analysis (auto-injected by policy)
==============================================================================
Task         : Nuget Security Analysis
Description  : A task to scan for vulnerabilities in nuget files.
Version      : 0.2.102
Author       : Microsoft Corporation
Help         : See https://aka.ms/nugetsecurityanalysis for more information. Please contact OpenSourceEngSupport@microsoft.com if you run into problems or have questions with this task.
==============================================================================
For more information please visit: https://aka.ms/nugetsecurityanalysis
Starting Multifeed Nuget Security Analysis: 
nuget.config - Multiple internal feeds declared, but none with upstreams.
samples/Basic/Uno/NuGet.config - Missing <clear/> statement.
samples/Basic/Uno/NuGet.config - Multiple feeds declared.
Starting Multifeed Python Security Analysis: 
Starting CFS NuGet Analysis: 
samples/Basic/Uno/NuGet.config - External feeds found in the file.
Starting CFS NPM Analysis: 
Starting DockerFile Analysis: 
scripts/Docker/alpine/amd64/Dockerfile - Container usage from external registry 'docker.io' found.
scripts/Docker/debian9/amd64/Dockerfile - Container usage from external registry 'docker.io' found.
scripts/Docker/debian9/clang-cross/Dockerfile - Container usage from external registry 'docker.io' found.
Azure Artifacts Configuration Analysis found 1 vulnerable NuGet package manifest in the repository. Visit http://aka.ms/azure-artifacts-configuration-analysis for more details.
Container security analysis found 3 violations. This repo has one or more docker files having references to images from external registries. Please review https://aka.ms/containers-security-guidance to remove the reference of container images from external registries. Please contact cssc@microsoft.com for any questions or clarifications.
##[error]NuGet Security Analysis found 1 vulnerable package manifest in the repository. Visit https://aka.ms/nugetmultifeed for more details.
Finishing: Nuget Security Analysis (auto-injected by policy)

@mattleibow

Copy link
Copy Markdown
Contributor

I notice this in the logs:

CSC : warning CS8002: Referenced assembly 'Uno.UI, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.Foundation, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.UI.BindingHelper.Android, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.UI.FluentTheme, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.UI.FluentTheme.v1, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.UI.FluentTheme.v2, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         CSC : warning CS8002: Referenced assembly 'Uno.UI.Toolkit, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' does not have a strong name. [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]

Did the net6 uno loose the strong name?

@jeromelaban

Copy link
Copy Markdown
Contributor

Uno never had strong names (and likely never will). Could it be that the skia build requires strong names in net6?

@mattleibow mattleibow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just some comments, all looking really close.

<AssemblyName>SkiaSharp.Views.Windows</AssemblyName>
<PackagingGroup>SkiaSharp.Views.WinUI</PackagingGroup>
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
<PublishTrimmed>false</PublishTrimmed>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, isn't WINDOWS already defined? Did you mean WINUI instead? How does this (if at all) relate to the || WINUI added in the cs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PublishTrimmed is scattered thought... is that needed as I think it is an app feature.

<RootNamespace>SkiaSharp.Views.UWP</RootNamespace>
<AssemblyName>SkiaSharp.Views.UWP</AssemblyName>
<PackagingGroup>SkiaSharp.Views.Uno.WinUI</PackagingGroup>
<PackageId>SkiaSharp.Views.Uno.WinUI</PackageId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This may need a <SignAssembly>false to disable strong naming for Uno things. I see it is in the skia/wasm projects...

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="SkiaSharp" android:versionCode="1" android:versionName="1.0">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This file should not be in a library.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nor the info.plists.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

msbuild was failing without these two files unfortunately, not sure if it is still doing this

@jeromelaban jeromelaban May 13, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@anpin I can take over this PR and finish it, if that's fine with you. I'll have to re-create it and I'll keep the history.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jeromelaban I don't mind that as my attention shifted on something else and I no longer need this actually

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@anpin Thanks! I'll open another PR then.

"SkiaSharp.Views.Uno\\SkiaSharp.Views.Uno.Reference\\SkiaSharp.Views.Uno.Reference.csproj",
"SkiaSharp.Views.Uno\\SkiaSharp.Views.Uno.Skia\\SkiaSharp.Views.Uno.Skia.csproj",
"SkiaSharp.Views.Uno\\SkiaSharp.Views.Uno.Wasm\\SkiaSharp.Views.Uno.Wasm.csproj",
"SkiaSharp.Views.Uno\\SkiaSharp.Views.Uno.WinUI.Mobile\\SkiaSharp.Views.Uno.WinUI.Mobile.csproj",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to confirm if SkiaSharp.Views.Uno.WinUI.Mobile.csproj builds with netfx... I was having issues - but I think that was months ago so maybe it all works now :)

@mattleibow

Copy link
Copy Markdown
Contributor

The Windows builds are failing with:

       "D:\a\1\s\source\SkiaSharpSource.Windows-net6.slnf" (Build target) (1:2) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (default target) (10:22) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (Build target) (10:25) ->
       (CoreCompile target) -> 
         D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.iOS\SKSwapChainPanel.iOS.cs(14,11): error CS0246: The type or namespace name 'SKGLView' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]


       "D:\a\1\s\source\SkiaSharpSource.Windows-net6.slnf" (Build target) (1:2) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (default target) (10:22) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (Build target) (10:26) ->
         D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.Mac\SKXamlCanvas.macOS.cs(3,23): error CS0234: The type or namespace name 'Mac' does not exist in the namespace 'SkiaSharp.Views' (are you missing an assembly reference?) [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         D:\a\1\s\source\SkiaSharp.Views\SkiaSharp.Views.Mac\SKGLView.cs(6,23): error CS0234: The type or namespace name 'GlesInterop' does not exist in the namespace 'SkiaSharp.Views' (are you missing an assembly reference?) [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]
         D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.Mac\SKXamlCanvas.macOS.cs(14,11): error CS0246: The type or namespace name 'SKCGSurfaceFactory' could not be found (are you missing a using directive or an assembly reference?) [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]


       "D:\a\1\s\source\SkiaSharpSource.Windows-net6.slnf" (Build target) (1:2) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (default target) (10:22) ->
       "D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj" (Build target) (10:23) ->
         D:\a\1\s\source\SkiaSharp.Views\SkiaSharp.Views.AppleiOS\SKGLView.cs(9,23): error CS0234: The type or namespace name 'GlesInterop' does not exist in the namespace 'SkiaSharp.Views' (are you missing an assembly reference?) [D:\a\1\s\source\SkiaSharp.Views.Uno\SkiaSharp.Views.Uno.WinUI.Mobile\SkiaSharp.Views.Uno.WinUI.Mobile.csproj]

@jeromelaban jeromelaban mentioned this pull request May 16, 2022
4 tasks
@mattleibow mattleibow added this to the v2.88.1 milestone May 22, 2022
@mattleibow

mattleibow commented May 27, 2022

Copy link
Copy Markdown
Contributor

Merged in 7b3e8f3 via #2042

@mattleibow mattleibow closed this May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants