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

10611 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena ee6129b376
[CI] Remove noise that was added while testing. (#11028) 2021-03-30 17:40:02 -04:00
Manuel de la Pena 8041d36d35
[CI] Remove steps that are never used. (#11026) 2021-03-30 17:39:27 -04:00
Manuel de la Pena 36a2df3904
[VSmac] Bump max version to the new stable. (#11025) 2021-03-30 09:51:02 -04:00
TJ Lambert 42014b1d24
[Localization] Adding Merge Conditional (#11021)
Adding in a conditional to trigger OneLocBuild task only on merges

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2021-03-29 17:07:48 -04:00
Sebastien Pouliot b186bd675a
[dotnet] Call monovm_initialize before mono_jit_init (#11014)
Those are called respectively inside `xamarin_vm_initialize` and
`xamarin_bridge_initialize` functions.

This fix the **AppContext.GetData always return null for iOS** issue
https://github.com/dotnet/runtime/issues/50290

Thanks for @filipnavara for diagnosing this quicker than anyone else!

Added unit tests to ensure `AppContext.GetData` can read back the values
we're providing at startup.
2021-03-29 16:23:38 -04:00
Sebastien Pouliot 9c0d46674a
[generate-type-forwarders] Reduce string allocations (#11000)
Output should be identical and since all other PR are merged it
also produce an output with no breaking changes.

https://gist.github.com/92f759e37e2cd193266ca190a741cc24
2021-03-27 12:04:40 -04:00
Mike Bond 0a1df1f411
[Xcode12.5] Target new xamarin-macios agent pools to be ready for BS. 2021-03-26 16:50:58 -04:00
Jonathan Peppers 7bf3e8d83a
[dotnet] default $(SuppressTrimAnalysisWarnings) to true (#10970)
Fixes: https://github.com/xamarin/xamarin-macios/issues/10887

After bumping to .NET 6 Preview 3, we get hundreds of ILLINK warnings.
This is because of:

https://github.com/dotnet/sdk/pull/16327

We need to default `$(SuppressTrimAnalysisWarnings)` to ignore these
warnings for now.

We should continue to use `TrimMode=link`, as that is the behavior
Xamarin developers get today.
2021-03-26 13:50:35 -05:00
Sebastien Pouliot 114b01bc2a
[generate-type-forwarders] Fix final properties (#10973)
The type implementation of an interface member does not need to be
`virtual` but, since it's done by _sealing_ the member.

Example

```diff
 public virtual ---final--- int Count { get; }
```
2021-03-26 09:36:28 -04:00
Sebastien Pouliot cf94879d83
[generate-type-forwarders] Fix parameter arrays used by-reference (#10975)
Removed method:

```csharp
public static GLKMesh[] FromAsset (ModelIO.MDLAsset asset, out ModelIO.MDLMesh[] sourceMeshes, out Foundation.NSError error);
```

Added method:

```csharp
public static GLKMesh[] FromAsset (ModelIO.MDLAsset asset, out ModelIO.MDLMesh sourceMeshes, out Foundation.NSError error);
```
2021-03-26 09:35:26 -04:00
Sebastien Pouliot fc5c571ab7
[generate-type-forwarders] Fix incorrect overrides on methods and properties (#10978)
Examples

Modified properties:

```diff
-public virtual SceneKit.SCNScene Scene { get; set; }
+public override SceneKit.SCNScene Scene { get; set; }
```

Modified methods:

```diff
-public virtual void CancelRequest (Foundation.NSError error)
+public override void CancelRequest (Foundation.NSError error)
```
2021-03-26 09:34:09 -04:00
VS MobileTools Engineering Service 2 9f4390cc65
[xcode12.5] Link FrameworkList.xml to a place where MSBuild SDK actually expects it (#10955)
* Link FrameworkList.xml to a place where MSBuild SDK actually expects it

* Create necessary directories

* Fix symlinks for packaging

* Add test case

* Minor tweak to test case

* Fix cut & paste error

Co-authored-by: Filip Navara <navara@emclient.com>
2021-03-26 07:21:50 -04:00
Rolf Bjarne Kvinge 0971b6bb83
[ObjCRuntime] Fix a GCHandle leak. (#10967)
Make sure to free the weak GCHandles we create to track NSObjects, just
removing them from our dictionary doesn't cut it.
2021-03-26 08:13:41 +01:00
Alex Soto 29890ea644 [OneLocBuild] Disable autocompletion of localization PRs 2021-03-25 19:46:23 -04:00
Alex Soto c77db16b76 Revert "Localized file check-in by OneLocBuild Task"
This reverts commit 92e847b68e.
2021-03-25 19:43:47 -04:00
VS MobileTools Engineering Service 2 9d7252d193
[xharness] Bump timeout to evaluate MSBuild properties by running msbuild. (#10963)
Sometimes msbuild wants to restore packages during this process, which may
take a while.

Hopefully fixes errors like this:

    Harness exception for 'Tests for C6353E8B-BFDA-4F54-93D9-FF0F838BF8EE': System.Exception: Unable to evaluate the property OutputPath.
        at Xharness.AppBundleLocator.GetPropertyByMSBuildEvaluationAsync (System.Xml.XmlDocument csproj, System.String projectPath, System.String evaluateProperty, System.String dependsOnTargets, System.Collections.Generic.Dictionary`2[TKey,TValue] properties) [0x00327] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppBundleLocator.cs:109
        at Xharness.AppBundleLocator.LocateAppBundle (System.Xml.XmlDocument projectFile, System.String projectFilePath, Microsoft.DotNet.XHarness.iOS.Shared.TestTarget target, System.String buildConfiguration) [0x000d2] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppBundleLocator.cs:49
        at Microsoft.DotNet.XHarness.iOS.Shared.AppBundleInformationParser.ParseFromProject (System.String projectFilePath, Microsoft.DotNet.XHarness.iOS.Shared.TestTarget target, System.String buildConfiguration) [0x00147] in /_/src/Microsoft.DotNet.XHarness.iOS.Shared/AppBundleInformationParser.cs:71
        at Xharness.AppRunner.InitializeAsync () [0x00046] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/AppRunner.cs:120
        at Xharness.Jenkins.TestTasks.RunSimulator.SelectSimulatorAsync () [0x002df] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/RunSimulator.cs:108
        at Xharness.Jenkins.TestTasks.AggregatedRunSimulatorTask.ExecuteAsync () [0x00335] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/AggregatedRunSimulatorTask.cs:63
        at Xharness.Jenkins.TestTasks.TestTasks.RunInternalAsync () [0x00226] in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/xharness/Jenkins/TestTasks/TestTask.cs:283

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2021-03-25 15:59:44 -04:00
VS MobileTools Engineering Service 2 1812a46af3
Localized file check-in by OneLocBuild Task: Build definition ID 13947: Build ID 4592372
Localized file check-in by OneLocBuild Task
2021-03-25 12:26:11 -07:00
VS MobileTools Engineering Service 2 92e847b68e Localized file check-in by OneLocBuild Task 2021-03-25 12:25:59 -07:00
TJ Lambert a401654dc7
[Localization] Adding Check-In Capability (#10965) 2021-03-25 14:22:49 -05:00
TJ Lambert cae0be6e73
[Localization] Adding OneLocBuildPat Variable (#10942)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
Co-authored-by: Connor Adsit <connor.adsit@gmail.com>
2021-03-25 09:59:39 -05:00
Rolf Bjarne Kvinge cfe0a309dc
[CoreCLR] Add support for mono_assembly_open. (#10962)
This requires a few things:

* [runtime] Add support for generating managed delegates only for CoreCLR.

    However, since our managed code is shared between CoreCLR and MonoVM, the
    best we can do is to make these CoreCLR-only delegates .NET-only.

* [runtime] Make it possible to implement Mono Embedding API in the CoreCLR bridge

    By making it possible to skip the automatically generated Mono Embedding

* [runtime] Add a MonoObject implementation for CoreCLR.

    We need a way to represent a managed object in native code, and since most
    our existing runtime code uses MonoObjects, we use the same for the
    CoreCLR bridge, just our own version of it. In Mono, the MonoObjects are
    tracked by the GC (which scans the stack), but we can't make CoreCLR scan
    the stack, so we use a reference counted version of MonoObject instead -
    we just put the GCHandle into a reference counted MonoObject, and when the
    MonoObject is freed, then we free the GCHandle as well.

* Go through all uses of mono_assembly_open, and make sure they release the
  returned assembly.
2021-03-25 15:56:56 +01:00
Rolf Bjarne Kvinge 1d9c9baf25
[msbuild] Fix ItemName vs PropertyName confusion in task output. (#10936)
There doesn't seem to have been any ill effects from the confusion, but it's
better done the right way.
2021-03-25 15:51:37 +01:00
Sebastien Pouliot 8e3be82e44
[tests] Fix introspection tests running on macOS 11.3 (beta 5) (#10947) 2021-03-25 09:09:30 -04:00
Sebastien Pouliot 7706c42b5c
[generate-type-forwarders] Add interfaces to types (#10960)
and that requires ensuring all (implicit/explicit) interface members are
generated...

**Example**

Removed interfaces:

```csharp
IARAnchorCopying
Foundation.INSCoding
Foundation.INSCopying
Foundation.INSSecureCoding
```
2021-03-25 09:07:18 -04:00
Manuel de la Pena 08b13589c7
[CI][APDiff] Fix pattern matching. (#10961) 2021-03-25 08:35:22 -04:00
Rolf Bjarne Kvinge a82575189b [CoreCLR] Add support for mono_assembly_open.
This includes going through all uses of mono_assembly_open, and make sure the release
the returned assembly.
2021-03-25 07:32:32 +01:00
Rolf Bjarne Kvinge 18ac48c5c8 [runtime] Make it possible to implement Mono Embedding API in the CoreCLR bridge
By making it possible to skip the automatically generated Mono Embedding API that
just asserts.
2021-03-25 07:32:32 +01:00
Rolf Bjarne Kvinge 2527679e34 [runtime] Add a MonoObject implementation for CoreCLR.
We need a way to represent a managed object in native code, and since most our existing
runtime code uses MonoObjects, we use the same for the CoreCLR bridge, just our own
version of it. In Mono, the MonoObjects are tracked by the GC (which scans the stack),
but we can't make CoreCLR scan the stack, so we use a reference counted version of
MonoObject instead - we just put the GCHandle into a reference counted MonoObject,
and when the MonoObject is freed, then we free the GCHandle as well.
2021-03-25 07:32:32 +01:00
Rolf Bjarne Kvinge 9a643594fb [runtime] Add support for generating managed delegates only for CoreCLR.
However, since our managed code is shared between CoreCLR and MonoVM, the best we
can do is to make these CoreCLR-only delegates .NET-only.
2021-03-25 07:32:32 +01:00
Rolf Bjarne Kvinge c8b6bc6c85
[dotnet] Build macOS/.NET for ARM64 as well. (#10959)
Partial fix for #10959.
2021-03-25 07:26:48 +01:00
Rolf Bjarne Kvinge 253061bf74
[runtime] Implement calling the managed Runtime.Initialize method from the CoreCLR bridge. (#10951)
* Move the existing logic to call Runtime.Initialize into the MonoVM code.
* Implement calling the managed Runtime.Initialize method from the CoreCLR bridge.

The call to Runtime.Initialize succeeds, which means we're now executing
managed code with CoreCLR for the first time.
2021-03-25 07:25:20 +01:00
Rolf Bjarne Kvinge 5fd95007fd
[tests] Adjust BuildingSameSolutionTwice_ShouldNotRunACToolTwice to work on an M1 machine. (#10954)
This test verifies that the build log prints:

    "execution started with arguments: actool --errors --warnings --notices --output-format xml1 --output-partial-info-plist "

However, for M1 machines, we don't call actool directly, we go through 'arch'
instead, and this line is printed:

    Tool arch execution started with arguments: -arch arm64e /usr/bin/xcrun actool --errors --warnings --notices --output-format xml1 --output-partial-info-plist ...

So adjust the test to cope with both of these behaviors.
2021-03-25 07:25:05 +01:00
Sebastien Pouliot 07fb20a6de
[generate-type-forwarders] Fix default parameters (#10958)
Example

```diff
-public AvailabilityAttribute (Platform introduced, Platform deprecated = 0, Platform obsoleted = 0, Platform unavailable = 0)
+public AvailabilityAttribute (Platform introduced, Platform deprecated, Platform obsoleted, Platform unavailable)
```
2021-03-24 19:58:18 -04:00
Sebastien Pouliot c3981d257e
[generate-type-forwarders] Fix missing `protected internal` methods stubs (#10956)
Example:

```diff
-protected virtual void OnNewPersonComplete (ABNewPersonCompleteEventArgs e);
```
2021-03-24 17:42:43 -04:00
Sebastien Pouliot 9224246d25
[generate-type-forwarders] Fix `new virtual` properties (#10957)
```diff
-public virtual FPUIActionExtensionContext ExtensionContext { get; }
+public FPUIActionExtensionContext ExtensionContext { get; }
```
2021-03-24 17:38:41 -04:00
Alex Soto 9c791dcd07
[mono] Bump mono to bring iOS binaries built with xcode12.4 (#10943)
* [mono] Bump mono to bring iOS binaries built with xcode12.4

Also bumping system mono pkg to the one that contains arm64 support

New commits in mono/mono:

* mono/mono@eb4c3116eb Build iOS SDK archives on Xcode 12.4
* mono/mono@acb8d8ed6f [2020-02][marshal] Fix VARIANT and BSTR marshaling in structs (#20918)

Diff: be9218f4d1..eb4c3116eb

* [mtouch] fix version logic check

Fixes Unexpected minOS version (expected 8.0.0, found 7.0.0) in MonoTouch.iphonesimulator.sdk/lib/libmono-native-compat.dylib ()

we really only care if it is over the version we expect not below.

* Fix version test
2021-03-24 17:34:30 -04:00
Rolf Bjarne Kvinge 1b658149ff
[runtime] Fix argument name confusion in the xamarin_gchandle_new[_weakref] methods. (#10952)
This way the argument names match the argument names in the corresponding Mono Embedding API.

This is just an argument rename, no functional changes.
2021-03-24 17:38:01 +01:00
Rolf Bjarne Kvinge b30777f420
Bump to .NET 6.0.100-preview.3.21161.23 (#10772)
* Bump to .NET 6.0.100-preview.3.21152.10

* Bump to 6.0.100-preview.3.21152.10.

* Bump to 6.0.100-preview.3.21161.7.

* Bump to .NET 6.0.100-preview.3.21161.23.

* [dotnet-linker] Bump ILink and use the supported method of getting an assembly's location.

* Bump to MSBuild.StructuredLogger 2.1.364 to get support for newer binlog versions.

* Fix build failure

Fixes:

    TestHelpers/BuildEngine.cs(161,24): error CS0433: The type 'ProjectEvaluationFinishedEventArgs' exists in both 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'StructuredLogger, Version=2.1.0.0, Culture=neutral, PublicKeyToken=d4c7181801cb6448' [/Users/builder/azdo/_work/1/s/xamarin-macios/tests/msbuild/Xamarin.MacDev.Tests/Xamarin.MacDev.Tests.csproj]

* Update parsing binlog properties.

* Be more defensive.

* [tests] Make sure the InternalsVisibleToAttribute constructor isn't linked away.

* [tests] Implement better printing of binlogs.

The latest MSBuild.StructuredLogger made some internal changes to the Message
property which confuses some of our test logic. So implement manual printing
of the log entries that we care about to make sure they conform to the
expected format by the tests (the output is mimicing what 'msbuild /v:diag
foo.binlog' would show).
2021-03-24 16:59:33 +01:00
Rolf Bjarne Kvinge a93bcdec34
[ObjCRuntime] Simplify Runtime.NSLog to always call xamarin_log. (#10937)
* [ObjCRuntime] Simplify Runtime.NSLog to always call xamarin_log.

This also fixes a couple of bugs:

* We wouldn't use the arm64 version of NSLog on Xamarin.Mac.
* We would use a wrong xamarin_log declaration on Xamarin.Mac on older macOS
  (the string argument would be UTF8 as opposed to Unicode, which is what the
  native function expects).

* [Dlfcn] Ignore any failures to show a warning about dlopen with full path.

We can run into this problem:

    System.EntryPointNotFoundException: xamarin_log assembly:<unknown assembly> type:<unknown type> member:(null)
        at (wrapper managed-to-native) ObjCRuntime.Runtime.xamarin_log(string)
        at ObjCRuntime.Runtime.NSLog (System.String value) [0x00001] in <7b41a16d434f401091abbf1beafe6453>:0
        at ObjCRuntime.Dlfcn.dlopen (System.String path, System.Int32 mode) [0x0003b] in <7b41a16d434f401091abbf1beafe6453>:0
        at ObjCRuntime.Runtime.LookupInternalFunction[T] (System.String name) [0x00040] in <7b41a16d434f401091abbf1beafe6453>:0
        at ObjCRuntime.Runtime.EnsureInitialized () [0x00036] in <7b41a16d434f401091abbf1beafe6453>:0
        at AppKit.NSApplication.Init () [0x00016] in <7b41a16d434f401091abbf1beafe6453>:0
        at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
        at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:395

which happens because we're trying to find libxammac.dylib, which we first try
to load without a full path, which runs into a code path that wants to show a
warning, which wants to use xamarin_log, which is in libxammac.dylib, which
we're trying to load. Ops.

So just ignore any failures to print this warning.

* Find a solution that doesn't involve catching exceptions.
2021-03-24 16:58:31 +01:00
Rolf Bjarne Kvinge 3b2fa0d0b1
[runtime] Move the declaration of the MonoObject struct to MonoVM-specific code. (#10938)
The fields of the MonoObject struct is specific to MonoVM, so this makes sure
we don't accidentally poke into random memory on CoreCLR.

Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2021-03-24 14:55:03 +01:00
Sebastien Pouliot 007964cb9f
[generate-type-forwarders] Fix const/readonly fields (#10944)
Examples:

```diff
-public double MinimumDuration = 5---null---;
+public const double MinimumDuration = null;
```

```diff
 public ---readonly--- Foundation.NSString RGB565;
```

Also handle `string` constants (quotes).
2021-03-24 09:25:14 -04:00
Rachel Kang deacce3293
Merge pull request #10886 from rachelkang/xcode12.5-avfoundation-b123
[AVFoundation] Update bindings for Xcode 12.5 beta 1,2,3
2021-03-24 09:21:56 -04:00
Sebastien Pouliot fa12b8d5e2
[devicecheck] Update for xcode 12.5 beta 3 (#10946) 2021-03-24 09:06:41 -04:00
Sebastien Pouliot 78ac083dcd
[generate-type-forwarders] Fix extension methods (#10948)
Examples:

```
-public void DidDeactivate (this IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
+public void DidDeactivate (IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
-public void DidRequestSessionReset (this IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
+public void DidRequestSessionReset (IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
-public void WillActivate (this IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
+public void WillActivate (IARCoachingOverlayViewDelegate This, ARCoachingOverlayView coachingOverlayView)
```
2021-03-24 09:04:49 -04:00
Sebastien Pouliot 3298f3b0b9
[apidiff] Skip _removed_ types when comparing Xamarin.iOS.dll between Catalyst and iOS assemblies (#10949)
We already have the _removed_ namespaces and listing all their types is
quite noisy which does not help reviewing changes/diff between the
assemblies.
2021-03-24 09:03:48 -04:00
Filip Navara 85dd54db29
Link FrameworkList.xml to a place where MSBuild SDK actually expects it (#10928)
The [SDK conflict resolution code](3c1307d227/src/Tasks/Common/src/ConflictResolution/ResolvePackageFileConflicts.cs (L54-L57)) expects the FrameworkList.xml file to be located in `$(TargetFrameworkDirectory)/RedistList/FrameworkList.xml`.

Fixes https://github.com/dotnet/runtime/issues/49211
Fixes https://github.com/dotnet/runtime/issues/49940
Fixes https://github.com/dotnet/runtime/issues/49477
Fixes https://github.com/xamarin/xamarin-macios/issues/10912
Fixes https://github.com/xamarin/xamarin-macios/issues/10839
Fixes https://github.com/xamarin/xamarin-macios/issues/10548
Fixes https://github.com/xamarin/xamarin-macios/issues/10592
Fixes https://github.com/mono/mono/issues/20805
Fixes https://github.com/mono/mono/issues/20894
2021-03-24 09:31:15 +01:00
Rolf Bjarne Kvinge 43d3f8b0f5
[runtime] Make the exception_gchandle argument optional for callbacks to managed code in CoreCLR. (#10939)
If no exception handling is provided when calling a managed delegate from native
code, and the managed code throws, then we'll abort.

It's not entirely clear how we'll handle managed exceptions that go through native
code yet, so this makes the initial implementation easier. By making the exception
handling optional, it'll be easy to find all cases where we need to fix it later,
by making it non-optional. The alternative is to add exception handling code all
over the place that would potentially have to be updated when we figure out exactly
what needs to be done.
2021-03-24 09:26:31 +01:00
Rolf Bjarne Kvinge 9153edebda
[runtime] Redirect to our objc_msgSend wrapper functions when needed for .NET code. (#10932)
This makes the mono_dllmap_insert function unnecessary for .NET, so remove it.

Ref: https://github.com/dotnet/runtime/issues/48110
Ref: https://github.com/dotnet/runtime/issues/43204
Ref: #10504
2021-03-24 09:17:35 +01:00
Sebastien Pouliot 2b7dc07d20
[generate-type-forwarders] Fix issues with properties stubs (#10941)
Examples

* Fix visibility, e.g. `protected`

```diff
-		public virtual System.IntPtr RawJointLandmarks {
+		protected virtual System.IntPtr RawJointLandmarks {
```

* Remove non-visible properties, e.g. `internal`

```diff
-		public virtual System.IntPtr _AddressBook {
-			get { throw new global::System.PlatformNotSupportedException (global::Constants.UnavailableOnMacCatalyst); }
-			set { throw new global::System.PlatformNotSupportedException (global::Constants.UnavailableOnMacCatalyst); }
-		}
```

* Fix `abstract` members

```diff
-public abstract ARSession Session { get; }
+public virtual ARSession Session { get; }
```
2021-03-23 20:05:49 -04:00
Rachel Kang ea3b15a95e
Fix spacing 2021-03-23 11:17:33 -04:00