Skip to content
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

[.NET] Build time is slower #10251

Open
Tracked by #44736
rolfbjarne opened this issue Dec 10, 2020 · 20 comments
Open
Tracked by #44736

[.NET] Build time is slower #10251

rolfbjarne opened this issue Dec 10, 2020 · 20 comments
Labels
dotnet An issue or pull request related to .NET (6) enhancement The issue or pull request is an enhancement iOS Issues affecting iOS macOS Issues affecting macOS
Milestone

Comments

@rolfbjarne
Copy link
Member

Build time is significantly slower with .NET 6 than with Xamarin.iOS.

cd tests/dotnet
git clean -xfdq
make compare

Then check the bin logs in the tests/dotnet directory.

Xamarin.iOS takes 11s to build:

$ msbuild /v:diag build-oldnet.binlog | tail -n 15
       62 ms  ResolveAssemblyReference                   1 calls
       69 ms  DetectSigningIdentity                      1 calls
      103 ms  DetectSdkLocations                         1 calls
      119 ms  SymbolStrip                                1 calls
      126 ms  SpotlightIndexer                           1 calls
      186 ms  Codesign                                   2 calls
      653 ms  DSymUtil                                   1 calls
      772 ms  Csc                                        1 calls
     8388 ms  MTouch                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:11.24

.NET 6 takes 18s to build:

$ msbuild /v:diag build-dotnet.binlog | tail -n 15
      200 ms  MSBuild                                    7 calls
      296 ms  LinkNativeCode                             1 calls
      393 ms  GenerateDepsFile                           2 calls
      501 ms  Codesign                                   2 calls
      917 ms  Csc                                        1 calls
     1185 ms  AOTCompile                                 1 calls
     1222 ms  CopyRefAssembly                            1 calls
     3276 ms  CompileNativeCode                          2 calls
     8576 ms  ILLink                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:18.55

The ILLink task significantly longer than the MTouch task used to take (which also includes AOT compilation and native code compilation).

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement macOS Issues affecting macOS iOS Issues affecting iOS dotnet An issue or pull request related to .NET (6) labels Dec 10, 2020
@rolfbjarne rolfbjarne added this to the .NET 6 milestone Dec 10, 2020
@rolfbjarne
Copy link
Member Author

CC @marek-safar

@rolfbjarne rolfbjarne added dotnet-pri0 .NET 6: required for stable release dotnet-pri1 .NET 6: important for stable release estimate-2w and removed dotnet-pri0 .NET 6: required for stable release labels Feb 3, 2021
@spouliot
Copy link
Contributor

spouliot commented Mar 9, 2021

P2 numbers. They look closer, between them [1], than the original numbers.

[1] this was done on a different (and slower) computer than the original post.

msbuild /v:diag build-oldnet.binlog | tail -n 15
      129 ms  SymbolStrip                                1 calls
      222 ms  ResolveAssemblyReference                   1 calls
      232 ms  SpotlightIndexer                           1 calls
      453 ms  DetectSdkLocations                         1 calls
      723 ms  DetectSigningIdentity                      1 calls
      881 ms  Codesign                                   2 calls
     1625 ms  DSymUtil                                   1 calls
     1745 ms  Csc                                        1 calls
    11812 ms  MTouch                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:18.99
/Users/poupou/git/master/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-preview.2.21158.2-osx-x64/dotnet /Users/poupou/git/master/xamarin-macios/builds/downloads/dotnet-sdk-6.0.100-preview.2.21158.2-osx-x64/sdk/6.0.100-preview.2.21158.2/MSBuild.dll /v:diag build-dotnet.binlog | tail -n 15
      339 ms  LinkNativeCode                             1 calls
      341 ms  UnpackLibraryResources                     1 calls
      478 ms  GenerateDepsFile                           2 calls
      555 ms  DetectSigningIdentity                      1 calls
     1104 ms  AOTCompile                                 1 calls
     1408 ms  Csc                                        1 calls
     2833 ms  CompileNativeCode                          2 calls
     5142 ms  Codesign                                   2 calls
     5391 ms  ILLink                                     1 calls

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:21.39

@filipnavara
Copy link
Member

