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

InternalSDKUtils trim warning #3497

Closed
1 task
tmitchel2 opened this issue Oct 1, 2024 · 2 comments
Closed
1 task

InternalSDKUtils trim warning #3497

tmitchel2 opened this issue Oct 1, 2024 · 2 comments
Labels
bug This issue is a bug. module/sdk-core p1 This is a high priority issue queued

Comments

@tmitchel2
Copy link

Describe the bug

Usage of AWSSDK.Core 3.7.400.22 with native aot causes the following trimmer warning.

ILC : Trim analysis warning IL2075: Amazon.Util.Internal.InternalSDKUtils.ApplyValues(Object,IDictionary`2<String,Object>): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicProperties' in call to 'System.Type.GetProperty(String)'. The return value of method 'System.Object.GetType()' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

No trim warnings.

Current Behavior

Trim warnings raised.

Reproduction Steps

Reference AWSSDK.Core and try to publish with PublishAot true... Various parts of my csproj are below.

  <PropertyGroup>
    <TrimmerSingleWarn>false</TrimmerSingleWarn> 
  </PropertyGroup>

  <ItemGroup> 
    <PackageReference Include="Amazon.Lambda.RuntimeSupport" Version="1.11.0" />
    <PackageReference Include="Amazon.Lambda.Core" Version="2.3.0" />
    <PackageReference Include="Amazon.Lambda.Serialization.SystemTextJson" Version="2.4.3" />
    <PackageReference Include="Amazon.Lambda.APIGatewayEvents" Version="2.7.1" />
  </ItemGroup>

  <ItemGroup>
    <!-- <TrimmerRootAssembly Include="AWSSDK.Core" /> -->
    <TrimmerRootAssembly Include="Amazon.Lambda.APIGatewayEvents" />
    <TrimmerRootAssembly Include="bootstrap" />
  </ItemGroup>

Possible Solution

No response

Additional Information/Context

Also, setting the AWSSDK.Core reference as a trimmer root assembly results in even more warnings.

AWS .NET SDK and/or Package version used

AWSSDK.Core 3.7.400.22

Targeted .NET Platform

.NET 8

Operating System and version

OSX Arm64

@tmitchel2 tmitchel2 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 1, 2024
@bhoradc bhoradc added module/sdk-core p2 This is a standard priority issue needs-review p1 This is a high priority issue queued and removed needs-triage This issue or PR still needs to be triaged. p2 This is a standard priority issue needs-review labels Oct 2, 2024
@bhoradc
Copy link

bhoradc commented Oct 4, 2024

Hi @tmitchel2,

Thank you for bringing this issue to our attention. Our team will work towards implementing a suitable fix.

Regards,
Chaitanya

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

peterrsongg added a commit that referenced this issue Oct 17, 2024
* fix #3497. Make InternalSDKUtils aot compatible in v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. module/sdk-core p1 This is a high priority issue queued
Projects
None yet
Development

No branches or pull requests

2 participants