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 granular suppressions for linker warnings #40691

Merged
merged 28 commits into from
Sep 30, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bb55be6
Add granular suppressions for linker warnings
layomia Aug 10, 2020
9674406
Add suppressions for mono SPC
layomia Sep 24, 2020
9de885f
Misc additions
layomia Sep 24, 2020
abf24a8
Add suppressions for Debug config
layomia Sep 25, 2020
a26a72b
Fix Android xml file
layomia Sep 25, 2020
7a69826
Include System.ComponentModel.Annotations suppressions
layomia Sep 25, 2020
49b9485
Add suppressions for System.Security.Cryptography.X509Certificates on…
layomia Sep 25, 2020
f8fc0cb
Fix TargetOs exists check
layomia Sep 25, 2020
d33e645
Add IL2077 to System.Security.Cryptography.X509Certificates on Android
layomia Sep 25, 2020
db012bb
Generalize some System.Security.Cryptography.X509Certificates suppres…
layomia Sep 25, 2020
acc860d
Remove ref to catch-all System.Security.Cryptography.X509Certificates…
layomia Sep 25, 2020
38dbe28
Misc clean up and some feedback
layomia Sep 25, 2020
9566ce3
Use ILLinkDirectory in CreateRuntimeRootILLinkDescriptorFile.targets
layomia Sep 25, 2020
d2bb2b5
Update paths for directories
layomia Sep 25, 2020
9bc6f38
Set TargetPath as part of include
layomia Sep 25, 2020
5e86757
Delete bin-placing TODO
layomia Sep 26, 2020
5867e57
Include more xml files during per-library run
layomia Sep 26, 2020
204334b
Include more xml files during per-library run, pt 2
layomia Sep 26, 2020
8af057a
Include more xml files during per-library run, pt 3
layomia Sep 26, 2020
b153fc9
Try including System.ComponentModel.Annotations based on BuildingNETC…
layomia Sep 26, 2020
77d5d10
Switch to BuildAllConfigurations
layomia Sep 26, 2020
317d5e1
Include xml extension in file paths
layomia Sep 26, 2020
1c95697
Remove version number from assembly suppression files
layomia Sep 26, 2020
c0bbd56
Delete ILLink.Suppressions.xml
layomia Sep 26, 2020
3e87870
Try removing IL2035 nowarn
layomia Sep 29, 2020
eede3bb
Address review feedback
layomia Sep 29, 2020
c50d377
Remove version from Microsoft.VisualBasic.Core assemly name
layomia Sep 29, 2020
fc28394
Address feedback
layomia Sep 30, 2020
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
44 changes: 39 additions & 5 deletions eng/illink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<!-- Inputs and outputs of ILLinkTrimAssembly -->
<PropertyGroup>
<ILLinkDirectory Condition="'$(ILLinkDirectory)' == ''">$(MSBuildProjectDirectory)\ILLink\</ILLinkDirectory>
layomia marked this conversation as resolved.
Show resolved Hide resolved
<ILLinkTasksDir>$([MSBuild]::NormalizeDirectory('$(PkgMicrosoft_NET_ILLink_Tasks)', 'tools'))</ILLinkTasksDir>
<ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(ILLinkTasksDir)net5.0/ILLink.Tasks.dll</ILLinkTasksPath>
<ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' != 'core'">$(ILLinkTasksDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
Expand All @@ -35,14 +36,19 @@
<ILLinkTrimInputSymbols>$(ILLinkTrimInputPath)$(TargetName).pdb</ILLinkTrimInputSymbols>
<ILLinkTrimOutputPath>$(IntermediateOutputPath)</ILLinkTrimOutputPath>

<ILLinkTrimXml Condition="'$(ILLinkTrimXml)' == '' and Exists('$(MSBuildProjectDirectory)/ILLinkTrim.xml')">$(MSBuildProjectDirectory)/ILLinkTrim.xml</ILLinkTrimXml>
<ILLinkTrimXml Condition="'$(ILLinkTrimXml)' == '' and Exists('$(ILLinkDirectory)ILLinkTrim.xml')">$(ILLinkDirectory)ILLinkTrim.xml</ILLinkTrimXml>
<!-- ILLinkTrim_LibraryBuild.xml files are only used during building the library, not an app. They shouldn't be embedded into the assembly. -->
<ILLinkTrimXmlLibraryBuild Condition="'$(ILLinkTrimXmlLibraryBuild)' == '' and Exists('$(MSBuildProjectDirectory)/ILLinkTrim_LibraryBuild.xml')">$(MSBuildProjectDirectory)/ILLinkTrim_LibraryBuild.xml</ILLinkTrimXmlLibraryBuild>
<ILLinkTrimXmlLibraryBuild Condition="'$(ILLinkTrimXmlLibraryBuild)' == '' and Exists('$(ILLinkDirectory)ILLinkTrim_LibraryBuild.xml')">$(ILLinkDirectory)ILLinkTrim_LibraryBuild.xml</ILLinkTrimXmlLibraryBuild>
<ILLinkDescriptorsXmlIntermediatePath>$(IntermediateOutputPath)ILLink.Descriptors.xml</ILLinkDescriptorsXmlIntermediatePath>

