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

6275 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 9713bea70e
[tests][mono-native] Adjust logic which is causing tests to fail on tvOS. (#5877)
Fixes this when running on tvOS using dylibs:

> [FAIL] Introspection.CheckSymbols : dlsym() not found mono_native_initialize()

Now:

* If on iOS, we'll always have the `mono_native_initialize` symbol, because the symbol is used in P/Invoke in a user assembly (the test assembly itself), and mtouch will make the AOT-compiled code use dlsym for P/Invokes in user assemblies (and when using dlsym we can't (native) strip away the symbol).
* If on watchOS or tvOS, we'll have the symbol when we're loading `mono_native_initialize` from a dylib. If loading `mono_native_initialize` from a static library, we can (native) strip away the symbol because mtouch will make the AOT-compiled P/Invoke use a static reference to the native symbol, and thus the `mono_native_initialize` symbol will not be present in the executable.
2019-04-11 19:41:25 +02:00
Rolf Bjarne Kvinge 86a76998f1 Revert accidental mono bump. 2019-04-11 19:38:21 +02:00
Rolf Bjarne Kvinge 89b397bacf [bgen] Add a GeneratedTypes class to avoid having a static GeneratedType.knownTypes field. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge bead5c0159 [bgen] Make Generator.BindingTouch an instance field. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge ab9de421b5 [bgen] Make Generator.BindThirdPartyLibrary an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge fb459cbcdd [bgen] Remove unused Stret.BindingTouch field. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 9a6b4c4e4c [bgen] Make Generator.CurrentPlatform an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 8288de174a [bgen] Remove the static Stret.TypeManager property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 6450390ad8 [bgen] Make Generator.TypeManager an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 048ab300c6 [bgen] Make Generator.Frameworks an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 90da04acca [bgen] Remove the static Stret.isUnified member. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge d88d92508c [bgen] Make Generator.UnifiedAPI an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 81d6b1aa24 [bgen] Make various type maps instance members. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge ba721ed007 [bgen] Make Generator.XamcoreVersion an instance property. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 097338eda7 [bgen] Make Generator.AttributeManager an instance field.
This requires passing a Generator instance around in several places (or
alternatively making static Generator members instance members instead).
2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge df4cd48de1 [bgen] Make Generator.NamespaceManager and Generator.ns instance members. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 68826db790 [bgen] Make Generator.IsPublicMode an instance field.
This cascaded into a few other required changes, since we now have to pass a
Generator instance around.
2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 4b9f01a401 [bgen] Remove the static Generator.SharedGenerator field. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 6044db614f [bgen] Simplify some code. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 4d602190c0 [bgen] Make the Generator.BindThirdPartyLibrary value dependent on the BindingTouch instance. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge d2256230ad [bgen] Make the TypeManager class instance based.
In some cases it's still accessed off a static field, but that will change
later.
2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 6e47b2157e [bgen] Make the AttributeManager class instance based.
It's still accessed off a static field in the Generator class, but that will
change later.
2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 62e98c84cb [bgen] Make the Frameworks class instance based. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 15d47aeac7 [bgen] Make NamespaceManager use the BindingTouch instance. 2019-04-11 18:02:13 +02:00
Rolf Bjarne Kvinge 47fca9a6e8 [bgen] Make the BindingTouch class instance based.
It's still accessed using a static variable in several places, but that will change later.
2019-04-11 18:02:13 +02:00
Manuel de la Pena a3ad78c937
[XHarness] Update ignore for some failing tests. (#5887)
The mono bump added some new tests that fail on device + release
configurations. This is a known issue by mono and they'll fix it in the
next version but will not be backported to 2018-10.
2019-04-11 17:20:55 +02:00
Rolf Bjarne Kvinge 09f3fce5f2 [tests][bgen] Capture stdout/stderr per thread.
Otherwise tests running in parallel interfere with the output of eachother.
2019-04-11 08:35:21 +02:00
Rolf Bjarne Kvinge 3d9826ae5f [tests][bgen] Specify an output assembly for tests, so that we don't use the current directory.
Using the current directory won't work for in-process bgen tests.
2019-04-11 08:34:36 +02:00
Rolf Bjarne Kvinge ff82af4576 [bgen] Make it possible to run the tests using an in-process generator.
This means referencing the generator project, and create an array of the
arguments (since Main takes an array of strings) instead of a quoted string.
2019-04-11 08:32:58 +02:00
Rolf Bjarne Kvinge acd98e4595 [bgen] Make BindingTouch.ToolName a constant.
We don't necessarily have an entry assembly (when running tests from within
the IDE), nor is the entry assembly the one that names the tool (when running
tests from outside the IDE).
2019-04-11 08:31:09 +02:00
Rolf Bjarne Kvinge 2dc44c1f44 [bgen] Make error reporting work with multiple generators in the same process.
* Don't call Environment.Exit in case of errors. That's just rude.
* Make ErrorHelper's static state thread-static. This makes it possible to run
  multiple generators simultaneously, each in its own thread. While this is
  not the best solution (the best would be to not have static state at all),
  but the best solution would require many more code changes (every line that
  shows an error/warning would have to be modified).
