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

10675 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 63db14ec7d
[runtime] Implement mono_method_signature and related signature methods for CoreCLR. (#11465) 2021-05-06 16:19:59 +02:00
Sebastien Pouliot 625d8cd090
[dotnet][linker] Do not remove `[LinkWith]` using xml (#11457)
This is removed _too soon_ and we end up not linking with the native
library, which makes the build fail.

Fixes https://github.com/xamarin/xamarin-macios/issues/11456
2021-05-06 09:26:23 -04:00
Jonathan Peppers cb96817f07
[dotnet] rename workload to Microsoft.NET.Sdk._platform_.Manifest-6.0.100 (#11436)
* [dotnet] rename workload to Microsoft.NET.Sdk._platform_.Manifest-6.0.100

Context: https://github.com/dotnet/designs/pull/188/files#diff-8fcaa29d8e6f00b34b3cb1830d93f33e75f04424780a66a3c658c7021048e74fR125
Context: https://github.com/xamarin/xamarin-android/pull/5898

The `$(PackageId)` of our workload `.nupkg` needs to be:

    Microsoft.NET.Sdk._platform_.Manifest-6.0.100

While the `$(PackageVersion)` remains the same as before.

The layout on disk will change to:

    dotnet\sdk-manifests\6.0.100\Microsoft.NET.Sdk._platform_\
        WorkloadManifest.json
        WorkloadManifest.targets

Note that `.Manifest` and `-6.0.100` are not in the folder name on disk.

At the same time, let's also update the `version` in
`WorkloadManifest.json` so it contains the proper version for our
workload. This used to not be possible because `version` was a `long`,
but it now is a `string` where we can put our version.

* Use $(DOTNET6_VERSION_BAND)

* Pass in -p:VersionBand to 'dotnet pack'
2021-05-06 07:46:01 +02:00
Emanuel Fernandez Dell'Oca d5f1671184
[dotnet] Fix _DetectSdkLocations from Windows (#11451)
This task ends up setting as env variable the Xamarin Sdk root directory on the Mac, but when building from Windows it was setting the Windows path, so instead we need to override it with the proper value on macOS.

This should not change the original behavior when building from macOS.
2021-05-06 07:42:43 +02:00
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
Rolf Bjarne Kvinge 50b68d4aab
[runtime] Print more information about the exception for unhandled managed exceptions. (#11440)
This eases debugging when trying to figure out what went wrong.
2021-05-05 16:31:03 +02:00
Sebastien Pouliot a3cf2eaa79
[dotnet][linker] Add a shared ILLink.LinkAttributes.xml file for the platform assemblies (#11424) 2021-05-05 08:28:15 -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
Rolf Bjarne Kvinge 6225cac669
[msbuild/dotnet] Fix build logic when using .NET to not try to use nor require any version of installed Xamarin.iOS/Xamarin.Mac. Fixes #10827. (#11433)
* [dotnet] Ship the buildinfo file.

* [msbuild/dotnet] Fix build logic when using .NET to not try to use nor require any version of installed Xamarin.iOS/Xamarin.Mac. Fixes #10827.

We do this by setting the _XamarinSdkRoot variable in our .NET logic, which
our existing shared build logic reads, passes to the DetectSdkLocations task,
and then sets our override environment variable
(MD_MTOUCH_SDK_ROOT/XAMMAC_FRAMEWORK_PATH) to the install location, so that
existing code (which honors the override variable) continues to work as-is.

Fixes https://github.com/xamarin/xamarin-macios/issues/10827.
2021-05-04 21:36:48 -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 81300576ff
[runtime] Implement mono_object_isinst for CoreCLR. (#11427) 2021-05-04 20:20:46 +02:00
Rolf Bjarne Kvinge 41bf71a0e2
[runtime] Implement mono_object_get_class for CoreCLR. (#11398) 2021-05-04 14:31:20 +02: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 0285689aa3
[runtime] Never disable exception marshalling for CoreCLR. (#11407) 2021-05-04 08:28:34 +02:00
Rolf Bjarne Kvinge f57d9835b8
[CoreGraphics] Don't exclude ARM64 code path on macOS anymore. (#11402) 2021-05-04 08:28:01 +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
Rolf Bjarne Kvinge f0a0d08aeb
[runtime] Call into managed code to handle runtime exceptions. (#11381)
* [runtime] Call into managed code to handle runtime exceptions.

This makes things easier for CoreCLR.

There should be no significant performance hits; this code path is
exceptional, and exceptions are already very heavy-weight anyways.

* Update to use xamarin_free instead of mono_free as per review.

* Port more to managed code.
2021-05-04 08:19:46 +02:00
Sebastien Pouliot 72a6d60d2b
[tests][dotnet] Bump MSBuild.StructuredLogger to 2.1.472 to fix ArgumentNullException in our tests (#11422) 2021-05-03 19:51:52 -04: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 47f273b4f6
[Tests] Update xamarin domain to make tests not fail. (#11408)
A wrong implementation of a redirect was added and returns a 403 and not
a 302 resulting in an error. Update to the final destination of the
redirect and be happy.

fixes https://github.com/xamarin/maccore/issues/2432
2021-05-02 20:11:16 -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
Emanuel Fernandez Dell'Oca 2aa6c5aa6b
[dotnet] Fixes _RunILLink from Windows for Preview 4 (#11390)
There were some changes on the original target.
2021-04-30 08:46:51 +02: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 6f743fd292
[build] Skip building stuff that isn't enabled. (#11385) 2021-04-30 07:51:58 +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
Rolf Bjarne Kvinge 655f2f921f
[runtime] Implement xamarin_get_reflection_method_method for CoreCLR. (#11383) 2021-04-30 07:49:25 +02:00
Rolf Bjarne Kvinge cb32305434
[msbuild] Show tool output with high importance if the tool fails. (#11380)
Build failures will now include things like this for quiet builds:

    Tool xcrun execution finished (exit code = 1).

    Undefined symbols for architecture x86_64:
      "_GlobalizationNative_LoadICUData", referenced from:
         -u command line option
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
2021-04-30 07:44:27 +02:00
Rolf Bjarne Kvinge c96ae4c73d
[bgen] Ship all files published by 'dotnet publish' for bgen. Fixes #11269. (#11362)
Ship all files published by 'dotnet publish' for bgen, not only files prefixed
by 'bgen*'. This way we ship Mono.Options.dll too (and we won't crash at
launch trying to look for it).

Fixes https://github.com/xamarin/xamarin-macios/issues/11269.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-30 07:41:50 +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
Sebastien Pouliot e2d65529dc
[tests][xtro] Fix recent failures (#11386)
New file was not committed (should have been with a rename)
2021-04-29 15:46:20 -04:00
Alexander Köplinger d7d69a6bf8
[dotnet][msbuild] Fix property for native http handler (#11388)
We were documenting the wrong name (fix in https://github.com/dotnet/runtime/pull/52055) which lead Sebastien to change it to the wrong one in 095b7e1105
2021-04-29 15:40:41 -04:00
Sebastien Pouliot 426d6d6bea
[tests][xtro] Fix catalyst changes with xcode12.5 RC (#11340)
xtro should soon be re-enabled and spot those on the (backport) PR
2021-04-29 10:14:05 -04:00
Sebastien Pouliot 8679482cc0
[dotnet] Fix release builds on devices (#11367)
Fixed by removal of
```
<InvariantGlobalization Condition="'$(InvariantGlobalization)' == ''">false</InvariantGlobalization>
```
which is (should be) the default.

All our local usage compare with it with `true` so this likely comes from
somewhere else (sdk / runtime).

It does not really have a huge impact on build size (and the small diff
is probably the source of the crash)

* fails (17,479,981): https://gist.github.com/spouliot/6f8defb8f940e68314ba167ea76dc9bf
* works (17,502,741): https://gist.github.com/spouliot/d06f0b1b95e114fe469ce49081c70e33

Also fix target to run a release (no debug) build, which is more helpful
"out of the box" :)

Tracking issue with: https://github.com/xamarin/xamarin-macios/issues/11366
2021-04-29 09:44:14 -04:00
Rolf Bjarne Kvinge 174bafe9b0
[runtime] MapKit is available on macOS/arm64. (#11363) 2021-04-29 14:45:58 +02:00
Rolf Bjarne Kvinge fdd386b68f
[runtime] Remove dead code. (#11354)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 13:56:54 +02:00
Rolf Bjarne Kvinge d9ec37ca2d
[tests] Build a macOS/arm64 version of libtest. (#11364)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 13:41:52 +02:00
Mauro Agnoletti b4b8ee735c
Updated Xamarin.Messaging version (#11369)
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 09:05:52 +02:00
Rolf Bjarne Kvinge ec7dc80b59
[tests] Add a bluetooth usage description to monotouch-test/macOS. (#11355)
This seems to be required when running monotouch-test with lldb (!) - no idea
why it doesn't fail otherwise.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 08:37:36 +02:00
Rolf Bjarne Kvinge 24cf0becd2
[generator] Improve performance for the printing inner loop. (#11365)
* Remove 1 array allocation per print statement.
* Remove 2 string concatenations per print statement.
* Don't indent empty lines.

For the generated code for watchOS, this is the difference (time-wise I wasn't
able to measure anything significant, although the memory savings are
significant):

Before:

    Allocation summary
           Bytes        Count  Average Type name
     535.485.544    7.115.025       75 System.String
     145.340.480    2.270.945       64 IKVM.Reflection.CustomAttributeData
     110.149.624    1.238.394       88 System.Char[]
    ...
    Total memory allocated: 1.793.323.536 bytes in 28.827.325d objects

After:

    Allocation summary
           Bytes        Count  Average Type name
     494.592.328    6.624.441       74 System.String
     145.340.480    2.270.945       64 IKVM.Reflection.CustomAttributeData
      99.345.984      968.303      102 System.Char[]
    ...
    Total memory allocated: 1.741.626.784 bytes in 28.066.650d objects

Difference:

    Allocation summary
           Bytes       Count  Average Type name
     -40.893.216    -490.584       -1 System.String
               0           0       64 IKVM.Reflection.CustomAttributeData
     -10.803.640    -270.091      +14 System.Char[]
    ...
    Total memory allocated: -51.696.752 bytes in -760.675 objects

This was measured by executing the following in an already built working copy:

    /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --profile=log:nocalls,alloc --debug build/common/bgen.exe @build/watchos.rsp

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2021-04-29 07:54:21 +02: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