Skip to content

[xcode26] Merge main into xcode26 #23065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jun 18, 2025
Merged

Conversation

dalexsoto
Copy link
Member

No description provided.

csigs and others added 30 commits June 10, 2025 12:32
…20250607055448645 to main (#23011)

LEGO: Pull request from
lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20250607055448645 to main
with localized lcls
…20250606053650926 to main (#23008)

LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20250606053650926 to main with localized lcls

---------

Co-authored-by: CSIGS-Expires-nextweek <csigs@outlook.com>
Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
* Update the dotnet-ilrepack tool to the latest version.
* Remove some old code in ILMerge.targets. This required adding the MSBuild package
  references to Xamarin.iOS.Task.Windows.csproj, because these packages were getting
  imported by the otherwise unused ILRepack.MSBuild.Task package reference.
* Ask ilrepack to merge ILLink resources (this fixes a warning about duplicate
  ILLink.Substitutions.xml resources).
#23018)

The changes will get the native object representations (string ->
NSString) so that we can call the native invoker.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
…3019)

Creates any call that has to be executed after the call to the native
invoker, in most of the cases we need to add a GC.KeepAlive to ensure
that the handle is not removed by the GC while it is in used by the
native code.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
This pull request updates the following dependencies

## From https://github.com/dotnet/sdk

- **Subscription**: [a3af34df-ee86-4a08-b10d-b90bd4a87d76](https://maestro.dot.net/subscriptions?search=a3af34df-ee86-4a08-b10d-b90bd4a87d76)
- **Build**: [20250610.12](https://dev.azure.com/dnceng/internal/_build/results?buildId=2727452)
- **Date Produced**: June 11, 2025 1:27:47 AM UTC
- **Commit**: [837be9cabbc28b6d18d7576fad24c7a8f961381d](dotnet/sdk@837be9c)
- **Branch**: refs/heads/release/9.0.1xx

- **Updates**:
  - **Microsoft.NET.Sdk**: [from 9.0.106-servicing.25217.33 to 9.0.108-servicing.25310.12][13]

[13]: dotnet/sdk@bdd832b...837be9c

## 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 9.0.4 to 9.0.5 (parent: Microsoft.NET.Sdk)
  - **Microsoft.AspNetCore.App.Ref**: from 9.0.4 to 9.0.5 (parent: Microsoft.NET.Sdk)
  - **Microsoft.NETCore.App.Ref**: from 9.0.4 to 9.0.5 (parent: Microsoft.NET.Sdk)
  - **Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport**: from 9.0.4-servicing.25157.2 to 9.0.5-servicing.25212.1 (parent: Microsoft.NETCore.App.Ref)
  - **Microsoft.NETCore.App.Ref**: from 9.0.4 to 9.0.5 (parent: Microsoft.NET.Sdk)
  - **Microsoft.DotNet.Cecil**: from 0.11.5-alpha.25112.2 to 0.11.5-alpha.25213.4 (parent: Microsoft.NETCore.App.Ref)

This PR is an incremental version of #22772.
This pull request updates the following dependencies

## From https://github.com/dotnet/arcade

- **Subscription**: [0ed7aa82-fff7-4048-943c-7b5fa7eed6f0](https://maestro.dot.net/subscriptions?search=0ed7aa82-fff7-4048-943c-7b5fa7eed6f0)
- **Build**: [20250602.2](https://dev.azure.com/dnceng/internal/_build/results?buildId=2721828)
- **Date Produced**: June 2, 2025 9:40:50 PM UTC
- **Commit**: [0d52a8b262d35fa2fde84e398cb2e791b8454bd2](dotnet/arcade@0d52a8b)
- **Branch**: refs/heads/release/9.0

- **Updates**:
  - **Microsoft.DotNet.Arcade.Sdk**: [from 9.0.0-beta.25271.1 to 9.0.0-beta.25302.2][1]
  - **Microsoft.DotNet.Build.Tasks.Feed**: [from 9.0.0-beta.25271.1 to 9.0.0-beta.25302.2][1]

[1]: dotnet/arcade@086a177...0d52a8b

- **Updates to .NET SDKs:**
  - Updates sdk.version to 9.0.106
  - Updates tools.dotnet to 9.0.106
…invocation steps. (#23029)

Instead than calling the GC.KeepAlive method we want to call
CFString.Release native which keeps a ref to the native string and, more
importantly, frees the memory of the string once we are done with it.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
There are some types that are known and we want to create a new instance
for using new rather than GetINativeObject/GetNSObject. Add a new
  overload of the New method that allows to pass directly a TypeSyntax.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…g. (#23027)

Add a factory method that will return the expression needed to get a
SmartEnum from a NSString value.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
…rned from the delegate. (#23032)

If a delegate returns a smart enum, we need to ensure that we retain the
NSString handle that is returned by the delegate execution.
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
…m the parameter info. (#23044)

This is a helper method that knows how to handle the ref kind and will
create the correct argument syntax. This can later be used to create the
arguments in a more elegant way.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Create the needed factory method that will generate the call for the
invoker native delegate.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
…1: Build ID 11769411 (#23053)

This is the pull request automatically created by the OneLocBuild task in the build process to check-in localized files generated based upon translation source files (.lcl files) handed-back from the downstream localization pipeline. If there are issues in translations, visit https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is https://aka.ms/onelocbuild and the localization process in general is documented at https://aka.ms/AllAboutLoc.

---------
)

Also:

* Enable nullability and fix any issues.
* Improve docs.

Fixes #23009.
We achieve the following:

1. Create a method that will do any needed conversion of the return
type.
2. Fix a bug in which we were keeping alive the handle, when it should
the managed object.
3. Complete the generation of the invoke. Call the conversions, call the
invoker, call the post conversions and return the valid value.

This completes all the code that needs to be generated by trampoline. We
will add tests with known frameworks in coming commits to ensure that we
are generating equivalent code.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
…g original resources. Fixes #10148. (#22985)

Traditionally we've disabled building projects when doing design-time builds
(in an IDE), because such builds have to be quick, but building binding
projects required a remote connection to a Mac when building from Windows.

However, we recently completed support for building binding projects fully on
Windows, with one caveat: the option to bundle original resources in the
binding assembly has to be enabled (off by default in .NET 9, on by default in
.NET 10+), because otherwise the remote mac connection is still needed.

So here we enable design-time builds, as long as the project is bundling
original resources, since the entire binding project will be built on Windows.

Fixes #10148.
… bundling original resources. (#22984)

Recently we added support for fully building library and binding projects on
Windows, without connecting to a remote Mac.

This fix makes it so that we won't connect to the Mac when it's not needed.
Use the GCHandle stored on the native instance to find the managed instance to
call 'ConformsToProtocol' on, instead of looking up the native handle in our
object dictionary.

Hopefully fixes this random exception:

    ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x13d566800 (type: MyType). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'MyType' does not have a constructor that takes one NativeHandle argument).
       at ObjCRuntime.Runtime.MissingCtor(IntPtr , IntPtr , Type , MissingCtorResolution , IntPtr , RuntimeMethodHandle )
       at ObjCRuntime.Runtime.ConstructNSObject[NSObject](IntPtr , Type , MissingCtorResolution , IntPtr , RuntimeMethodHandle )
       at ObjCRuntime.Runtime.ConstructNSObject[NSObject](IntPtr , Type , MissingCtorResolution )
       at ObjCRuntime.Runtime.ConstructNSObject(IntPtr , IntPtr , MissingCtorResolution )
       at ObjCRuntime.Runtime.GetNSObject(IntPtr , MissingCtorResolution , Boolean )
       at ObjCRuntime.Runtime.GetNSObject(IntPtr )
       at ObjCRuntime.Runtime.InvokeConformsToProtocol(IntPtr , IntPtr )
       at ObjCRuntime.Runtime.invoke_conforms_to_protocol(IntPtr obj, IntPtr protocol, IntPtr* exception_gchandle)
       Exception_EndOfInnerExceptionStack

This should be a little bit faster.
…20250617054315946 to main (#23057)

LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20250617054315946 to main with localized lcls

---------

Co-authored-by: CSIGS-Expires-nextweek <csigs@outlook.com>
This later is required to be able to generate out NSObject parameters in
trampolines.

---------

Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
Co-authored-by: GitHub Actions Autoformatter <github-actions-autoformatter@xamarin.com>
@dalexsoto
Copy link
Member Author

@rolfbjarne feel free to merge this now or whenever you feel it is the best time to do so

@rolfbjarne rolfbjarne merged commit 95ba4b7 into xcode26.0 Jun 18, 2025
271 of 273 checks passed
@rolfbjarne rolfbjarne deleted the dev/alex/merge-main-xcode26 branch June 18, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants