We don't typically own input parameters, so make sure to pass 'false' for the
'owns' parameter to Runtime.GetNSObject.
This fixes a crash due to overreleasing these objects.
Also make the block creation code optimizable.
From net8, ILLink is not part of dotnet/sdk anymore but part of dotnet/runtime: https://github.com/dotnet/runtime/tree/main/src/tools/illink/src/ILLink.Tasks
This means that now it's a NuGet package called `Microsoft.NET.ILLink.Tasks` and it's installed as part of the dotnet SDK installation
This affects the remote builds since we were looking on the dotnet SDK installation folder used by XMA (/Library/Caches/Xamarin/XMA/SDKs/dotnet) to find the 'illink.dll' assembly, but now that file is located in the NuGet packages folder used by XMA (/Library/Caches/Xamarin/XMA/SDKs/.home).
This change consists of adding some new MSBuild properties to calculate the right path of the 'illink.dll' assembly depending on if it's included in the SDK or not
This should fix Bug #1748997 - [XVS][.NET 8] Build failed with two errors when Target Framework is net8.0-ios: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1748997
* Make BlockLiteral disposable.
This also means to modify the cleanup logic so that it's safe to call
Dispose more than once.
* Create a helper class to create a block for a simple Action delegate.
This allows us to simplify a good chunk of code.
* Update all block creation to use the new block API, where blocks are
disposable. This makes the code pattern a lot simpler.
I've changed all the P/Invokes to use an unsafe 'BlockLiteral*' pointer,
because 'using' variables can't be passed as ref arguments, so the choice
was either to make the parameter type 'IntPtr' and cast away the pointer:
using var block = new BlockLiteral ();
PInvoke ((IntPtr) &block);
or make the parameter an unsafe 'BlockLiteral*' pointer:
unsafe {
using var block = new BlockLiteral ();
PInvoke (&block);
}
The upcoming support for function pointers don't have this choice:
function pointers are always unsafe, so I chose to go the unsafe route
here as well, since it makes the code simpler once support for function
pointers has been implemented.
Contributes towards https://github.com/xamarin/xamarin-macios/issues/15783.
This PR might be easier to review commit-by-commit.
This turned out a bit more complex than usual, because the delegate we want to
remove from the call to the P/Invoke is a part of the public API.
I worked around this by adding new API that uses the new P/Invoke, and having
the old API throw an exception until we can remove it, but only in .NET 8,
which seems like the earliest we should do this kind of behavioral breaking
change.
Applies the following changes from Xamarin.Messaging:
xamarin/Xamarin.Messaging#543xamarin/Xamarin.Messaging#541
It includes fixes for SSH keys handling, UX improvements when SSH is disabled on the Mac and also when the user is not logged in on the Mac
Naming could be problematic when generating code, move the logic out of
the generator class to a helper class whose only job is to name classes
and keep track of names.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
This pull request updates the following dependencies
## From https://github.com/xamarin/xamarin-macios
- **Subscription**: 69411ae3-c771-4088-2d6e-08dac814288b
- **Build**: 20230217.2
- **Date Produced**: February 17, 2023 8:36:39 AM UTC
- **Commit**: e2529ed7a2
- **Branch**: refs/heads/release/7.0.1xx-xcode14.2
- **Updates**:
- **Microsoft.MacCatalyst.Sdk**: [from 16.2.1034 to 16.2.1035][4]
This pull request updates the following dependencies
## From https://github.com/dotnet/runtime
- **Subscription**: 38d2313f-22d5-4062-c8e1-08dabd6d8c77
- **Build**: 20230215.6
- **Date Produced**: February 16, 2023 6:00:46 AM UTC
- **Commit**: b68fd882623b528fd4ef78b122209710f17bacdb
- **Branch**: refs/heads/release/7.0
- **Updates**:
- **Microsoft.NETCore.App.Ref**: [from 7.0.4 to 7.0.4][1]
Code is complicated, lets remove as much noise as possible to focus on
the important parts.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
This pull request updates the following dependencies
## From https://github.com/xamarin/xamarin-macios
- **Subscription**: 69411ae3-c771-4088-2d6e-08dac814288b
- **Build**: 20230216.3
- **Date Produced**: February 16, 2023 10:35:57 AM UTC
- **Commit**: 39361a37b1
- **Branch**: refs/heads/release/7.0.1xx-xcode14.2
- **Updates**:
- **Microsoft.MacCatalyst.Sdk**: [from 16.2.1033 to 16.2.1034][4]
Use a class that we can have to store the types and a single place to
locate the types to load.
Later we can use the class to write tests and move to a Dictionary
implementation that passes the tests and is more efficient.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Group all attr methods in the attr manager class.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Several changes:
- Refactored AsyncMethodInfo and move the collection extensions out of
the Generator class.
- Added tests for the collection extension methods.
- Fix a mistake/bug in which Last was used instead of LastOrDefault
(funny comment was close to the right reason).
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Move all the string methods that can be an extension to a static class
(re-use the present one) and add tests.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
This pull request updates the following dependencies
## Coherency Updates
The following updates ensure that dependencies with a *CoherentParentDependency*
attribute were produced in a build used as input to the parent dependency's build.
See [Dependency Description Format](https://github.com/dotnet/arcade/blob/master/Documentation/DependencyDescriptionFormat.md#dependency-description-overview)
- **Coherency Updates**:
- **Microsoft.NET.ILLink.Tasks**: from 7.0.100-1.22579.2 to 7.0.100-1.23062.2 (parent: Microsoft.Dotnet.Sdk.Internal)
- **Microsoft.AspNetCore.App.Ref**: from 7.0.2 to 7.0.3 (parent: Microsoft.Dotnet.Sdk.Internal)
## From https://github.com/dotnet/installer
- **Subscription**: 50c9492e-4671-4d1d-7920-08dabd1031a2
- **Build**: 20230214.27
- **Date Produced**: February 15, 2023 2:49:17 AM UTC
- **Commit**: 6d3cb5a4f9f758114727bce6a7fd965097a763fa
- **Branch**: refs/heads/release/7.0.1xx
- **Updates**:
- **Microsoft.Dotnet.Sdk.Internal**: [from 7.0.104-servicing.23109.16 to 7.0.104-servicing.23114.27][1]
- **Microsoft.NET.ILLink.Tasks**: [from 7.0.100-1.22579.2 to 7.0.100-1.23062.2][2]
- **Microsoft.AspNetCore.App.Ref**: [from 7.0.2 to 7.0.3][3]
[1]: 0709aa6...6d3cb5a
[2]: 8db10f4...19fa656
[3]: https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore/branches?baseVersion=GC7c81065&targetVersion=GCfebee99&_a=files
We need to use 'DOTNET_MANIFEST_VERSION_BAND' instead of
'DOTNET_VERSION_BAND', because the former always ends with '00' (which
manifest version bands are supposed), while the latter can have other numbers
(for instance 7.0.100 vs 7.0.101 - the former is a valid manifest version
band, the latter isn't).
Cleaned some code that could be simpler too.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: TJ Lambert <50846373+tj-devel709@users.noreply.github.com>
Remove more indirections that make the code more complicated to follow
that it really needs to be.
---------
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>