Skip to content

build: fix AOT and IDE integration - #2378

Merged
mjcheetham merged 4 commits into
git-ecosystem:vnextfrom
mjcheetham:build-fixes
Jul 13, 2026
Merged

mjcheetham merged 4 commits into
git-ecosystem:vnextfrom
mjcheetham:build-fixes

Conversation

@mjcheetham

Copy link
Copy Markdown
Contributor

Summary

Address follow-up issues from the Native AOT and build-system changes. Distribution builds remain AOT by default, while normal and design-time builds produce IL that IDE tooling such as the Avalonia previewer can load.

What changes

  • Move PublishAot from the main project into the platform publish scripts.
  • Retain AOT analyzer coverage with IsAotCompatible.
  • Remove an AOT warning by using generic Marshal.SizeOf<T>().
  • Add shared build scripts to the solution.
  • Correct the Avalonia code-behind filename for IDE nesting.

There is no intended runtime behavior change.

Testing

  • dotnet build git-credential-manager.slnx
  • macOS AOT publish
  • macOS non-AOT publish

Follow-up to #2366 and #2367.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Make the AOT compilation property explicitly passed to the `dotnet
publish` command in the various distribution scripts, rather than being
the default in the main CLI csproj.

We do this so that design-time tools such as Avalonia editors in IDEs
and editors can load and render the views from IL. We still set the
`IsAotCompatible` property to true in the csproj to ensure the AOT
analysers are still being run, warning if we use an API or pattern that
is not AOT friendly when developing

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
The EnableNtlmView code-behind file (EnableNtlmView.cs) should be named
with the .axaml.cs extension, like all the others. This is just a
convention so that IDEs correctly nest the .cs file with the actual
XAML file (.axaml) and does not impact the behaviour of the compilation.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Use of `Marshal.SizeOf(Type)` is not AOT safe depending on the type.
Warning IL3050 was being emitted due to its use in WindowsSystemPrompts.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
@mjcheetham
mjcheetham requested a review from a team as a code owner July 13, 2026 11:42
@mjcheetham mjcheetham added gcm3.0 Targets the next major release of Git Credential Manager - v3.0 engineering Refactoring or build changes labels Jul 13, 2026
@mjcheetham
mjcheetham requested a review from dscho July 13, 2026 11:42

@dscho dscho 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.

Great!

@mjcheetham
mjcheetham merged commit ab75a6b into git-ecosystem:vnext Jul 13, 2026
25 checks passed
@mjcheetham
mjcheetham deleted the build-fixes branch July 13, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering Refactoring or build changes gcm3.0 Targets the next major release of Git Credential Manager - v3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants