Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2ca5032
[dotnet-linker] Only override `NSObjectProxyAttribute.LookupUnmanaged…
rolfbjarne Aug 5, 2026
26355fb
Bump zizmorcore/zizmor-action from 0.6.0 to 0.6.1 (#26404)
dependabot[bot] Aug 5, 2026
0d9d023
[dotnet] Make trimmable-static the default registrar for CoreCLR too …
rolfbjarne Aug 5, 2026
3d00dc0
[docs] Improve XML docs for ten types (#26407)
rolfbjarne Aug 5, 2026
a26e2d4
[linker] Convert the EnsureUIThread optimization to a trimmer feature…
rolfbjarne Aug 5, 2026
c0f5924
[runtime] Fix the alloc/init handle-reuse race in object_map (issue #…
rolfbjarne Aug 6, 2026
5a3e485
[docs] Improve XML docs for ten types (#26415)
rolfbjarne Aug 6, 2026
111d59a
[tools] Report warnings as warnings in ErrorHelper.ShowInternal. (#26…
rolfbjarne Aug 6, 2026
0d1ec8c
[dotnet-linker] Relocate generic registrar trampolines into the compa…
rolfbjarne Aug 6, 2026
f7920a5
[CI] Retry simulator runtime downloads on transient network failures.…
rolfbjarne Aug 6, 2026
e4325ae
[mono-api-html] Fix placeholder leak and add a test project (#26405)
rolfbjarne Aug 6, 2026
ed5bb66
[registrar] Import the framework for NSObject types used in method si…
rolfbjarne Aug 6, 2026
4aa288a
[docs] Improve XML docs for ten types (#26419)
rolfbjarne Aug 6, 2026
ac39de2
[net11.0] Merge main into net11.0.
rolfbjarne Aug 7, 2026
0f3d9fe
[tests] Update expected sizes.
rolfbjarne Aug 7, 2026
ac20de8
[dotnet] Fix merge conflict resolution failure wrt UseMonoRuntime.
rolfbjarne Aug 7, 2026
00c155b
[dotnet-linker] Import the type into the current assembly for Dynamic…
rolfbjarne Aug 7, 2026
c72a708
[docs] Improve XML docs for ten types (#26423)
rolfbjarne Aug 7, 2026
26ebd80
[assembly-preparer] Fix the assembly action computed for TrimMode=link.
rolfbjarne Aug 7, 2026
74a95d8
[assembly-preparer] Pass the computed DynamicRegistrationSupported va…
rolfbjarne Aug 7, 2026
df894ca
[assembly-preparer] Port RemoveAttributesStep to the assembly-preparer.
rolfbjarne Aug 7, 2026
ccf71f1
[assembly-preparer] Remove TypeMapAssemblyTarget attributes pointing …
rolfbjarne Aug 7, 2026
7cfa209
[tests] Define PREPARE_ASSEMBLIES whenever the assembly-preparer is u…
rolfbjarne Aug 7, 2026
d141330
[msbuild] Reword the message about using DEVELOPER_DIR or XcodeLocati…
rolfbjarne Aug 12, 2026
d259b5f
[runtime] Generate trusted platform assemblies at build time. Fixes #…
rolfbjarne Aug 12, 2026
9b0cf99
Bump zizmorcore/zizmor-action from 0.6.1 to 0.6.2 (#26440)
dependabot[bot] Aug 25, 2026
a7a9095
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Aug 25, 2026
964ad6c
[main] Update dependencies from dotnet/xharness (#26437)
dotnet-maestro[bot] Aug 25, 2026
abdbb18
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Aug 25, 2026
c6b4de8
LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_…
csigs Aug 25, 2026
f0bbf3b
Bump to the latest v8 version of System.Security.Cryptography.Xml. (#…
rolfbjarne Aug 25, 2026
ee8bcd9
[msbuild] Merge runtimeconfig.dev.json into the runtime configuration…
rolfbjarne Aug 25, 2026
e865f33
Merge remote-tracking branch 'origin/net11.0' into dev/rolf/bump-main…
rolfbjarne Aug 27, 2026
f4d27db
[tests] Update expected sizes.
rolfbjarne Aug 27, 2026
10b38c6
[devops] Vendor Maestro changelog tool (#26461)
rolfbjarne Aug 27, 2026
f4789d0
[tests] Skip '_Xamarin_ConstructINativeObject' and '_Xamarin_Construc…
rolfbjarne Aug 27, 2026
76a0c5a
[dotnet-linker] Emit the macro/short form of IL instructions in gener…
rolfbjarne Aug 28, 2026
fab2bbc
[dotnet-linker] Don't unconditionally preserve smart enum conversions…
rolfbjarne Aug 28, 2026
9b1cc87
[main] Update dependencies from dotnet/xharness (#26472)
dotnet-maestro[bot] Aug 28, 2026
d8005b0
[dotnet-linker] Write the generated typemap assemblies deterministica…
rolfbjarne Aug 28, 2026
f62280a
Merge remote-tracking branch 'origin/main' into dev/rolf/bump-main-in…
rolfbjarne Aug 28, 2026
a6c96e7
[assembly-preparer] Populate application assemblies before extracting…
rolfbjarne Aug 28, 2026
1692234
[assembly-preparer] Skip RemoveAttributesStep when postprocessing Nat…
rolfbjarne Aug 28, 2026
78f0fd1
[tests] Ignore generated type map assemblies in bundle structure tests.
rolfbjarne Aug 28, 2026
19554c8
[tests] Recognize assembly preparation as linker-step execution.
rolfbjarne Aug 28, 2026
aeb050f
[tests] Update CoreCLR native build expectations after C# changes.
rolfbjarne Aug 28, 2026
815c0f5
[tests] Accept both codesign failure message variants.
rolfbjarne Aug 28, 2026
5cbd553
[tests] Update CoreCLR framework expectations for trimmable static re…
rolfbjarne Aug 28, 2026
bd9d6ec
[tests] Update expected sizes.
rolfbjarne Aug 28, 2026
69ff165
[tests] Clarify the optional codesign diagnostic.
rolfbjarne Aug 28, 2026
ed693cf
[msbuild] Skip assembly preparation for non-Mac builds.
rolfbjarne Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/maestro-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
if: github.event.pull_request.user.login == 'dotnet-maestro[bot]'

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '9'
global-json-file: ./global.json

- name: 'Compute changelog'
run: |
set -exo pipefail
git clone https://github.com/spouliot/dotnet-tools
cd dotnet-tools/changelog
dotnet build
./bin/Debug/net9.0/changelog https://github.com/$GITHUB_REPOSITORY/pull/${GITHUB_REF_NAME/\/*/} > /tmp/changelog.txt 2>&1
dotnet run --project scripts/changelog/changelog.csproj --verbosity quiet -- https://github.com/$GITHUB_REPOSITORY/pull/${GITHUB_REF_NAME/\/*/} /tmp/changelog.txt

- name: 'Add changelog'
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
Expand All @@ -45,7 +45,9 @@ jobs:
issue_number: context.issue.number
}).then ((comments) =>
{
const changelogComment = comments.find(comment => comment.body.includes (".net ChangeLog for") && comment.user.login == 'github-actions[bot]')
const changelogComment = comments.find(comment =>
(comment.body.includes (".NET Changelog for") || comment.body.includes (".net ChangeLog for")) &&
comment.user.login == 'github-actions[bot]')
if (changelogComment)
commentId = changelogComment.id
})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
echo "files=$files" >> "$GITHUB_OUTPUT"

- name: Run zizmor
uses: zizmorcore/zizmor-action@6599ee8b7a49aef6a770f63d261d214911a7ce02 # v0.6.0
uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2
with:
inputs: ${{ steps.find-files.outputs.files }}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<!-- Fix transient dependency issue found by component governance 4.7.0 -> 4.7.2 brought by Microsoft.Build package -->
<SystemDrawingCommonPackageVersion>4.7.2</SystemDrawingCommonPackageVersion>
<!-- Fix transient dependency issue found by component governance 4.7.0 -> 4.7.1 brought by Microsoft.Build.Tasks.Core package -->
<SystemSecurityCryptographyXmlPackageVersion>8.0.0</SystemSecurityCryptographyXmlPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>8.0.4</SystemSecurityCryptographyXmlPackageVersion>

<ClangSharpPackageVersion>21.1.8.3</ClangSharpPackageVersion>
<ICSharpCodeNRefactoryPackageVersion>5.5.1</ICSharpCodeNRefactoryPackageVersion>
Expand Down
28 changes: 28 additions & 0 deletions docs/building-apps/build-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,27 @@ The default value of this property `false` in .NET 9, and `true` in .NET 10+.
> [!NOTE]
> File an issue if you find that you need to disable this feature, as it's possible that the option to disable it will be removed in future.

## CheckForIllegalCrossThreadCalls

Controls whether the UI thread checks (the `[NS|UI]Application.EnsureUIThread`
calls the generated bindings emit for UI code) are performed.

When set to `true`, the checks are enabled: accessing UI API off the UI thread
throws an exception. When set to `false`, the checks are disabled.

This property is emitted as the `ObjCRuntime.Runtime.CheckForIllegalCrossThreadCalls`
runtime feature switch, so it takes effect even when trimming is disabled: the
`[NS|UI]Application.CheckForIllegalCrossThreadCalls` field reflects the property
value at runtime, and the checks are enabled or disabled accordingly.

When trimming is enabled and the checks are disabled, ILLink additionally stubs
the `[NS|UI]Application.EnsureUIThread` method body and trims away the
`CheckForIllegalCrossThreadCalls` field, making the app slightly smaller and
faster.

If this value is not specified, the checks are kept in debug builds and removed
in release builds.

## CodesignAllocate

The path to the `codesign_allocate` tool.
Expand Down Expand Up @@ -660,6 +681,13 @@ Default: true

Where the generated source from the generator are saved.

## GenerateTrustedPlatformAssemblies

A boolean property that specifies whether the trusted platform assembly list is
generated at build time instead of discovered when the app launches.

The default value is `false` for debug builds and `true` for other builds.

## GetApplicationArtifactsDependsOn

A semi-colon delimited property that can be used to extend the
Expand Down
13 changes: 10 additions & 3 deletions docs/website/optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ Xamarin.iOS and Xamarin.Mac apps.

## Remove UIApplication.EnsureUIThread / NSApplication.EnsureUIThread

Removes calls to [UIApplication.EnsureUIThread][1] (for Xamarin.iOS) or
`NSApplication.EnsureUIThread` (for Xamarin.Mac).
> [!NOTE]
> This optimization has been replaced by the `CheckForIllegalCrossThreadCalls`
> MSBuild property, which sets the
> `ObjCRuntime.Runtime.CheckForIllegalCrossThreadCalls` trimmer feature switch.
> The `--optimize=[+|-]remove-uithread-checks` flag is no longer applied and has
> no effect.

Removes calls to [UIApplication.EnsureUIThread][1] (for .NET for iOS) or
`NSApplication.EnsureUIThread` (for .NET for macOS).

This optimization will change the following type of code:

Expand All @@ -43,7 +50,7 @@ methods with the `[BindingImpl (BindingImplOptions.Optimizable)]` attribute.

By default it's enabled for release builds.

The default behavior can be overridden by passing `--optimize=[+|-]remove-uithread-checks` to mtouch/mmp.
Set the `CheckForIllegalCrossThreadCalls` MSBuild property to override the default behavior.

[1]: /dotnet/api/UIKit.UIApplication.EnsureUIThread

Expand Down
51 changes: 32 additions & 19 deletions dotnet/targets/Xamarin.Shared.Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,48 @@
<_UseNativeAot Condition="'$(PublishAot)' == 'true' And '$(_IsPublishing)' == 'true'">true</_UseNativeAot>

<!--
On .NET 11+, make the trimmable-static registrar the default for NativeAOT (it used to be
managed-static). This has to be set here, at evaluation time, and not only in the SelectRegistrar
target (which runs later), because the static _SkipILLink / _PostprocessAssembliesAfterIlc gates
check the registrar at evaluation time.

This is deliberately scoped to NativeAOT: the trimmable-static registrar only produces a *smaller*
app under NativeAOT (where the TypeMap feature and the post-ILC registrar reorder let us trim the
registered binding surface). On Mono/CoreCLR the trimmable-static registrar keeps the whole
registered NSObject surface and makes apps 2-3x *larger*, so those runtimes keep managed-static.
These have to be computed here, before the registrar defaults below, because those check
$(UseMonoRuntime) at evaluation time.
-->
<Registrar Condition="'$(Registrar)' == '' And '$(_UseNativeAot)' == 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">trimmable-static</Registrar>
<UseMonoRuntime Condition=" '$(UseMonoRuntime)' == ''">false</UseMonoRuntime>

<!--
Enable the PrepareAssemblies flow by default for NativeAOT on .NET 11+. This runs our custom linker
steps in the assembly-preparer, and for the (NativeAOT-default) trimmable-static registrar it also
generates the native static registrar code *after* the NativeAOT compiler (ILC) has run (see
_PostprocessAssembliesAfterIlc), so the registrar can drop the native code for UnmanagedCallersOnly
trampolines ILC trimmed away (an app-size optimization).
On .NET 11+, make the trimmable-static registrar the default for both CoreCLR and NativeAOT (it used
to be managed-static, and before that the trimmable-static registrar was only the default for
NativeAOT). This has to be set here, at evaluation time, and not only in the SelectRegistrar target
(which runs later), because the static _SkipILLink / _PostprocessAssembliesAfterIlc gates check the
registrar at evaluation time.

Mono keeps the managed-static registrar.
-->
<PrepareAssemblies Condition="'$(PrepareAssemblies)' == '' And '$(_UseNativeAot)' == 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">true</PrepareAssemblies>
<Registrar Condition="'$(Registrar)' == '' And '$(UseMonoRuntime)' != 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">trimmable-static</Registrar>

<!--
Enable the PrepareAssemblies flow by default for CoreCLR and NativeAOT on .NET 11+. This runs our
custom linker steps in the assembly-preparer. For NativeAOT it additionally generates the native
static registrar code *after* the NativeAOT compiler (ILC) has run (see
_PostprocessAssembliesAfterIlc, which is NativeAOT-only), so the registrar can drop the native code
for the UnmanagedCallersOnly trampolines ILC trimmed away (an app-size optimization).

This is *required* for the trimmable-static registrar to produce a small app: the assembly-preparer
writes the generated type map assemblies to disk (marked with [AssemblyMetadata ("IsTrimmable", "True")])
before the trimmer runs, so the trimmer treats them as ordinary trimmable input assemblies. Without it
the type map assemblies are created from inside the trimmer, where they end up with the 'copy' assembly
action - which means they're not trimmed, and since they reference every Objective-C type in the app,
nothing else can be trimmed either (that made apps ~3x larger).

The $(Registrar) check means a CoreCLR app that explicitly opts back in to the managed-static
registrar doesn't get PrepareAssemblies enabled - that combination makes apps *larger*. NativeAOT
always gets PrepareAssemblies regardless of the registrar, which is the pre-existing behavior.
-->
<PrepareAssemblies Condition="'$(PrepareAssemblies)' == '' And '$(UseMonoRuntime)' != 'true' And ('$(_UseNativeAot)' == 'true' Or '$(Registrar)' == 'trimmable-static') And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">true</PrepareAssemblies>

<!--
PostProcessAssemblies defaults to $(PrepareAssemblies) (see Xamarin.Shared.targets), but the static
_PostprocessAssembliesAfterIlc gate reads it at evaluation time - earlier than that default runs - so
apply the same $(PrepareAssemblies) default here too, otherwise the gate wouldn't see it.
-->
<PostProcessAssemblies Condition="'$(PostProcessAssemblies)' == '' And '$(_UseNativeAot)' == 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">$(PrepareAssemblies)</PostProcessAssemblies>

<UseMonoRuntime Condition=" '$(UseMonoRuntime)' == ''">false</UseMonoRuntime>
<PostProcessAssemblies Condition="'$(PostProcessAssemblies)' == '' And '$(UseMonoRuntime)' != 'true' And ('$(_UseNativeAot)' == 'true' Or '$(Registrar)' == 'trimmable-static') And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '11.0'))">$(PrepareAssemblies)</PostProcessAssemblies>

<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)Microsoft.$(_PlatformName).Sdk.targets</AfterMicrosoftNETSdkTargets>

Expand Down
Loading
Loading