* Make it possible to clear ErrorHelper's static state. This makes it possible
  to run multiple generators sequentially in the same process.
* Make ErrorHelper.Show re-throw errors (but not warnings) unless it's the
  top-level catch handler. Otherwise errors won't necessarily cause Main to
  return 1.
2019-04-11 08:15:26 +02:00
Manuel de la Pena 5cfc33e059
[MSBuild] Fix the codesign of f# app extensions. (#5884)
We need to import the iOS common after the core f# ones to ensure they do
not override the wrong ones.

Fixes: https://github.com/xamarin/xamarin-macios/issues/3684
2019-04-11 00:43:58 +02:00
Sebastien Pouliot 83f7f7cbe7 [cfnetwork] Add missing locks inn CFNetworkHandler
Previous commit missed part of the fix from
d9508b8086

Sadly this does not solve the hangs/time out while testing it
2019-04-10 16:24:29 -04:00
Rolf Bjarne Kvinge f4efeb0e63
[mtouch] Avoid an NRE when using the embeddinator by returning an empty collection instead of null. (#5883)
Fixes this NRE:

    error MT0000: Unexpected error - Please file a bug report at https://github.com/xamarin/xamarin-macios/issues/new
    System.ArgumentNullException: Value cannot be null.
    Parameter name: collection
      at System.Collections.Generic.List`1[T].InsertRange (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] collection) [0x00003] in <a104f9cbbafd4348bcc580acb0a3f8a8>:0
      at System.Collections.Generic.List`1[T].AddRange (System.Collections.Generic.IEnumerable`1[T] collection) [0x00000] in <a104f9cbbafd4348bcc580acb0a3f8a8>:0
      at Xamarin.Bundler.Application.BuildApp () [0x00040] in /work/maccore/master/xamarin-macios/tools/mtouch/Application.cs:1541
      at Xamarin.Bundler.Application.BuildNative () [0x0001f] in /work/maccore/master/xamarin-macios/tools/mtouch/Application.cs:903
      at Xamarin.Bundler.Application+<>c.<BuildAll>b__148_2 (Xamarin.Bundler.Application v) [0x00000] in /work/maccore/master/xamarin-macios/tools/mtouch/Application.cs:840
      at System.Collections.Generic.List`1[T].ForEach (System.Action`1[T] action) [0x0001e] in <a104f9cbbafd4348bcc580acb0a3f8a8>:0
      at Xamarin.Bundler.Application.BuildAll () [0x00076] in /work/maccore/master/xamarin-macios/tools/mtouch/Application.cs:840
      at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x004a1] in /work/maccore/master/xamarin-macios/tools/mtouch/mtouch.cs:1369
      at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /work/maccore/master/xamarin-macios/tools/mtouch/mtouch.cs:877
2019-04-10 21:48:05 +02:00
Alexander Köplinger 47963d14e1 Bump mono
New commits in mono/mono:

* mono/mono@766b3204c3 [corlib] Disable a ParameterInfoTest test on MONOTOUCH
* mono/mono@c920e2002c [corlib] Fix NSLogWriter.Write to take into account the index and count parameters.
* mono/mono@578b9269c3 [corlib] Simplify newline checking in NSLogWriter.
* mono/mono@31df40e9b7 [corlib] Make NSLogWriter thread-safe.
* mono/mono@5a1c128151 [configure] Add failsafe for missing submodules (#13957)
* mono/mono@0b6dbfa349 [System.Net.Http] Make some tests specific to HttpClientHandler

Diff: cd08c69f0a..766b3204c3
2019-04-10 20:55:05 +02:00
Alexander Köplinger 3029a43b1a Merge remote-tracking branch 'upstream/master' into mono-2019-02
# Conflicts:
#	external/mono
2019-04-10 20:53:19 +02:00
Rolf Bjarne Kvinge 06426bd7a0
[Foundation] Improve/fix NSRegularExpression and NSDataDetector bindings. Fixes #5881. (#5882)
* NSDataDetector

    * Add constructor found in header. No idea where the commented-out
      constructor came from, it's not in the header, so I removed it.
    * Add overloads that take NSTextCheckingType in addition to
      NSTextCheckingTypes. Apple's API take NSTextCheckingTypes, but all the
      documentation and samples say that you're supposed to pass one or more
      or'ed NSTextCheckingType values, so support that as well without casting
      between enums.

* NSRegularExpression

    * GetMatches had the wrong return type, so add a GetMatches2 that does it
      right. Also add a test to make sure it's really right.
    * Bind 'regularExpressionWithPattern:options:error:' with a static method.
      There's a corresponding constructor, but constructors returning out
      NSError parameters isn't the nicest API (when the NSError is important),
      so add the static method as well.
    * Add a missing [NullAllowed] on FindFirstMatch's return value.

* NSRegularExpressionOptions

    * Add missing enum value.

Fixes https://github.com/xamarin/xamarin-macios/issues/5881.
2019-04-10 15:12:24 +02:00
Rolf Bjarne Kvinge f2edbe12dc
Bump mono. (#5875)
New commits in mono/mono:

* mono/mono@bd6801d402 [merp] Restore non-assertion behavior in debugger-engine.c (#13880)
* mono/mono@323e32d96b [System.Data] Remove unnecessary file from xunit tests (#13935)
* mono/mono@85d1920b01 Bump bockbuild to get GTK fix (#13912)
* mono/mono@2458d2d477 Merge pull request #13867 from monojenkins/backport-pr-13866-to-2018-10
* mono/mono@da5c20953f [2018-10] [merp] Fix image size reported (#13884)
* mono/mono@0e9b8f7c93 [mono-dl] Don't do thread state transitions in mono_dl_fallback_register
* mono/mono@9144241961 [MacSDK] Bump bockbuild for fix to #13804
* mono/mono@fc775d0b9f [2018-10] Fix transition offset logic (#13800)

Diff: 15d050a792..bd6801d402
2019-04-10 08:04:29 +02:00
Alexander Köplinger d9376421fe Revert "[XHarness] Ignore monotouch_Microsoft.CSharp_xunit-test.dll until issue 5868 is fixed. (#5869)"
This reverts commit dc697dd5ef.
The mono issue was fixed.
2019-04-09 21:07:30 +02:00
Alexander Köplinger e42e1e8fce Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-04-09 21:06:44 +02:00
Vincent Dondain da007e5781 Bump maccore to improve beta device testing (#5874) 2019-04-09 18:56:24 +02:00
Alexander Köplinger 07e454bb40 Bump Mono .pkg version 2019-04-09 17:47:50 +02:00
Alexander Köplinger 1944b7cf4d Bump mono
Commit list for mono/mono:

* mono/mono@cd08c69f0a Fix reading of undefined NativeType values in old Cecil
* mono/mono@af5b50b134 [debugger-agent] Ignore thread_end event if thread is detached (#13938)
* mono/mono@6c59f0e124 [System.Net.Http] Use LEGACY_HTTPCLIENT on xammac_net_4_5
* mono/mono@e5985e541c [2019-02] [merp] Restore non-assertion behavior in debugger-engine.c (#13879)
* mono/mono@b2b2089145 [System.Data] Remove unnecessary file from xunit tests (#13935)
* mono/mono@b1eb3d59cd [AOT] remove confusing llcopts flag (#13910)
* mono/mono@6b981362ec Bump bockbuild to get GTK fix (#13912)

Diff: c4d0fae9e5...cd08c69f0a
2019-04-09 17:29:10 +02:00
Rolf Bjarne Kvinge 0e8423e2dd
[TVMLKit] Work around Apple breaking API for enum values in TVElementUpdateType. (#5849)
* [TVMLKit] Work around Apple breaking API for enum values in TVElementUpdateType.

Reference: https://trello.com/c/Eyox7vlH/118-41123682-tvelementupdatetype-enum-values-changed
Reference: rdar://41123682 (closed as by design)

* Use this workaround even after XAMCORE_4_0.

Apple's breaking changes don't disappear in XAMCORE_4_0.

* Fix compiler warnings and Export attribute location.
2019-04-09 16:48:18 +02:00
Rolf Bjarne Kvinge 8792992b79
[registrar] Make Runtime.GetINativeObject_Static take token references instead of type names. (#5879)
Saves some space in the executable by using 32-bit sized integers instead of much longer strings.
2019-04-09 16:47:33 +02:00
Rolf Bjarne Kvinge 1d4e434eb5
[tests][test-libraries] Fix struct declarations to not create symbols everywhere. (#5876)
This fixes a build problem with the interdependent-binding-projects test:

    clang : error : linker command failed with exit code 1 (use -v to see invocation) [.../tests/xharness/tmp-test-dir/interdependent-binding-projects2601/interdependent-binding-projects-tvos.csproj]
    MTOUCH : error MT5212: Native linking failed, duplicate symbol: '_Sssss'. [.../tests/xharness/tmp-test-dir/interdependent-binding-projects2601/interdependent-binding-projects-tvos.csproj]
    MTOUCH : error MT5212: Native linking failed, duplicate symbol: '_Ssss'. [.../tests/xharness/tmp-test-dir/interdependent-binding-projects2601/interdependent-binding-projects-tvos.csproj]
    MTOUCH : error MT5212: Native linking failed, duplicate symbol: '_Sss'. [.../tests/xharness/tmp-test-dir/interdependent-binding-projects2601/interdependent-binding-projects-tvos.csproj]
2019-04-09 14:34:51 +02:00
Manuel de la Pena dc697dd5ef
[XHarness] Ignore monotouch_Microsoft.CSharp_xunit-test.dll until issue 5868 is fixed. (#5869)
If not ignored, we will have an issue building the test app on device
resulting on a failure.
2019-04-09 12:57:27 +02:00
Alexander Köplinger 3a398ee5dd [System.Net.Http] Set LEGACY_HTTPCLIENT for test project
Otherwise a bunch of tests that assume the new behavior fail.
2019-04-09 12:11:07 +02:00
Alex Soto 6e2eddd328
[devops] Add azure devops build support (#5873) 2019-04-09 05:35:08 -04:00
Manuel de la Pena c9b834ddaa
[XHarness] Use better names for BCL watchOS tests. (#5867)
Ensure we do not use the target dir because that does not represent the
name of the test because it is shared by all of them.

Fixes https://github.com/xamarin/xamarin-macios/issues/5157
2019-04-08 19:22:22 +02:00