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 AoT support to NETCore.Setup #3174

Draft
wants to merge 1 commit into
base: main-staging
Choose a base branch
from

Conversation

martincostello
Copy link
Contributor

Description

Update AWSSDK.Extensions.NETCore.Setup to support native AoT.

Motivation and Context

Fix AoT warnings in the AWSSDK.Extensions.NETCore.Setup assembly by adding new overloads that accept a type parameter.

I was testing an internal application using Amazon.AspNetCore.DataProtection.SSM with native AoT to see what compatibility warnings there were, and the transient dependency on AWSSDK.Extensions.NETCore.Setup flagged warnings due to the lack of AoT support.

These changes fix the AoT warnings in the assembly, but the approach may not be what the maintainers would prefer, so this is just a draft for now to solicit feedback on the approach.

If the changes are eventually merged and released, I can do a follow-up PR to Amazon.AspNetCore.DataProtection.SSM to consume the updated package version and make any code changes needed.

Based on the initial commit in this PR, that would changing this line of code:

- builder.Services.TryAddAWSService<IAmazonSimpleSystemsManagement>();
+ builder.Services.TryAddAWSService<IAmazonSimpleSystemsManagement, AmazonSimpleSystemsManagementClient, AmazonSimpleSystemsManagementConfig>();

Testing

New unit tests added. Further tests can be added once/if the changes are otherwise acceptable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

Fix AoT warnings in the AWSSDK.Extensions.NETCore.Setup assembly by adding new overloads that accept a type parameter.
@dscpinheiro dscpinheiro changed the base branch from main to main-staging February 6, 2024 12:15
@normj normj self-requested a review February 6, 2024 19:00
@normj
Copy link
Member

normj commented Feb 7, 2024

@martincostello I have a near prototype that I have been working on for NETCore.Setup that uses the recent .NET feature static interface methods. Basically I updated the generated to have a static factory method on the service client interfaces used for creating the default implementation. I haven't fully proven the idea out yet but I want to see if I can get that all working first before having to add overloads. I'll tag you when I put out that PR.

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.

None yet

2 participants