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

13557 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena d89dfec8fb
[CI] Sign the contents of the bundle.zip to be used in xma. (#14970) 2022-05-12 13:24:01 -04:00
TJ Lambert a27fbdc19f
[twitter] Add nullability to (generated and manual) bindings (#14929)
Co-authored-by: tj_devel709 <antlambe@microsoft.com>
2022-05-12 12:19:50 -05:00
TJ Lambert 6993eff5bf
[usernotification] Add nullability to (generated and manual) bindings (#14941)
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-05-12 12:15:13 -05:00
TJ Lambert fcf1a19631
[security] Add nullability to (generated and manual) bindings (#14884)
* Add nullability

* throw better null exceptions

* use is null and is not null AND fix spacing

* Rolfs suggestions and redo spacing

* missed a few spaces

* Found one more elusive space

Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
2022-05-12 12:11:15 -05:00
Rolf Bjarne Kvinge 911cdf3c23
[AppKit] Add NSView.AddToolTip overloads that take NSObjects as owners. Fixes #14996. (#15000)
Fixes https://github.com/xamarin/xamarin-macios/issues/14996.
2022-05-12 18:12:25 +02:00
Rolf Bjarne Kvinge 718c72f57e
[ObjCRuntime] Improve the debug logging in the Runtime.CoreCLR.cs file. (#14920)
* Fix an issue where we could run into infinite recursion (and stack overflow)
  when printing method arguments.
* Simplify the output a bit.
2022-05-12 18:05:05 +02:00
Rolf Bjarne Kvinge a6c92d9a25
[tests] Ignore the new MnistTester test on the bots. (#15002)
Bots seems to break more often after this change, so let's see if this improves matters.

This is what happens with the bots:

    We stopped hearing from agent [...]. Verify the agent machine is running and has a healthy network connection. Anything that terminates an agent process, starves it for CPU, or blocks its network access can cause this error. For more information, see: https://go.microsoft.com/fwlink/?linkid=846610
2022-05-12 16:07:04 +02:00
Rolf Bjarne Kvinge f1d4967540
[actions] Fix changelog logic when there's no existing changelog comment. (#15003) 2022-05-12 16:05:34 +02:00
Rolf Bjarne Kvinge 06041ab37f
[xharness/devops] Enable .NET tests by default. (#14998)
Which alo means there's no need to select them if .NET is enabled.
2022-05-12 14:58:24 +02:00
Rolf Bjarne Kvinge 447e637ac0
[xharness] Fix logic to include the .NET xtro tests. (#14991)
Both 'IncludeXtro' and 'IncludeDotNet' must be set to run the .NET xtro tests
(which means they're ignored if either is false).
2022-05-12 08:20:06 +02:00
Rolf Bjarne Kvinge 774b3d7380
[devops] A PR API diff with changes isn't an error. (#14992)
It's only an error if it has breaking changes (which is handled elsewhere).
2022-05-12 08:19:35 +02:00
Rolf Bjarne Kvinge f7c89d1106
[make] Add better error message when the required Xcode isn't installed. (#14995)
Before:

    $ make whatever
    Print: Entry, ":ProductBuildVersion", Does Not Exist

After:

    $ make whatever
    The required Xcode (13.3) is not installed in /Applications/Xcode_13.3.0.app/Contents/Developer
2022-05-12 08:18:43 +02:00
Rolf Bjarne Kvinge adb56501da
[apidiff] Switch to getting mono-api-[info|html] from rolfbjarne/api-tools. (#14965)
Switch to getting mono-api-[info|html] from a newly created repository we
control and where we can easily fix issues, since mono/mono isn't getting many
fixes anymore. In the past I know I've been reluctant to look at these tools,
just because of the hassle of setting things up to debug, and then the
paperwork to get the fixes in mono/mono, and then backported to the branch
where we need them.

This repo has a few other benefits:

* The tools are built using normal projects, which means they're easy to debug
  in an IDE (mono/mono's code has generated project files, which used in-tree versions
  of the BCL, and it got quite complex quite fast).
* One fewer dependency on the mono archive, so we're getting closed to be able
  to drop it completely when we drop support for legacy Xamarin.
* #13669 is already fixed there.
* It contains a few other misc fixes.

Fixes https://github.com/xamarin/xamarin-macios/issues/13669.
2022-05-11 22:01:39 +02:00
Manuel de la Pena 80f4844bc4
[CI] Ensure we do not leave processes once we are done. (#14988) 2022-05-11 15:46:47 -04:00
Rolf Bjarne Kvinge b56184b60d
[actions] Add GitHub action to compute the changelog for maestro bumps. (#14984)
And add that changelog as a comment to the PR. If there already is a comment
with a changelog, then update that comment instead.
2022-05-11 21:41:12 +02:00
Chris Hamons cec44107a5
[nnyeah] Add executable integration test (#14977)
- Test is currently semi-manual and uses Alert to popup results
- Covers nint/nuint/nfloat with method/prop/field/event
- Execution currently doesn't execute events yet.
- Test fails due to reference issue reported to Steve
- Currently not hooked up to any automated tests
2022-05-11 12:02:06 -05:00
Manuel de la Pena 01459aece0
[CI] Bump timeout. (#14982)
Until we parallize the tests we need to bump the timeout since we are
getting timeout issues in some bots, for example: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=6134329&view=logs&j=673140f8-3abe-5ac0-6769-091785cf5576&t=27d47212-35cf-595c-16ff-96a3671a2d41
2022-05-11 12:13:56 -04:00
Rolf Bjarne Kvinge 92eda7f353
[dotnet] Add support for selecting whether to create P/Invoke wrappers or not. Fixes #4940. (#14961)
* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

Fixes https://github.com/xamarin/xamarin-macios/issues/4940.
2022-05-11 16:42:01 +02:00
Rolf Bjarne Kvinge c4f3d65b68
[devops] Compute better base for comparing API diff. (#14963)
Previously we'd compare the tip of the PR branch with the commit before merge commit into the target branch created by GitHub.

This doesn't work in the following scenario:

    main  gh  pr
    
       |  G1 |          (merge commit created by GitHub)
       | / \ |
       |/   \|
       M2    |
       |     P2
       |    /|
       |   / |
       |  /  |
       | /   |
       |/    |
       M1    |
       |     |
       |     P1
       |    /
       |   /
       |  /
       | /
       |/

We'd end up comparing P2 with M2, which is not what we want, because M2 could
have API changes that would show up as missing in P2.

It's actually even worse than that, because we could be in the following
scenario:

    main  gh  pr
    
       |  G2 |          (merge commit created by GitHub when api diff started)
       | / \ |
       |/   \|
       M3    |
       |     P3
       |     |
       |  G1 |          (merge commit created by GitHub when build started)
       | / \ |
       |/   \|
       M2    |
       |     P2
       |    /|
       |   / |
       |  /  |
       | /   |
       |/    |
       M1    |
       |     |
       |     P1
       |    /
       |   /
       |  /
       | /
       |/

And we still want to P2 with M2, but we'd compare P2 with M3.

We want to compare P2 with M1 instead. This is done by asking git for the
merge-base between P2 and M2.
2022-05-11 16:40:40 +02:00
Manuel de la Pena 22ba05bed5
[Xharness] Enable nullable in the BuildProject class and clean code a little. (#14897) 2022-05-11 07:25:48 -04:00
Manuel de la Pena 642b03b09b
[Tools] Enable nullability on Cache.cs. (#14947) 2022-05-11 07:23:37 -04:00
Manuel de la Pena f66fba9c8d
[Tools] Enable nullability in StringUtils.cs (#14944) 2022-05-11 07:08:57 -04:00
Chris Hamons 086469f70b
[nnyeah] Fix method hashing of generic matching non-generic due to Cecil limitation. (#14962)
This gets iOS integration tests passing

From what I can tell we are failing due to:

    public static new PHLivePhotoViewAppearance GetAppearance (UITraitCollection traits) {
    public static new PHLivePhotoViewAppearance GetAppearance<T> (UITraitCollection traits) where T: PHLivePhotoView {

having the same hash, as the generic constraints are not printed.

To solve this we take on a small (250ish) dependency on code from MonoMod.Common (MIT licensed). They have code which creates stable hash keys that include generic information.
2022-05-10 16:09:46 -05:00
Rolf Bjarne Kvinge f2bcedd441
[msbuild/dotnet] Add support for passing --aot arguments to the AOT compiler. (#14936)
Pick up --aot arguments in MtouchExtraArgs and pass them to the AOT compiler
when building a .NET project. This makes it possible to work around #14887 by
manually increasing the number of trampolines.

Ref: https://github.com/xamarin/xamarin-macios/issues/14887
2022-05-10 16:25:19 +02:00
Chris Hamons e6d4878fa5
[Nnyeah] Improve error messages for missing required arguments (#14949) 2022-05-10 09:07:05 -05:00
Chris Hamons 569aef64b7
[nnyeah] Refactor reworker to a 1-pass initialization (#14957)
Reworker previous to this PR was very Lazy is it's init process. In
many ways this was beneficial, but was tricky to get right and made
nullability attributes a nightmare to add. It also included multiple "null objects"
that would show errors only at the end of a conversion when writing the file.

I replaced it with a single-pass init system, where the module is read
and all required attributes are fetched before processing begins.

Two requirements to consider:
- We don't want to ModuleDefinition.ReadModule to be repeated
- We don't want to fetch all of the attributes if reworking is not
necessary, but need the ModuleDefination to know that

A static factory method `CreateReworker` only returns a reworker
if work is required. This way, there is never a half-loaded state
to consider.

Other:
- Renamed some fields to match standard coding convention
- Also update integration makefile to include new required args

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-10 09:06:29 -05:00
Steve Hawley 6afe259e08
[nnyeah] Module information extensions (#14956)
Added code to find what (if any) Xamarin platform we depend on.
Tests as per usual.
The code is not called from main (yet).
2022-05-10 09:51:52 -04:00
Manuel de la Pena 2e8d0d8473
[Tools] Enable nullability on Execution.cs (#14954) 2022-05-10 09:23:54 -04:00
Rolf Bjarne Kvinge 1be1d746d6
[apidiff] Fix comparison of assemblies with different names. (#14964)
When we compare assemblies with different names (such as Xamarin.iOS vs
Microsoft.iOS, or Microsoft.iOS vs Microsoft.MacCatalyst), we need to adjust
one the xml definitions to match the other with regards to the assembly name.
2022-05-10 14:22:30 +02:00
Manuel de la Pena fb77743c21
[CI] Perform the classic sign-notarize of each pkg in parallel. (#14932)
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
2022-05-10 07:21:40 -04:00
Frank A. Krueger bd4fee0cdc
Add MetalPerformanceShadersGraph Bindings (#14303)
I'm very pleased to present full bindings to the MetalPerformanceShadersGraph framework!

I'm happy with how everything turned out with the exception of a few notes and questions below.

I re-implemented Apple's MNIST sample (from https://developer.apple.com/documentation/metalperformanceshadersgraph/training_a_neural_network_using_mps_graph) here:

https://gist.github.com/praeclarum/b8077771fb341a1f9c28240113e00425

It's also added as a unit test.

Fixes #14286

### Notes

* Although the API says it works on macOS 11, it has bugs and crashes with errors even with Apple’s Swift examples. It’s better on macOS 12. iOS 14 and on is fine.

* `MPSGraphSparseStorageType` has terrible names. They match Apple's but I wish they were better.

* I added convenience methods to `MPSNDArray` and `MPSGrapTensorData` and the `Variable` and `Constant` operations to decrease the amount of unsafe code users have to write. I currently do this for 32-bit floats, the most common data type.

Co-authored-by: Alex Soto <alex@alexsoto.me>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
2022-05-10 10:52:22 +02:00
Rolf Bjarne Kvinge 8cf02316ca
[tests] Unignore test that's now fixed in .NET. (#14937) 2022-05-10 09:34:21 +02:00
Rolf Bjarne Kvinge d1b7606181
Adjust versioning scheme for .NET to make the third field the commit distance. (#14923)
Adjust our versioning scheme so that the NuGet version is
`Major.Minor.CommitDistance`. The previous scheme ("Major.Minor.<fixed-ish
version>") causes problems on branches producing stable builds, because each
new commit would end up with the same NuGet version, and we wouldn't be able
to push those to a NuGet feed because there might already be an existing
version there.

By using the commit distance in the NuGet version we ensure that every commit
has a different version.
2022-05-10 09:28:39 +02:00
Rolf Bjarne Kvinge ffae484355
Bump mono to get fix for #12416. (#14934)
New commits in mono/mono:

* mono/mono@281ee19b9b [mono] Remove some of the restrictions on constrained calls from gsharevt methods.
* mono/mono@ed0788bf61 [2020-02] Use upstream zlib 1.2.12

Diff: 86118d5810..281ee19b9b

Fixes https://github.com/mono/mono/issues/21187.
Fixes https://github.com/xamarin/xamarin-macios/issues/12416.
2022-05-10 09:27:02 +02:00
Rolf Bjarne Kvinge cf44501f0f
[runtime] Fix build when logging is enabled. (#14922) 2022-05-10 09:26:20 +02:00
Rolf Bjarne Kvinge a07fda8f33
Bump maccore to get fix for #14834. (#14946)
New commits in xamarin/maccore:

* xamarin/maccore@29a1c1382e [mlaunch] Redirect stdout and stderr through a pty when launching in the simulator. Fixes #14834.

Diff: 749e84cb16..29a1c1382e

Fixes https://github.com/xamarin/xamarin-macios/issues/14834.
2022-05-10 09:18:20 +02:00
Rolf Bjarne Kvinge 69662c94e6
[apidiff] Ignore inherited interfaces. (#14960)
We only care about what each type does, not what any base types might have
done (nothing we can do about that anyway).
2022-05-10 09:04:20 +02:00
Rolf Bjarne Kvinge f8314a435e
Add a [NativeName] attribute we can use to declare the native name for a type (enum/struct). (#14918)
We already have a few attributes that can specify the native name for a type, whenever the native name doesn't match the managed name:

* [Register ("DifferentClassName"): specifies the Objective-C class name
* [Native ("DifferentEnumName")]: specifies the Objective-C enum name (and also that it's a native-sized enum)
* [Protocol ("DifferentProtocolName")]: specifies the Objective-C protocol name
* [Category ("DifferentCategoryName")]: specifies the Objective-C category name

Unfortunately this leaves (at least) two cracks:

* Objective-C structs.
* Objective-C enums which aren't native-sized.

So I'm adding a [NativeName] attribute for this purpose, and updating numerous
types to specify the native name (either using an existing [Native] attribute
for enums that already have one, or by adding a new [NativeName] attribute).

The static registrar needs to know the native name for such types, in case
they appear as parameter types in function signatures.

This also allows us to simplify xtro a bit, to not have a separate map of
managed name given a native name, because we can now build that map
dynamically.
2022-05-09 22:16:17 +02:00
Rolf Bjarne Kvinge b08a0f91db
[apidiff] Use variables to reduce code duplication. (#14935)
This also makes it easier to switch to .NET 5(+) versions of mono-api-info and mono-api-html
when that happens.
2022-05-09 22:12:03 +02:00
Rolf Bjarne Kvinge 32c29c1639
[Foundation] Make NSUserDefaults.VolatileDomainNames a property in XAMCORE_5_0. (#14942)
That's how it's in Swift.
2022-05-09 21:48:15 +02:00
Steve Hawley d8dfd37cc6
[nnyeah] IConvertible ancient history (#14945)
This was old code that hung around from before we discovered that we can't fully handle `IConvertible`
2022-05-09 14:23:22 -04:00
Mauro Agnoletti ff40b22180
Updated Xamarin.Messaging to 1.6.6 (#14915) 2022-05-09 18:16:52 +02:00
Steve Hawley 5631ca5c8e
[nnyeah] Start testing (#14913)
Added code to:

compile a string to a platform library
collect the output of the compilation process
check for errors
Added a single unit test of the smoke test variety.
2022-05-09 09:42:34 -04:00
dotnet-maestro[bot] 073c2c1047
[main] Update dependencies from dotnet/runtime (#14921)
Microsoft.NETCore.App.Ref
 From Version 6.0.6 -> To Version 6.0.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-05-09 10:59:51 +02:00
Emanuel Fernandez Dell'Oca e9333bae47
Bumps Xamarin.HotRestart.Application to 1.1.5 (#14925)
This new version contains a fix for incremental deployments when using Xamarin iOS Hot Restart.
2022-05-09 10:30:22 +02:00
Rolf Bjarne Kvinge 07b9d90fee
[msbuild] Enable nullability in the AOTCompileTask class. (#14924) 2022-05-09 10:10:57 +02:00
Rolf Bjarne Kvinge 8074f20aec
[apidiff] Pass full paths to mono-api-info and mono-api-html. (#14917)
Makes it easier to copy-paste commands to debug them with an IDE.
2022-05-09 09:06:46 +02:00
Manuel de la Pena 211fb9c83b
[CI] Make signing faster by using two diff jobs one for classic and one for dotnet. (#14908)
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2022-05-08 14:30:51 -04:00
Manuel de la Pena 43c2270b9d
[Nnyeah] Ensure that we have all the needed xamarin-macios dlls when using make. (#14910)
We need to be able to embed the dlls as a resource to compare the diff
assemblies. To do so we are going to ensure that we have called make in
the root dir so that the needed deps are present. This change is not yet
in the csproj, that will be a diff commit.



Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
2022-05-06 18:41:11 -04:00
Manuel de la Pena 99de095726
[XHarness] Enable nullable and fix some code issues (wrong inheritance) (#14867) 2022-05-06 17:14:00 -04:00