-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable deduplication of generics in Xamarin.iOS build #17766
Enable deduplication of generics in Xamarin.iOS build #17766
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The estimated savings/improvements look amazing! Well done @kotlarmilos! 🚀 |
@@ -1022,6 +1048,39 @@ | |||
</ItemGroup> | |||
</Target> | |||
|
|||
<Target Name="_CreateAOTDedupAssembly" | |||
Condition="'$(_RunAotCompiler)' == 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding Inputs
and Outputs
makes it so that the assembly isn't recreated on every build, only the first build:
Condition="'$(_RunAotCompiler)' == 'true'"> | |
Condition="'$(_RunAotCompiler)' == 'true'" | |
Inputs="$(MSBuildThisFileFullPath)" | |
Outputs="$(_DedupAssembly)" | |
> |
This also means you'll have to define _DedupAssembly
elsewhere (maybe the _ComputeVariables
target?)
<PropertyGroup> | ||
<_DedupAssembly>$(IntermediateLinkDir)aot-instances.dll</_DedupAssembly> | ||
</PropertyGroup> | ||
<WriteLinesToFile File="$(_IntermediateNativeLibraryDir)/aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<WriteLinesToFile File="$(_IntermediateNativeLibraryDir)/aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" /> | |
<WriteLinesToFile File="$(_IntermediateNativeLibraryDir)aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" /> |
<_DedupAssembly>$(IntermediateLinkDir)aot-instances.dll</_DedupAssembly> | ||
</PropertyGroup> | ||
<WriteLinesToFile File="$(_IntermediateNativeLibraryDir)/aot-instances.cs" Overwrite="true" Lines="" WriteOnlyWhenDifferent="true" /> | ||
<Csc Sources="$(_IntermediateNativeLibraryDir)\aot-instances.cs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Csc Sources="$(_IntermediateNativeLibraryDir)\aot-instances.cs" | |
<Csc Sources="$(_IntermediateNativeLibraryDir)aot-instances.cs" |
@@ -1022,6 +1048,39 @@ | |||
</ItemGroup> | |||
</Target> | |||
|
|||
<Target Name="_CreateAOTDedupAssembly" | |||
Condition="'$(_RunAotCompiler)' == 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is necessary so that we don't try to do this when building on Windows without being connected to a Mac:
Condition="'$(_RunAotCompiler)' == 'true'"> | |
Condition="'$(_RunAotCompiler)' == 'true' And '$(IsMacEnabled)' == 'true'"> |
This didn't happen on the bots, so it might have been something local to you. |
/azp run |
Commenter does not have sufficient privileges for PR 17766 in repo xamarin/xamarin-macios |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Looks like Mac Catalyst apps crash on startup on ARM64:
|
Thanks! I will try to obtain more verbose stack trace by using the locally built runtime. The deduplication improvement has been tested on ios, tvos, and arm64 simulators in the runtime. |
Azure Pipelines successfully started running 2 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failures shouldn't be related. However, there are simulator tests pending. @rolfbjarne should we rerun the CI or pull the latest changes from the base branch? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
🔥 Failed to compare API and create generator diff 🔥 Failed to update apidiff references Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻✅ All tests on macOS M1 - Mac Ventura (13.0) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
❌ [CI Build] Windows Integration Tests failed ❌❌ Failed ❌ Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 219 tests passed 🎉 Tests counts✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
This PR contributes to dotnet/runtime#83193. It creates a new target
_CreateAOTDedupAssembly
, and makes the_AOTCompile
depend on it. Also, it changes theAOTCompile
task to passdedup-skip
anddedup-include
to the Mono AOT compiler.The change was tested on
MySingleView
app andMonotouch
tests. Both apps are working, but some monotouch tests are failing due toArg_NotlmplementedException
. Assumption is that calls between Obj-C and C# could be problematic, as with the dedup improvement enabled, extra methods got moved from origin assemblies to the dedup assembly, so native to managed mapping could be corrupted.Here are preliminary results comparing size on disk and build time between the baseline (
net8.0
branch) and the target (this branch). Binlog details are attached.Draft PR should get a full test run on the changes. The following tasks should be resolved before making this PR ready for review.
Tasks
aot-instances.dll
are calculated in inlined msbuild task, which is not the optimal solution. They might be calculated inComputeAOTArguments
, but the task is used during repository build./cc: @rolfbjarne @akoeplinger @ivanpovazan