The difference in Codesign is quite striking. Any explanation for it? (or .binlogs to analyze)

@spouliot
Copy link
Contributor

spouliot commented Mar 9, 2021

@filipnavara I missed it (looked only at how MTouchTask is now split out) and I'm not sure why in this case [1]. Let me find back the binlogs... (binlogs.zip attached)

note: It seems there was already a large diff in Codesign numbers in the original post.

[1] some Apple tools (like ibtool) spawn daemons that stays alive (for a while) so running two builds sequentially can skew numbers.

@filipnavara
Copy link
Member

The majority of time in Codesign is spent on signing the native libraries. The libraries coming from https://github.com/dotnet/runtime/tree/main/src/libraries/Native are already signed with some key and get resigned. The runtime libraries (libmonosgen-2.0.dylib, libxamarin.dylib, libxamarin-dotnet.dylib) are not signed.

Presumably this is something that should not be done on every compilation or could be avoided. I cannot see the same thing happening in the old Mono build unless it's folded quietly into one of the other tasks.

Moreover, the NuGet package Microsoft.iOS.Runtime.ios-arm64 seems to distribute both libxamarin.[a|dylib] and libxamarin-dotnet.[a|dylib]. That doesn't sound right. I believe only the later should be distributed for .NET 6.

@spouliot
Copy link
Contributor

spouliot commented Mar 9, 2021

@filipnavara that make sense 😄 The .dylib should not be present as they are not even allowed in iOS apps. The code is already linked (from the static library) inside the native executable. To be usable, dynamically, this would need to be put inside a (user) framework.

In all honesty taking the times from a release build (like we did here) is not really correct. It was just easier as the data was already on hands (from the size tracking issue). IOW

  • We really care about build time performance in debug builds where a fast edit/build/deploy cycle is important for the developer's productivity.

  • For, much less common, release builds we're willing to trade additional build time to get optimized (faster/smaller) applications.

But right now comparing release build times from current/legacy and dotnet gives us a feeling if we trend in the right (or wrong) direction. We'll eventually do more accurate measurements once all the pieces have landed. OTOH don't let me stop you from doing your own measurements/experiments 😃

@filipnavara
Copy link
Member

The .dylib should not be present as they are not even allowed in iOS apps.

Ah, good point. Coming from macOS background I missed that, especially since there was an explicit condition for iOS dylibs:
https://github.com/xamarin/xamarin-macios/blob/3a96cb02f50728feb2e4b3d5d2c3a5063b81137c/msbuild/Xamarin.Shared/Xamarin.Shared.targets#L1017-L1022

So the issue is that more things get included that should not be present in the bundle, right?

In all honesty taking the times from a release build (like we did here) is not really correct.

Well, I compared the binlogs you used. Then again, on iOS the code signing is unconditionally enabled even on Debug builds:
https://github.com/xamarin/xamarin-macios/blob/3a96cb02f50728feb2e4b3d5d2c3a5063b81137c/msbuild/Xamarin.Shared/Xamarin.Shared.targets#L1000-L1004

@spouliot
Copy link
Contributor

spouliot commented Mar 9, 2021

since there was an explicit condition for iOS dylibs:

Yes, dylib are fine for simulators and for device / debug build., e.g. it's used for the incremental builds. However they would be refused when submitted to the App Store.

So the issue is that more things get included that should not be present in the bundle, right?

Yes. They are not needed... or if they somehow are it's a bug that needs to be fixed.

on iOS the code signing is unconditionally enabled even on Debug builds

Yes. Devices won't accept unsigned (native) code. Simulator behave differently wrt signatures (it's not always needed).

@filipnavara
Copy link
Member

Moreover, the NuGet package Microsoft.iOS.Runtime.ios-arm64 seems to distribute both libxamarin.[a|dylib] and libxamarin-dotnet.[a|dylib]. That doesn't sound right. I believe only the later should be distributed for .NET 6.

I checked the latest package from main and this was already fixed. I could not pinpoint which commit did that though.

@spouliot
Copy link
Contributor

time on release builds (with the same caveats as mentioned in earlier comments)

legacy 16.19 real 14.47 user 2.98 sys
dotnet 17.23 real 18.64 user 3.52 sys

