Closed dme-compunet closed 1 week ago
For example: this is gallery binaries after native compilation created using the current added workflow.
https://github.com/kikipoulet/SukiUI/actions/runs/11990392672/artifacts/2228541595
Now I see that after merging the master, the Dock page is also broken, probably due to a dependency bump.
I have no computer to test it today but If I understand well, these changes permits the actual code to open the gallery without crash at startup at least, right ? It's a welcomed fix to me, but we need @sirdoombox opinion about the ViewLocator modifications.
Running the gallery in NativeAOT is not a priority at all, but being able to open it until going to a critical page is a great addition.
I doubt anybody cares about the ViewLocator. Thats just code thats copied often between projects. Breaking controls is a larger issue for me. If there is supposed to be support for AOT, then all things in SukiUI should support it.
For the PropertyGrid, that probably means writing a source generator. Same for the DataGrid.AutoGenerateColumns
I'm not too worried about any implementation detail in the demo, it's only for testing and showcasing, the viewlocator in particular only ever used reflection because it was simpler and we could add/remove pages without having to worry about it. The demo is mostly complete at this point, so the additional maintenance burden of a more complex view locator doesn't really matter now.
I think getting NativeAOT working with (at least some of) our custom controls and having a testing environment to work with is a nice idea. As long as this doesn't break the regular build, having NativeAOT builds at least partially functional is great, even if we never release a NativeAOT build, having it for testing internally is a solid get.
I'm also not too concerned with getting every single feature working with NativeAOT, it's inherently a limiting target and just marking some controls as "not NativeAOT compatible" is entirely reasonable I think, generally if you need the NativeAOT target you're going in eyes wide open about the limits you'll be facing.
I won't be in front of my dev machine to test this until some time tomorrow, but as long as the standard build alll works as before I see no problem with these changes.
It seems to me that we have a kind of consensus.
As long as this doesn't break the regular build, having NativeAOT builds at least partially functional is great, even if we never release a NativeAOT build, having it for testing internally is a solid get.
I'm also not too concerned with getting every single feature working with NativeAOT, it's inherently a limiting target and just marking some controls as "not NativeAOT compatible" is entirely reasonable I think, generally if you need the NativeAOT target you're going in eyes wide open about the limits you'll be facing.
This 100%.
I will test it today 👍
We could introduce some compiler directive for the NativeAOT build, which would enable us to include only those pages that we think should work with NativeAOT (or atleast be able to warn users). If thats fine with everyone, i could PR this after this gets merged.
I mean there's no need for the NativeAOT build to work perfectly, and having all our features available to see what does/doesn't work is probably more useful than trying to make the NativeAOT build stable enough to release.
I hold no strong view either way, in a perfect world everything we have would work with NativeAOT. Maybe having a semi working NativeAOT build will make contributing fixes easier?
Tested the regular build locally, other than the splash page missing from the viewlocator and therefore the app, everything seems to be working as intended. The NativeAOT publish succeeds and seems to work as expected. The playground page doesn't work but it doesn't work in a way that is informative and useful, so that's fine.
The Dock page breaks at the transition point between version 11.1.0.2
and 11.1.0.3
of Dock.Avalonia
package.
This PR makes the SukiUI control gallery compatible with NativeAOT compilation.
Key Changes:
ViewLocator
with one that resolves views using a pre-defined list.SideMenuBar
(unsure why, butSideMenuSearchToVisibilityConverter
throwsInvalidCastException
in NativeAOT).AutoGenerateColumns
property inDataGrid
, manually adding columns instead.Issues/Incompatibilities:
PropertyGrid
is broken due to its reliance on reflection, requiring a larger fix.Additional Notes:
Note: Feel free to close the PR if you don't agree with these changes. I think it would be great if the gallery was compatible with NativeAOT compilation, but the decision is yours.