Skip to content
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

Add public API to obtain a location specifier for a call #72133

Closed
RikkiGibson opened this issue Feb 15, 2024 · 18 comments
Closed

Add public API to obtain a location specifier for a call #72133

RikkiGibson opened this issue Feb 15, 2024 · 18 comments
Assignees
Labels
api-approved API was approved in API review, it can be implemented Area-Compilers blocking API needs to reviewed with priority to unblock work Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Interceptors
Milestone

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Feb 15, 2024

Continuation of #72093

Need for generators to obtain a location specifier for a call

We are making adjustments to the interceptors design in order to improve the following aspects:

  • Portability of generated code. (i.e. the ability to generate code on one machine and compile the generated code on another machine.)
  • Simplicity for generator authors, by introducing public API accessible for generators, in order to get the correct argument(s) for [InterceptsLocation], with minimal guesswork.
  • Evolvability of the representation of locations, transparent to generator authors, by introducing an [InterceptsLocation(int, string)] constructor overload, the encoding of which can be updated over time.

Proposed API

We plan to add the following well-known constructor to InterceptsLocationAttribute:

 namespace System.Runtime.CompilerServices;

 public class InterceptsLocationAttribute
 {
     public InterceptsLocationAttribute(string filePath, int line, int character) { } // plan to drop support prior to stable release of interceptors feature
+    public InterceptsLocationAttribute(int version, string data) { }
 }

We propose adding the following public API to Roslyn:

 namespace Microsoft.CodeAnalysis
 {
     public static class CSharpExtensions
     {
+        /// <summary>
+        /// If 'node' cannot be intercepted, returns null. Otherwise, returns an InterceptableLocation instance which can be used to intercept the call denoted by 'node'.
+        /// </summary>
+        [Experimental(RoslynExperiments.Interceptors)]
+        public InterceptableLocation? GetInterceptableLocation(this SemanticModel model, InvocationExpressionSyntax node);
     }
 
     namespace CSharp
     {
+        /// <summary>Location data which can be used to intercept a call.</summary>
+        [Experimental(RoslynExperiments.Interceptors)]
+        public sealed class InterceptableLocation : IEquatable<InterceptableLocation>
+        {
+            /// <summary>The version of the InterceptsLocationAttribute data encoding. Used as an argument for the parameter 'version' of InterceptsLocationAttribute.</summary>
+            public int Version { get; }
+
+            /// <summary>Opaque data which references an interceptable call. Used as an argument for the parameter 'data' of InterceptsLocationAttribute.</summary>
+            public string Data { get; }
+
+            /// <summary>Gets a human-readable location description for the interceptable call.</summary>
+            public string GetDisplayLocation();
+
+            /// <summary>Returns a source code fragment of the form `[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(version, data)]`.</summary>
+            public string GetInterceptsLocationAttributeSyntax();
+        }
+    }
 }
  • We declare this as an extension method because we want to use C#-specific types in the signature (a la Add public API to determine if a call is being intercepted #72093).
  • We use SemanticModel as the receiver type of the extension, because we want to have the ability to depend on compilation-level information in the location encoding.

The InterceptsLocation(string, int, int) constructor will coexist with the new constructor while we work to get partner generators onboarded to it. Prior to stable release of the interceptors feature, support for InterceptsLocation(string, int, int) will be dropped.

Usage Examples

In order to produce an interceptor method like the following:

// C:\project\src\Program.cs(6,17)
[InterceptsLocation(1, "yPU5+1/pMuRHlz+XbnIQwQYAAAARAAAAUHJvZ3JhbS5jcw==")]
public static void Interceptor(this ReceiverType receiver, ParamType param) { ... }

We may employ a generator implemented like the following:

using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;

[Generator(LanguageNames.CSharp)]
public class MyGenerator : IIncrementalGenerator
{
    record InterceptorInfo(InterceptableLocation location, object data);

