diff --git a/build/README.md b/build/README.md index 0698a8fbc1..718d38b42d 100644 --- a/build/README.md +++ b/build/README.md @@ -13,3 +13,58 @@ dotnet publish -c Release -r $RUNTIME_IDENTIFIER -o $DESTINATION_FOLDER src/Sour ``` > [!NOTE] > Please replace the `$RUNTIME_IDENTIFIER` with one of `win-x64`,`win-arm64`,`linux-x64`,`linux-arm64`,`osx-x64`,`osx-arm64`, and replace the `$DESTINATION_FOLDER` with the real path that will store the output executable files. + + +## Native AOT diagnostics + +Release builds publish as Native AOT. A successful publish can still report AOT +analysis warnings from dependencies. To expand a third-party assembly warning +such as `IL3053`, publish with: + +```sh +dotnet publish src/SourceGit.csproj -c Release -r linux-x64 -p:TrimmerSingleWarn=false +``` + +`SuppressTrimAnalysisWarnings` currently suppresses trimming diagnostics; it does +not suppress AOT diagnostics. The command above expands the existing AOT warnings +without disabling the analysis or changing their severity. + +### DataGrid warnings + +With Avalonia.Controls.DataGrid 12.1.2, the expanded `IL3053` consists of three +`IL3050` warnings: + +* `TypeHelper.GetPropertyOrIndexer()` in `Utils/ReflectionHelper.cs` dynamically + constructs `IList` and `IReadOnlyList` with `Type.MakeGenericType`. These + two warnings also occur with DataGrid 11.3.13. This fallback is reached only for + an indexer path when no suitable default indexer was found and an element type + can be inferred. +* `DataGrid.GenerateColumn()` in `DataGridColumns.cs` creates a reflection-based + `Binding` for an automatically generated column. Avalonia 12 marks that + constructor as requiring dynamic code. + +SourceGit's `HistoriesCommitList` sets `AutoGenerateColumns` and +`CanUserSortColumns` to `false`, sets `IsReadOnly` to `true`, and defines its +columns explicitly as `DataGridTemplateColumn` instances. It does not configure +indexed property paths for DataGrid's bound-column, sorting, or grouping helpers. +These usage constraints are the basis for accepting the audited warnings; they +are not proof of unreachability available to the AOT compiler. + +Revisit this assessment when changing the DataGrid version, adding automatically +generated or bound columns, introducing indexed property paths, or enabling +property-based sorting or grouping. Setting a runtime DataGrid property does not +remove the corresponding implementation from AOT analysis. The current DataGrid +package has no feature switch to disable its indexer fallback. + +Keep AOT warnings enabled. A global `NoWarn=IL3050` would also hide unrelated +warnings introduced by future changes. An `UnconditionalSuppressMessage` on a +SourceGit caller does not suppress warnings emitted inside a dependency method. +A dependency-level fix or suppression would require changes to that dependency; +suppression alone would not change its runtime behavior. + +References: + +* [IL3053: assembly produced AOT warnings](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/warnings/il3053) +* [IL3050: calls requiring dynamic code](https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/warnings/il3050) +* [DataGrid 12.1.2 indexer fallback](https://github.com/AvaloniaUI/Avalonia.Controls.DataGrid/blob/1e12211eb0c52a09e314ca57a344147c37d0a26c/src/Avalonia.Controls.DataGrid/Utils/ReflectionHelper.cs#L342-L416) +* [DataGrid 12.1.2 automatic column generation](https://github.com/AvaloniaUI/Avalonia.Controls.DataGrid/blob/1e12211eb0c52a09e314ca57a344147c37d0a26c/src/Avalonia.Controls.DataGrid/DataGridColumns.cs#L1703-L1784) diff --git a/depends/AvaloniaEdit b/depends/AvaloniaEdit index ddf00a91dc..358f2c9e4a 160000 --- a/depends/AvaloniaEdit +++ b/depends/AvaloniaEdit @@ -1 +1 @@ -Subproject commit ddf00a91dc0da29b85c79b85c9583860213a99ff +Subproject commit 358f2c9e4ac57667c0183bf68f8869b110a69b1e diff --git a/global.json b/global.json index 32035c6564..d46d21e50b 100644 --- a/global.json +++ b/global.json @@ -1,7 +1,7 @@ { "sdk": { - "version": "10.0.0", - "rollForward": "latestMajor", + "version": "10.0.100", + "rollForward": "latestFeature", "allowPrerelease": false } } diff --git a/src/App.axaml.cs b/src/App.axaml.cs index 66882b4869..d2c84256e3 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -7,11 +7,9 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Data.Core.Plugins; using Avalonia.Markup.Xaml; using Avalonia.Media; using Avalonia.Media.Fonts; -using Avalonia.Platform; using Avalonia.Styling; using Avalonia.Threading; @@ -54,6 +52,8 @@ public static AppBuilder BuildAvaloniaApp() { var builder = AppBuilder.Configure(); builder.UsePlatformDetect(); + if (OperatingSystem.IsLinux() && !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WAYLAND_DISPLAY"))) + builder.UseWayland(); builder.LogToTrace(); builder.WithInterFont(); builder.With(new FontManagerOptions() @@ -251,8 +251,6 @@ public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - BindingPlugins.DataValidators.RemoveAt(0); - // Disable tooltip if window is not active. ToolTip.ToolTipOpeningEvent.AddClassHandler((c, e) => { diff --git a/src/Native/Linux.cs b/src/Native/Linux.cs index 3d09f82663..96a616a6fd 100644 --- a/src/Native/Linux.cs +++ b/src/Native/Linux.cs @@ -7,7 +7,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; namespace SourceGit.Native { @@ -28,12 +27,12 @@ public void SetupWindow(Window window) if (OS.UseSystemWindowFrame) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.Default; + window.WindowDecorations = WindowDecorations.Full; window.ExtendClientAreaToDecorationsHint = false; } else { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; + window.WindowDecorations = WindowDecorations.None; window.ExtendClientAreaToDecorationsHint = true; window.Classes.Add("custom_window_frame"); } diff --git a/src/Native/MacOS.cs b/src/Native/MacOS.cs index 06d09e8fa3..59e731a159 100644 --- a/src/Native/MacOS.cs +++ b/src/Native/MacOS.cs @@ -8,7 +8,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; namespace SourceGit.Native { @@ -50,7 +49,7 @@ public void SetupApp(AppBuilder builder) public void SetupWindow(Window window) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.SystemChrome; + window.WindowDecorations = WindowDecorations.Full; window.ExtendClientAreaToDecorationsHint = true; window.BorderThickness = new Thickness(0); } diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index fde6cb25a7..0349012b4a 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -9,7 +9,6 @@ using Avalonia; using Avalonia.Controls; -using Avalonia.Platform; using Avalonia.Threading; namespace SourceGit.Native @@ -48,7 +47,7 @@ public void SetupApp(AppBuilder builder) public void SetupWindow(Window window) { - window.ExtendClientAreaChromeHints = ExtendClientAreaChromeHints.NoChrome; + window.WindowDecorations = WindowDecorations.BorderOnly; window.ExtendClientAreaToDecorationsHint = true; window.BorderThickness = new Thickness(1); window.Padding = new Thickness(0); diff --git a/src/Resources/Styles.axaml b/src/Resources/Styles.axaml index d1ba76c821..2455a5043f 100644 --- a/src/Resources/Styles.axaml +++ b/src/Resources/Styles.axaml @@ -19,7 +19,7 @@ - + @@ -57,7 +57,7 @@