<ILLinkSubstitutionsXmlIntermediatePath>$(IntermediateOutputPath)ILLink.Substitutions.xml</ILLinkSubstitutionsXmlIntermediatePath>
<ILLinkLinkAttributesXmlIntermediatePath>$(IntermediateOutputPath)ILLink.LinkAttributes.xml</ILLinkLinkAttributesXmlIntermediatePath>

<ILLinkSuppressionsXmlFile>$(ILLinkDirectory)ILLink.Suppressions</ILLinkSuppressionsXmlFile>
layomia marked this conversation as resolved.
Show resolved Hide resolved
<ILLinkSuppressionsConfigurationSpecificXmlFile>$(ILLinkSuppressionsXmlFile).$(Configuration)</ILLinkSuppressionsConfigurationSpecificXmlFile>
<ILLinkSuppressionsTargetArchitectureSpecificXmlFile>$(ILLinkSuppressionsXmlFile).$(TargetArchitecture)</ILLinkSuppressionsTargetArchitectureSpecificXmlFile>
<ILLinkSuppressionsNonWindowsXmlFile>$(ILLinkSuppressionsXmlFile).NonWindows</ILLinkSuppressionsNonWindowsXmlFile>

<!-- if building a PDB, tell illink to rewrite the symbols file -->
<ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' and '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
</PropertyGroup>
Expand All @@ -57,19 +63,47 @@
-->
<ItemGroup Condition="'$(BinPlaceILLinkTrimAssembly)' == 'true'">
<BinPlaceTargetFramework Include="$(BuildSettings)">
<RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/trimmed</RuntimePath>
<RuntimePath>$(ILLinkTrimAssemblyArtifactsRootDir)trimmed</RuntimePath>
<ItemName>TrimmedItem</ItemName>
</BinPlaceTargetFramework>
<BinPlaceTargetFramework Include="$(BuildSettings)">
<RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/reports</RuntimePath>
<RuntimePath>$(ILLinkTrimAssemblyArtifactsRootDir)reports</RuntimePath>
<ItemName>TrimmingReport</ItemName>
</BinPlaceTargetFramework>
<BinPlaceTargetFramework Include="$(BuildSettings)">
<RuntimePath>$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/pretrimmed</RuntimePath>
<RuntimePath>$(ILLinkTrimAssemblyArtifactsRootDir)pretrimmed</RuntimePath>
<ItemName>PreTrimmedItem</ItemName>
</BinPlaceTargetFramework>
</ItemGroup>

<PropertyGroup>
<ILLinkTrimAssemblyArtifactsRootDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'ILLinkTrimAssembly', '$(BuildSettings)'))</ILLinkTrimAssemblyArtifactsRootDir>
layomia marked this conversation as resolved.
Show resolved Hide resolved
<ILLinkTrimAssemblySuppressionsXmlsDir>$(ILLinkTrimAssemblyArtifactsRootDir)suppressions-xmls\</ILLinkTrimAssemblySuppressionsXmlsDir>
</PropertyGroup>

<ItemGroup>
<BinPlaceTargetFrameworks Include="$(NetCoreAppCurrent)">
<RuntimePath>$(ILLinkTrimAssemblySuppressionsXmlsDir)</RuntimePath>
<ItemName>ILLinkSuppressionsXmls</ItemName>
</BinPlaceTargetFrameworks>
<BinPlaceTargetFrameworks Include="$(NetCoreAppCurrent)-$(TargetOS)">
layomia marked this conversation as resolved.
Show resolved Hide resolved
<RuntimePath>$(ILLinkTrimAssemblySuppressionsXmlsDir)</RuntimePath>
<ItemName>ILLinkSuppressionsXmls</ItemName>
</BinPlaceTargetFrameworks>
</ItemGroup>

