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

1573 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge d884c2a2c7 [linker] We don't need to pass the linker options to create sub steps anymore. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 17ac227fb3 [linker] Stop passing data to the OptimizeGeneratedCode steps using a constructor. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge d5aaa964e1 [linker] Stop passing data to the RemoveUserResources sub step using a constructor. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 41abc3af77 [linker] Always create the RemoveCode step, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:47 +02:00
Rolf Bjarne Kvinge 196ea91a72 [linker] Always create the CoreRemoveSecurity step, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 1b3cb7747e [linker] Always create the [Core]RemoveAttributes steps, and instead detect if it should be active using the LinkContext field. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 0dde91584c [linker] Stop passing data to the CoreHttpMessageHandler step using a constructor. 2020-05-07 15:51:38 +02:00
Rolf Bjarne Kvinge 03c6f8d1cc
[mmp] Remove the Driver.linker_options field, and use BuildTarget.LinkerOptions instead. (#8540)
This will eventually allow for more code sharing between mtouch and mmp.
2020-05-07 15:01:26 +02:00
Rolf Bjarne Kvinge 3ce5b69276
[linker] Remove extranous space in user-visible text. (#8539) 2020-05-07 15:00:53 +02:00
Rolf Bjarne Kvinge 48b7ef4696
[mtouch/mmp] Pass the path to mscorlib explicitly to the partial static registrar code instead of relying on resolving it successfully. (#8525)
This makes the code simpler when we have to add support for .NET.

This requires modifying the linker to accept a null FrameworkDirectory.
2020-05-07 08:37:17 +02:00
Sebastien Pouliot 61580b15af
[linker] Update custom attributes that can be removed (#8535)
Some are no longer part of the SDK (or converted into new ones
at build time), others were new (and missing).

A full list of attributes and their usage frequency in what we ship can
be seen in https://gist.github.com/spouliot/ca03c6da7d4d75670ca77749350eb8a2

Also update tests: no need to check for removals of stuff that does not
exists anymore.
2020-05-06 20:44:52 -04:00
Sebastien Pouliot 73da7658dc
[linker] Directly use Annotations in BaseStep subclasses (#8530)
It's exposed directly in `BaseStep` and makes porting code easier to net5
2020-05-06 20:43:16 -04:00
Sebastien Pouliot b462447053
[mtouch] Fix debug with profiler on app extensions (#8505)
Always add `libmono-profiler-log.dylib` if profiling is enabled and we
are building with dynamic libraries. The profiler code is not (meant to
be) shipped so it can be added even without a `Frameworks` directory.

This fix debugging too (if profiler is enabled) since the library was
linked (even if it was not included).

Fix https://github.com/xamarin/xamarin-macios/issues/8470

Co-authored-by: Sebastien Pouliot <sebastien.pouliot@microsoft.com>
2020-05-06 17:34:44 -04:00
Rolf Bjarne Kvinge 296eabd9ac
[mmp] Always pass --nolink when generating the partial static registrar code. (#8524)
The fact that the mobile profile allows linking doesn't mean it should be done
(it doesn't actually link because we run the registrar before linking happens,
but this way the code is less confusing and there are no unnecessary
differences between full and mobile).
2020-05-06 16:43:55 +02:00
Rolf Bjarne Kvinge 7b927aa558
[linker] Remove unused LinkerOptions.IsDualBuild field. (#8522) 2020-05-06 14:11:08 +02:00
Rolf Bjarne Kvinge d574250a27
Remove XAMARIN_APPLETLS, it seems like it's always defined, which means it's not needed. (#8523)
Also remove outdated comment about Xamarin.Mac/Classic, since XM/Classic is dead.
2020-05-06 14:11:02 +02:00
Rolf Bjarne Kvinge a1c8b59e8a
[mmp] No need to pass --xamarin-full-framework when generating the partial static registrar code. (#8520)
It's already implied with the --framework argument.
2020-05-06 14:10:31 +02:00
Rolf Bjarne Kvinge f7bc4e2364
[mtouch] Generate partial static registrar code for arm64_32 as well. (#8521) 2020-05-06 14:10:12 +02:00
Rolf Bjarne Kvinge 70cfbca868
[mtouch] Rework makefile logic to use a template to minimize code duplication. (#8518)
This becomes more important with .NET, when we'll have twice as many files to generate and compile.
2020-05-06 09:25:30 +02:00
Rolf Bjarne Kvinge 352dc6b796
[mmp] Simplify partial static registrar generation command a little bit. (#8516) 2020-05-06 09:24:47 +02:00
Rolf Bjarne Kvinge cf2b43ef5d
[mmp] Use our explicit clang execution instead of using xcrun. (#8517)
This way we use the Xcode.app we've configured in Make.config.
2020-05-06 09:15:46 +02:00
Rolf Bjarne Kvinge c81f254a28
[mtouch/mmp] Share Driver.GetFrameworks. (#8511) 2020-05-05 16:52:56 +02:00
Rolf Bjarne Kvinge 6f5299fe3d
[mtouch/mmp] Remove IStaticRegistrar, it's no longer needed. (#8512)
It was created to support Xamarin.Mac/Classic, but that's not supported
anymore, so we can just remove this interface.
2020-05-05 16:50:28 +02:00
Rolf Bjarne Kvinge 83e77173dc
[mtouch] Detect the right build target for the partial static registrar. (#8508) 2020-05-05 15:35:35 +02:00
Rolf Bjarne Kvinge acfb101a78
[mtouch/mmp] Share the Application.References field. (#8507) 2020-05-05 15:35:02 +02:00
Rolf Bjarne Kvinge fc990997b4
[mmp] Use absolute paths when generating the partial static registrar code. (#8509)
Makes it easier to c&p commands and execute them elsewhere.
2020-05-05 15:31:17 +02:00
Rolf Bjarne Kvinge 5e398e0f02
[mmp] No need to lipo a single executable file. (#8510)
Just copy it instead.
2020-05-05 15:31:06 +02:00
Sebastien Pouliot e45278259b
[linker] Remove now unneeded code from PreserveCode (#8504)
`monotouch-glue.m` was replaced a while ago and the new code does not
need `Class.LookupFullName` to be preserved in debug builds.

Also `PreserveType` was unused code (left from even older times?)
2020-05-05 09:27:26 -04:00
Rolf Bjarne Kvinge f8be1a8802
Merge pull request #8463 from rolfbjarne/remove-objectwrapper
Remove the ObjectWrapper class
2020-05-05 08:44:55 +02:00
Sebastien Pouliot 6f50b8f5e9 [mtouch] Fix debug with profiler on app extensions
Always add `libmono-profiler-log.dylib` if profiling is enabled and we
are building with dynamic libraries. The profiler code is not (meant to
be) shipped so it can be added even without a `Frameworks` directory.

This fix debugging too (if profiler is enabled) since the library was
linked (even if it was not included).

Fix https://github.com/xamarin/xamarin-macios/issues/8470
2020-05-04 16:56:33 -04:00
Rolf Bjarne Kvinge 7501991f08
[mtouch/mmp] When copying a directory hierarchy, delete the target file if it exists. (#8485)
The copyfile method does not like copying files over an existing file, and
sometimes it may end up showing an error.
2020-05-04 18:32:26 +02:00
Rolf Bjarne Kvinge 6a407b7989
[linker] Make the corlib name dynamic. (#8499)
Use the correct corlib name depending on whether we're targeting .NET or Mono,
since there's no mscorlib.dll anymore in .NET.
2020-05-04 18:31:48 +02:00
Rolf Bjarne Kvinge 632fd10328 Convert Runtime.GetBlockWrapperCreator, Runtime.CreateBlockProxy and Runtime.Get[Generic]MethodFromToken to use GCHandle.
The native methods xamarin_get_[generic_]method_from_token are a bit unusual
in that they return an actual GCHandle. This is for performance reasons, since
in some cases their return value is passed as parameters to other function
calls to managed code, in which case we need the GCHandle. This way we avoid
round-tripping a GCHandle multiple times.
2020-05-04 11:31:19 +02:00
Rolf Bjarne Kvinge 7e18b592ca
[master] [devops] Use a more restricted glob to find directories with sample data in. Fixes xamarin/maccore#2202. (#8466)
The previous pattern would match the output files we created from processing
these directories, and somehow the pattern would match such a file (even
though the pattern should only be executed before doing any processing, when
those files don't exist yet, so I don't know exactly why this is happening),
leading us to try to process those files as if they were directories with
sample data in, with the predictable (disastrous) result.

Fixes https://github.com/xamarin/maccore/issues/2202.
2020-04-29 17:34:31 +02:00
Rolf Bjarne Kvinge d73c21d43e
[mmp] Don't re-compute (possibly incorrectly) the system framework directories to find assemblies in. (#8454) 2020-04-27 08:34:37 +02:00
Rolf Bjarne Kvinge e631a55787
[mtouch] Fix typo in simlauncher.mm. (#8455) 2020-04-27 08:34:24 +02:00
Manuel de la Pena 40761ccb36
[Devops] If we fail to provision dependencies skip certain tasks. (#8423)
xamarin-storage can not be reachable or a network issue might happen
when we try to provision the dependencies. In that case, skip those
tasks that are skipped when we cannot provision the certs.

The provisioning dependencies will only execute in the provisioning
profiles was successful, therefore, the if statement is not stepping in
any value that was set by the profiles step.
2020-04-23 10:10:34 -04:00
Manuel de la Pena 337f3efac4
[Devops] Add timeouts to the steps. (#8436)
Add timeouts to the steps to catch possible issues when a step takes
longer than expected. Numbers have been taken from common runs and
rounded up a little to have some buffer.
2020-04-20 19:06:02 -04:00
Sebastien Pouliot c8a8fb3156
[mtouch] Always enable experimental-xforms-product-type (#8425)
Not an experiment anymore - it works as expected.

This half-remove the optimization option (it must remain there to avoid
breaking all projects that have it defined) but it will always be `true`
so `Xamarin.Forms.Platform.iOS.dll` will **always** be considered as SDK
code by the linker.

Fix https://github.com/xamarin/xamarin-macios/issues/8407
2020-04-17 17:18:20 -04:00
Rolf Bjarne Kvinge 1de5368593
[mtouch/mmp] Simplify namespace handling now that we don't support Classic anymore. (#8410)
Also consolidate and sort the list of namespaces.
2020-04-17 12:26:38 +02:00
Rolf Bjarne Kvinge 28eddda439
Extract the ApplePlatform and LinkMode enums into their own files. (#8411) 2020-04-17 09:45:18 +02:00
Rolf Bjarne Kvinge 02481c1525
[mmp] Handle not being able to resolve an assembly gracefully. Fixes #8399. (#8406)
Fixes https://github.com/xamarin/xamarin-macios/issues/8399.
2020-04-16 16:24:57 +02:00
Rolf Bjarne Kvinge e4f8460277
[mmp/mtouch] Share more code. (#8394)
* Rearrange files in Xamarin.Mac a bit to ease code sharing between mmp and
  mtouch, by putting mono's static and dynamic libraries in
  /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Sdks/Xamarin.macOS.sdk
  to match how Xamarin.iOS does it.

* Don't use 'usr' as an intermediate directory. This removes another special
  case.

* Share many of the functions and properties that return specific directories,
  and document (as comments) what each function/property is supposed to
  return.
2020-04-16 14:19:45 +02:00
Rolf Bjarne Kvinge 8feb3c29e6
[mtouch] Handle a failure to launch the native linker better by showing better error messages. (#8391)
* [mtouch] Handle a failure to launch the native linker better by showing better error messages.

dotnet will throw a Win32Exception if the command line is too long, so handle
that scenario. Also handle any other Win32Exceptions and show a better error
message.

* Make MT5217 an error to avoid multiple potentially confusing errors.
2020-04-16 14:18:43 +02:00
Sebastien Pouliot 1a8f0e6811
[mmp] Fix PostLinkScanTypeReferenceStep from running two times (#8402)
This came with the merge from xcode11.4 into master. Thankfully there
were unit tests to caught it, because Eyeballs Mark I did not.

Fix https://github.com/xamarin/xamarin-macios/issues/8400
2020-04-15 20:33:29 -04:00
Rolf Bjarne Kvinge 511124f4b1
[mmp] Explicitly resolve assemblies from the GAC / system mono. (#8377)
Cecil has a fall-back mode where it looks in the GAC / system mono for
assemblies when failing to find them elsewhere. This is not the expected
behavior when using Xamarin.Mac in the Full/XM mode, because then we should
only resolve to assemblies shipped with Xamarin.Mac.

Unfortunately doing so will break apps (our own tests break), so instead
change our resolution to be explicit about where we find assemblies, and if we
find assemblies in the GAC / system mono when we're not supposed to, then show
a warning.

Also add a fall-back mechanism, where we use the old logic instead, in case
the new logic is not 100% compatible with the old one.

This showed up when I tried to port mmp to dotnet, because then Cecil stopped
looking in the GAC / system mono for assemblies (Cecil has a special case when
running on Mono to look in Mono's GAC), and tests started failing.
2020-04-14 16:32:42 +02:00
Rolf Bjarne Kvinge 794fd9983d
[mmp] Make the system mono location customizable. Fixes #7923. (#8369)
This also makes things a bit easier with regards to the .NET 5 work.

Fixes https://github.com/xamarin/xamarin-macios/issues/7923.
2020-04-14 09:09:55 +02:00
Rolf Bjarne Kvinge f3ee011797
[xharness] Automatically generate xharness make dependencies. (#8324) 2020-04-13 09:26:55 +02:00
Sebastien Pouliot 48b813e8a3
[linker] Fix infinite queue found with nullability PR (#8337)
and removed previous workaround

Replace previous attempt https://github.com/xamarin/xamarin-macios/pull/8336
2020-04-10 10:59:01 -04:00
Sebastien Pouliot a5ac0ea102
[generator] Add C#8 nullability into generated code (#7570)
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings

Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)

Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
2020-04-09 09:29:28 -04:00