@rolfbjarne
Copy link
Member Author

This is an example of where our build is pretty slow: #11886

@rolfbjarne
Copy link
Member Author

See also: dotnet/linker#2089

@spouliot
Copy link
Contributor

spouliot commented Sep 8, 2021

time on release builds (same caveats as before, but it match the previous data used here) using RC1 binaries on MacBook Pro / M1

legacy 29.25 real 23.83 user 3.45 sys
dotnet 38.83 real 35.05 user 4.71 sys [1][2]

[1] configured to use LLVM, like legacy but unlike previous numbers for dotnet
[2] IL strip is not done (on dotnet/rc1) but is done on legacy

@spouliot
Copy link
Contributor

spouliot commented Sep 8, 2021

time on debug builds for simulators - again using RC1 binaries on MacBook Pro / M1

Legacy

time 5.03 real 3.81 user 1.04 sys

debug-oldnet.binlog.zip

Duration = 3.770 s
...
Top 10 most expensive tasks
    MTouch = 1.076 s
    Csc = 220 ms
    DetectSdkLocations = 215 ms
    ResolveAssemblyReference = 197 ms
    Codesign = 110 ms
    CompileAppManifest = 44 ms
    WriteItemsToFile = 41 ms
    MakeDir = 31 ms
    Message = 28 ms
    GetReferenceAssemblyPaths = 26 ms

net6 rc.1

time 22.32 real 23.38 user 4.40 sys

debug-dotnet.binlog.zip

Duration = 21.327 s
...
Top 10 most expensive tasks
    ILLink = 15.833 s
    CompileNativeCode = 566 ms
    RestoreTask = 450 ms
    Codesign = 275 ms
    LinkNativeCode = 264 ms
    Csc = 221 ms
    Copy = 214 ms
    DetectSdkLocations = 165 ms
    ProcessFrameworkReferences = 147 ms
    GenerateRuntimeConfigurationFiles = 123 ms

since it's close to the smallest app possible this kind of show the minimal build times.

note: this can be duplicated by applying https://gist.github.com/spouliot/2ade2822865fa7dff6cad0f11bbb2b09 to xamarin-macios branch release/6.0.1xx-rc.1 (or main for rc2 / work-in-progress)

@chamons
Copy link
Contributor

chamons commented Sep 23, 2021

I did some testing on release/6.0.1xx-preview9 to get speed info.

It was done on an older mac pro (trashcan), so they are comparable only to each other, not older builds.

These are release device builds:
Legacy: 33.95 real 32.75 user 2.57 sys
net6: 55.73 real 56.81 user 4.32 sys

These are debug sim builds:
Legacy: real 0m2.146s user 0m1.757s sys 0m0.467s
net6: real 0m35.024s user 0m46.012s sys 0m4.629s

@chamons
Copy link
Contributor

chamons commented Oct 21, 2021

These are on a newer machine than last time, so they are comparable only to each other, not older builds.

Release Device

Legacy - real 0m24.838s user 0m23.670s sys 0m3.584s
net6 - real 0m37.889s user 0m37.353s sys 0m5.227s

Debug Sim

Legacy - real 0m5.205s user 0m3.823s sys 0m1.142s
net6 - real 0m22.010s user 0m19.365s sys 0m4.626s

@chamons
Copy link
Contributor

chamons commented Dec 1, 2021

Report on 4564969 from https://github.com/xamarin/xamarin-macios/commits/release/6.0.1xx-preview11:

Release Device

Legacy - real 0m30.268s user 0m24.250s sys 0m3.900s
net6 - real 0m42.698s user 0m37.756s sys 0m5.734s

Debug Sim

Legacy - real 0m5.227s user 0m3.829s sys 0m1.123s
net6 - 0m21.774s user 0m19.472s sys 0m4.666s

