Skip to content

Commit

Permalink
Build fixes
Browse files Browse the repository at this point in the history
* Update local copy of ExperimentalAttribute per dotnet/runtime#85444

* Deprecate this repo's option validator code gen in favor of the runtime'src

- This removes traces of the option code generator in this repo, now
that the code has moved to dotnet/runtime. Unfortunately, the generator
in dotnet/runtime has currently dropped the use of the 'file' visibility
accessor in generated code, which leads to some conflicting type
definitions in this code base due to the use of IntervalsVisibleTo.
This surfaces as build warnings which are safe to ignore, since the
C# compiler ends up binding to the right thing. Fixing these warnings
will require a new drop of the runtime's generator.

* Suppress CS0436
  • Loading branch information
RussKie committed Jun 28, 2023
1 parent a4c8766 commit 5334717
Show file tree
Hide file tree
Showing 205 changed files with 176 additions and 6,239 deletions.
20 changes: 16 additions & 4 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@
<!-- This is false for local development, but set to true in the CI system -->
<TreatWarningsAsErrors Condition=" '$(TreatWarningsAsErrors)' == '' ">false</TreatWarningsAsErrors>

<!-- TODO: to be reenabled and all warnings fixed (https://github.com/dotnet/r9/issues/177) -->
<!--
TODO: to be resolved (https://github.com/dotnet/extensions/issues/4128)
warning CS0436: (NETCORE_ENGINEERING_TELEMETRY=Build) The type '__Attributes' in
'Microsoft.Extensions.Options.SourceGeneration/Microsoft.Extensions.Options.Generators.Generator/Validators.g.cs' conflicts with the imported type
'__Attributes' in 'Microsoft.Extensions.Telemetry, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Using the type defined in 'Microsoft.Extensions.Options.SourceGeneration/Microsoft.Extensions.Options.Generators.Generator/Validators.g.cs'.
-->
<NoWarn>$(NoWarn);CS0436</NoWarn>

<!-- TODO: to be re-enabled and all warnings fixed (https://github.com/dotnet/extensions/issues/4002) -->
<NoWarn>$(NoWarn);IL2026;IL2087;IL2067;IL2075;IL2091;IL2072;IL2090;CA1825;IL2070;IL2098;IL2057</NoWarn>

<!-- Prevent analyzer crashes from stopping things -->
Expand All @@ -35,14 +45,14 @@
<NoWarn Condition="'$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'net472' or '$(TargetFramework)' == 'netstandard2.0'">$(NoWarn);CA1062</NoWarn>
</PropertyGroup>

<!-- .NET 8 specific configurations (https://github.com/dotnet/r9/issues/177) -->
<!-- .NET 8 specific configurations (https://github.com/dotnet/extensions/issues/4126) -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<!-- Ignore ASP0019: Use IHeaderDictionary.Append or the indexer to append or set headers. IDictionary.Add will throw an ArgumentException when attempting to add a duplicate key -->
<NoWarn>$(NoWarn);ASP0019</NoWarn>
</PropertyGroup>

<PropertyGroup>
<!-- Ignore RS1024: Compare symbols correctly (https://github.com/dotnet/r9/issues/177) -->
<!-- Ignore RS1024: Compare symbols correctly (https://github.com/dotnet/extensions/issues/4127) -->
<NoWarn>$(NoWarn);RS1024</NoWarn>
</PropertyGroup>

Expand All @@ -66,7 +76,9 @@
</Target>

<ItemGroup Condition="'$(Stage)' == 'dev' AND '$(OutputType)' != 'Exe' AND '$(Api)' != 'false'">
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExperimentalAttribute" />
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExperimentalAttribute">
<_Parameter1>TBD</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<Target Name="AddInternalsVisibleToDynamicProxyGenAssembly2" BeforeTargets="BeforeCompile">
Expand Down
4 changes: 0 additions & 4 deletions eng/MSBuild/Generators.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\src\Generators\Microsoft.Gen.EnumStrings\Roslyn4.0\Microsoft.Gen.EnumStrings.Roslyn4.0.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Private="false" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
</ItemGroup>

<ItemGroup Condition="'$(UseOptionsValidationGenerator)' == 'true' and '$(BuildingSlnForDocs)' != 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\src\Generators\Microsoft.Gen.OptionsValidation\Roslyn4.0\Microsoft.Gen.OptionsValidation.Roslyn4.0.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Private="false" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
</ItemGroup>

<ItemGroup Condition="'$(UseMeteringGenerator)' == 'true' and '$(BuildingSlnForDocs)' != 'true'">
<ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\src\Generators\Microsoft.Gen.Metering\Roslyn4.0\Microsoft.Gen.Metering.Roslyn4.0.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" Private="false" IncludeAssets="runtime; build; native; contentfiles; analyzers; buildtransitive" />
</ItemGroup>
Expand Down

This file was deleted.

Loading

0 comments on commit 5334717

Please sign in to comment.