    public void Initialize(IncrementalGeneratorInitializationContext context)
    {
        var interceptorInfos = context.SyntaxProvider.CreateSyntaxProvider(
            predicate: IsInterceptableCall,
            transform: (GeneratorSyntaxContext context, CancellationToken token) => {
                var interceptableLocation = context.GetInterceptableLocation((InvocationExpressionSyntax)context.Node);
                if (interceptableLocation is null)
                {
                    return null; // generator wants to intercept call, but host thinks call is not interceptable. bug.
                }

                // generator is careful to propagate only equatable data (i.e., not syntax nodes or symbols).
                return new InterceptorInfo(interceptableLocation, GetData(context));
            })
            .Where(info => info != null)
            .Collect();

        context.RegisterSourceOutput(interceptorInfos, (context, interceptorInfos) => {
            var builder = new StringBuilder();
            // builder boilerplate..
            foreach (var interceptorInfo in interceptorInfos)
            {
                var (location, data) = interceptorInfo;
                builder.Add($$"""
                    // {{location.GetDisplayLocation()}}
                    [InterceptsLocation({{location.Version}}, "{{location.Data}}")]
                    public static void Interceptor(this ReceiverType receiver, ParamType param)
                    {
                        {{GetMethodBody(data)}}
                    }
                    """);

                // alternatively, author can use the convenience method, which fully qualifies the attribute name:
                // e.g. `[global::System.Runtime.CompilerServices.InterceptsLocationAttribute(...)]`.
                builder.Add($$"""
                    // {{location.GetDisplayLocation()}}
                    {{location.GetInterceptsLocationAttributeSyntax()}}
                    public static void Interceptor(this ReceiverType receiver, ParamType param)
                    {
                        {{GetMethodBody(data)}}
                    }
                    """);
            }
            // builder boilerplate..

            context.AddSource(builder.ToString(), hintName: "MyInterceptors.cs");
        });
    }
}

Alternative Designs

  • Do not add a new constructor to [InterceptsLocation], and instead expose an API which obtains the attribute arguments for the existing constructor. This would likely require knowing the output directory for the particular generator and accepting a hintName in order to produce a relative path.
 namespace Microsoft.CodeAnalysis;

 public readonly struct GeneratorSyntaxContext
 {
     public void AddSource(string hintName, string source);
+    /// <summary>If 'expression' cannot be intercepted, returns null. Otherwise, returns a location specifier which can be used to intercept 'expression'.</summary>
+    /// <remarks>Currently, only 'InvocationExpressionSyntax' can be intercepted.</remarks>
+    public (string filePath, int line, int character)? GetInterceptsLocationArguments(ExpressionSyntax expression, string interceptorFileHintName);
 }
  • Do not expose any API for obtaining InterceptsLocation arguments. Instead, document the location encoding and have generator authors create them on their own.

Risks

LDM has not yet reviewed the proposed checksum-based approach. LDM will review the design while there is time to address any feedback before shipping the feature. If the feedback requires adjusting the approach (e.g. the particular signature of the attribute constructor), then it is possible that corresponding public API changes will need to also be made prior to shipping.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 15, 2024
@333fred 333fred added Concept-API This issue involves adding, removing, clarification, or modification of an API. api-ready-for-review API is ready for review, it is NOT ready for implementation blocking API needs to reviewed with priority to unblock work labels Feb 15, 2024
@333fred 333fred added this to the 17.10 milestone Feb 15, 2024
@333fred 333fred removed the untriaged Issues and PRs which have not yet been triaged by a lead label Feb 15, 2024
@jaredpar
Copy link
Member

@333fred, @RikkiGibson is this on the schedule for API review? 2 weeks with no activity so would assume it went through review by now.

@RikkiGibson
Copy link
Contributor Author

RikkiGibson commented Feb 27, 2024

We filed this immediately after the previous API review meeting because it was the part of the proposal for that meeting which we ran out of time to review. Expecting we will review it this Thursday.

@333fred
Copy link
Member

333fred commented Feb 29, 2024

API Review

  • Do we need to put the API on the GeneratorSyntaxContext, or should it go in a more broad location?
  • What if the user doesn't know the hintName yet in this stage of the pipeline?
  • Important scenario for generators is that users can switch on EmitGeneratedFiles, then check
    in the files. That won't seem to work here?
    • Compiler provides an option to control where the generated source is emitted
    • Could we just specify from the root of the project?
    • This would potentially also allow us to not need the hintName of the generated file, which could simplify the API.
  • Could we have GetInterceptsLocationSpecifier return the entire globally-qualified attribute?
    • Seems odd that we'd save the user typing and escaping the string, but then still require them to specify the attribute?
    • Users may be trying to make the attribute look prettier, handling imports and the like.
    • Perhaps we may want to have a general "give me a string literal that represents this string value" API
  • Can we have "handle" based approach that the compiler has more knowledge of? So that if only the location
    changes, the compiler can understand this, and not rerun everything?
    • Complex topic. Maybe possible, but pretty hard.
    • We may also want to look into a ForMethodWithName approach for interceptors which could further optimize this path.