rolfbjarne added a commit that referenced this issue Feb 2, 2022
…don't link' scenario. (#14011)

This speeds up builds significantly when the linker is disabled.

Test case: building tests/dotnet/MySimpleApp for macOS.

* Before: 37s
* After: 9s
* Difference: 26s (4x faster)

Test case: run the .NET tests

* Before: 2h55
* After: 1h43
* Difference: 1h12 (1.7x faster)

Contributes towards #10251.
Ref: dotnet/linker#2089
@rolfbjarne
Copy link
Member Author

There is still work to do here, but it's too late in the .NET 6 timeframe, so I'm postponing until .NET 7.

@rolfbjarne rolfbjarne modified the milestones: .NET 6, .NET 7 Feb 15, 2022
@rolfbjarne rolfbjarne removed estimate-2w dotnet-pri1 .NET 6: important for stable release labels Feb 15, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 7, .NET 8 Aug 26, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 8, .NET 9 Sep 11, 2023
@rolfbjarne rolfbjarne changed the title [.NET 6] Build time is slower [.NET6] Build time is slower Sep 11, 2023
@rolfbjarne rolfbjarne changed the title [.NET6] Build time is slower [.NET] Build time is slower Sep 11, 2023
@github-project-automation github-project-automation bot moved this to Optimizations in .NET 9 Aug 27, 2024
@rolfbjarne rolfbjarne modified the milestones: .NET 9, .NET 10 Sep 26, 2024
@rolfbjarne rolfbjarne removed this from .NET 9 Sep 26, 2024
@MichaelLHerman
Copy link

MichaelLHerman commented Jan 22, 2025

This build time problem is getting out of hand - keeps on getting worse. I have to keep increasing the timeout while building on Azure Dev Ops, currently needed to set the build timeout to 3 hours.

AOTCompile of Microsoft.iOS is taking 32 minutes (my main assembly is only taking 16.75 minutes)

Also, not sure from the logs whats happening between 16:33:02 and 17:11:24 since it doesn't print a "Tool ... execution started with arguments: " only a "Tool ... execution finished" at 17:11:24, but thats taking 38 minutes as well.

Initialize job log

2025-01-22T15:05:08.6430780Z ##[section]Starting: Initialize job
2025-01-22T15:05:08.6433220Z Agent name: 'Hosted Agent'
2025-01-22T15:05:08.6433710Z Agent machine name: 'Mac-1737558067549'
2025-01-22T15:05:08.6433970Z Current agent version: '3.248.0'
2025-01-22T15:05:08.6473500Z ##[group]Operating System
2025-01-22T15:05:08.6473890Z macOS
2025-01-22T15:05:08.6474140Z 15.2
2025-01-22T15:05:08.6474350Z 24C101
2025-01-22T15:05:08.6474600Z ##[endgroup]
2025-01-22T15:05:08.6474890Z ##[group]Runner Image
2025-01-22T15:05:08.6475190Z Image: macos-15
2025-01-22T15:05:08.6475510Z Version: 20250120.591
2025-01-22T15:05:08.6476100Z Included Software: https://github.com/actions/runner-images/blob/macos-15/20250120.591/images/macos/macos-15-Readme.md
2025-01-22T15:05:08.6476840Z Image Release: https://github.com/actions/runner-images/releases/tag/macos-15%2F20250120.591
2025-01-22T15:05:08.6477300Z ##[endgroup]
2025-01-22T15:05:08.6477630Z ##[group]Runner Image Provisioner
2025-01-22T15:05:08.6478180Z 2.0.414.1+2ecee806bcbb7b5d267443ac0090547f461e95b1
2025-01-22T15:05:08.6478560Z ##[endgroup]
2025-01-22T15:05:08.6485910Z Current image version: '20250120.591'
2025-01-22T15:05:08.9400690Z Agent running as: 'runner'
2025-01-22T15:05:08.9465640Z Prepare build directory.
2025-01-22T15:05:09.1508420Z Set build variables.
2025-01-22T15:05:09.1544930Z Download all required tasks.
2025-01-22T15:05:09.1730540Z Downloading task: InstallAppleCertificate (2.246.5)
2025-01-22T15:05:11.0550680Z Downloading task: InstallAppleProvisioningProfile (1.246.3)
2025-01-22T15:05:12.1764170Z Downloading task: CmdLine (2.246.1)
2025-01-22T15:05:12.6772690Z Downloading task: UseDotNet (2.248.1)
2025-01-22T15:05:15.0467530Z Downloading task: DotNetCoreCLI (2.247.3)
2025-01-22T15:05:18.0526890Z Downloading task: CopyFiles (2.246.0)
2025-01-22T15:05:18.6253590Z Downloading task: PublishBuildArtifacts (1.247.1)
2025-01-22T15:05:19.1045010Z Checking job knob settings.
2025-01-22T15:05:19.1048780Z    Knob: DockerActionRetries = true Source: $(VSTSAGENT_DOCKER_ACTION_RETRIES) 
2025-01-22T15:05:19.1049390Z    Knob: AgentToolsDirectory = /Users/runner/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
2025-01-22T15:05:19.1051190Z    Knob: UseGitLongPaths = true Source: $(USE_GIT_LONG_PATHS) 
2025-01-22T15:05:19.1053330Z    Knob: EnableIssueSourceValidation = true Source: $(ENABLE_ISSUE_SOURCE_VALIDATION) 
2025-01-22T15:05:19.1054460Z    Knob: AgentEnablePipelineArtifactLargeChunkSize = true Source: $(AGENT_ENABLE_PIPELINEARTIFACT_LARGE_CHUNK_SIZE) 
2025-01-22T15:05:19.1057260Z    Knob: ContinueAfterCancelProcessTreeKillAttempt = true Source: $(VSTSAGENT_CONTINUE_AFTER_CANCEL_PROCESSTREEKILL_ATTEMPT) 
2025-01-22T15:05:19.1058480Z    Knob: ProcessHandlerSecureArguments = false Source: $(AZP_75787_ENABLE_NEW_LOGIC) 
2025-01-22T15:05:19.1059150Z    Knob: ProcessHandlerSecureArguments = false Source: $(AZP_75787_ENABLE_NEW_LOGIC_LOG) 
2025-01-22T15:05:19.1059610Z    Knob: ProcessHandlerTelemetry = true Source: $(AZP_75787_ENABLE_COLLECT) 
2025-01-22T15:05:19.1060460Z    Knob: UseNewNodeHandlerTelemetry = True Source: $(DistributedTask.Agent.USENEWNODEHANDLERTELEMETRY) 
2025-01-22T15:05:19.1061490Z    Knob: ProcessHandlerEnableNewLogic = true Source: $(AZP_75787_ENABLE_NEW_PH_LOGIC) 
2025-01-22T15:05:19.1062280Z    Knob: EnableResourceMonitorDebugOutput = true Source: $(AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT) 
2025-01-22T15:05:19.1062840Z    Knob: EnableResourceUtilizationWarnings = true Source: $(AZP_ENABLE_RESOURCE_UTILIZATION_WARNINGS) 
2025-01-22T15:05:19.1063580Z    Knob: IgnoreVSTSTaskLib = true Source: $(AZP_AGENT_IGNORE_VSTSTASKLIB) 
2025-01-22T15:05:19.1064040Z    Knob: FailJobWhenAgentDies = true Source: $(FAIL_JOB_WHEN_AGENT_DIES) 
2025-01-22T15:05:19.1064650Z    Knob: CheckForTaskDeprecation = true Source: $(AZP_AGENT_CHECK_FOR_TASK_DEPRECATION) 
2025-01-22T15:05:19.1065380Z    Knob: CheckIfTaskNodeRunnerIsDeprecated246 = True Source: $(DistributedTask.Agent.CheckIfTaskNodeRunnerIsDeprecated246) 
2025-01-22T15:05:19.1066990Z    Knob: UseNode20ToStartContainer = True Source: $(DistributedTask.Agent.UseNode20ToStartContainer) 
2025-01-22T15:05:19.1068170Z    Knob: LogTaskNameInUserAgent = true Source: $(AZP_AGENT_LOG_TASKNAME_IN_USERAGENT) 
2025-01-22T15:05:19.1068680Z    Knob: UseFetchFilterInCheckoutTask = true Source: $(AGENT_USE_FETCH_FILTER_IN_CHECKOUT_TASK) 
2025-01-22T15:05:19.1069240Z    Knob: Rosetta2Warning = true Source: $(ROSETTA2_WARNING) 
2025-01-22T15:05:19.1070300Z    Knob: AddForceCredentialsToGitCheckout = True Source: $(DistributedTask.Agent.AddForceCredentialsToGitCheckout) 
2025-01-22T15:05:19.1070920Z Finished checking job knob settings.
2025-01-22T15:05:19.2092880Z Start tracking orphan processes.
2025-01-22T15:05:19.2172370Z ##[section]Finishing: Initialize job

dotnet publish -f net9.0-ios -c Release -v d -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignKey="blah" -p:CodesignProvision="redacted" -p:NoDSymUtil=false

2025-01-22T15:07:53.5451360Z ##[section]Starting: RC - Build App
2025-01-22T15:07:53.5458290Z ==============================================================================
2025-01-22T15:07:53.5458500Z Task         : Command line
2025-01-22T15:07:53.5458660Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2025-01-22T15:07:53.5458850Z Version      : 2.246.1
2025-01-22T15:07:53.5458950Z Author       : Microsoft Corporation
2025-01-22T15:07:53.5459130Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2025-01-22T15:07:53.5459310Z ==============================================================================
2025-01-22T15:07:53.8051060Z Generating script.
2025-01-22T15:07:53.8066320Z ========================== Starting Command Output ===========================
2025-01-22T15:07:53.8090770Z [command]/bin/bash --noprofile --norc /Users/runner/work/_temp/b602b4b9-3deb-48ba-b505-65bfb763dd81.sh
2025-01-22T15:07:54.2440270Z Build started 1/22/2025 3:07:54 PM.
2025-01-22T15:07:54.2479790Z      0>Terminal Logger was not used because the output is being redirected to a file.
2025-01-22T15:07:54.2484810Z        Process = "/Users/runner/hostedtoolcache/dotnet/dotnet"
2025-01-22T15:07:54.2485540Z        MSBuild executable path = "/Users/runner/hostedtoolcache/dotnet/sdk/9.0.100/MSBuild.dll"
2025-01-22T15:07:54.2492000Z        Command line arguments = "/Users/runner/hostedtoolcache/dotnet/sdk/9.0.100/MSBuild.dll -maxcpucount -verbosity:m -tlp:default=auto -nologo -target:Restore -tlp:verbosity=quiet --property:_IsPublishing=true --property:ArchiveOnBuild=true --property:RuntimeIdentifier=ios-arm64 --property:NoDSymUtil=false -property:Configuration=Release -verbosity:d -property:DOTNET_CLI_DISABLE_PUBLISH_AND_PACK_RELEASE=true -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/Users/runner/hostedtoolcache/dotnet/sdk/9.0.100/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/Users/runner/hostedtoolcache/dotnet/sdk/9.0.100/dotnet.dll"
2025-01-22T15:07:54.2500990Z        Current directory = "/Users/runner/work/1/s/CadabraMobile"
2025-01-22T15:07:54.2510230Z        MSBuild version = "17.12.7+5b8665660"
...
2025-01-22T15:33:13.8968200Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution started with arguments: --path=/Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked --aot=mtriple=arm64-ios,data-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.aotdata,static,asmonly,dedup-skip,direct-icalls,full,readonly-value=ObjCRuntime.Runtime.Arch=i4/0,nodebug,dwarfdebug,llvm-path=/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools,outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.s,llvm-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.llvm.o --debug --llvm -O=gsharedvt /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/Microsoft.iOS.dll
2025-01-22T15:33:13.8969710Z                  
2025-01-22T15:33:13.8970020Z              Current directory: /Users/runner/work/1/s/CadabraMobile
2025-01-22T15:33:13.8970340Z              With environment:
2025-01-22T15:33:13.8970920Z                  DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
2025-01-22T16:05:45.2230350Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 0).
2025-01-22T16:05:45.2233550Z                  
2025-01-22T16:05:45.2234510Z          Mono Ahead of Time compiler - compiling assembly /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/Microsoft.iOS.dll
2025-01-22T16:05:45.2235140Z          AOTID A625E2C9-C467-23E4-50FA-E0ED117B282C
2025-01-22T16:05:45.2235710Z          Compiled: 156829/156850
2025-01-22T16:05:45.2236800Z          Executing opt: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/opt" -f -disable-tail-calls -passes="default<O2>,place-safepoints" -spp-all-backedges -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.s.opt.bc" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.s.bc"
2025-01-22T16:05:45.2239390Z          Executing llc: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/llc"  -enable-implicit-null-checks -disable-fault-maps -march=aarch64 -asm-verbose=false -mtriple=arm64-ios -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_Microsoft_iOS_eh_frame -disable-tail-calls -relocation-model=static -filetype=obj -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.llvm.o" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.s.opt.bc"
2025-01-22T16:05:45.2241730Z          Output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.s'.
2025-01-22T16:05:45.2242430Z          Linking symbol: '_mono_aot_module_Microsoft_iOS_info'.
2025-01-22T16:05:45.2243050Z          LLVM output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/Microsoft.iOS.dll.llvm.o'.
2025-01-22T16:05:45.2243670Z          JIT time: 38542 ms, Generation time: 17940 ms, Assembly+Link time: 1884881 ms.
2025-01-22T16:05:45.2244070Z          
2025-01-22T16:05:45.2248300Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution started with arguments: --path=/Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked --aot=mtriple=arm64-ios,data-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.aotdata,static,asmonly,dedup-skip,direct-icalls,full,readonly-value=ObjCRuntime.Runtime.Arch=i4/0,nodebug,dwarfdebug,llvm-path=/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools,outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.s,llvm-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.llvm.o --debug --llvm -O=gsharedvt /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/CadabraMobile.dll
2025-01-22T16:05:45.2268630Z                  
2025-01-22T16:05:45.2269260Z              Current directory: /Users/runner/work/1/s/CadabraMobile
2025-01-22T16:05:45.2269750Z              With environment:
2025-01-22T16:05:45.2270300Z                  DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
2025-01-22T16:22:27.6573000Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 0).
2025-01-22T16:22:27.6574280Z                  
2025-01-22T16:22:27.6574970Z          Mono Ahead of Time compiler - compiling assembly /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/CadabraMobile.dll
2025-01-22T16:22:27.6575880Z          AOTID 86D598D3-7C06-E253-E1B6-75D3762181DE
2025-01-22T16:22:27.6582390Z          Compiled: 46417/46417
2025-01-22T16:22:27.6584840Z          Executing opt: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/opt" -f -disable-tail-calls -passes="default<O2>,place-safepoints" -spp-all-backedges -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.s.opt.bc" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.s.bc"
2025-01-22T16:22:27.6587470Z          Executing llc: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/llc"  -enable-implicit-null-checks -disable-fault-maps -march=aarch64 -asm-verbose=false -mtriple=arm64-ios -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_CadabraMobile_eh_frame -disable-tail-calls -relocation-model=static -filetype=obj -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.llvm.o" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.s.opt.bc"
2025-01-22T16:22:27.6589940Z          Output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.s'.
2025-01-22T16:22:27.6590730Z          Linking symbol: '_mono_aot_module_CadabraMobile_info'.
2025-01-22T16:22:27.6591300Z          LLVM output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/CadabraMobile.dll.llvm.o'.
2025-01-22T16:22:27.6591760Z          JIT time: 20310 ms, Generation time: 5947 ms, Assembly+Link time: 970919 ms.

