Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Sebastien Pouliot 3a851e2a63
[mtouch][mmp] Report invalid debug symbols files. Fixes #3200 (#3203)
* [mtouch][mmp] Report invalid debug symbols files. Fixes #3200

Try to read the assembly with symbols and, if that fails, warn and
fallback to loading them without symbols.

This fixes cases were it's not easy to update or delete (e.g. nuget)
bad symbols files - so this cannot be an error without causing a lot
of pain.

However it needs to be reported, otherwise it wont be fixed (by the
publisher) and it can limit the debugability of the application and
the usefulness of the stacktraces.

Finally merge most of the resolver's code between mtouch and mmp so
we don't have to fix such issue twice anymore.

note: this needs to be slightly updated once we get a version of cecil
that can give us a more precise error message.

Also bring Rolf's tests from
https://github.com/xamarin/xamarin-macios/pull/3079

reference:
https://github.com/xamarin/xamarin-macios/issues/3200
2018-01-12 17:39:38 -05:00
Chris Hamons 91ded43b0b [macos] Fix pdb mismatch when saving assemblies processed by mmp (#2901)
- https://bugzilla.xamarin.com/show_bug.cgi?id=60277
- Teach mmp and mtouch resolver to always ask for symbol reading from Cecil
- In most cases we explicitly load symbols (LoadReferencesStep) but when we don't rewritten assemblies don't match their pdb and we break debugging.
2017-10-23 12:52:14 -05:00
Ludovic Henry 8178ecc5ea Bump mono to 2017-06 (#2595) 2017-09-05 14:48:09 -04:00
Rolf Bjarne Kvinge 257de9c2c0 [mtouch] Normalize strings that refer to assemblies and their paths before comparing them. Fixes #57266. (#2217)
HFS normalizes filenames to Form D when files are stored. This means that an
assembly whose assembly name is stored in Form C might be stored in a file
whose filename is Form D (which you'll get if you use the Form C filename).

However, this is a problem when we've already loaded an assembly and if we
doesn't take normalization into account: we check the cache based on the
filename, but store in the cache based on the assembly name. If those two uses
different normalization schemes, bad things (bug #57266) happen.

So in these scenarios normalize strings before comparing them.

https://bugzilla.xamarin.com/show_bug.cgi?id=57266
2017-06-15 11:24:31 +02:00
Rolf Bjarne Kvinge 7e28df59c4 [mtouch] Implement support for sharing code between app extensions and container apps.
Implement support for sharing both code and resources between app extensions
and their container app:

* AOT-compiled code. Each shared assembly is only AOT-compiled once, and if
  the assembly is built to a framework or dynamic library, it will also only
  be included once in the final app (as a framework or dynamic library in the
  container app, referenced directly by the app extension). If the assemblies
  are built to static objects there won't be any size improvements in the app,
  but the build will be much faster, because the assemblies will only be AOT-
  compiled once.
* Any resources related to managed assemblies (debug files, config files,
  satellite assemblies) will be put in the container app only.

Since these improvements are significant, code sharing will be enabled by
default.

Test results
============

For an extreme test project with 7 extensions (embedded-frameworks)[1]:

             with code sharing     cycle 9     difference
build time      1m 47s               3m 33s        -1m 46s = ~50% faster
app size         26 MB               131 MB       -105 MB  = ~80% smaller

For a more normal test project (MyTabbedApplication)[2] - this is a simple application with 1 extension:

             with code sharing     cycle 9     difference
build time      0m 44s               0m 48s        -4s    = ~ 8% faster
app size         23 MB                37 MB        -15 MB = ~40% smaller

Another tvOS app with one extension also show similar gains (MyTVApp)[3]:

             with code sharing     cycle 9     difference
build time      0m 22s               0m 48s        -26s    = ~54% faster
app size         22 MB                62 MB        -40 MB  = ~65% smaller

[1]: https://github.com/rolfbjarne/embedded-frameworks
[2]: https://github.com/xamarin/xamarin-macios/tree/cycle9/msbuild/tests/MyTabbedApplication
[3]: https://github.com/xamarin/xamarin-macios/tree/cycle9/msbuild/tests/MyTVApp
2017-02-10 16:39:15 +01:00
Sebastien Pouliot b1281b259f [cecil] Bump mono to get the latest Cecil's revision. Fixes #51336 (#1478)
This includes [1] which fix the parsing of broken .mdb as seen in [2]

Also fix mtouch's resolver and the static registrar to match some Cecil
API changes.

references:
[1] 045b0f9729
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=51336
2017-01-12 08:47:06 -05:00
Sebastien Pouliot eb34a6a74f [mtouch] Reduce the number of file lookups inside AssemblyResolver (#1009)
The SDK does not ship any, non-tool, .exe files. In fact .exe _should_
never need to be resolved since the main .exe is always given as an input
to mtouch.

Still it's possible (if quite uncommon) to refer to other .exe assemblies
just like if they were .dll. However those can only come from the
RootDirectory (and not the other places that ship with the SDK).

This "fix" ensure lookups for *.exe is done only inside the RootDirectory
location, speeding up (a bit) resolving assemblies.
2016-10-31 22:30:32 -04:00
Rolf Bjarne Kvinge c6d7a3adec [linker] Use ordinal instead of invariant comparison. (#1025)
Profiled when running the partial static registrar on Xamarin.iOS.dll

Duration before: 1,60s
Duration after:  1,41s
Difference:     -0,19s = -11,9%

Memory usage before: 541.887.736 bytes
Memory usage after:  509.111.944 bytes
Difference:          -32.775.792 bytes = -6,0%

Method calls before: 86.720.379
Method calls after:  63.073.602
Difference:         -23.646.777 = -27,3%
2016-10-28 08:28:02 -04:00
Rolf Bjarne Kvinge a3939b100f [mtouch] Tell Cecil to load assemblies in memory unless they're big assemblies. (#935)
In the recent Cecil update Cecil changed from loading assemblies in memory to
keep a FileStream around and read whenever necessary [1].

This is problematic for us, because we need all the AssemblyDefinitions in
memory at once, and if there are many assemblies, then we'll run into problems
due to the number of file descriptors in use.

So revert to the behavior for the old Cecil: loading assemblies in memory,
unless the assemblies are big, since in that case we might run out of memory
otherwise.

http://cecil.pe/post/149243207656/mono-cecil-010-beta-1
2016-10-03 13:44:51 -04:00
Rolf Bjarne Kvinge 2eb6ba12c7 [mtouch/mmp] Fix build after breaking cecil update in mono.
Also use mono's cecil instead of our own cecil submodule for mtouch.
2016-09-01 18:28:35 +02:00
Rolf Bjarne Kvinge e291f1717d Revert "Bump [watch-]mono to master to get fix for #43658." (#665) 2016-08-25 14:44:53 +02:00
Rolf Bjarne Kvinge f6b1ccd748 Bump [watch-]mono to master to get fix for #43658. (#653)
* Bump [watch-]mono to master to get fix for #43658.

https://bugzilla.xamarin.com/show_bug.cgi?id=43658

* [mtouch/mmp] Fix build after breaking cecil update in mono.

Also use mono's cecil instead of our own cecil submodule for mtouch.

* Bump [watch-]mono to get compilation fixes after cecil bump in mono.

* Remove cecil submodule, we only use the one in mono now.
2016-08-25 13:10:14 +02:00
Rolf Bjarne Kvinge 50a8af84db Add mtouch to the build. 2016-04-24 14:47:27 -04:00