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

1296 Коммитов

Автор SHA1 Сообщение Дата
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
Rolf Bjarne Kvinge c8993a3597 [tests/mscorlib] Fix template. (#897) 2016-09-27 11:20:32 +02:00
Alex Soto 912ab01d1e Merge pull request #891 from dalexsoto/generator
[generator] Fix bug 37175 and bug 44322
2016-09-26 11:26:33 -05:00
Rolf Bjarne Kvinge 86e1e0e882 [mtouch] Show more information about LinkWith attributes. (#895)
* [mtouch] Fix source analysis warning about culture-aware string comparison.

* [mtouch] Show more information about LinkWith attributes.
2016-09-26 16:23:28 +02:00
Rolf Bjarne Kvinge ab14b432d2 [generator] Order the list of generated files to ease diffs. (#894) 2016-09-26 08:54:12 -04:00
Alex Soto ff326bdfdb [generator] ForcedType is now only valid on parameters, properties and return value
https://bugzilla.xamarin.com/show_bug.cgi?id=37175
https://bugzilla.xamarin.com/show_bug.cgi?id=44322

* ForcedType is now only valid on parameters, properties and return value
* Added generator test
* Fixed bindings accordingly
* Fixed docs
2016-09-26 03:57:57 -05:00
Alexander Köplinger 32e87b3f9a Bump MAX_MONO_VERSION (#893)
We're using 4.9.x in mono master now.
2016-09-26 10:33:26 +02:00
Chris Hamons 4d299f35ae [XM] Add missing Javascript bindings in webkit.cs (#890)
- https://bugzilla.xamarin.com/show_bug.cgi?id=32975
2016-09-24 10:32:22 -04:00
Martin Baulig a7676cd373 Merge pull request #892 from xamarin/appletls-finish-write
[AppleTls]: Disallow calling SSLHandshake() again after the handshake has finished
2016-09-24 11:10:08 +02:00
Martin Baulig 6ed46cc6a1 [AppleTls]: Disallow calling SSLHandshake() again after the handshake has finished.
Bump Mono to pickup the BCL part of the fix.

commit 2a3e4002ead94aae6796c7eb7af9a850398beb51
Author: Martin Baulig <martin.baulig@xamarin.com>
Date:   Fri Sep 23 17:42:05 2016 +0200

    [AppleTls]: Flush the write queue before finishing the handshake.

    It is possible for SSLHandshake() to return SslStatus.Success while we're still
    having a pending write (AsyncOperationStatus.WantWrite).

    This is because our managed write callback must never return 'WouldBlock', so
    SSLHandshake() things that all data have been sent while we still have them in
    our write queue.

    When this happens, we currently flush the write queue then call SSLHandshake()
    again via AsyncOperationStatus.WantWrite -> AsyncOperationStatus.Continue.

    This returns SslStatus.Protocol on iOS 10.

    (cherry picked from commit 2cc1b887c1c6e86b6844116c8010bac3305c84f9)
2016-09-24 07:41:28 +02:00
Alex Soto 72f6d0a232 [Foundation] NSUrlSession's Create*Task methods may return a base class of the type the headers claim. Fixes #37175.
https://bugzilla.xamarin.com/show_bug.cgi?id=37175

NSUrlSession's Create*Task methods may return an object of the wrong
type (NSUrlSessionTask instead of NSUrl[Data|Download|Upload]SessionTask),
so we need to bypass our type check when creating the managed object,
otherwise we end up throwing InvalidCastExceptions randomly. We will
return the type that is declared on the headers so if the native side
returns a cat and headers says it barks we'll we make it bark :).
2016-09-23 21:37:33 -05:00
Alex Soto 7845caa577 [AVFoundaation] Fix bug 44322 - AVAssetDownloadUrlSession.CreateSession throws a System.InvalidCastException: Specified cast is not valid.
https://bugzilla.xamarin.com/show_bug.cgi?id=44322

AVAssetDownloadUrlSession.CreateSession according to headers it
should return an AVAssetDownloadUrlSession but it is returning
an apple internal type NSURLBackgroundSession so with our
current bindings it throws an InvalidCastException, adding
ForcedTypeAttribute will create the managed type wihout
the actual typecheck. Added test verifing that the API
no longer throws.
2016-09-23 19:17:57 -05:00
Alex Soto bcbe813ab1 [generator] Fix bug 37175 and bug 44322
https://bugzilla.xamarin.com/show_bug.cgi?id=37175
https://bugzilla.xamarin.com/show_bug.cgi?id=44322

Sometimes iOS API is returning objects of the wrong type for example

- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request

It clearly states that it will return an NSURLSessionDownloadTask
instance, but yet it returns a NSURLSessionTask and we throw an
InvalidCastException when creating the managed object. This is
fine in ObjC but for us in a type-safety context is not.

Introducing ForcedTypeAttribute when applying this attribute
we will use GetINativeObject instead of GetNSObject which
the former does not perfom a type check on the underlying object
2016-09-23 17:53:22 -05:00
Rolf Bjarne Kvinge 85cead2337 [mtouch] Don't use nested Parallel.ForEach loops. (#888)
The nested Parallel.ForEach loops don't take into account the outer
MaxDegreeOfParallelism value, causing us to spawn more concurrent tasks than
we want to.

So refactor the code to have one static list of tasks, which each subtask adds
to.
2016-09-23 16:03:23 -04:00
Chris Hamons fa18df5710 Fix build warning (#889) 2016-09-23 14:27:53 -05:00
Sebastien Pouliot eb91e692a6 [mtouch] Update script to use mono64. Fixes #44122 and others (#887)
Our move to open source and the mtouch/mlaunch split changed mtouch from
a 64bits to a 32bits application (because mono is, by default, still
32bits on OSX).

That's the cause for several recent bugs

* https://bugzilla.xamarin.com/show_bug.cgi?id=44122
* https://bugzilla.xamarin.com/show_bug.cgi?id=44521
* https://bugzilla.xamarin.com/show_bug.cgi?id=44518
* https://bugzilla.xamarin.com/show_bug.cgi?id=44516
2016-09-23 12:55:11 -04:00
Rolf Bjarne Kvinge e598db9621 [xharness] Add Jenkins support for watchOS Series 2 simulators. (#885) 2016-09-23 09:06:05 -04:00
Rolf Bjarne Kvinge 7656a92756 Revert "[mtouch] Don't use nested Parallel.ForEach loops." (#886) 2016-09-23 14:35:43 +02:00
Rolf Bjarne Kvinge fc55e4306f [mtouch] Don't use nested Parallel.ForEach loops. (#881)
The nested Parallel.ForEach loops don't take into account the outer
MaxDegreeOfParallelism value, causing us to spawn more concurrent tasks than
we want to.

So refactor the code to have one static list of tasks, which each subtask adds
to.
2016-09-23 07:02:11 +02:00
Rolf Bjarne Kvinge 02818182f1 [Foundation] Add a few missing NSAttributedString methods to watchOS. Fixes #44455. (#880)
https://bugzilla.xamarin.com/show_bug.cgi?id=44455
2016-09-22 13:11:50 -04:00
Jeffrey Stedfast 5922215e72 [msbuild] Add watch-companion to UIRequiredDeviceCapabilities for watchOS1 extensions (#868)
Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=44257
2016-09-22 19:09:10 +02:00
Rolf Bjarne Kvinge 388e62ef49 [WatchKit] Bind [WKInterfaceDevice preferredContentSizeCategory] as PreferredContentSizeCategoryString. Fixes #44456. (#878)
https://bugzilla.xamarin.com/show_bug.cgi?id=44456
2016-09-22 18:08:42 +02:00
Rolf Bjarne Kvinge 88a9b809d2 CFNetworkHandler is not a valid http message handler for watchOS, so show a helpful message if someone tries. (#879) 2016-09-22 18:08:16 +02:00
Artur Shamsutdinov 351bb29f0c [corewlan] Added CWWiFiClient class. (#853) 2016-09-22 09:39:57 -04:00
Rolf Bjarne Kvinge 0db1fe1ff2 [mtouch] Add support for -j X to specify concurrency. (#876) 2016-09-22 09:21:20 -04:00
Rolf Bjarne Kvinge d4edc453a6 Fix default http message handler for watchOS. (#873)
* Fix default http message handler for watchOS.

Fix default http message handler for watchOS to be NSUrlSessionHandler (the
previous attempt at eb7c2fd was quite incomplete), and make sure
HttpClientHandler is never used (show errors if someone tries).

* [tests] Remove explicit http client handler from project files.

Just use the default instead, since the set of valid http client handlers varies between platforms.
2016-09-22 14:29:18 +02:00
Rolf Bjarne Kvinge 1412b5bbed Remove any code related to the IL registrar. (#874)
We've used the dynamic registrar for years now when selecting the IL registrar
(and I've never heard about anybody doing it), so just remove all the related
(and in fact dead) code.
2016-09-22 14:27:54 +02:00
Rolf Bjarne Kvinge fc72efdea0 [tests/scripted] Convert to Unified. (#875) 2016-09-22 14:27:38 +02:00
Rolf Bjarne Kvinge 7e3cc1f376 [mtouch-errors] Suggest disabling incremental builds to work around MT3001. (#872) 2016-09-22 10:37:02 +02:00
Martin Baulig f3501d99af Remove Mono.Security.Providers.*.dll in preparation of their upcoming removal from the BCL. 2016-09-22 07:23:40 +02:00
Sebastien Pouliot ad2f23e5ae [scenekit] Add overload to SCNRenderer.FromContext that accept a [C|EA]GLContext argument. Fixes #34436 (#871)
* CGLContext for macOS
* EAGLContext for iOS and tvOS
* the (original) IntPtr remains non-obsoleted to allow cross-platform code

https://bugzilla.xamarin.com/show_bug.cgi?id=34436
2016-09-22 07:23:12 +02:00
Rolf Bjarne Kvinge 9000e48034 [tests] Remove Classic test projects, and make the Unified test projects the master projects. (#858) 2016-09-21 22:55:10 +02:00
Chris Hamons e749d428b8 [XM] Unbump master to 3.0.0 so we line up better with beta preview before we get out of visible sync (#870) 2016-09-21 15:29:29 -05:00
Rolf Bjarne Kvinge 821fe4c563 [apidiff] Remove XI/Classic api diff. (#867) 2016-09-21 11:48:28 -04:00
Manuel de la Pena 009c8a0aa2 [Jenkins] Add different steps to be executed in jenkins. (#856)
* [Jenkins] Add different steps to be executed in jenkins.

* Remove old jenkins.sh
2016-09-21 16:46:00 +02:00
Sebastien Pouliot 96f0c09225 [uikit] Add UIFontTextStyle enum to ease UIFont[Descriptor].GetPreferred* API usage. Fixes #42967 (#863)
New enum UIFontTextStyle maps to UIFontTextStyle* fields. Allows easier use of
* UIFont.GetPreferredFontForTextStyle
* UIFontDescriptor.GetPreferredDescriptorForTextStyle

https://bugzilla.xamarin.com/show_bug.cgi?id=42967
2016-09-21 07:35:36 +02:00
Sebastien Pouliot 347ed1a56a [uikit] Add missing [NullAllowed] on UIImageView ctors. Fixes #42929 (#864)
The UIImage arguments of both .ctor (single and double) can be null.

https://bugzilla.xamarin.com/show_bug.cgi?id=42929
2016-09-21 07:31:27 +02:00
Zoltan Varga 6d174b4fc1 [builds] Pass --with-llvm to the cross compile build's configure instead of adding llvm's bin directory to the PATH. (#862) 2016-09-20 20:34:05 -04:00