Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 20257 [details]
If I do a clean build of an iOS app it takes a long time (20 minutes in mobile centre, 7 minutes locally). Incremental builds are fast, but clean builds are slow. It seems to be related to the AOTing of libraries and nuget packages. If I delete everything from bin/obj except the mtouch_cache folder builds are fast.
Log file generated using -v -v -v --time --time attached.
You have a lot of assemblies (it looks like ~60 assemblies remain after the managed linker has removed unused code), and AOT-compilation is slow. It's normal that a full build takes a while.
A few tips:
* Don't build for 3 architectures unless you have a good reason to (armv7, armv7s, arm64). For 99% of apps armv7s is unnecessary. This will make the build ~30% faster.
* Don't clean the project :) We implemented incremental builds to solve exactly this problem, but that won't work if you clean your project.
* Enable device-specific builds in the IDE. This will reduce the amount of architectures you build from the IDE to 1 (the one your connected device has).
* Enable the linker for all assemblies, not only SDK assemblies. This will likely remove more code, and there will be less work for the AOT compiler. Some apps don't work correctly when fully linked, in particular apps that use reflection in some way, so take care here.
Thanks Rolf. I raised this at the request of John Miller after discussing on the slack channel. The problem with incremental builds is sometimes we get weird errors in Visual Studio for Mac about a sealed resource is missing and we have to do a clean build. We also build using Mobile Center which is always a clean build, so it would be nice to speed that up.
I'll remove the armv7s and see how it goes.
Is there a way to cache parts of the mtouch_cache outside of the Obj folder so that we could ship the AOTd binaries for nuget packages with our build to make it faster in Mobile Center?
Looks like Rolf got a chance to investigate this before me, thanks Rolf!
It sounds like a separate issue should be filed for the sealed resource problem. That might be something that can be fixed.
(In reply to Jim Bennett from comment #2)
> The problem with incremental builds is sometimes we get
> weird errors in Visual Studio for Mac about a sealed resource is missing and
> we have to do a clean build.
This sounds like bug #52165.