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

15756 Коммитов

Автор SHA1 Сообщение Дата
Filip Navara 05502d1260
Remove IKVM submodule (#18516) 2023-06-30 10:32:32 +02:00
Emanuel Fernandez Dell'Oca 0ccfc4b506
Bump Xamarin.Messaging to 1.11.2 (#18521) 2023-06-30 10:31:50 +02:00
Rolf Bjarne Kvinge c7fa7ab52e
[msbuild] Fix ILStripping of resource assemblies on Windows. (#18508)
Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes https://github.com/xamarin/xamarin-macios/issues/17009.
Fixes https://github.com/xamarin/xamarin-macios/issues/14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.
2023-06-29 11:04:42 +02:00
Rolf Bjarne Kvinge 64b4a5909a
[tests] Automatic network failure detection in tests. (#18439)
Detect if a url we use in our tests actually works, and if not, save the
results and ignore any subsequent test that tries to use that url.

---------

Co-authored-by: Haritha Mohan <harithamohan@microsoft.com>
2023-06-29 07:48:53 +02:00
Šimon Rozsíval 6010c13d40
[managed-static-registrar] Remove use of reflection in UCOs of generic types (#18421)
Closes #18356

In the static UnmanagedCallersOnly methods we don't know the generic
parameters of the type we're working with and we need to use this trick
to be able to call methods on the generic type without using reflection.
When we call a non-generic interface method implemented on a generic
class, the .NET runtime will resolve the generic parameters for us. In
the implementation of the interface method, we can simply use the
generic parameters and generate the same code we usually generate in the
UnmanagedCallersOnly callback method.

This is an example of the code we generate in addition to user code:

```csharp
internal interface __IRegistrarGenericTypeProxy__CustomNSObject_1__
{
	void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr p0);
}

public class CustomNSObject<T> : NSObject, __IRegistrarGenericTypeProxy__CustomNSObject_1__
	where T : NSObject
{
	[Export ("someMethod:")]
	public void SomeMethod (T someInput)
	{
		// ...
	}

	// generated implementation of the proxy interface:
	public void __IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
	{
		try {
			var obj0 = (T) Runtime.GetNSObject<T> (p0);
			SomeMethod (obj0);
		} catch (Exception ex) {
			*exception_gchandle = Runtime.AllocGCHandle (ex);
		}
	}

	// generated registrar callbacks:
	private static class __Registrar_Callbacks__
	{
		[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
		public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
		{
			var proxy = (__IRegistrarGenericTypeProxy__CustomNSObject_1__)Runtime.GetNSObject (pobj);
			proxy.__IRegistrarGenericTypeProxy__CustomNSObject_1____SomeMethod (sel, p0, exception_gchandle);
		}
	}
}
```
```csharp
// regular non-generic class for comparison:
public class CustomNSObject : NSObject
	where T : NSObject
{
	[Export ("someMethod:")]
	public void SomeMethod (NSSet someInput)
	{
		// ...
	}
	
	private static class __Registrar_Callbacks__
	{
		[UnmanagedCallersOnly (EntryPoint = "_callback_1_CustomNSObject_1_SomeMethod")]
		public unsafe static void callback_1_CustomNSObject_1_SomeMethod (IntPtr pobj, IntPtr sel, IntPtr p0, IntPtr* exception_gchandle)
		{
			try {
				NSSet obj0 = Runtime.GetNSObject<NSSet> (p0);
				SomeMethod (obj0);
			} catch (Exception ex) {
				*exception_gchandle = Runtime.AllocGCHandle (ex);
			}
		}
	}
}
```

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-28 12:24:46 +02:00
Meri Khamoyan 3f6d43c756
[iOS] HybridGlobalization set flag in SDK (#18498)
Add HybridGlobalization flag in SDK and load icudt_hybrid.dat file when
HybridGlobalization is on.

Contributes to https://github.com/dotnet/runtime/issues/80689
2023-06-28 10:25:24 +02:00
Manuel de la Pena c0fa2efaa2
Bump maccore to pick policheck fixes. (#18503) 2023-06-27 16:04:29 -04:00
Rolf Bjarne Kvinge 7f910487f5
[msbuild/dotnet] Handle dylibs that don't start with 'lib' better. Fixes #15044. (#18496)
For a given dylib named '/path/to/libMyLibrary.dylib', we pass this to the native linker:

    -L/path/to -lMyLibrary

however, that doesn't work unless the dylib's name starts with 'lib'.

So detect this, and if the dylib doesn't start with 'lib' (say it's just
'MyLibrary.dylib'), then just pass the path to the dylib as-is to the native
linker:

	/path/to/MyLibrary.dylib

Fixes https://github.com/xamarin/xamarin-macios/issues/15044.
2023-06-27 07:55:04 +02:00
Rolf Bjarne Kvinge a8ba9c402c
[msbuild/generator] Compile api definitions in MSBuild logic instead of inside the generator. (#18398#pullrequestreview-1498787955)
This has a few advantages:

* A step towards simplifying the generator.
* A step towards being able to build binding projects on Windows, since it's easier
  to build C# code in MSBuild using the Csc task rather than figuring out how to
  call csc as an external program (which we've already done on macOS, but having
  a single solution that works on all platforms is preferrable).

Note that this is only implemented for .NET, doing this for legacy Xamarin required a lot more work.
2023-06-26 17:29:12 +02:00
Steve Hawley a36cd71174
[dotnet] Integrate class handle rewriting into static registrar process. (#18456)
Integrate class handle rewriting into static registrar.
2023-06-23 10:12:35 -04:00
Manuel de la Pena 9ac2d59d0b
[CI] Add a timeout to the provisioning of the sims. (#18491) 2023-06-23 07:21:00 -04:00
Manuel de la Pena 1681e9f915
[Code Style] Add some extra style checks focused on nullability. (#17831)
Added the following new checks:

```csharp
// dotnet_style_coalesce_expression = true
var v = x ?? y;

// dotnet_style_coalesce_expression = false
var v = x != null ? x : y; // or
var v = x == null ? y : x;
```

```csharp
// dotnet_style_null_propagation = true
var v = o?.ToString();

// dotnet_style_null_propagation = false
var v = o == null ? null : o.ToString(); // or
var v = o != null ? o.String() : null;
```

```csharp
// dotnet_style_prefer_is_null_check_over_reference_equality_method = true
if (value is null)
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if (object.ReferenceEquals(value, null))
    return;

// dotnet_style_prefer_is_null_check_over_reference_equality_method = false
if ((object)o == null)
    return;
```
2023-06-22 13:31:04 -04:00
Rolf Bjarne Kvinge aec6925d18
[msbuild] Print the binlog if the prebuilt app failed to build. (#18474)
This makes it easy to copy-paste the path to the binlog to open it in a
binlog viewer.
2023-06-22 08:16:12 +02:00
Rolf Bjarne Kvinge ce85073609
[msbuild] Remove some logic for watchOS on .NET. (#18473)
We don't support watchOS on .NET, so this is just useless code.
2023-06-22 08:15:56 +02:00
Rolf Bjarne Kvinge 4e7a988c05
Update DOWNLOADS.md with new releases. (#18448) 2023-06-21 20:45:58 +02:00
Rolf Bjarne Kvinge a66950d2de
[bgen] Remove useless catch/(re)throw. (#18467)
There's no purpose to catching an exception just to throw it, so remove
the entire try/catch handler.

Fixes this compiler warning:

    src/bgen/Generator.cs(1284,4): warning CA2200: Re-throwing caught exception changes stack information
2023-06-20 18:07:28 +02:00
EmilienDup 7cea2a8c3a
NSUrlSessionHandler should propagate network exceptions (#18459)
fixes #18458
2023-06-20 07:27:46 +02:00
Manuel de la Pena 3d8db21288
[CI] Upload the policheck result to be able to later decide what to exclude. (#18463)
This allows to later get the result and generate the exception list
based on it.
2023-06-19 15:38:52 -04:00
Rolf Bjarne Kvinge aab0ed1362
[AVFoundation] Fix a few issues with the AVAssetImageGenerator bindings. Partial fix for #18452. (#18460)
* The 'copyCGImageAtTime:actualTime:error:' selector is deprecated, so
replicate that.
* Bind the 'generateCGImageAsynchronouslyForTime:completionHandler:'
selector.

Fixes parts 1 and 2 of https://github.com/xamarin/xamarin-macios/issues/18452.
2023-06-19 19:16:29 +02:00
Mike Bond ed78eaf55e
Migrate to backport-action (#18462) 2023-06-19 09:33:18 -07:00
Rolf Bjarne Kvinge cb34bfe86c
[bgen] Make the generated code check for zero handle before creating an INativeObject wrapper instance. Fixes part of #18452. (#18461)
Also don't create the instance directly from third-party bindings, the
required constructor might not be public - use Runtime.GetINativeObject
instead.

Fixes part 4 of https://github.com/xamarin/xamarin-macios/issues/18452.
2023-06-19 11:16:34 +02:00
Rolf Bjarne Kvinge 959bb55d86
[tests] Fix formatting issues. (#18453) 2023-06-16 13:58:49 +02:00
Rolf Bjarne Kvinge 4c51cfa8bb
[msbuild] Copy the zip file back to Windows from the Zip task for remote builds. Fixes #18402. (#18447)
The zip file might be used later directly on Windows (for instance it
might be embedded inside a binding assembly as an embedded resource), so make
sure to copy it back to Windows.

Fixes https://github.com/xamarin/xamarin-macios/issues/18402 part 2.
2023-06-15 16:32:34 +02:00
Rolf Bjarne Kvinge 2761123a6b
[dotnet] Add a property to opt-out of the _CopyLocalBindingResources logic easily. (#18443)
It seems this target has more problems than at first I thought, so make
it easier to opt-out of it by just setting a property in the csproj.

More investigation is needed, but I'm keeping the target on by default
for now, since it solves a real-world problem as well.

Ref: https://github.com/xamarin/xamarin-macios/issues/18445
2023-06-15 09:54:22 +02:00
Rolf Bjarne Kvinge 7df3eb1520
[dotnet] Add targets to compute mlaunch arguments for installing and launching mobile apps. Fixes #18359. (#18446)
Add public targets to compute the mlaunch command lines for installing
and launching mobile apps.

These new targets are:

* ComputeMlaunchInstallArguments
* ComputeMlaunchRunArguments

As part of this change, also create a few new public properties:

* MlaunchPath
* MlaunchRunArguments
* MlaunchInstallArguments
* MlaunchRunScript
* MlaunchInstallScript

If the *Script variables are set, the corresponding target will create a
script file with the path to mlaunch + the corresponding arguments.

Otherwise, it's also possible to get the arguments directly from the
build log.

Fixes https://github.com/xamarin/xamarin-macios/issues/18359.
2023-06-15 07:21:09 +02:00
Rolf Bjarne Kvinge 859a48a73a
[tools] Automatically re-create ProductConstants.cs when the current commit changes. (#18426)
This fixes a frequent issue where building locally again would create
test apps where the registrar would fail due to mismatched runtime versions.
2023-06-12 18:44:25 +02:00
Rolf Bjarne Kvinge ba5becc790
[configure] Make it possible to run configure from any directory. (#18427) 2023-06-12 18:44:11 +02:00
Ivan Povazan e3088879a6
Reduce the size of `__LINKEDIT Export Info` section in stripped binaries (#18408)
# Description

This PR reduces the application's SOD (size on disk) by making
`__LINKEDIT Export Info` section smaller in the stripped Mach-O
binaries.

The feature is controlled by `_ExportSymbolsExplicitly` MSBuild property
and can be disabled by specifying: `-p:_ExportSymbolsExplicitly=true`

Fixes #18332 

# Initial problem

It has been noticed that during stripping, the strip tool does not
resize the export info section after it removes the symbols. Instead it
only zeroes out the entries (achieved by calling `prune_trie` function):

- https://github.com/apple-oss-distributions/cctools/blob/cctools-986/misc/strip.c
- https://github.com/apple-oss-distributions/ld64/blob/ld64-711/src/other/PruneTrie.cpp

Thanks @lambdageek for helping to track this down.

# Approach

As Xamarin build process already collects all the [required symbols][1] needed
for the application to run and preserves them during the strip phase, we can
use the same file to instruct clang toolchain to export only those symbols via
the command line options: `-exported_symbols_list <file>` ([source][2]).

This will make the export info section only include what is necessary for the
runtime - and at the same time eliminate the problem of the `strip` tool which
does not resize stripped symbols.

# Investigation setup

The issue is observable by building and inspecting the test application:
https://github.com/xamarin/xamarin-macios/blob/main/tests/dotnet/MySingleView/MySingleView.csproj
and targeting iOS platform in Release mode.

## Results:

| Measure      | MySingleView - main | MySingleView - this PR | Diff (%) | 
| :---         |                ---: |                   ---: |     ---: |
| SOD (bytes)  |            13668940 |               13458476 |    -1.5% |
| .ipa (bytes) |             4829368 |                4827928 |   -0.03% |

Even though zeroes are compressed well, the SOD is still affected and
unused section takes around 1.5% of the most simplistic app size.
Much bigger impact has been noted when trying out a MAUI iOS template
app with NativeAOT where the `__LINKEDIT Export Info` zeroes take up to
20MB of the SOD, but also with the regular macOS applications:
https://github.com/dotnet/runtime/issues/86707

### Repro current state of MySingleView.app with stripped binary

1. Build the app (you can ignore the need to run the sample, I just did it to
   make sure the changes do not break anything)

```bash
make run-device
``` 

2. Print the load commands - [load_cmds_strip.list][3]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_strip.list
```

- We are interested in the export info section:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942960
export_size 207712
```

3. Create a hex dump of the export info section - [hex_dump_strip.list][4]

``` bash
xxd -s 5942960 -l 207712 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_strip.list
```

- NOTE: Notice around ~200kb of zeroes from ~0x005ab490 to ~0x005dda00
    
4. Verify exported symbols are correct - [dyld_info_strip.list][5]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_strip.list
```

### Repro current state of MySingleView.app with unstripped binary

1. Build the app (the make target preserves the symbols)

```bash
make run-device-no-strip
``` 

2. Print the load commands - [load_cmds_nostrip.list][6]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_nostrip.list
```

- We are interested in the export info section:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942960
export_size 207712
```

3. Create a hex dump of the export info section - [hex_dump_nostrip.list][7]

``` bash
xxd -s 5942960 -l 207712 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_nostrip.list
```

- Notice that the range: ~ 0x005ab490 to ~ 0x005dda00 now includes exported symbol entries
    
4. Verify exported symbols are correct - [dyld_info_nostrip.list][8]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_nostrip.list
```

### Repro the new approach 

1. Build the app (the make target uses the new approach)

```bash
make run-device-export-syms
``` 

2. Print the load commands - [load_cmds_export.list][9]

```bash
otool -l bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > load_cmds_export.list
```

- We are interested in the export info section ***notice the reduced size of the section***:

```
cmd LC_DYLD_INFO_ONLY
...
export_off 5942432
export_size 1048
```

3. Create a hex dump of the export info section - [hex_dump_export.list][10]

``` bash
xxd -s 5942432 -l 1048 bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > hex_dump_export.list
```
    
4. Verify exported symbols are correct - [dyld_info_export.list][11]

``` bash
dyld_info -exports bin/Release/net7.0-ios/ios-arm64/MySingleView.app/MySingleView > dyld_info_export.list
```

---

## Additional benefits

With this approach we could also switch the way strip tool is invoked to
always strip all debug and local symbols via `strip -S -x` instead of passing
the file with symbols to preserve. This would remove the warning that we are
currently getting (which is being ignored):

```
/Applications/Xcode_14.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip: warning: removing global symbols from a final linked no longer supported.  Use -exported_symbols_list at link time when building...
```

## Other references:

- https://github.com/qyang-nj/llios/blob/main/exported_symbol/README.md

[1]: 11e7883da0/tools/dotnet-linker/Steps/GenerateReferencesStep.cs (L38-L44)
[2]: https://developer.apple.com/library/archive/documentation/DeveloperTools/Conceptual/DynamicLibraries/100-Articles/DynamicLibraryDesignGuidelines.html
[3]: https://gist.github.com/ivanpovazan/d53f8d10be5e4ea9f39a41ea540aa7fa
[4]: https://gist.github.com/ivanpovazan/60637422f3ff8cb5f437ddd06a21d9c1
[5]: https://gist.github.com/ivanpovazan/352595ad15c2ac02f38dcb3bd4130642
[6]: https://gist.github.com/ivanpovazan/bf700161f2f3691d1d7381c98d4fa0be
[7]: https://gist.github.com/ivanpovazan/44269e4fff5ebd58a4d181451e5c106f
[8]: https://gist.github.com/ivanpovazan/38c5afe076502d514a77420af0e10b01
[9]: https://gist.github.com/ivanpovazan/3f663c3c630005f5a578605d48ba807e
[10]: https://gist.github.com/ivanpovazan/0bb84f64281d05ab20438aeaed64f13c
[11]: https://gist.github.com/ivanpovazan/78b3ba2288f53a2316b9bc46964e7e4f

---------

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2023-06-12 13:45:38 +02:00
Rolf Bjarne Kvinge 707a2db3e1
[msbuild] Make sure to copy the manifest from a binding resource package back to Windows. Fixes #18402. (#18419)
This fixes a build problem on windows when a project has a project reference
to a binding project. The binding resource package from the binding project
would lack the manifest, and thus the main project wouldn't detect it as a
binding resource package, effectively not seeing any native resource from the
binding project.

Fixes https://github.com/xamarin/xamarin-macios/issues/18402.
2023-06-08 16:51:29 +02:00
Rolf Bjarne Kvinge 50c5ae57f2
[msbuild] Dispose a few streams when done with them in the unzip/decompress logic. (#18410)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1829715.
2023-06-08 16:51:10 +02:00
James Parsons 3feddf30eb
Update Messaging and System.Diagnostics.Tracer versions (#18416)
We need to update the `System.Diagnostics.Tracer` package to version
`2.1.0-alpha` due to an issue with the `ChecksumAlgorithm` property of
older versions.

Cherry-pick: https://github.com/xamarin/xamarin-macios/pull/18310
2023-06-07 12:55:27 +02:00
VS MobileTools Engineering Service 2 1527450920
[dotnet] Set _RequiresILLinkPack=true so that we always restore the ILLink package. (#18412)
This property will be required when building for a net7.0-* target framework
using .NET 8 (preview 6 - preview 5 does not need this fix)

Backport of #18411
2023-06-07 08:48:42 +02:00
Rolf Bjarne Kvinge 9e2143032f
Use Enum.GetValues<T> instead of Enum.GetValues in numerous places for .NET. (#18382)
NativeAOT warns about Enum.GetValues and suggests using Enum.GetValues<T>
instead, so do just that.
2023-06-07 08:47:55 +02:00
Haritha Mohan 4bbd7df8f5
[dotnet] Enable runtime identifiers to be overriden at build time (#18396)
Fixes #17707
The error target for when there is a conflict of interest in defining
both the runtime identifier and runtime identifiers is called during the
multi-rid builds, but not sure if the placement is the most ideal..

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-06 13:49:29 -07:00
Rolf Bjarne Kvinge b59587a0cd
[tests] Rework TestRuntime.RunAsync. (#18391)
* Move all the RunAsync logic to the TestRuntime class, instead of having some
  in TestRuntime and some in AppDelegate.
* Create a unified Task-based implementation for all platforms, optionally showing
  a UI on the platforms where we can do that.
* Remove all the overloads that took a DateTime timeout, and instead only use a
  TimeSpan timeout. This simplified some of the code.
* The new Task-based implementation will capture any exceptions (and rethrow most
  of them) from the tasks we're waiting for, so no need to do that in each RunAsync
  caller. This simplifies the testing code a lot for some tests.
* Add a new TryRunAsync method that will return (instead of rethrowing) any exceptions.
  This simplifies some of the testing code (which verifies the correct exception,
  or ignores the test in case of some exceptions).
* The new Task-based implementation will bubble up any NUnit exceptions, which
  means that the tasks we're waiting for can call NUnit's Assert and the right thing
  happens (in particular Assert.Ignore will actually ignore the test).
2023-06-06 21:36:49 +02:00
Rolf Bjarne Kvinge 1ca3c6ad8a
[tests] Adjust a few tests to not write a temporary file into the user directory. (#18394)
Fixes:

    MonoTouchFixtures.Foundation.NSFileManagerTest
    	[FAIL] GetSkipBackupAttribute : System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/F9F5B72D-D452-49F9-93AC-5CBB1E60A81C/DoNotBackupMe-NSFileManager-14036' is denied.
      ----> System.IO.IOException : Operation not permitted
    		   at Interop.ThrowExceptionForIoErrno(ErrorInfo , String , Boolean )
    		   at Interop.CheckIo(Error , String , Boolean )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , UnixFileMode , Int64& , UnixFileMode& , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , Nullable`1 , Func`4 )
    		   at System.IO.File.OpenHandle(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
    		   at System.IO.File.WriteToFile(String , FileMode , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String )
    		   at MonoTouchFixtures.Foundation.NSFileManagerTest.GetSkipBackupAttribute() in xamarin-macios/tests/monotouch-test/Foundation/FileManagerTest.cs:line 98
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
    		--IOException
    MonoTouchFixtures.Foundation.UrlTest
    	[FAIL] IsExcludedFromBackupKey : System.UnauthorizedAccessException : Access to the path '/private/var/mobile/Containers/Data/Application/F9F5B72D-D452-49F9-93AC-5CBB1E60A81C/DoNotBackupMe-NSUrl-14036' is denied.
      ----> System.IO.IOException : Operation not permitted
    		   at Interop.ThrowExceptionForIoErrno(ErrorInfo , String , Boolean )
    		   at Interop.CheckIo(Error , String , Boolean )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , OpenFlags , Int32 , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , UnixFileMode , Int64& , UnixFileMode& , Func`4 )
    		   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String , FileMode , FileAccess , FileShare , FileOptions , Int64 , Nullable`1 , Func`4 )
    		   at System.IO.File.OpenHandle(String , FileMode , FileAccess , FileShare , FileOptions , Int64 )
    		   at System.IO.File.WriteToFile(String , FileMode , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String , Encoding )
    		   at System.IO.File.WriteAllText(String , String )
    		   at MonoTouchFixtures.Foundation.UrlTest.IsExcludedFromBackupKey() in xamarin-macios/tests/monotouch-test/Foundation/UrlTest.cs:line 54
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
    		--IOException
2023-06-06 18:28:23 +02:00
dependabot[bot] df5b616c3f
Bump rolfbjarne/autoformat from 0.2.2 to 0.2.99 (#18407)
Bumps rolfbjarne/autoformat from 0.2.2 to 0.2.99.

## Commits

* Add support for a custom .NET executable and a custom working directory.
* Add branding.
* Change name so that it can be published to the marketplace.
* Quote script. Fixes issue 8.

See full diff: https://github.com/rolfbjarne/autoformat/compare/v0.2.2...v0.2.99
2023-06-06 15:12:44 +02:00
Rolf Bjarne Kvinge b03a9b3b87
[tools] Bump Xcode version in SdkVersions.cs. (#18406) 2023-06-06 14:49:41 +02:00
Rolf Bjarne Kvinge 11e7883da0
[tests] System.Numerics.Vector3.Length is a method, not a property, so treat it as such. (#18401)
Fixes:

    MonoTouchFixtures.Phase.PhaseObjectTest
    	[FAIL] ForwardTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
    	[FAIL] RigthTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
    	[FAIL] UpTest :   length
			Expected: 1
			But was:  <System.Func`1[System.Single]>
2023-06-05 15:46:33 +02:00
Rolf Bjarne Kvinge 12c300fb22
[ObjCRuntime] Avoid using Assembly.Location, it doesn't work with NativeAOT. (#18372) 2023-06-05 14:06:56 +02:00
Rolf Bjarne Kvinge 8d3a1aff7e
[tests] Fix warnings in tests/bgen/bgen-tests.csproj and enforce no more nullability warnings. (#18400) 2023-06-05 10:42:33 +02:00
Rolf Bjarne Kvinge 481ce215c9
[tests] Update the Xcode version check for Xcode 13.3. (#18390)
Fixes:

    MonoTouchFixtures.AVFoundation.CaptureMetadataOutputTest
    	[PASS] Defaults
    	[PASS] Flags
    	[FAIL] MetadataObjectTypesTest : System.NotImplementedException : The method or operation is not implemented.
    		   at TestRuntime.CheckXcodeVersion(Int32 major, Int32 minor, Int32 build) in xamarin-macios/tests/common/TestRuntime.cs:line 483
    		   at MonoTouchFixtures.AVFoundation.CaptureMetadataOutputTest.MetadataObjectTypesTest() in xamarin-macios/tests/monotouch-test/AVFoundation/CaptureMetadataOutputTest.cs:line 131
    		   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
2023-06-05 10:27:32 +02:00
Alex Soto cc35efe4bc
[Xcode] Bump Xcode to version 14.3.1 (#18290)
Bump to stable Xcode 14.3.1
2023-06-02 10:39:14 -04:00
Rolf Bjarne Kvinge d33a5d812d
[tests] Use the NetworkResources class for urls instead of hardcoding them. (#18374) 2023-06-02 15:27:41 +02:00
Rolf Bjarne Kvinge a43b664584
[Foundation] Several fixes to NSFileManager. (#18371)
* Enable nullability.
* Add API that was previously iOS-specific to all platforms.
2023-06-02 15:19:42 +02:00
Rolf Bjarne Kvinge 7198886910
[tests] Give the CGImagePropertiesGPSTest some latitude with the coordinates. (#18375)
Seems like the actual values on device might be ever so slightly off.
2023-06-02 14:35:51 +02:00
Rolf Bjarne Kvinge 9e14229176
[tests] Adjust BundleTest to not use Assembly.Location, since it doesn't work in NativeAOT. (#18376) 2023-06-02 14:35:01 +02:00
Rolf Bjarne Kvinge fad26bcc3e
[tests] Adjust BundleTest to cope with a differently named app. (#18392)
It seems the actual app name might be "PublicStaging.app" on device now.

Fixes:

    MonoTouchFixtures.CoreFoundation.BundleTest
        [FAIL] TestExecutableUrl :
            Expected: String containing "monotouchtest.app/monotouchtest"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/monotouchtest"
        [FAIL] TestResourcesDirectoryUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
        [FAIL] TestSupportFilesDirectoryUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
         [FAIL] TestUrl :
            Expected: String containing "monotouchtest.app/"
            But was:  "file:///private/var/containers/Bundle/Application/4B2AD441-C411-42D4-ACCB-4E964A905A17/PublicStaging.app/"
2023-06-02 14:32:05 +02:00
Rolf Bjarne Kvinge d98be15ea7
[tests] Fix typo in method name. (#18393) 2023-06-02 14:31:41 +02:00
Rolf Bjarne Kvinge 53e62dc1a0
[devops] Upgrade the PoliCheck and PostAnalysis tasks to v2. (#18381)
Fixes these warnings in Azure DevOps:

	* Please upgrade the version of this build task in your build to major version: 2. For more information, please see: https://aka.ms/gdn-v1-deprecation
	Governance Checks • Governance Checks • PoliCheck

	* Please upgrade the version of this build task in your build to major version: 2. For more information, please see: https://aka.ms/gdn-v1-deprecation
	Governance Checks • Governance Checks • Post Analysis

---------

Co-authored-by: Alex Soto <alex@alexsoto.me>
2023-06-02 09:20:33 +02:00