<ItemGroup>
<ILLinkSuppressionsXmls Condition="Exists('$(ILLinkSuppressionsXmlFile).xml')"
Include="$(ILLinkSuppressionsXmlFile).xml" />
<ILLinkSuppressionsXmls Condition="Exists('$(ILLinkSuppressionsConfigurationSpecificXmlFile).xml')"
Include="$(ILLinkSuppressionsConfigurationSpecificXmlFile).xml" />
<ILLinkSuppressionsXmls Condition="Exists('$(ILLinkSuppressionsTargetArchitectureSpecificXmlFile).xml')"
Include="$(ILLinkSuppressionsTargetArchitectureSpecificXmlFile).xml" />
<ILLinkSuppressionsXmls Condition="'$(TargetOs)' != 'Windows_NT' and Exists('$(ILLinkSuppressionsNonWindowsXmlFile).xml')"
Include="$(ILLinkSuppressionsNonWindowsXmlFile).xml" />
<ILLinkSuppressionsXmls Update="@(ILLinkSuppressionsXmls)" TargetPath="%(FileName).$(AssemblyName).xml" />
layomia marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<Target Name="_EmbedILLinkXmls"
DependsOnTargets="_CombineILLinkDescriptorsXmls;_CombineILLinkSubstitutionsXmls;_CombineILLinkLinkAttributesXmls">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</PropertyGroup>

<ItemGroup>
<_ILLinkDescriptorsFilePaths Include="$(MSBuildThisFileDirectory)ILLinkTrim.xml" />
<_ILLinkDescriptorsFilePaths Include="$(ILLinkDirectory)ILLinkTrim.xml" />
<_ILLinkDescriptorsFilePaths Include="$(CoreLibSharedDir)ILLink\ILLink.Descriptors.Shared.xml" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<ILLinkTrimAssembly>true</ILLinkTrimAssembly>
<ILLinkTrimXml>$(IntermediateOutputPath)System.Private.CoreLib.xml</ILLinkTrimXml>
<ILLinkDirectory>$(MSBuildThisFileDirectory)src\ILLink\</ILLinkDirectory>
</PropertyGroup>

<!-- Note that various places in SPCL depend on this resource name i.e. TplEventSource -->
Expand Down
143 changes: 143 additions & 0 deletions src/libraries/Microsoft.CSharp/src/ILLink/ILLink.Suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<linker>
<assembly fullname="Microsoft.CSharp, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
layomia marked this conversation as resolved.
Show resolved Hide resolved
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2026</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.DynamicMetaObjectProviderDebugView.#cctor</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2055</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.VariantArray.GetStructType(System.Int32)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2055</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.AggregateType.CalculateAssociatedSystemType</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2060</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprMethodInfo.get_MethodInfo</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2070</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.RuntimeBinderExtensions.GetTypeIndexerName(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2070</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.AddAggregateToSymbolTable(Microsoft.CSharp.RuntimeBinder.Semantics.NamespaceOrAggregateSymbol,System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2070</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.AddConversionsForOneType(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2072</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.ComTypeClassDesc.CreateInstance</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2072</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprFactory.CreateZeroInit(Microsoft.CSharp.RuntimeBinder.Semantics.CType)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2072</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprZeroInit.get_Object</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.ComBinderHelpers.ProcessArgumentsForCom(System.Dynamic.DynamicMetaObject[]@)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.ExcepInfo.GetException</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.IDispatchComObject.GetMembers(System.Collections.Generic.IEnumerable{System.String})</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ComInterop.TypeUtils.GetUserDefinedCoercionMethod(System.Type,System.Type,System.Boolean)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.DynamicMetaObjectProviderDebugView.CreateDelegateAndInvoke(System.Type[],System.Runtime.CompilerServices.CallSiteBinder,System.Object[])</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.ExpressionTreeCallRewriter.GenerateField(Microsoft.CSharp.RuntimeBinder.Semantics.ExprCall)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprMethodInfo.get_ConstructorInfo</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprMethodInfo.get_MethodInfo</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.Semantics.ExprPropertyInfo.get_PropertyInfo</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.AddPredefinedMethodToSymbolTable(Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol,Microsoft.CSharp.RuntimeBinder.Syntax.Name)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.AddPredefinedPropertyToSymbolTable(Microsoft.CSharp.RuntimeBinder.Semantics.AggregateSymbol,Microsoft.CSharp.RuntimeBinder.Syntax.Name)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.BuildDeclarationChain(System.Type)</property>
</attribute>
<attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute">
<argument>ILLink</argument>
<argument>IL2080</argument>
<property name="Scope">member</property>
<property name="Target">M:Microsoft.CSharp.RuntimeBinder.SymbolTable.AddNamesInInheritanceHierarchy(System.String,System.Collections.Generic.List{System.Type})</property>
</attribute>
</assembly>
</linker>
Loading