Skip to content

Conversation

@KevinRansom
Copy link
Contributor

@KevinRansom KevinRansom commented May 2, 2023

Fix for #15167

Shows up in virtually all static link scenarios.

When static linking assemblies targetting net472 or netstandard2.0, or net5 and below I suppose. StaticLinking will try to copy the:

  • "System.Runtime.CompilerServices.IsReadOnlyAttribute"
  • "System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute"
  • "System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes"

to the built library, obviously this will cause duplicates in the built library which causes a compile error. This change will stop them being copied more than once to the output directory. This is limited to the known set of embeddable attributes, if additional attributes become embeddable in the future the known set list needs to be updated.

As part of this PR we also update the AOT tests to include static linking scenarios:
And wire up static linking a bit better in the componenttests framework as well as add a static linking test to the component tests.

@KevinRansom KevinRansom requested a review from a team as a code owner May 2, 2023 03:34
@KevinRansom KevinRansom force-pushed the aotforstaticlinkedfsharpcore branch 5 times, most recently from 7e5bc19 to bd39e29 Compare May 5, 2023 19:53
@KevinRansom KevinRansom force-pushed the aotforstaticlinkedfsharpcore branch from 971d337 to 6f1a703 Compare May 8, 2023 03:41
@KevinRansom KevinRansom changed the title Aot for static linked fsharpcore test and fix Aot for static linked fsharpcore test and fix duplicated embedded types issue. May 9, 2023
@KevinRansom KevinRansom force-pushed the aotforstaticlinkedfsharpcore branch from ea5f0d3 to 85b5f33 Compare May 13, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants