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

1333 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c0255c2d49 Try to make the watch build parallel safe. (#949)
We need to build the watch profile in tools64 now, since we don't have
a separate watch-mono repository anymore.
2016-10-05 20:20:53 +02:00
Timothy Risi 065b189c26 [Mac] CoreBluetooth low hanging fruit bindings (#947) 2016-10-05 11:10:32 -05:00
Rolf Bjarne Kvinge 1d54c461b0 Remove the watch-mono repository, and use a single mono repository. (#941)
Still keeping some of the logic so that it's easy to switch back if we wish
to.
2016-10-05 16:21:01 +02:00
Chris Hamons 642173828e [XM] Disable blts on XM since we don't ship it (#946) 2016-10-04 21:31:56 -04:00
Rolf Bjarne Kvinge d1361d963e Merge pull request #933 from rolfbjarne/watchos-network-api
Bump [watch-]mono to get more API removal for watchOS.
2016-10-04 19:47:10 +02:00
Rolf Bjarne Kvinge f694955e5b Add makefile target to clean everything. (#942) 2016-10-04 18:42:57 +02:00
Rolf Bjarne Kvinge 8abaa2a742 Bump [watch-]mono to get ServicePointManager adjustments. 2016-10-04 18:40:50 +02:00
Rolf Bjarne Kvinge 66915a01c0 [system-dependencies] Add logic to auto-provision cmake. (#940) 2016-10-04 10:28:41 +02:00
Marius Ungureanu 9b7feaae38 Performance improvements (#938)
* [Perf] Use Runtime.IntPtrEqualityComparer everywhere

This avoid boxing the key for Dictionaries which take IntPtr as keys.

* [Perf] Avoid Tuple allocations and boxing of tuple items

The default implementation of Tuple IEquatable uses EqualityComparer<Object>.Default, which causes boxing for IntPtr.
Implement a hand-made IntPtr-Type tuple that also uses custom comparers defined Runtime, for IntPtr and Type equality.

This should improve allocations done by GetDelegateForBlock
2016-10-04 10:26:18 +02:00
Alex Soto 462a3c79fa [CoreLocation] Review macOS CoreLocation low hanging fruits and xtro (#937) 2016-10-03 21:59:39 -04:00
Alex Soto f136ae0520 Merge pull request #936 from VincentDondain/master-fix-bug-44874
[networkextension] Enable default contructor on NETunnelProviderManager
2016-10-03 19:52:25 -05:00
Vincent Dondain 699fbdf7fc [networkextension] Enable default contructor on NETunnelProviderManager
Fixes bug #44874: Problems with NetworkExtension.NETunnelProviderManager
(https://bugzilla.xamarin.com/show_bug.cgi?id=44874)

Using the default constructor doesn't return null anymore, this might be a
change we missed in one of the betas.
2016-10-03 23:31:53 +02:00
Timothy Risi ecdd2fa43a [Mac] SceneKit and Metal low hanging fruit bindings from iOS (#931) 2016-10-03 16:02:32 -04:00
Chris Hamons a214a37c96 [XM] Add NSValidatedUserInterfaceItem, NSCloudSharingValidation, NSUs… (#928)
- https://bugzilla.xamarin.com/show_bug.cgi?id=18359
2016-10-03 14:23:40 -05:00
Rolf Bjarne Kvinge 1fdd17e611 [mtouch] Add (another) workaround for file descriptor leak in System.Diagnostics.Process. (#934) 2016-10-03 20:02:28 +02: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
Jeffrey Stedfast 2a02804d81 [msbuild] Fixed IsWatchExtension state property (#913)
The problem was that this property was evaluating to True
for the main app bundle because it assumed that if the
project contained a Watch app, that it was the WatchExtension.

This logic only holds true for WatchOS1, but not WatchOS2.

Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44841
2016-10-03 13:44:31 -04:00
Rolf Bjarne Kvinge 2c9b5a5377 [Security] Re-enable some TLS logic on watchOS to fix a few unit tests.
Re-enable some TLS logic on watchOS to fix a few unit tests:

    [FAIL] CertificateTest.MailX1 : Same Handle
    [FAIL] RecordTest.SecRecordRecordTest : Same Handle
2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge 7bcad32ddc [tests] Tweak link all/sdk tests after API change in watchOS. 2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge c4f4056b22 Bump [watch-]mono to get more API removal for watchOS. 2016-10-03 18:31:04 +02:00
Martin Baulig 032e2482e4 [AppleTls]: Make 'OldTlsProvider' derive from 'LegacyTlsProvider'.
Ideally, we should just simply use 'Mono.Net.Security.LegacyTlsProvider',
but that would require some tweaks to the linker code.
2016-10-03 18:31:04 +02:00
Rolf Bjarne Kvinge 0fa4235097 [mtouch] Don't do any TLS processing in the linker for watchOS.
Don't do any TLS processing in the linker for watchOS, because on watchOS we
don't have (managed) TLS.
2016-10-03 18:31:04 +02:00
Manuel de la Pena da1478a680 New url session handler (#932)
* Added rewritten NSUrlSessionHandler that handles memory better

This is a rewrite of the ModernHttpClient version of NSUrlSessionHandler, it has better handling for memory that provides a more consistant memory footprint. It accomplishes this by using NSInputStream for requests, and reading and disposing directly from NSData instead of transitioning the NSData to a byte[] array.

* Try to fix build of PR #31

* [foundation] Restore compatibility with the new NSUrlSessionHandler

Mostly my comments in PR #174

* Add support for redirection [1]
* Add support for credentials [1]
* Add support for caching [2]
* Remove 2nd dictionary lookup in GetHeaderSeparator
* Avoid extraneous cast for credentialsToUse

PR 177 [3] adds tests that ensure no commits can remove, or change
default values, for handlers.

[1] breaking changes (feature, not API)
[2] breaking change (API removal)
[3] https://github.com/xamarin/xamarin-macios/pull/177

* [foundation] Restore compatibility with the new NSUrlSessionHandler

Mostly my comments in PR #174

* Add support for redirection [1]
* Add support for credentials [1]
* Add support for caching [2]
* Remove 2nd dictionary lookup in GetHeaderSeparator
* Avoid extraneous cast for credentialsToUse

PR 177 [3] adds tests that ensure no commits can remove, or change
default values, for handlers.

[1] breaking changes (feature, not API)
[2] breaking change (API removal)
[3] https://github.com/xamarin/xamarin-macios/pull/177

* Try to fix build of PR #31

* prevent DEADLOCK in UI code

* Added ConfigureAwait(false) to Task.Delay to prevent DEADLOCK when the stream is being awaited on the UI thread

* added a few more ConfigureAwait(false) statments that were missed on first pass

* Fix some small style issues.

* Set the default value of AllowAutoRedirect to true.
2016-10-03 18:25:16 +02:00
Martin Baulig eb516cbcd8 [AppleTls]: Ignore port number when validating certificates.
Fix for:
https://bugzilla.xamarin.com/show_bug.cgi?id=44708
2016-10-01 20:20:37 -04:00
Vincent Dondain fff489e3c0 Update reference to maccore 2016-10-01 23:11:23 +02:00
Vincent Dondain ecf5b1abe6 Update reference to maccore 2016-09-30 23:35:53 +02:00
Chris Hamons 110fc4cb5b [XM] Remove TODO from LaunchServices.cs because LSOpenFromURLSpec is deprecated (#930) 2016-09-30 17:13:33 -04:00
Rolf Bjarne Kvinge 460d41e9e3 Bump mono to get System test fixes. (#919) 2016-09-30 16:14:43 -04:00
Sebastien Pouliot 3c000ff67b [CoreVideo] Add CVPlanarPixelBufferInfo_YCbCrBiPlanar, fixes #28817 (#927) 2016-09-30 15:47:01 -04:00
Rolf Bjarne Kvinge 3f74be5a80 [system-dependencies] Add CMake dependency. (#920) 2016-09-30 15:46:40 -04:00
Rolf Bjarne Kvinge 0863e412b4 Remove XI/Classic support (#926)
* [tests] Remove Classic SDK tests.

* Remove XI/Classic support.

This also means we can remove support for the legacy registrars.

* [monotouch-test] Remove legacy registrar tests.

* [tests/mtouch] Remove Classic tests (and legacy registrar logic).

* [tests/scripted] Fix tests to reference Xamarin.iOS.dll.
2016-09-30 15:02:17 -04:00
Chris Hamons b7b970588a [XM] Add NSTooltipOwner to NSObject (#904)
* [XM] Add NSTooltipOwner to NSObject

- https://bugzilla.xamarin.com/show_bug.cgi?id=27349
- Designed to be implemented by any NSObject you pass into AddToolTip.
2016-09-30 11:57:28 -05:00
Chris Hamons 97dfc6e972 [XM] Add missing NSNotification bits (#925)
- https://bugzilla.xamarin.com/show_bug.cgi?id=40494
2016-09-30 12:51:11 -04:00
Sebastien Pouliot d0773a9ffc [avfoundation] Add overloads to AVCaptureDevice that accept an enum. Fixes #32535 (#922)
The current API use `string`, not `NSString` is added as a step forward.
The `NSString` is more correct but it does not ease discoverability (e.g.
code completion) so an enum-based overload is added (as the preferred API).

https://bugzilla.xamarin.com/show_bug.cgi?id=32535
2016-09-30 12:49:45 -04:00
Timothy Risi 7d14a4b94f [Mac] Activate gamekit bindings shared with iOS (#924) 2016-09-30 09:13:17 -05:00
Alex Soto 1d828e9e5e [CoreFoundation] Fix bug 44399 - ArgumentNullException in AddObserver (#921)
https://bugzilla.xamarin.com/show_bug.cgi?id=44399

We did not fully support passing null to name and objectToObserve in
CFNotificationCenter::AddObserver an  ArgumentNullException was thrown

The use case of sending null to both name and objectToObserve is to
observe all notifications posted to the notification center, this
won't work using darwing notification center, it is restricted
by apple.
2016-09-29 13:35:29 -04:00
Rolf Bjarne Kvinge 4d06d05cc0 [mtouch] Add workaround for file descriptor leak in System.Diagnostics.Process. (#917) 2016-09-29 17:45:23 +02:00
Rolf Bjarne Kvinge b58b36178b Update list of Facade assemblies. (#916)
These assemblies were added here: 919b89954a
2016-09-29 16:12:31 +02:00
Sebastien Pouliot 9fda816230 [mtouch][linker] Use correct error code for CoreOptimizeGeneratedCode (#915)
Previous PR [1] has the right documentation but the wrong source code.

[1] https://github.com/xamarin/xamarin-macios/pull/903
2016-09-28 23:16:03 -04:00
Rolf Bjarne Kvinge 46b9a5bfbf [builds] Apply magic to make us build on Sierra. (#911)
* Pass -Wl,-no_weak_imports to the linker so that   we don't accidentally use
  symbols weakly. This would   cause problems on older OSes where the symbol
  isn't there, because our code is not prepared to deal with weakly linked
  symbols.

* Manually disable fstatat and readlinkat (introduced with Xcode 7 in iOS 8 /
  macOS 10.10), found by the above.

* Manually disable __thread support for a few targets, since mono's configure
  script doesn't properly detect it's not supported.

* Manually disable clock_nanosleep, since mono's configure script doesn't
  properly detect it's not supported.
2016-09-28 20:27:10 -04:00
Martin Baulig 860704ddb4 [AppleTls]: API cleanups in preparation of the BTLS integration.
* Bump Mono to mono-4.8.0-branch commit 9437553e545f57443ccc33fe4129cbb6ac94f832.

* Rename MobileCertificateHelper -> AppleCertificateHelper.

  All the non-Apple-specific functionality now lives in System.dll's
  MobileTlsContext, so it can be shared with BTLS.

* Remove old src/Security/Tls sources which have been moved into System.dll
  a couple of weeks ago.
2016-09-29 00:59:15 +02:00
Ankit Jain 6f37730293 [msbuild] Set $(CscDebugFileExt) also, whenever overriding $(CscToolExe) (#896)
* [msbuild] Set $(CscDebugFileExt) also, whenever overriding $(CscToolExe)

- This property was introduced in mono's msbuild, but will be upstream
  also
- This *must* be set before Microsoft.CSharp.targets file is imported.
- Even though the msbuild targets will automatically select `.mdb` if
  the `$(CscToolExe)` is `mcs` or `mcs.exe`, it would be a good
  practice to set both the properties together.

- This came up in cases where we use `smcs`, because in that case the
  msbuild targets end up using `.pdb`.

* [msbuild] Set `$(CscDebugFileExt)` == `.mdb`

Xamarin.ObjcBinding.CSharp.targets: Set the debug file extension also,
since we are overriding the compiler via `$(CscToolExe)`. Also, move
the property definition around to ensure that they are set *before*
importing `Microsoft.CSharp.targets`.
2016-09-28 14:37:44 -04:00
Sebastien Pouliot 5b80e7f85c [mtouch][linker] Provide a more specific error code when OptimizeGeneratedCodeSubStep fails (#903)
The MT2001 error is a general, something went bad, in the linker code
base. The stack trace is often enough to track down issues but in some
cases it would be easier to ask customers for a specific assembly
(rather than their complete project) to investigate an issue.

Example:

error MT2103: Binding Optimizer failed processing `System.Void GoogleConversionTracking.Unified.GoogleConversionPing::.ctor()`.
--- inner exception
System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessIsDirectBinding (Mono.Cecil.MethodDefinition caller, Mono.Cecil.Cil.Instruction ins) [0x00026] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:264
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.ProcessCalls (Mono.Cecil.MethodDefinition caller, Int32 i) [0x00337] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:197
  at MonoTouch.Tuner.OptimizeGeneratedCodeSubStep.Process (Mono.Cecil.MethodDefinition method) [0x0007b] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/MonoTouch.Tuner/OptimizeGeneratedCodeSubStep.cs:81
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00004] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:48
---
  at Xamarin.Linker.StateSubStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00014] in /Users/poupou/git/xamarin/xamarin-macios/tools/linker/CoreOptimizeGeneratedCode.cs:50
  at Mono.Tuner.SubStepDispatcher.DispatchMethod (Mono.Cecil.MethodDefinition method) [0x0001d] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:215
  at Mono.Tuner.SubStepDispatcher.BrowseMethods (ICollection methods) [0x0001c] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:167
  at Mono.Tuner.SubStepDispatcher.BrowseTypes (ICollection types) [0x0006b] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:145
  at Mono.Tuner.SubStepDispatcher.BrowseAssemblies (IEnumerable`1 assemblies) [0x00050] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:123
  at Mono.Tuner.SubStepDispatcher.Process (Mono.Linker.LinkContext context) [0x0000f] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/tuner/Mono.Tuner/Dispatcher.cs:104
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00027] in /Users/poupou/git/xamarin/xamarin-macios/external/mono/mcs/tools/linker/Mono.Linker/Pipeline.cs:118
  at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List`1& assemblies) [0x000ac] in /Users/poupou/git/xamarin/xamarin-macios/tools/mtouch/Tuning.cs:79

Right now the MT2001 would only include the inner exception, which does
not include any clue to which assembly caused the exception.

Note: The same pattern to be applied to other BaseSubStep subclasses in
separate commits.

Related to (but not the fix for) https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-28 11:46:14 -04:00
Rolf Bjarne Kvinge 876698ce25 [xharness] Define FEATURE_NO_BSD_SOCKETS for watchOS test projects. (#909) 2016-09-28 11:26:36 -04:00
Alex Soto b8bd71c7b5 [Security] Add convenience Certificate, Key and Identity ctors to SecRecord (#905) 2016-09-28 08:17:39 -04:00
Alex Soto 5c10b87637 [CoreImage] Add missing property ColorSpace to CIImage (#906)
https://bugzilla.xamarin.com/show_bug.cgi?id=44438

The ColorSpace property is decorated with the CF_RETURNS_NOT_RETAINED
macro, this means it returns an object that follows the CoreFoundation
[Ownership Policy](1) but it does not follow the naming convention
documented in the policy.

The [CF_RETURNS_NOT_RETAINED](2) indicates that the object reference
returned is not owned by the caller, so we should definitely call
CGColorSpaceRetain when obtaining a handle.

Since CGColorSpace is considered into the [MarshalType list](3) the
generated code ends up calling the IntPtr ctor which does the right
thing, [calling CGColorSpaceRetain](4) in the given ptr.

And last but not least, we already bind another property decorated
with [CF_RETURNS_NOT_RETAINED](2) in [CIColor::ColorSpace](5).

[1]: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html
[2]: http://clang-analyzer.llvm.org/annotations.html#attr_cf_returns_not_retained
[3]: 0bc23b379a/src/generator.cs (L2642)
[4]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/CoreGraphics/CGColorSpace.cs#L77-L80
[5]: https://github.com/xamarin/xamarin-macios/blob/xcode8/src/coreimage.cs#L112-L113
2016-09-28 12:33:51 +02:00
Sebastien Pouliot 0bc23b379a Bump mono for an (pre C9/master) alpha refresh (#902)
* mono revision at fc99fc4313e7afd75a4605a48b47e7d1273aefe4

* watch-mono revision is more recent to include the BCL adjustments
  for types not available on that platform

* Update two linksdk  test cases that won't work _normally_ for watchOS
2016-09-27 23:45:13 -04:00
Sebastien Pouliot da60263a0a [mtouch] Fix NRE when optimizing bindings. Fixes #44701 (#900)
Some binding assemblies contains extra, unneeded code, generated by the C# compiler, e.g.

IL_002f: stloc.0
IL_0030: ldloc.0

which the binding optimizer did not expect.

https://bugzilla.xamarin.com/show_bug.cgi?id=44701
2016-09-27 16:09:42 -04:00
Chris Hamons c46f5d4793 [XM] Add ThreadSafe to API that gets called on background thread by Cocoa (#901) 2016-09-27 14:51:00 -05:00
Rolf Bjarne Kvinge 19d237473e [runtime] Fix support for debugging on watch device with multiple IP addresses. Fixes #44568. (#898)
At startup we send a request to all the IP addresses we have,
so we must make sure to not get confused if we get responses
from more than one of them.

This fix also requires an updated mlaunch.

https://bugzilla.xamarin.com/show_bug.cgi?id=44568
2016-09-27 08:07:31 -04:00