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

3331 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 5cc46dee6f [UIKit] Store delegates in static members so that the GC doesn't free them prematurely. (#2820)
Split off from PR #[2383](https://github.com/xamarin/xamarin-macios/pull/2383)

https://github.com/xamarin/xamarin-macios/pull/2383
2017-09-29 17:25:02 +02:00
Rolf Bjarne Kvinge f660667990 [registrar] Store the attribute type separately for availability attributes saved for the registrar. (#2807)
The registrar requires the availability attributes to work properly, which is
non-trivial when the linker is being used, because the linker runs before the
registrar, and will remove availability attributes.

For this reason we store the availability attributes separately when the
linker removes them so that the registrar can still find them, but
unfortunately it's not enough to store the CustomAttribute instance, because
it may end up crippled: if the attribute type itself is removed by the linker,
then it's not possible to get the attribute type from the CustomAttribute
instance, because 'attribute.Constructor.DeclaringType' returns null (the
linker sets the declaring type of the constructor to null).

Solution: store the attribute type separately; now we use a Tuple of
CustomAttribute and TypeReference.

Fixes this ugly exception:

    System.NullReferenceException: Object reference not set to an instance of an object
      at XamCore.Registrar.Registrar.RegisterAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00146] in /work/maccore/master/xamarin-macios/src/ObjCRuntime/Registrar.cs:2316
      at XamCore.Registrar.StaticRegistrar.Generate (System.Collections.Generic.IEnumerable`1[T] assemblies, System.String header_path, System.String source_path) [0x00035] in /work/maccore/master/xamarin-macios/tools/common/StaticRegistrar.cs:4197
      at Xamarin.Bundler.RunRegistrarTask.Execute () [0x00001] in /work/maccore/master/xamarin-macios/tools/mtouch/BuildTasks.mtouch.cs:154
2017-09-29 17:19:08 +02:00
Rolf Bjarne Kvinge 05484c915f [registrar] Don't verify the SDK for protocol members, and fix the SDK check for other cases. Fixes #59617. (#2790)
* [registrar] Remove useless interface.

* [registrar] Don't store LinkContext in the static registrar when in can be fetched from the Target. Partially fixes #59617.

This avoids a problem where our code would store null because LinkContext
wasn't created yet when the static registrar instance was created.

This fixes the missing error from bug #59617.

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

* [registrar] Don't verify the SDK for protocol members. Partially fixes #59617.

It's not needed, because protocol members don't end up in the registrar output
anyway (and would thus not prevent the registrar code from compiling).

Classes that implement any protocol members would still run into the SDK
check, so this should not prevent real problematic code from being reported
either.

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

* [tests][mtouch] Fix tests after registrar changes.
2017-09-28 17:35:21 +02:00
Rolf Bjarne Kvinge eeb6256834 [mtouch] Show MT0123 if the executable assembly does not reference the product assembly. Fixes #59798. (#2801)
It does not make sense to create Xamarin.iOS projects that don't reference
Xamarin.iOS.dll, so make this an explicit error.

This fixes a NullReferenceException which could (when building for device, or
when not using simlauncher) occur, and instead shows the MT0123 error.

> MTOUCH : error MT0000: Unexpected error - Please file a bug report at http://bugzilla.xamarin.com
> System.NullReferenceException: Object reference not set to an instance of an object
>   at Xamarin.Bundler.Target.GatherFrameworks () [0x00065] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/common/Target.cs:122
>   at Xamarin.Bundler.Target.ProcessAssemblies () [0x000c2] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Target.cs:802
>   at Xamarin.Bundler.Application.ProcessAssemblies () [0x0002f] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:1407
>   at Xamarin.Bundler.Application.BuildManaged () [0x00001] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:831
>   at Xamarin.Bundler.Application+<>c.<BuildAll>b__134_1 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:779
>   at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x00024] in <48b95f3df5804531818f80e28ec60191>:0
>   at Xamarin.Bundler.Application.BuildAll () [0x00050] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/Application.cs:779
>   at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00481] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/mtouch.cs:1420
>   at Xamarin.Bundler.Driver.Main (System.String[] args) [0x0000f] in /Users/builder/data/lanes/5024/152b654a/source/xamarin-macios/tools/mtouch/mtouch.cs:945

https://bugzilla.xamarin.com/show_bug.cgi?id=59798
2017-09-28 17:31:55 +02:00
Alexander Köplinger f7e079cde3 Bump min Mono version to 5.4.0.201 (#2797)
The previous one was a pretty old 5.4 build by now.
2017-09-27 22:20:27 -04:00
Sam Schwarz 098011f67d Update run-tests to use file. (#2789) 2017-09-27 19:31:19 +02:00
Rolf Bjarne Kvinge 8319b67fd3 [src] Fix directory dependence for build/tvos/reference/OpenTK-1.0.dll.config. Fixes #59432. (#2787)
Otherwise copying OpenTK-1.0.dll.config to its target destination would fail
because the target directory didn't exist:

> make[2]: *** [build/tvos/reference/OpenTK-1.0.dll.config] Error 1

https://bugzilla.xamarin.com/show_bug.cgi?id=59432
2017-09-27 18:44:42 +02:00
Rolf Bjarne Kvinge d0bb1c5d0c [tests] Recover BindAs test that got lost in merges. (#2786) 2017-09-27 14:05:54 +02:00
Sebastien Pouliot a61590967f [linker] Use correct namespace for async debugging helpers. Fixes #59015 (#2782)
Replace https://github.com/xamarin/xamarin-macios/pull/2704
It's almost identical but it adds unit tests so this does not regress.

The issue was already reported in [1] but the fix [2] was incorrect
and that was also missed when the bug was verified by QA [3].

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=55037
[2] https://github.com/xamarin/xamarin-macios/pull/2004
[3] https://bugzilla.xamarin.com/show_bug.cgi?id=55037#c10
2017-09-27 07:50:01 -04:00
Rolf Bjarne Kvinge a867c4fa3b [mmp/mtouch] Don't link with frameworks not available in the current SDK. Fixes #59636. (#2777)
We already have this logic for frameworks we detect according to the namespace
of the used types, but not for frameworks we detect from P/Invokes.

Fix this by using the same framework exclusion logic for frameworks detected
from P/Invokes: don't link with frameworks not available in the current SDK.

https://bugzilla.xamarin.com/show_bug.cgi?id=59636
2017-09-27 11:40:28 +02:00
Rolf Bjarne Kvinge ee91b95c19 [tests] Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects. (#2776)
Unset XCODE_DEVELOPER_DIR_PATH when building mac binding projects, so that
when building from VSfM when the Xcode in VSfM differs from the system Xcode
(according to xcode-select) the Xcode command-line tools don't end up confused
and fail in strange ways.
2017-09-27 10:48:51 +02:00
Rolf Bjarne Kvinge 8798cea04f [docs] Fix doc formatting. (#2778)
Remove duplicated MT4171/MT4172 documentation, and fix some formatting to be proper markdown.
2017-09-27 10:47:13 +02:00
Rolf Bjarne Kvinge 50148e7c51 Merge pull request #2288 from rolfbjarne/bindas-registrar-support
[registrar] Add support for the BindAs attribute.
2017-09-26 15:39:46 +02:00
Rolf Bjarne Kvinge 40d9cb9bf1 Merge remote-tracking branch 'origin/master' into bindas-registrar-support 2017-09-26 10:58:35 +02:00
Chris Hamons 8100830d83 Add NSApplicationLaunchUserNotificationKey in more obvious location
- https://bugzilla.xamarin.com/show_bug.cgi?id=58243
2017-09-25 16:09:02 -05:00
Jon Goldberger f87c911017 Moved #if !XAMCORE conditional 2017-09-25 09:49:09 -10:00
Jon Goldberger 7b90d75638 Add #if !XAMCORE conditional around old binding 2017-09-25 09:46:39 -10:00
Jon Goldberger cf5604ae53 Remove #if !XAMCORE conditional 2017-09-25 09:41:20 -10:00
Jon Goldberger 1a8b172758 Fix bug 58243 new PR
This replaces PR #2765
2017-09-25 09:34:50 -10:00
Rolf Bjarne Kvinge cd542a0845 [generator] Remove non-IKVM code. (#2769) 2017-09-25 14:37:51 -04:00
Rolf Bjarne Kvinge 254aa87d3c [generator] Improve BI1049 to include the type name + member name of the broken definition, instead of just the member name. (#2768) 2017-09-25 14:37:24 -04:00
Timothy Risi 65daac9573 [macOS] Fix new xtro failures introduced by the xcode9 branch (#2741) 2017-09-25 09:50:44 -08:00
Rolf Bjarne Kvinge 90d0d978d9 Bump maccore to get fix for #59667. (#2770)
https://bugzilla.xamarin.com/show_bug.cgi?id=59667
2017-09-25 19:15:10 +02:00
Rolf Bjarne Kvinge 017c98aa77 [docs] Document how to add support for new BindAs types. 2017-09-25 16:38:21 +02:00
Chris Hamons 7c676d663b [macos] Release mode AOT should delete dSYM files (#2760)
- https://bugzilla.xamarin.com/show_bug.cgi?id=59647
- There is no reasonable knob on the AOT process to not generate dSYM so delete after processing (these specific files are spawned only by/during AOT)
- AppStore complains if you ship bundles with dSYM fils present
- Fix mmp unit test stand alone execution (make run in tools/mmp uses different (faster) build system than full mmp tests)
2017-09-25 09:34:48 -05:00
Chris Hamons 0442739c4f Fix CFMessagePort crash when returning data from callback (#2764)
- The system releases returned CFData, which caused over release crashes
- https://bugzilla.xamarin.com/show_bug.cgi?id=51263
- Was checked w\ instruments after fix for leaks (none found).
2017-09-25 09:22:25 -05:00
Rolf Bjarne Kvinge 7d0be430c9 [apidiff] Use MSBuild. (#2759) 2017-09-25 16:18:19 +02:00
Alex Soto d2415cae1f [CoreAnimation] CATextLayer.Alignment* strings should be CATextLayerAlignment enum / type. Fixes bug 59537 (#2723)
https://bugzilla.xamarin.com/show_bug.cgi?id=59537

Removes constants from `CATextLayer` (only for XAMCORE_4_0) and creates
two smart enums `CATextLayerTruncationMode` and `CATextLayerAlignmentMode`.
Also this introduces two new strong properties into CATextLayer class,
`TextTruncationMode` and `TextAlignmentMode` that takes the new enums
respectively, these new properties are meant to replace their
string counterparts `TruncationMode` and `AlignmentMode`.
2017-09-25 10:12:53 -04:00
Rolf Bjarne Kvinge 884ab8fe48 [linker] Filter smart enum conversion to enums, and downgrade warnings to log messages.
Only apply smart enum conversion to enums, and downgrade related warnings to log messages.

This avoids spurious warnings like this:

> warning MT4124: Invalid BindAsAttribute found on 'Bindings.Test.ObjCRegistrarTest.GetBooleanArray': could not find the smart extension type System.BooleanExtensions. Please file a bug report at https://bugzilla.xamarin.com

when the BindAs attribute is valid, but just not about a smart enum in the first place.
2017-09-25 16:06:54 +02:00
Rolf Bjarne Kvinge 748273e2ae [linker] Teach 'provider to string' logic about method return types.
Prevents these little gems:

> warning MT4124: Invalid BindAsAttribute found on 'Mono.Cecil.MethodReturnType': could not find the smart extension type ...
2017-09-25 16:06:54 +02:00
Rolf Bjarne Kvinge 147d5963c6 [registrar] Don't store stuff in instance variables before knowing if the stuff is correct. 2017-09-25 16:06:54 +02:00
Rolf Bjarne Kvinge b38c114fbe Add support for NSDirectionalEdgeInsets NSValues to the BindAs attribute. 2017-09-25 16:06:50 +02:00
Rolf Bjarne Kvinge 517c90ad01 [tests] Make more tests Xcode-version-aware. 2017-09-25 16:06:39 +02:00
Rolf Bjarne Kvinge e08490eccd [runtime] Ask clang to be quiet about using new API for our conversion methods. 2017-09-25 13:20:32 +02:00
Rolf Bjarne Kvinge 613e84ac47 Merge remote-tracking branch 'origin/master' into HEAD 2017-09-25 13:20:30 +02:00
Timothy Risi de8ad17723 [macOS][AOT] Remove 'experimental', indicate hybrid is only for 'all' (#2742)
--aot[=VALUE]          Specify assemblies that should be AOT compiled
                               - none - No AOT (default)
                               - all - Every assembly in MonoBundle
                               - core - Xamarin.Mac, System, mscorlib
                               - sdk - Xamarin.Mac.dll and BCL assemblies
                               - |hybrid after option enables hybrid AOT which
                               allows IL stripping but is slower (only valid
                               for 'all')
                                - Individual files can be included for AOT via +
                               FileName.dll and excluded via -FileName.dll

                               Examples:
                                 --aot:all,-MyAssembly.dll
                                 --aot:core|hybrid,+MyOtherAssembly.dll,-
                               mscorlib.dll
2017-09-22 10:13:33 -08:00
Chris Hamons 7112b3b7f6 [macos] Add objc_msgSends to un-break classic API (#2757)
- https://bugzilla.xamarin.com/show_bug.cgi?id=59673
2017-09-22 13:07:27 -05:00
Rolf Bjarne Kvinge fdaeb9f2d2 [xharness] Don't try to run 32-bit tests on devices that don't support 32-bits. (#2749) 2017-09-22 19:53:35 +02:00
Chris Hamons 76b759ef22 Disable link-keep-resources-2 test (#2758)
- A change in mono added a small xml file to the resources, causing the test to fail
- Fix exists in mono/linker but 20 commits behind head, too risky to bump just for a test fix
- Will be fixed in mono's 2017-08 branch
- https://bugzilla.xamarin.com/show_bug.cgi?id=59277
2017-09-22 11:52:19 -05:00
Rolf Bjarne Kvinge bf6f4e9498 [xharness] There's no need to wait for simulators/devices to load. (#2748)
We construct every test case independent of whether a simulator or device is
available, which means we don't have to wait for simulators/devices to load
before creating test cases. Enumerating the available simulators/devices will
still block until loading is complete, but that only happens when we want to
run a test (after building it).

This makes the initial load much faster, since listing devices is becoming
slower now.
2017-09-22 18:06:21 +02:00
Rolf Bjarne Kvinge 8518e57f12 [xharness] Make EndWith comparison ordinal. (#2750) 2017-09-22 18:06:09 +02:00
Rolf Bjarne Kvinge 0603fbad9e [xharness] Fix javascript to work in Safari 11. (#2755)
There seems to be two bugs:

1. Comparing identical styles returns false (although this may just be how javascript works).

2. Given the following:

    ar_obj.style.display = 'hide';
    new_obj.style.display = 'hide';
    ar_obj.style = new_obj.style;
    // now ar_obj.style.display == 'block'. HUH!?!

    I can't fathom how this is expected, but Chrome shows the same behavior. Yay javascript.

Fix this by not trying to assign identical styles, by comparing the css text
instead of the style objects.
2017-09-22 18:05:51 +02:00
Rolf Bjarne Kvinge 551000c185 [xharness] Bump the device listing timeout to 2 minutes. (#2754)
Based on local experiments, sometimes it takes over a minute now 😞
2017-09-22 18:05:21 +02:00
Rolf Bjarne Kvinge e66bd67ab7 [xharness] Build with MSBuild. (#2752)
Time to embrace C# 7.
2017-09-22 18:05:11 +02:00
Rolf Bjarne Kvinge 1ba523011a [xharness] Add support for manually reloading devices/simulators from the html UI. (#2753)
This is useful when forgetting to plug in a device before launching the web ui.
2017-09-22 18:04:55 +02:00
Rolf Bjarne Kvinge 71a17aa673 [xharness] Add support for generating only specific variations for iOS projects. Fixes #57529 (#2751)
And use it to skip watchOS tests for Mono.Security, since we don't ship Mono.Security.dll for watchOS.

https://bugzilla.xamarin.com/show_bug.cgi?id=57529
2017-09-22 18:04:32 +02:00
Rolf Bjarne Kvinge a979a10412 Merge remote-tracking branch 'origin/master' into bindas-registrar-support 2017-09-22 10:50:07 +02:00
Sebastien Pouliot 90bc97c35b [tests] Add a better version check for PR2733 GKAgent3D test (#2747) 2017-09-22 07:15:32 +02:00
Sebastien Pouliot 990842ea3f [tests] Fix linksdk WebKit_NSProxy test. Fixes #59671 (#2746)
In release (optimize) mode the compiler would eliminate the unused

> var t = typeof (WKWebView);

which means the linker would never see `WKWebView`, which in turns
removed `NSProxy`.

Original bug: https://bugzilla.xamarin.com/show_bug.cgi?id=59247
Original PR: https://github.com/xamarin/xamarin-macios/pull/2732

https://bugzilla.xamarin.com/show_bug.cgi?id=59671
2017-09-22 07:14:43 +02:00
Sebastien Pouliot 32ae1d4e63 [mtouch][mmp] Add better diagnose for bugs #59570 and #58063 (#2745)
Bug #59570 was a dupe of #58063 but was harder (than it should be) to
diagnose because the error did not point out which assembly had the
issue (requiring a whole, large, customer solution to confirm).

This adds a new MT2103 error which points to the assembly that could
not be read.

E.g. VSfM will now show

> Error MT2103: Error processing assembly 'Shim, Version=2.0.1.0, Culture=neutral, PublicKeyToken=c55ec16d10c4b366': System.NullReferenceException: Object reference not set to an instance of an object (MT2103) (...)

[1] https://bugzilla.xamarin.com/show_bug.cgi?id=59570
[2] https://bugzilla.xamarin.com/show_bug.cgi?id=58063
2017-09-21 20:22:12 -04:00