@333fred 333fred added api-needs-work API needs work before it is approved, it is NOT ready for implementation and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Feb 29, 2024
@jaredpar
Copy link
Member

jaredpar commented Mar 1, 2024

Important scenario for generators is that users can switch on EmitGeneratedFiles, then check
in the files. That won't seem to work here?

What about this doesn't work if the user checks in files? The intent of this design is that the file path for generated files is the same whether or not EmitGeneratedFiles is specified in the build. Flipping the switch on should change only if they are written to disk, not where they are written to disk.

Yes the user can change the location by manipulating <CompilerGeneratedFilesOutputPath> directly but that doesn't change the invariant above. Essentially the path should still match.

Do we need to put the API on the GeneratorSyntaxContext, or should it go in a more broad location?

What data is needed to make this decision?

What if the user doesn't know the hintName yet in this stage of the pipeline?

Redesign your pipeline to know it.

@333fred
Copy link
Member

333fred commented Mar 1, 2024

What about this doesn't work if the user checks in files?

This was addressed during the meeting, that's why there's a bullet point under that describing the option for controlling where files are emitted.

What data is needed to make this decision?

We likely should examine real interceptor pipelines that don't have a constant hintName.

Redesign your pipeline to know it.

Not possible. This is the start node of the pipeline. There is no way to flow information into this stage from other parts of a pipeline.

@jaredpar
Copy link
Member

jaredpar commented Mar 1, 2024

This was addressed during the meeting, that's why there's a bullet point under that describing the option for controlling where files are emitted.

What was addressed? What specific scenarios do not work?

@333fred
Copy link
Member

333fred commented Mar 1, 2024

What specific scenarios do not work?

None. As I said, this concern was addressed during the meeting.

@roji
Copy link
Member

roji commented Mar 6, 2024

Including the method as an extension on GeneratorSyntaxContext pushes it toward only being usable from the transform callback of CreateSyntaxProvider, versus being able to be used from any other context type from a different built-in provider. However, it appears that this is the most suitable provider to use when the generator needs to generate code based on presence of invocations in user source code.

On this - if I understand correctly, that means that creating a location would only be possible in a source generator; other code which generates code but isn't a Roslyn source generator wouldn't be able to use it. The EF approach notably does this - code generation happens in a standalone program (and/or possibly code executed as an MSBuild task on publish), since there are various blockers on generating the interceptors in a Roslyn source generator.

In other words, it would be useful (at least for EF) if there were no dependency on source generator APIs here.

@RikkiGibson

This comment was marked as outdated.

@RikkiGibson RikkiGibson added api-ready-for-review API is ready for review, it is NOT ready for implementation and removed api-needs-work API needs work before it is approved, it is NOT ready for implementation labels Mar 25, 2024
@RikkiGibson
Copy link
Contributor Author

Updated the proposal toward the checksum-based approach that came out of recent discussions.

@jaredpar jaredpar modified the milestones: 17.10, 17.11 Mar 26, 2024
@333fred
Copy link
Member

333fred commented Mar 28, 2024

API Review

  • Why do we need Version and Data?
    • Because we want to allow users to pretty-print the attribute
  • We should document the guarantees around Data:
    • Will need no escaping to use as string content
    • Specify the type of string (regular, verbatim, etc)
  • Should we make InterceptableLocation an abstract class now so that we can add new internal derived types later?
    • Likely not a breaking change given how roslyn emits method calls, but fine to do anyways.
    • Make the constructor internal or private protected so it can't be inherited publicly
  • Move GetInterceptsLocationAttributeSyntax to an extension?
    • Should be fine, it's essentially a helper.

Conclusion: Modulo the move to an abstract type and GetInterceptsLocationAttributeSyntax, this is approved.

@333fred 333fred added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Mar 28, 2024
@jaredpar
Copy link
Member

Will need no escaping to use as string content

Not following this comment. Can you elaborate a bit?

@333fred
Copy link
Member

333fred commented Mar 29, 2024

Not following this comment. Can you elaborate a bit?

The guarantee is that Data can be surrounded with quotes and need no further manipulation to be a legal C# string.

@RikkiGibson
Copy link
Contributor Author

In implementation we found a need to pass a CancellationToken as part of getting the file content hash. I will update the proposal accordingly. Seems like a fairly small/standard change. Let me know if there are any concerns.

@RikkiGibson
Copy link
Contributor Author

Heads up @mgravell about this change to the experimental feature design, as it looks like DapperAOT is using interceptors.

@RikkiGibson
Copy link
Contributor Author