…
2025-01-22T16:33:02.5400280Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution started with arguments: --path=/Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked --aot=mtriple=arm64-ios,data-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.aotdata,static,asmonly,dedup-skip,direct-icalls,full,readonly-value=ObjCRuntime.Runtime.Arch=i4/0,nodebug,dwarfdebug,direct-pinvoke,llvm-path=/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools,outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.s,llvm-outfile=obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.llvm.o --debug --llvm -O=gsharedvt /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/System.IO.Pipes.AccessControl.dll
2025-01-22T16:33:02.5401910Z                  
2025-01-22T16:33:02.5402760Z              Current directory: /Users/runner/work/1/s/CadabraMobile
2025-01-22T16:33:02.5404420Z              With environment:
2025-01-22T16:33:02.5405350Z                  DEVELOPER_DIR=/Applications/Xcode_16.2.app/Contents/Developer
2025-01-22T16:33:02.7183890Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 0).
2025-01-22T16:33:02.7184800Z                  
2025-01-22T16:33:02.7185730Z          Mono Ahead of Time compiler - compiling assembly /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/System.IO.Pipes.AccessControl.dll
2025-01-22T16:33:02.7186440Z          AOTID F60A89A8-F126-3CA3-8CBC-16A2DBA73900
2025-01-22T16:33:02.7187360Z          Compiled: 52/52
2025-01-22T16:33:02.7188950Z          Executing opt: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/opt" -f -disable-tail-calls -passes="default<O2>,place-safepoints" -spp-all-backedges -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.s.opt.bc" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.s.bc"
2025-01-22T16:33:02.7191500Z          Executing llc: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/llc"  -enable-implicit-null-checks -disable-fault-maps -march=aarch64 -asm-verbose=false -mtriple=arm64-ios -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_System_IO_Pipes_AccessControl_eh_frame -disable-tail-calls -relocation-model=static -filetype=obj -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.llvm.o" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.s.opt.bc"
2025-01-22T16:33:02.7193030Z          Output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.s'.
2025-01-22T16:33:02.7194080Z          Linking symbol: '_mono_aot_module_System_IO_Pipes_AccessControl_info'.
2025-01-22T16:33:02.7195220Z          LLVM output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/System.IO.Pipes.AccessControl.dll.llvm.o'.
2025-01-22T16:33:02.7208330Z          JIT time: 6 ms, Generation time: 2 ms, Assembly+Link time: 124 ms.
2025-01-22T16:33:02.7208730Z          
2025-01-22T17:11:24.7265480Z          Tool /Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 0).
2025-01-22T17:11:24.7269240Z                  
2025-01-22T17:11:24.7271960Z          Mono Ahead of Time compiler - compiling assembly /Users/runner/work/1/s/CadabraMobile/obj/Release/net9.0-ios/ios-arm64/linked/aot-instances.dll
2025-01-22T17:11:24.7274070Z          AOTID 79F7456B-5216-0909-0976-234BBD04DAF7
2025-01-22T17:11:24.7276890Z          Adding 142746 dedup-ed methods.
2025-01-22T17:11:24.7278500Z          Compiled: 126283/126310
2025-01-22T17:11:24.7280730Z          Executing opt: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/opt" -f -disable-tail-calls -passes="default<O2>,place-safepoints" -spp-all-backedges -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.s.opt.bc" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.s.bc"
2025-01-22T17:11:24.7285610Z          Executing llc: "/Users/runner/hostedtoolcache/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.ios-arm64/9.0.0/Sdk/../tools/llc"  -enable-implicit-null-checks -disable-fault-maps -march=aarch64 -asm-verbose=false -mtriple=arm64-ios -disable-gnu-eh-frame -enable-mono-eh-frame -mono-eh-frame-symbol=_mono_aot_aot_instances_eh_frame -disable-tail-calls -relocation-model=static -filetype=obj -o "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.llvm.o" "obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.s.opt.bc"
2025-01-22T17:11:24.7289540Z          Output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.s'.
2025-01-22T17:11:24.7292070Z          Linking symbol: '_mono_aot_module_aot_instances_info'.
2025-01-22T17:11:24.7294130Z          LLVM output file: 'obj/Release/net9.0-ios/ios-arm64/nativelibraries/aot-output/arm64/aot-instances.dll.llvm.o'.
2025-01-22T17:11:24.7296630Z          JIT time: 702284 ms, Generation time: 16592 ms, Assembly+Link time: -1550973 ms.
2025-01-22T17:11:24.7298220Z          
2025-01-22T17:11:24.9952180Z        Done executing task "AOTCompile".

@MichaelLHerman
Copy link

MichaelLHerman commented Feb 5, 2025

My issue was that I had <MtouchLink>None</MtouchLink> in my Release configuration, overriding the default <MtouchLink>SdkOnly</MtouchLink> / <TrimMode>partial</TrimMode>. Feels ironic that linking/trimming now makes builds go faster by cutting down on AOT compile time on unused sdk dependencies, whereas previously, not linking was making builds go faster. Feels like this should be documented somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dotnet An issue or pull request related to .NET (6) enhancement The issue or pull request is an enhancement iOS Issues affecting iOS macOS Issues affecting macOS
Projects
None yet
Development

No branches or pull requests

5 participants