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

[AOT] Fix RuntimeContext warnings #4460

Closed
wants to merge 41 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
87cfa2a
initial commit
Yun-Ting May 9, 2023
bf8a530
Merge branch 'main' into yunl/runtimeContextEnum
Yun-Ting May 9, 2023
b133982
add custom type
Yun-Ting May 11, 2023
236a5f1
CI
Yun-Ting May 12, 2023
d4c38af
update
Yun-Ting May 12, 2023
bd2d709
update
Yun-Ting May 12, 2023
db04bd1
update
Yun-Ting May 12, 2023
260327b
fix sanity check
Yun-Ting May 12, 2023
6be9d0c
format
Yun-Ting May 12, 2023
5dae942
static ctor
Yun-Ting May 15, 2023
ebee07a
added support for ReflectionRuntimeContextSlotFactory
Yun-Ting May 16, 2023
299fc2a
sanity
Yun-Ting May 16, 2023
e93903f
Merge branch 'main' into yunl/runtimeContextEnum
Yun-Ting May 16, 2023
cc00b30
test CI
Yun-Ting May 16, 2023
99c8baa
Revert "test CI"
Yun-Ting May 17, 2023
a773917
CI
Yun-Ting May 17, 2023
fc32b25
update
Yun-Ting May 17, 2023
6ef81cd
Merge branch 'yunl/runtimeContextEnum' of https://github.com/Yun-Ting…
Yun-Ting May 17, 2023
23b77b5
comment
Yun-Ting May 17, 2023
6faf599
update
Yun-Ting May 17, 2023
e6b016c
ci
Yun-Ting May 17, 2023
44bb210
CI
Yun-Ting May 18, 2023
8d76270
preprossesor
Yun-Ting May 18, 2023
05bb4b6
fix build
Yun-Ting May 18, 2023
8586200
Add the trimming attributes to only OpenTelemetry.Api, and use #if to…
eerhardt May 18, 2023
452f6a6
CI
Yun-Ting May 18, 2023
649e39d
Adjust the folder path to the attributes.
eerhardt May 18, 2023
f0c7f44
CI
Yun-Ting May 18, 2023
f8714f9
Fix nullable warning in LoggerProviderSdk
eerhardt May 18, 2023
7956ab1
CI
Yun-Ting May 18, 2023
d2024a8
address comments
Yun-Ting May 19, 2023
b9c0b33
sanity check
Yun-Ting May 19, 2023
4120ffb
fix test
Yun-Ting May 19, 2023
633da1b
indentation
Yun-Ting May 19, 2023
7c1fde4
increased timeout and removed RS0026
Yun-Ting May 19, 2023
48d0b7f
RS0026
Yun-Ting May 19, 2023
19fce6a
CI
Yun-Ting May 19, 2023
35173c8
Fix ApiCompat for OpenTelemetry.Api's net6.0 target.
eerhardt May 22, 2023
21495bc
CI
Yun-Ting May 22, 2023
586511d
Merge branch 'main' into yunl/runtimeContextEnum
eerhardt May 22, 2023
9ba6626
fixed merge; scope down suppresion of RS0026
Yun-Ting May 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "test CI"
This reverts commit cc00b30.
Yun-Ting committed May 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 99c8baa1404132ca405319e083cd889498db58f0
4 changes: 2 additions & 2 deletions src/OpenTelemetry.Api/Context/RuntimeContextSlotFactory.cs
Original file line number Diff line number Diff line change
@@ -40,8 +40,8 @@ public override RuntimeContextSlot<T> Create<T>(string name)

public sealed class ThreadLocalRuntimeContextSlotFactory : RuntimeContextSlotFactory
{
public override RuntimeContextSlot<T> Create<T>(string name)
=> new ThreadLocalRuntimeContextSlot<T>(name);
public override RuntimeContextSlot<T> Create<T>(string name)
=> new ThreadLocalRuntimeContextSlot<T>(name);
}

[RequiresUnreferencedCode("ReflectionRuntimeContextSlotFactory is trimmer unsafe.")]
2 changes: 1 addition & 1 deletion src/OpenTelemetry.Api/OpenTelemetry.Api.csproj
Original file line number Diff line number Diff line change
@@ -19,6 +19,6 @@
<ItemGroup>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\RequiresDynamicCodeAttribute.cs" Link ="Includes\RequiresDynamicCodeAttribute.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\RequiresUnreferencedCodeAttribute.cs" Link="Includes\RequiresUnreferencedCodeAttribute.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs"/>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\ExceptionExtensions.cs" Link="Includes\ExceptionExtensions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\Guard.cs" Link="Includes\Guard.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry.Api\Internal\SpanAttributeConstants.cs" Link="Includes\SpanAttributeConstants.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link="Includes\UnconditionalSuppressMessageAttribute.cs"/>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link="Includes\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\PeerServiceResolver.cs" Link="Includes\PeerServiceResolver.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\ResourceSemanticConventions.cs" Link="Includes\ResourceSemanticConventions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\TagTransformer.cs" Link="Includes\TagTransformer.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs"/>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\ResourceSemanticConventions.cs" Link="Includes\ResourceSemanticConventions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\TagTransformer.cs" Link="Includes\TagTransformer.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\TagAndValueTransformer.cs" Link="Includes\TagAndValueTransformer.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs"/>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\PeerServiceResolver.cs" Link="Includes\PeerServiceResolver.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\ResourceSemanticConventions.cs" Link="Includes\ResourceSemanticConventions.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\TagTransformer.cs" Link="Includes\TagTransformer.cs" />
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs"/>
<Compile Include="$(RepoRoot)\src\OpenTelemetry\Internal\Shims\UnconditionalSuppressMessageAttribute.cs" Link ="Includes\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

<ItemGroup>
Original file line number Diff line number Diff line change
@@ -27,7 +27,12 @@ namespace System.Diagnostics.CodeAnalysis
/// code from an application.
/// </remarks>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)]
internal sealed class RequiresUnreferencedCodeAttribute : Attribute
#if SYSTEM_PRIVATE_CORELIB
public
#else
internal
#endif
sealed class RequiresUnreferencedCodeAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RequiresUnreferencedCodeAttribute"/> class
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@
// </copyright>
#nullable enable

#if !NET7_OR_GREATER
namespace System.Diagnostics.CodeAnalysis
{
/// <summary>
@@ -98,4 +97,3 @@ public UnconditionalSuppressMessageAttribute(string category, string checkId)
public string? Justification { get; set; }
}
}
#endif