Implemented in #72814

@Tornhoof
Copy link

That file hash, is it line endings sensitive?
If I understand the PR correctly it's a xx128 hash, so I'll get two different hashes on a win vs Linux build machine?
Won't that break things like deterministic builds?

@RikkiGibson
Copy link
Contributor Author

If you use different line endings you will get different content hashes.

We don't expect builds to be deterministic across OSes. since, for example, the PDBs already contain have checksums in SHA256.

However, in order to build correctly in a different environment after generating, you will need to take care to not change the line endings. For sources being checked out from git, this is fairly straightforward to achieve through config options.

jonathanpeppers added a commit to dotnet/maui that referenced this issue Jan 13, 2025
Changes required:

* Get appropriate `net9` branded workload manifests from dotnet/runtime

* Fix NuGet package downgrades:

    src\SingleProject\Resizetizer\src\Resizetizer.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 6.1.0 to 6.0.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Resizetizer -> Microsoft.Bcl.AsyncInterfaces 10.0.0-alpha.1.25058.4 -> System.Threading.Tasks.Extensions 4.6.0 -> System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
       Microsoft.Maui.Resizetizer -> System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
    src\Core\src\Core.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Numerics.Vectors from 4.6.0 to 4.5.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Core -> Microsoft.Extensions.Logging.Abstractions 10.0.0-alpha.1.25057.17 -> System.Memory 4.6.0 -> System.Numerics.Vectors (>= 4.6.0)
       Microsoft.Maui.Core -> System.Numerics.Vectors (>= 4.5.0)

* Update to iOS, tvOS, MacCatalyst 18.2

    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for MacCatalyst. Valid versions include:
        18.2
    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for iOS. Valid versions include:
        18.2

* Temporarily ignore `CS9270`:
  * dotnet/roslyn#76312
  * dotnet/roslyn#72133

    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-BindableLayout-BindableLayout.cs-GeneratedBindingInterceptors-235-10.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-72-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-77-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)

* iOS API changes:

    error CS0618: 'CLLocation.AccurracyBestForNavigation' is obsolete: 'Use 'AccuracyBestForNavigation' instead.'

    Screenshot.ios.cs(57,69): error CS8602: Dereference of a possibly null reference.

    Platform\iOS\KeyboardAutoManagerScroll.cs(867,55): error CS8602: Dereference of a possibly null reference.

    src\Core\src\Platform\iOS\MauiSwipeView.cs(601,8): error CS8625: Cannot convert null literal to non-nullable reference type.
    src\Core\src\Platform\iOS\MauiSwipeView.cs(634,8): error CS8625: Cannot convert null literal to non-nullable reference type.

    ResignFirstResponderTouchGestureRecognizer.iOS.cs(70,12): error CS8600: Converting null literal or possible null value to non-nullable type.

    GesturePlatformManager.iOS.cs(282,21): error CS8602: Dereference of a possibly null reference.

Most notably:

* `UIView.Window` can be null.

* Typo in API fixed `AccurracyBestForNavigation` -> `AccuracyBestForNavigation`
rmarinho added a commit to dotnet/maui that referenced this issue Jan 23, 2025
* Build with .NET 10 successfully

Changes required:

* Get appropriate `net9` branded workload manifests from dotnet/runtime

* Fix NuGet package downgrades:

    src\SingleProject\Resizetizer\src\Resizetizer.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Runtime.CompilerServices.Unsafe from 6.1.0 to 6.0.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Resizetizer -> Microsoft.Bcl.AsyncInterfaces 10.0.0-alpha.1.25058.4 -> System.Threading.Tasks.Extensions 4.6.0 -> System.Runtime.CompilerServices.Unsafe (>= 6.1.0)
       Microsoft.Maui.Resizetizer -> System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
    src\Core\src\Core.csproj : error NU1605:
      Warning As Error: Detected package downgrade: System.Numerics.Vectors from 4.6.0 to 4.5.0. Reference the package directly from the project to select a different version.
       Microsoft.Maui.Core -> Microsoft.Extensions.Logging.Abstractions 10.0.0-alpha.1.25057.17 -> System.Memory 4.6.0 -> System.Numerics.Vectors (>= 4.6.0)
       Microsoft.Maui.Core -> System.Numerics.Vectors (>= 4.5.0)

* Update to iOS, tvOS, MacCatalyst 18.2

    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for MacCatalyst. Valid versions include:
        18.2
    10.0.100-alpha.1.25059.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(259,5):
    error NETSDK1140:
        18.0 is not a valid TargetPlatformVersion for iOS. Valid versions include:
        18.2

