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

2212 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge c51cba525a
[runtime] Implement mono_runtime_invoke for CoreCLR. (#11439)
* [runtime] Implement mono_runtime_invoke for CoreCLR.

* [runtime] We always need a native xamarin_mono_object_retain function.
2021-05-06 07:25:43 +02:00
Manuel de la Pena 3f8a9ac9e0
[CI] Dump the hardware of the bot to see if we are virtual. (#11453)
Are we virtual or are we dancers?
2021-05-05 22:57:10 -04:00
Manuel de la Pena 3ac7d583d5
[CI] Remove apitest from the tests executed inolder macs. (#11452)
The test was merge with the xammac_tests in commit
93bbfe7a86
but we did not have the tests running to know.

This should fix some of the failures we have in older macs.
2021-05-05 22:02:25 -04:00
Mike Bond 906cb14c06
[CI] Use yaml-templates agent pool selector (#11356)
Use release version of yaml-templates agent pool selector from main

https://github.com/xamarin/yaml-templates/pull/115
2021-05-05 22:01:58 -04:00
Sebastien Pouliot 4ba7bf3b9d
[tests][dotnet] A few helping touch to do size comparison (#11446)
- Make git ignore the generated `report.md`
- Fix `.aotdata` reported total size in reports (was always 0)
- Add option to strip the dotnet app bundle (until [1]) so it's easier to compare with _oldnet_ sizes.

[1] https://github.com/xamarin/xamarin-macios/issues/11445
2021-05-05 19:15:18 -04:00
Sebastien Pouliot b90fa78bfa
[dotnet][linker] Only register assemblies that we're not deleting from the bundle (#11437)
So we generate this, inside `registrar.mm`, for a simple app

```objc
	static const char *__xamarin_registration_assemblies []= {
		"MySingleView",
		"System.Runtime.Serialization.Formatters",
		"System.Runtime",
		"System.Private.CoreLib",
		"Xamarin.iOS"
	};
```

instead of

```objc
	static const char *__xamarin_registration_assemblies []= {
		"MySingleView",
		"Microsoft.CSharp",
		"Microsoft.VisualBasic.Core",
		"Microsoft.VisualBasic",
		"Microsoft.Win32.Primitives",
		"Microsoft.Win32.Registry",
		"System.AppContext",
		"System.Buffers",
		"System.Collections.Concurrent",
		"System.Collections.Immutable",
		"System.Collections.NonGeneric",
		"System.Collections.Specialized",
		"System.Collections",
		"System.ComponentModel.Annotations",
		"System.ComponentModel.DataAnnotations",
		"System.ComponentModel.EventBasedAsync",
		"System.ComponentModel.Primitives",
		"System.ComponentModel.TypeConverter",
		"System.ComponentModel",
		"System.Configuration",
		"System.Console",
		"System.Core",
		"System.Data.Common",
		"System.Data.DataSetExtensions",
		"System.Data",
		"System.Diagnostics.Contracts",
		"System.Diagnostics.Debug",
		"System.Diagnostics.DiagnosticSource",
		"System.Diagnostics.FileVersionInfo",
		"System.Diagnostics.Process",
		"System.Diagnostics.StackTrace",
		"System.Diagnostics.TextWriterTraceListener",
		"System.Diagnostics.Tools",
		"System.Diagnostics.TraceSource",
		"System.Diagnostics.Tracing",
		"System.Drawing.Primitives",
		"System.Drawing",
		"System.Dynamic.Runtime",
		"System.Formats.Asn1",
		"System.Globalization.Calendars",
		"System.Globalization.Extensions",
		"System.Globalization",
		"System.IO.Compression.Brotli",
		"System.IO.Compression.FileSystem",
		"System.IO.Compression.ZipFile",
		"System.IO.Compression",
		"System.IO.FileSystem.AccessControl",
		"System.IO.FileSystem.DriveInfo",
		"System.IO.FileSystem.Primitives",
		"System.IO.FileSystem.Watcher",
		"System.IO.FileSystem",
		"System.IO.IsolatedStorage",
		"System.IO.MemoryMappedFiles",
		"System.IO.Pipes.AccessControl",
		"System.IO.Pipes",
		"System.IO.UnmanagedMemoryStream",
		"System.IO",
		"System.Linq.Expressions",
		"System.Linq.Parallel",
		"System.Linq.Queryable",
		"System.Linq",
		"System.Memory",
		"System.Net.Http.Json",
		"System.Net.Http",
		"System.Net.HttpListener",
		"System.Net.Mail",
		"System.Net.NameResolution",
		"System.Net.NetworkInformation",
		"System.Net.Ping",
		"System.Net.Primitives",
		"System.Net.Quic",
		"System.Net.Requests",
		"System.Net.Security",
		"System.Net.ServicePoint",
		"System.Net.Sockets",
		"System.Net.WebClient",
		"System.Net.WebHeaderCollection",
		"System.Net.WebProxy",
		"System.Net.WebSockets.Client",
		"System.Net.WebSockets",
		"System.Net",
		"System.Numerics.Vectors",
		"System.Numerics",
		"System.ObjectModel",
		"System.Private.DataContractSerialization",
		"System.Private.Uri",
		"System.Private.Xml.Linq",
		"System.Private.Xml",
		"System.Reflection.DispatchProxy",
		"System.Reflection.Emit.ILGeneration",
		"System.Reflection.Emit.Lightweight",
		"System.Reflection.Emit",
		"System.Reflection.Extensions",
		"System.Reflection.Metadata",
		"System.Reflection.Primitives",
		"System.Reflection.TypeExtensions",
		"System.Reflection",
		"System.Resources.Reader",
		"System.Resources.ResourceManager",
		"System.Resources.Writer",
		"System.Runtime.CompilerServices.Unsafe",
		"System.Runtime.CompilerServices.VisualC",
		"System.Runtime.Extensions",
		"System.Runtime.Handles",
		"System.Runtime.InteropServices.RuntimeInformation",
		"System.Runtime.InteropServices",
		"System.Runtime.Intrinsics",
		"System.Runtime.Loader",
		"System.Runtime.Numerics",
		"System.Runtime.Serialization.Formatters",
		"System.Runtime.Serialization.Json",
		"System.Runtime.Serialization.Primitives",
		"System.Runtime.Serialization.Xml",
		"System.Runtime.Serialization",
		"System.Runtime",
		"System.Security.AccessControl",
		"System.Security.Claims",
		"System.Security.Cryptography.Algorithms",
		"System.Security.Cryptography.Cng",
		"System.Security.Cryptography.Csp",
		"System.Security.Cryptography.Encoding",
		"System.Security.Cryptography.OpenSsl",
		"System.Security.Cryptography.Primitives",
		"System.Security.Cryptography.X509Certificates",
		"System.Security.Principal.Windows",
		"System.Security.Principal",
		"System.Security.SecureString",
		"System.Security",
		"System.ServiceModel.Web",
		"System.ServiceProcess",
		"System.Text.Encoding.CodePages",
		"System.Text.Encoding.Extensions",
		"System.Text.Encoding",
		"System.Text.Encodings.Web",
		"System.Text.Json",
		"System.Text.RegularExpressions",
		"System.Threading.Channels",
		"System.Threading.Overlapped",
		"System.Threading.Tasks.Dataflow",
		"System.Threading.Tasks.Extensions",
		"System.Threading.Tasks.Parallel",
		"System.Threading.Tasks",
		"System.Threading.Thread",
		"System.Threading.ThreadPool",
		"System.Threading.Timer",
		"System.Threading",
		"System.Transactions.Local",
		"System.Transactions",
		"System.ValueTuple",
		"System.Web.HttpUtility",
		"System.Web",
		"System.Windows",
		"System.Xml.Linq",
		"System.Xml.ReaderWriter",
		"System.Xml.Serialization",
		"System.Xml.XDocument",
		"System.Xml.XPath.XDocument",
		"System.Xml.XPath",
		"System.Xml.XmlDocument",
		"System.Xml.XmlSerializer",
		"System.Xml",
		"System",
		"WindowsBase",
		"mscorlib",
		"netstandard",
		"System.Private.CoreLib",
		"Xamarin.iOS"
	};
```

It probably has a positive impact on build time (but not measured).
2021-05-05 08:26:02 -04:00
Manuel de la Pena a86bbc5466
[CI] Create post pipelines that will publish html results. (#11431)
Create two pipelines that will be triggered when a new build is
completed and contains tests results. There are some important details:

1. pipeline triggers have to specify all branches or a subset. We use
   tags to trigger for PRs.
2. Tags are and, not or, so we need to pipelines (lame lame).

Due to 2. we add a new tag to identify ci builds.
2021-05-04 17:08:52 -04:00
Manuel de la Pena 12dd318212
[CI] Do not clutter the nuget feed with PR build nugets. (#11428)
Do not publish the nugets that have been created in a PR build. The
build results can be accessed from the comment once completed. This way
we make sure that next builds do not have conflicts when publishing the
nugets.
2021-05-04 15:31:44 -04:00
Rolf Bjarne Kvinge 938f63da22
[tests] Make the mtouch test project reference the actual mtouch project. (#11400)
This makes it easier to test localized strings used in mtouch, since we don't have
to replicate the build for all the resources.

This required a few changes to avoid including code in the mtouch tests that already
exists in the mtouch executable.

Also rename the mtouch test project to mtouchtests.csproj.

This way the test project can reference the actual mtouch.csproj without
causing conflicts due to having two projects with the same name.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-05-04 14:10:03 +02:00
Rolf Bjarne Kvinge 14f7cf48a0
[mlaunch] Don't ship for MacCatalyst. (#11397)
We don't need mlaunch for MacCatalyst.
2021-05-04 08:26:01 +02:00
Rolf Bjarne Kvinge 14e76c0139
[runtime] Return the exception from wrapper methods for exception marshalling. (#11382)
There's no general way to set a pending managed exception in CoreCLR (the
current plan is to support setting a pending managed exception for the
objc_msgSend family of functions). This means that the way we've implemented
custom wrappers that can handle Objective-C exceptions won't work, because
those wrappers currently tries to set a pending managed exception (which Mono
throws upon returning from the corresponding native wrapper function).

So rewrite this a bit: these custom wrappers now return a GCHandle with the
managed exception as an out parameter, and the calling managed code throws
that exception instead.

This also required adjusting a few API definitions to match how their wrapper
functions are defined.
2021-05-04 08:25:38 +02:00
Manuel de la Pena b720b44827
[CI] Just requests translations in the cron job. (#11420)
Execute the loc step + the creation of a PR only in the cron job and
skipt it in anyother build.
2021-05-03 11:35:18 -04:00
Manuel de la Pena 19482a71ae
[CI] Allow to enable or disable the dotnet builds. (#11358)
Create a new parameter that can be used to decide if we build or not the
dotnet parts of the project. If we do not, we make sure that we do not
have any errors in all the other steps.
2021-05-02 20:31:42 -04:00
Manuel de la Pena cc05e967a4
[Generator Diff] Ignore file we are not interested in. (#11409) 2021-05-02 20:08:51 -04:00
Sebastien Pouliot 5ef7fb2784
[dotnet][msbuild] Strip symbols from native executable (#11378)
We have to consider (setup and process) `libSystem.Globalization.Native`
in order not to remove the required symbols when stripping the native
executable.

Ignore `libSystem.Globalization.Native` for dotnet / catalyst
ref: https://github.com/xamarin/xamarin-macios/issues/11392
2021-05-02 15:06:11 -04:00
Connor Adsit 88554a71d6
Enable setting provisionator channel as parameter (#11377)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-30 16:47:15 -04:00
Manuel de la Pena 4d93be60c6
[CI] Add a prefix to make it nicer to humans when several builds happen. (#11391) 2021-04-30 08:24:12 -04:00
Rolf Bjarne Kvinge 8e9f86aad8
[runtime] Implement mono_method_get_class for CoreCLR. (#11389) 2021-04-30 07:53:30 +02:00
Rolf Bjarne Kvinge 4b8c328a48
[mlaunch] Only build if both iOS and macOS are enabled. (#11384) 2021-04-30 07:50:14 +02:00
Manuel de la Pena 993c744347
[CI] Re-enable API and Generator diff. (#11187)
Use the jenkins script as a base to get the PAI & generator from stable
diff back to the CI. Comment is not perfect, but does provide the
required information. The comment can be improve in a later commit since
this is getting too large.
2021-04-29 17:53:06 -04:00
Manuel de la Pena a4426e8a5c
[CI] Unblock the CI by using our own channel for provisionator. (#11368) 2021-04-28 16:22:22 -04:00
Rolf Bjarne Kvinge e4960ad9e3
[dotnet] Build the partial static registrar for CoreCLR. (#11345)
* The generated static registration code will eventually be different.
* The generated code has to be compiled with different compiler flags.

This also required adding a new overload of xamarin_mono_object_release for the generated
code to compile.
2021-04-28 07:34:40 +02:00
Manuel de la Pena a1a5c01935
[Xharness] Fix the test selector. (#11315)
Fix the tests selector by setting the PR number in an env variable that
is not longer linked with Jenkins.

Fixes #11299
2021-04-27 09:23:21 -04:00
Rolf Bjarne Kvinge 43f1d02dae
[CoreCLR] Implement xamarin_gchandle_get_target. (#11333)
This also meant reviewing calling code to make sure that MonoObject*s are
released when they should be, which meant reviewing every method that returns
a MonoObject*, and release the result.
2021-04-27 14:59:03 +02:00
Manuel de la Pena 5de96fd9f8
[CI] Continue on error when we cannot publish a nuget. (#11336) 2021-04-26 18:45:49 -04:00
Manuel de la Pena 99fa931a27
[CI] Fix nuget messaging in case of failure. (#11335) 2021-04-26 13:29:24 -04:00
Manuel de la Pena 9ff88c19a1
[CI] Workaorund misconfig pools. (#11323)
For some reason, some of the internal hosted pools have been set without
the OS version (WRONG WRONG). The simples way is to allow to skip this
check in those pools over re-configuring all bots.

'We can lick gravity, but sometimes the paperwork is overwhelming.'
2021-04-26 10:22:29 -04:00
Manuel de la Pena 52ae1dd1da
[CI] Fix mac tests provisioning. (#11324) 2021-04-26 10:21:14 -04:00
Manuel de la Pena fee57615f9
[CI] Add the context in the failed device bots. (#11318) 2021-04-24 06:46:09 -04:00
Manuel de la Pena 26d64a1a24
[CI] Unify both failing statuse. (#11311) 2021-04-23 16:45:59 -04:00
Rolf Bjarne Kvinge 5d42c933f1
[runtime] Move xamarin_create_managed_ref internal call to managed code. (#11271)
Move the xamarin_create_managed_ref internal call to managed code, to ease things
with CoreCLR.

In order to preserve performance, this wasn't a straight forward port.

* monotouch_create_managed_ref used to detect if there already was a GCHandle for
  a native object. To avoid a managed->native transition, this logic has now been
  moved into the code that sets the GCHandle (the xamarinSetGCHandle🎏 / xamarin_set_gchandle_trampoline
  code), and these methods return a value saying whether the GCHandle was set or
  not.

* xamarin_create_gchandle will check the retain count to determine whether to create
  a weak or a strong GCHandle for the managed object. In this particular case we
  should never need to create a strong GCHandle, which means that we don't need to
  check the retain count (saving a managed->native transition).

Using the new perftest (#11298), I get very similar numbers for both old code and new code: https://gist.github.com/rolfbjarne/e0fc2ae0f21da15062b4f051138679af (multiple runs). Sometimes the old code is faster, sometimes the new code is faster (although the old code tends to be the one who wins).

In any case there aren't any significant performance hits due to this change, so it should be good to go.
2021-04-23 18:42:11 +02:00
Manuel de la Pena 9c2ca9ccf5
[CI] Add triggers for new release branches. (#11303) 2021-04-22 18:50:47 -04:00
Rolf Bjarne Kvinge a3613a187f
[tools] Fix a typo in the error message for MX2301 that caused a format exception. (#11291)
Makes this error show properly:

> error MM2301: The linker step 'Setup' failed during processing: This version of {0} requires the {1} {2} SDK (shipped with Xcode {3}). Either upgrade Xcode to get the required header files or use the dynamic registrar or set the managed linker behaviour to Link Platform or Link Framework SDKs Only in your project's Mac Build Options > Linker Behavior} (to try to avoid the new APIs).. String.Format failed! Arguments were: "Microsoft.macOS" "macOS" "11.3" "12.5". Please file an issue to report this incorrect error handling.
2021-04-22 20:51:58 +02:00
Manuel de la Pena 196b4fa371
[CI] Fix pwsh. (#11296) 2021-04-22 14:01:02 -04:00
Rolf Bjarne Kvinge add11fbe39
[mmp] Use the resolver (and configure it correctly) when using --runregistrar. (#11288)
* Extract the code we use to configure the assembly resolver during a normal
  mmp run to make it usable for --runregistrar.
* Configure the assembly resolver we use for --runregistrar.
* Pass the assembly resolver to the registrar so that it's actually used.
* Adjust the System.Void lookup to look everywhere even if we find a corlib,
  since behavior changes a bit now that we're using an assembly resolver:
	* Previous behavior:
		1. In .NET mode, look for a corlib named System.Private.CoreLib, and fail to find it.
		2. Look in all the loaded assemblies for System.Void (and find it in System.Runtime.dll).
	* Broken behavior as a result of the resolver changes:
		1. Find corlib as System.Private.CoreLib.dll
		2. Fail to find System.Void in System.Private.CoreLib.dll, since we'd only look in corlib.
	* New behavior
		1. Find corlib as System.Private.CoreLib.dll
		2. Fail to find System.Void in System.Private.CoreLib.dll, but find it in System.Runtime.dll,
		   since we're now looking in all the loaded assemblies.

This is required to make VSMac's usage of --runregistrar
2021-04-22 14:47:47 +02:00
Manuel de la Pena 25715b8b5f
[CI] Remove duplicated status. (#11274) 2021-04-21 21:34:27 -04:00
Manuel de la Pena fac9cdc52f
[CI][VSTS] Remove redudant status. (#11267)
VSTS already provides a status per job, since the governance tests do
not give much feedback in the comments and just set a status, we can use
the default provided by the VSTS app.
2021-04-21 21:24:13 -04:00
Manuel de la Pena bceac54356
[CI] The env var is not provided in the CI builds, just PRs. (#11268) 2021-04-21 21:23:25 -04:00
Manuel de la Pena 78ef8b8d03
[CI] Remove Mac OS devices that will not happen. (#11272)
Remove those devices of Mac OS X that will not happen because we cannot
run the agent in such and old device. This is due to the fact that the
agent runs using c# and we do not support such and old OS.

Also add a new stage to run tests on catalina. ATM older OS as not
working, but Catalina should work with our trusted pool.
2021-04-21 17:47:10 -04:00
Manuel de la Pena 0ad8144f17
[CI] Reduce the number of statuses when we build nugets. (#11242)
We move from having a status per nugets to two statues:

1. xamarin-macios (Nugets built) -  to let us know that we did build
   nugets.
2. xamarin-macios (Nuvets published) - to let us know tat we did pubish
   the nugets.
2021-04-21 15:51:30 -04:00
Manuel de la Pena d0c09eb437
[CI] Fix import issue in device test templates. (#11249) 2021-04-21 09:30:50 -04:00
Manuel de la Pena 0455d94ba8
[CI][VSTS] Ensure statuses are set in the correct commit and not the merge commit. (#11250)
On a pull request, Azure DevOps does not build the exact version of the code that you pushed,
but a version merged with your target branch. This means that the commit
we see in the Buid.Revision is not the one of the last commit of the PR,
which makes some statuses get "lost" and checks be missed.

We make a distintion on which variable to used base on the build reason.
2021-04-21 06:11:36 -04:00
Rolf Bjarne Kvinge 405441f544
[mtouch] It seems watchOS simulators can automatically choose the right architecture from fat apps. (#11241)
* [mtouch] It seems watchOS simulators can automatically choose the right architecture from fat apps.

So we can build a fat simulator app, and not depend on mlaunch copying in the
specific architecture at launch time.

A partial fix for https://github.com/xamarin/maccore/issues/2411.

* Bump maccore.

New commits in xamarin/maccore:

* xamarin/maccore@d11721f55e [Xamarin.Hosting] Xcode seems to have changed some logic with regards to getting the primary instruments server. (#2416)
* xamarin/maccore@d27297a098 [Xamarin.Hosting] Don't copy single-arch executable over a fat executable. (#2417)
* xamarin/maccore@6c305d4aa7 [Xamarin.Hosting] Launching may succeed even if the launch request fails. Don't fail in that case. (#2415)
* xamarin/maccore@bccc91d6a0 Support ARM64 and ARM64e simulators (#2418)

Diff: c89fd6a694..d11721f55e
2021-04-21 08:00:02 +02:00
Peter Collins dec81b602a
[ci] Fix artifact upload in post build pipeline (#11231)
The artifact upload task in post-build-pipeline.yaml was not indented
correctly and the automatic pipeline triggers were not firing as a
result.
2021-04-16 16:01:39 -04:00
Sebastien Pouliot 3511995fd7
[linker] Obsolete 'LinkerSafeAttribute' in favor of `AssemblyMetadata` (#11229)
In this case we can obsolete the attribute on both legacy and dotnet
since the replacement attribute is available on both. However this does
require a small update to the legacy linker (and is part of the PR).

Fix https://github.com/xamarin/xamarin-macios/issues/10674
2021-04-16 15:06:49 -04:00
Manuel de la Pena 6e7205a5f4
[CI] Avoid other not needed steps on provisioning issues. (#11199) 2021-04-15 17:25:30 -04:00
Manuel de la Pena 46d8e430a5
[CI] There is no reason to need to run these tests on device bots. (#11214) 2021-04-15 10:41:16 -04:00
Manuel de la Pena 359b79abbc
[CI] Provide the info of the commit that generated a message. (#11203) 2021-04-14 17:44:12 -04:00
Peter Collins 2dc113ea28
[CI] Upload build asset data to darc/maestro (#11189) 2021-04-14 17:34:30 -04:00
Sebastien Pouliot 737a19199b
[static-registrar] Re-order some code in ToObjCParameterType (#11211)
This avoid some computation that might not be needed.

It also avoids a `NullReferenceException` when updating to net6 preview 4
builds (where `ResolveType` can return `null` but the type reference was
enough to complete the job).
2021-04-14 16:44:31 -04:00