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

13657 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 3337321d25
[CI] Using templates does not allow to run the pipeline without access to ESRP. (#15175) 2022-06-01 19:23:36 -04:00
Steve Hawley f552e63085
fixing logic error (#15170) 2022-06-01 15:44:50 -04:00
Manuel de la Pena 6a60c251b4
[CI] Disable the CI trigger explicitly. (#15172) 2022-06-01 11:56:14 -04:00
Manuel de la Pena d68141113b
[CI] Fix if statements that's flipped. (#15165) 2022-06-01 11:25:59 -04:00
Sebastien Pouliot 33b73a1fd6
[perf] Cache `Runtime.IsUserType` results (#15149)
This is computed **twice** _per instance_, when the instance is
* created: `NSObject.CreateManagedRef`
* released: `NSObject.ReleaseManagedRef`

However its (boolean) value remains identical for all instances of the same type.

This shows up as consuming a lot of time in the logs attached to https://github.com/xamarin/xamarin-macios/issues/15145

Basically two things are cached
* the selector for `xamarinSetGCHandle🎏`, which makes it 15% faster;
	 * some platforms, but not macOS, have an optimization for the `Selector.GetHandle` API
* the result is cached into a `Dictionrary<IntPtr,bool>`

Note that the optimizations are not specific to CoreCLR nor macOS (so they are not fixes for the CoreCLR performance regression of the above mentioned issue).
OTOH it will also help performance for legacy and other net6 (mono) platforms.

```
BenchmarkDotNet=v0.12.1, OS=macOS 12.3.1 (21E258) [Darwin 21.4.0]
Apple M1, 1 CPU, 8 logical and 8 physical cores
.NET Core SDK=        6.0.100 [/usr/local/share/dotnet/sdk]
  [Host] : .NET Core 6.0 (CoreCLR 6.0.522.21309, CoreFX 6.0.522.21309), Arm64 RyuJIT

Job=InProcess  Toolchain=InProcessEmitToolchain  IterationCount=3
LaunchCount=1  WarmupCount=3
```

|           Method | Length |           Mean |        Error |      StdDev | Ratio |
|----------------- |------- |---------------:|-------------:|------------:|------:|
|         Original |     16 |     7,729.8 ns |    212.61 ns |    11.65 ns |  1.00 |
|   CachedSelector |     16 |     6,552.6 ns |    202.70 ns |    11.11 ns |  0.85 |
| CachedIsUserType |     16 |       162.0 ns |     14.86 ns |     0.81 ns |  0.02 |
|                  |        |                |              |             |       |
|         Original |    256 |   123,183.0 ns |  4,724.95 ns |   258.99 ns |  1.00 |
|   CachedSelector |    256 |   104,570.3 ns |  2,029.20 ns |   111.23 ns |  0.85 |
| CachedIsUserType |    256 |     2,489.5 ns |    390.86 ns |    21.42 ns |  0.02 |
|                  |        |                |              |             |       |
|         Original |   4096 | 1,970,381.7 ns | 66,393.09 ns | 3,639.23 ns |  1.00 |
|   CachedSelector |   4096 | 1,676,773.0 ns | 12,149.92 ns |   665.98 ns |  0.85 |
| CachedIsUserType |   4096 |    39,933.3 ns |  7,426.74 ns |   407.08 ns |  0.02 |

[Benchmark source code](https://gist.github.com/spouliot/42fd43e94c5a9ce90164f0f6f9b35018)
2022-06-01 10:46:40 +02:00
Rolf Bjarne Kvinge 8fff1548cb
Add newlines to issue template to fix markdown formatting problems. (#15152) 2022-05-31 18:43:01 +02:00
VS MobileTools Engineering Service 2 74380ebcd2
Localized file check-in by OneLocBuild Task: Build definition ID 14411: Build ID 6217070 (#15150) 2022-05-31 11:42:02 -05:00
Rolf Bjarne Kvinge 4542fce4a2
Bump maccore. (#15158)
New commits in xamarin/maccore:

* xamarin/maccore@713bcb2442 [mlaunch] Flush the output from the pty.

Diff: 29e384e9e3..713bcb2442
2022-05-31 18:17:01 +02:00
Chris Hamons c17fd25583
[nnyeah] Map NSObject ctors with IntPtr to NativeHandle (#15134)
* [nnyeah] Remove NNYEAH_IN_PROCESS on IntegrationExamples.cs as it was cursed due to global caching in nuget tool install

* [nnyeah] Simplify test API

* [nnyeah] Map NSObject ctors with IntPtr to NativeHandle

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

This required a significant amount of refactoring:
- To resolve the base type of objects, we need to invoke cecil's Resolve
    - Resolve requires all assemblies to be loaded in memory, whcih requires a custom resolver to find them all
    - Note: This requires customer assemblies to include all non-platform dependencies to be next to the input
- This extra state prompted a refactor of Program.cs to create a tool 'AssemblyConverter' with instance variables to reduce param passing
- The ctor mapping logic is isolated to ConstructorTransforms to reduce the growth of Reworker.cs and make limited unit testing possible
- Turns out the flat removal of the platform assembly from the import list was wrong, as it caused all platform references, such as NSObject to
  be resolved from System.Runtime, which is wrong. So replace in place with the new platform assembly instead.
2022-05-31 10:40:56 -04:00
Manuel de la Pena 86fe13e17f
[CI] Split the pipeline in two, one for CI and a second one for PRs. (#15110) 2022-05-31 09:24:51 -04:00
dotnet-maestro[bot] da2b107189
[main] Update dependencies from dotnet/installer (#15153)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.301-rtm.22277.2 -> To Version 6.0.301-rtm.22280.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-05-31 09:06:34 +02:00
Sebastien Pouliot d869a6868a
[corefoundation] Cache `kCFNull` to avoid native calls (#15146) 2022-05-30 12:38:27 +02:00
Emanuel Fernandez Dell'Oca 7ad9f88939
[msbuild] Fixes Hot Restart compiled Entitlements output path (#15125)
The compiled entitlements should be placed in the intermediate Hot Restart app bundle so those can be picked up by the HotRestart Codesign task. Prior to this change, entitlements set in the project wouldn't be included in the app, making things like Keychain Access fail, even though it was configured.

Fixes https://developercommunity.visualstudio.com/t/Unable-to-use-MSAL-with-locally-connecte/1573064
2022-05-30 12:34:20 +02:00
Mauro Agnoletti f45c20505d
Updated Hot Restart Client version to 1.0.93 (#15137)
Bring changes in logging verbosity
2022-05-30 12:29:14 +02:00
dotnet-maestro[bot] f5ed7e80b8
[main] Update dependencies from dotnet/installer (#15148)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.301-rtm.22274.16 -> To Version 6.0.301-rtm.22277.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-05-30 11:56:47 +02:00
Rolf Bjarne Kvinge cf7c6b5980
[msbuild] Improve logic to clean up app bundle for unwanted files. (#15080)
The current directory at launch is the root directory of the app bundle. This
means that any files written to the current directory when an app is executed,
will be placed there. This becomes a problem when the app is rebuilt (and
resigned), because a valid macOS app bundle doesn't have any files in the root
directory of the app bundle, so signing fails.

We have logic to automatically crash crash reports from the app bundle, but it
turns out this is a more common problem with other types of files (and
folders), so improve the logic a bit:

* Add support for setting a property to automatically clean up everything from
  an app bundle we don't think should be there (which is anything not in a
  Contents/ subdirectory).
* Use the same property to add support for disabling any cleaning (we already
  clean mono's crash reports by default).
* Improve detection of unwanted files to include directories inside the app
  bundle, not only files.

Ref: https://github.com/dotnet/maui/issues/7353
2022-05-30 11:34:45 +02:00
Rolf Bjarne Kvinge 96116c400d
[appkit] Remove leftover code made obsolete by newrefcount. (#15103)
Remove code that we needed at some point due to memory related issues. These
issues were fixed several years ago (newrefcount), so we no longer need this
code (in fact it causes problems, see #15089).
2022-05-30 11:34:08 +02:00
Rolf Bjarne Kvinge 6ecc102b5b
[msbuild] Use the full path to the symbols list file. Fixes #15046. (#15105)
Give the full path to the symbols list file in the extension project to the
main project, so that strip can find it.

When building a solution remotely from Windows, we can't compute a relative
path between projects, because they're laid out differently on disk. This
means that we have to use full paths when passing paths between projects (such
as the path to the symbol list file).

Fixes https://github.com/xamarin/xamarin-macios/issues/15046.
2022-05-30 11:33:11 +02:00
Rolf Bjarne Kvinge ab7f0784ef
Bump maccore. (#15141) 2022-05-30 11:32:09 +02:00
Rolf Bjarne Kvinge ab46841563
[xharness] Redirect stdout/stderr for watch apps. (#15140)
I don't remember why I excluded watch apps, and it seems to work locally, so
let's see how it goes. Hopefully we'll get better diagnostics when something
goes wrong.
2022-05-30 11:30:50 +02:00
Steve Hawley 6676f816f2
added missing test invocations (#15132) 2022-05-27 10:59:40 -04:00
Mauro Agnoletti 342fb340c8
Fix bundle.zip structure in 'Sign bundle.zip' step (#15135)
The files of the bundle.zip are being re-zipped inside a 'bundle' folder after signing, which is wrong since everything else is expecting the files directly inside the zip file without parent folders (as we were doing before)
2022-05-27 13:31:53 +02:00
Rolf Bjarne Kvinge 91b4d15a31
[devops] Fix the post-build pipeline after dependent pipeline rename. (#15129) 2022-05-27 10:03:34 +02:00
Rolf Bjarne Kvinge 5041b4cfa8
Bump maccore. (#14979)
New commits in xamarin/maccore:

* xamarin/maccore@86db4740ec [mlaunch] Add support for installing and launching apps with simctl.
* xamarin/maccore@0f0ca14cf2 [mlaunch] Don't launch watch apps with simctl quite yet.

Diff: 29a1c1382e..0f0ca14cf2
2022-05-27 09:58:05 +02:00
Steve Hawley f16c1bb993
implicit operator tests (#15128)
Added more tests for implicit operators.
2022-05-26 15:09:21 -04:00
Steve Hawley 2397b51a79
bitwise operator tests (#15123) 2022-05-26 09:56:04 -04:00
dotnet-maestro[bot] 3129b99bae
[main] Update dependencies from dotnet/installer (#15119)
Microsoft.Dotnet.Sdk.Internal
 From Version 6.0.301-rtm.22263.15 -> To Version 6.0.301-rtm.22274.16

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-05-26 08:51:49 +02:00
Steve Hawley 6826fb8665
[nnyeah] added tests for boolean operators (#15109)
* added tests for boolean operators

* updated ignore message
2022-05-25 09:59:24 -04:00
Mauro Agnoletti 42594a8296
Updated Messaging and Hot Restart versions (#15114) 2022-05-25 10:17:56 +02:00
Rolf Bjarne Kvinge 5de4754c31
[runtime] Skip passing ICU_DAT_FILE_PATH to the runtime if we don't have an ICU data file. (#15085) 2022-05-25 08:31:26 +02:00
Rolf Bjarne Kvinge e3a03d2804
Remove the Visual Studio dependency. (#15102)
Remove our dependency on Visual Studio. Use the 'dotnet-t4' tool instead of
invoking the t4 tool embedded in Visual Studio.

Fixes this build error after installing VS Mac 2022:

> Cannot open assembly '/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/MonoDevelop.TextTemplating/TextTransform.exe': No such file or directory.
2022-05-25 08:26:51 +02:00
Manuel de la Pena 9b962748d9
[Harness] Revert label changes (#15101)
This reverts commit 0e179206d2.
This reverts commit 2953cf1fed.
2022-05-23 22:02:14 -04:00
Steve Hawley 5946727d08
[nnyeah] Arithmetic tests (#15097)
* Added tests for arithmetic and basic casting
* trying to rebase off main to clean up the PR and future PRs
2022-05-23 15:47:54 -04:00
Rolf Bjarne Kvinge 072219daf4
Make tput silent if there's an error. (#15073)
tput typically fails on bots (where there's no attahed terminal) with:

> tput: No value for $TERM and no -T specified

This avoids those messages in the logs.
2022-05-23 20:09:01 +02:00
Chris Hamons 560872bd3a
[AppKit] Add constructors for NSMenuToolbarItem classes (#15087)
- Fixes https://github.com/xamarin/xamarin-macios/issues/15069
2022-05-23 11:48:58 -05:00
Rolf Bjarne Kvinge 02838f2c29
[tools] Fix nullability for the Execution.Environment field. (#15084)
The values for environment variables can be null (to remove said environment
variable).

Fixes this warning:

    tests/dotnet/UnitTests/TestBaseClass.cs(294,100): warning CS8620: Argument of type 'Dictionary<string, string?>' cannot be used for parameter 'environment' of type 'Dictionary<string, string>' in 'Task<Execution> Execution.RunWithStringBuildersAsync(string filename, IList<string> arguments, Dictionary<string, string>? environment = null, StringBuilder? standardOutput = null, StringBuilder? standardError = null, TextWriter? log = null, string? workingDirectory = null, TimeSpan? timeout = null, CancellationToken? cancellationToken = null)' due to differences in the nullability of reference types.
2022-05-23 17:36:06 +02:00
Sandy Armstrong 6632f88769
Provisionator's XcodeSelect now configures Xamarin Settings.plist (#15079) 2022-05-23 17:35:27 +02:00
Rolf Bjarne Kvinge 0590cf9cad
[AppKit] Fix wrong binding for NSToolbarItem.Image in Mac Catalyst. Fixes #15068. (#15075)
Fixes https://github.com/xamarin/xamarin-macios/issues/15068.
2022-05-23 17:33:11 +02:00
Chris Hamons 7e8bd5cac4
[nnyeah] Centralize error handling (#15064)
- Due to https://github.com/microsoft/vstest/issues/3658 it is not possible to test code that exits the process on error
- Create a base class for nnyeah exceptions that we want to explicitly report (and not crash), ConversionException
- Move Main to Main2 and wrap it in a try/catch for this exception
2022-05-23 10:32:54 -05:00
Rolf Bjarne Kvinge da7dd02dfd
[dotnet] Make sure to not run the linker when we're on a disconnected Windows build. (#15076)
This also means that we shouldn't load the linker's output. Note that we need
to check _LoadLinkerOutput even if we've already disabled the linker, because
there may be linker output from a previous (connected) build, and we don't
want to load that.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1542438.
2022-05-23 16:33:09 +02:00
Rolf Bjarne Kvinge 0c08e725f3
[devops] Publish builds from the net7.0 branch. (#15091) 2022-05-23 16:18:19 +02:00
Steve Hawley d2e0a364d6
[nnyeah] Lets nfloat (#15088)
Reactivated the nfloat tests.
2022-05-23 09:46:19 -04:00
Steve Hawley 94e40c8b11
[nnyeah] fix issues compiling against nnyeah touched libraries (#15082)
fix issues compiling against nnyeah touched libraries
2022-05-20 15:31:18 -04:00
TJ Lambert b773b97b9b
[coremotion] Add nullability to (generated and manual) bindings (#15072)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-05-20 09:42:22 -05:00
Chris Hamons 03c3b3003a
[nnyeah] Add rest of top nuget examples to integration suite (#15058) 2022-05-20 05:48:29 -05:00
Chris Hamons add714ffb7
[nnyeah] Add unit test showing most common nuget failure (#15065)
- 'Error while attempting to map member System.IntPtr Foundation.NSObject::get_Handle() in old assembly'
- Also fix a strange directory name created by Cache.CreateTemporaryDirectory being called from async test method
2022-05-20 05:48:02 -05:00
Manuel de la Pena 0e179206d2
[XHarness] Provide the correct value to the tvOS label. (#15063) 2022-05-20 11:25:29 +02:00
TJ Lambert 1477c9bd51
[Localization] Use force-with-lease (#15054)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-05-18 15:18:34 -05:00
Steve Hawley 6d072fbc46
[nnyeah] Import Type and Member references (#15052)
import methods and types when referencing them
2022-05-18 16:18:04 -04:00
Manuel de la Pena 2953cf1fed
[Xharness] Move to use a flag to decide what tests to use (#15032)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-05-18 10:50:19 -04:00