* Temporarily ignore `CS9270`:
  * dotnet/roslyn#76312
  * dotnet/roslyn#72133

    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-BindableLayout-BindableLayout.cs-GeneratedBindingInterceptors-235-10.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-72-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)
    artifacts\obj\Controls.Core\Debug\net10.0\Microsoft.Maui.Controls.BindingSourceGen\Microsoft.Maui.Controls.BindingSourceGen.BindingSourceGenerator\D--src-maui-src-Controls-src-Core-ContentConverter.cs-GeneratedBindingInterceptors-77-13.g.cs(43,4): error CS9270: 'InterceptsLocationAttribute(string, int, int)' is not supported. Move to 'InterceptableLocation'-based generation of these attributes instead. (dotnet/roslyn#72133)

* iOS API changes:

    error CS0618: 'CLLocation.AccurracyBestForNavigation' is obsolete: 'Use 'AccuracyBestForNavigation' instead.'

    Screenshot.ios.cs(57,69): error CS8602: Dereference of a possibly null reference.

    Platform\iOS\KeyboardAutoManagerScroll.cs(867,55): error CS8602: Dereference of a possibly null reference.

    src\Core\src\Platform\iOS\MauiSwipeView.cs(601,8): error CS8625: Cannot convert null literal to non-nullable reference type.
    src\Core\src\Platform\iOS\MauiSwipeView.cs(634,8): error CS8625: Cannot convert null literal to non-nullable reference type.

    ResignFirstResponderTouchGestureRecognizer.iOS.cs(70,12): error CS8600: Converting null literal or possible null value to non-nullable type.

    GesturePlatformManager.iOS.cs(282,21): error CS8602: Dereference of a possibly null reference.

Most notably:

* `UIView.Window` can be null.

* Typo in API fixed `AccurracyBestForNavigation` -> `AccuracyBestForNavigation`

* Disable tizen net10.0 temporarily

* TargetFramework=net10.0

* TargetFramework=net10.0

* Unused yaml: `TestTargetFrameworks`

* Update RunnerGenerator.cs

Workaround: dotnet/android@715a36a

* Put iOS simulator versions back to 18.0

* Update RunnerGenerator.cs

* Update xUnitSharedAttributes.cs

    D:\src\maui\src\TestUtils\src\TestShared\xUnitSharedAttributes.cs(75,89): error CS0117: 'DynamicallyAccessedMemberTypes' does not contain a definition for 'PublicParameterlessConstructors'
    D:\src\maui\src\TestUtils\src\TestShared\xUnitSharedAttributes.cs(83,63): error CS0117: 'DynamicallyAccessedMemberTypes' does not contain a definition for 'PublicParameterlessConstructors'

* Update Core.DeviceTests.Shared.csproj

* Update RunnerGenerator.cs

* Remove Tizen project

* Update ios.cake

* Update Core.DeviceTests.csproj

* Update android

* Update xcode

* Disable trimming warnings for now

* [iOS] Move to 18.2 simulators

* Ignore more warnings

* Ignore more warnings

* Update MainViewController.cs

* Ignore more warnings

* Disable more warnings

* Update xUnitSharedAttributes.cs

* Put trimmer warnings back

* EnableTrimAnalyzer=false for test projects across repo

* Make `EnableTizen()` a no-op

* Update Controls.DeviceTests.csproj

* Install `mobile-librarybuilder-net9`

Context: xamarin/xamarin-macios@cb13402

* Update WindowsTemplateTest.cs

* `mobile-librarybuilder-net9` on test lanes

* Update Essentials.Sample.csproj

* See if newer .NET SDK fixes maui-blazor

Context: dotnet/sdk@26fd6d1...60e9a46

I see a dotnet/aspnetcore bump in the diff.

* Essentials.Sample.csproj is a "sample project"

* > darc update-dependencies --id 252455

* Revert "Update RunnerGenerator.cs"

This reverts commit b9f32f6.

* Revert "Update RunnerGenerator.cs"

This reverts commit 9f6d36d.

* Revert "Update RunnerGenerator.cs"

This reverts commit 0f43f7d.

* darc update-dependencies --id 252613

* darc update-dependencies --coherency-only

* Update Version.Details.xml

* SuppressTrimAnalysisWarnings=true for test/sample projects

* Update Controls.DeviceTests.csproj

* Revert "Update Controls.DeviceTests.csproj"

This reverts commit 5ce0390.

* Disable iOS test for now

* Update provision.yml

* Update versions

* Update versions

* Revert "Update provision.yml"

This reverts commit 33a8ee5.

* Update LabelExtensions.cs

* Update ButtonTests.iOS.cs

* Try these new aspnet versions

* Update AssemblyInfoTests.cs

* $(TrimmerSingleWarn)=false

* Update MauiBlazorWebView.DeviceTests.csproj

* $(IsTestProject) -> $(MauiTestProject)

The old name conflicts with dotnet/arcade.

* Update Core.UnitTests.csproj

* Update MacTemplateTest.cs

* Update MacTemplateTest.cs

* Revert "Update MacTemplateTest.cs"

This reverts commit 7ed2b89.

* Revert "Update MacTemplateTest.cs"

This reverts commit 882c45e.

* EnableTrimAnalyzer=false for default projects

Context: xamarin/xamarin-macios#21351

This will avoid some of the fallout of the above PR.

* $(EnableTrimAnalyzer) take 2

* Update TestUtils.DeviceTests.Sample.csproj

* Update Microsoft.Maui.Controls.Common.targets

* Update Microsoft.Maui.Controls.Common.targets

* Update SimpleTemplateTest.cs

* Update Microsoft.Maui.Controls.Common.targets

* System.Text.Json.Serialization.Converters.EnumConverterFactory warning is gone

* Potential fix for M.E.DI failure

Fixes?

    [15:12:46.2484560] 2025-01-22 15:12:46.242709-0800 RunOniOSmauiRel1586373188[97228:54445246] Received unhandled Objective-C exception that was marshalled from a managed exception: A suitable constructor for type 'Microsoft.Maui.Hosting.FontsMauiAppBuilderExtensions+FontInitializer' could not be located. Ensure the type is concrete and services are registered for all parameters of a public constructor. (System.InvalidOperationException)
[15:12:46.2484780]    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateConstructorCallSite(ResultCache, ServiceIdentifier, Type, CallSiteChain) + 0x4de
[15:12:46.2485210]    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateExact(ServiceDescriptor, ServiceIdentifier, CallSiteChain, Int32) + 0x1a5
[15:12:46.2485640]    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.TryCreateEnumerable(ServiceIdentifier, CallSiteChain) + 0x42f
[15:12:46.2485930]    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.CreateCallSite(ServiceIdentifier serviceIdentifier, CallSiteChain callSiteChain) + 0xfb
[15:12:46.2486100]    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteFactory.GetCallSite(ServiceIdentifier, CallSiteChain) + 0x92
[15:12:46.2486220]    at Microsoft.Extensions.DependencyInjection.ServiceProvider.CreateServiceAccessor(ServiceIdentifier serviceIdentifier) + 0x68
[15:12:46.2486330]    at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey, Func`2) + 0xdc
[15:12:46.2486790]    at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier, ServiceProviderEngineScope) + 0x39
[15:12:46.2486900]    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider, Type) + 0x3d
[15:12:46.2487000]    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider) + 0x2f
[15:12:46.2487100]    at Microsoft.Maui.MauiContextExtensions.InitializeAppServices(MauiApp) + 0x1b
[15:12:46.2487190]    at Microsoft.Maui.Hosting.MauiAppBuilder.Build() + 0x67
[15:12:46.2487420]    at Microsoft.Maui.MauiUIApplicationDelegate.WillFinishLaunching(UIApplication application, NSDictionary launchOptions) + 0x44
[15:12:46.2487530]    at RunOniOSmauiRel1586373188!<BaseAddress>+0xe200a

* Revert "Potential fix for M.E.DI failure"

This reverts commit 802e4c1.

* Update versions with CoherentParentDependency

* Update versions with coherent Microsoft.JSInterop

* Use strongly-typed Transient() for M.E.DI

* MauiVersionCurrent / MauiVersionPrevious

* Update FontsMauiAppBuilderExtensions.cs

* Revert "Update FontsMauiAppBuilderExtensions.cs"

This reverts commit 6b8e48a.

* Revert "Use strongly-typed Transient() for M.E.DI"

This reverts commit b0e0e45.

* Comment a few NativeAOT tests

---------

Co-authored-by: Rui Marinho <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved API was approved in API review, it can be implemented Area-Compilers blocking API needs to reviewed with priority to unblock work Concept-API This issue involves adding, removing, clarification, or modification of an API. Feature - Interceptors
Projects
None yet
Development

No branches or pull requests

5 participants