Skip to content

Move System.Net.Http ILLink suppressions to LibraryBuild. #50053

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

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions eng/illink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<ILLinkSuppressionsXmlFilePrefix>$(ILLinkDirectory)ILLink.Suppressions</ILLinkSuppressionsXmlFilePrefix>
<ILLinkSuppressionsXmlFile>$(ILLinkSuppressionsXmlFilePrefix).xml</ILLinkSuppressionsXmlFile>
<ILLinkSuppressionsConfigurationSpecificXmlFile>$(ILLinkSuppressionsXmlFilePrefix).$(Configuration).xml</ILLinkSuppressionsConfigurationSpecificXmlFile>
<ILLinkSuppressionsLibraryBuildXmlFile>$(ILLinkSuppressionsXmlFilePrefix).LibraryBuild.xml</ILLinkSuppressionsLibraryBuildXmlFile>

<!-- if building a PDB, tell illink to rewrite the symbols file -->
<ILLinkRewritePDBs Condition="'$(ILLinkRewritePDBs)' == '' and '$(DebugSymbols)' != 'false'">true</ILLinkRewritePDBs>
Expand Down Expand Up @@ -73,6 +74,8 @@
Include="$(ILLinkSuppressionsXmlFile)" />
<ILLinkSuppressionsXmls Condition="Exists('$(ILLinkSuppressionsConfigurationSpecificXmlFile)')"
Include="$(ILLinkSuppressionsConfigurationSpecificXmlFile)" />
<ILLinkSuppressionsXmls Condition="Exists('$(ILLinkSuppressionsLibraryBuildXmlFile)')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this collide with libraries which already define a LibraryBuild.xml?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean. No other libraries already define a LibraryBuild.xml. Just CoreLib, but all CoreLib ILLink files are handled specially because it doesn't get binplaced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I meant:

C:\Users\joperezr\git\runtime>dir /s /b *LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\coreclr\System.Private.CoreLib\src\ILLink\ILLink.Suppressions.LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.ComponentModel.TypeConverter\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Diagnostics.StackTrace\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Private.CoreLib\src\ILLink\ILLink.Suppressions.LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Private.CoreLib\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Private.Xml\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Private.Xml.Linq\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Security.Claims\src\ILLink\ILLinkTrim_LibraryBuild.xml
C:\Users\joperezr\git\runtime\src\libraries\System.Security.Principal.Windows\src\ILLink\ILLinkTrim_LibraryBuild.xml

So corelib is one, but I found others that had a LibraryBuild as well. That said, seems like I was getting confused as those doesn't seem to be suppressions, but instead just the old Linker files that would just preserve types/members.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ILLink.Suppressions.LibraryBuild.xml is not the same as ILLinkTrim_LibraryBuild.xml. The Suppressions file suppresses ILLink warnings. The ILLinkTrim files tell the linker what to preserve unconditionally. The LibraryBuild part of each means the same thing though - "this file is only used during the build of the library, not in the user's application".

I've been meaning to rename the old name ILLinkTrim.xml to ILLink.Descriptors.xml (and subsequently the _LibraryBuild.xml files.) See #37651. This confusion gives me enough reasoning to do it now, I've been putting it off since 5.0.

Include="$(ILLinkSuppressionsLibraryBuildXmlFile)" />
<ILLinkSuppressionsXmls Update="@(ILLinkSuppressionsXmls)" TargetPath="%(FileName).$(AssemblyName).xml" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<argument>IL2075</argument>
<property name="Scope">member</property>
<property name="Target">M:System.Net.Http.HttpClient.CreateDefaultHandler()</property>
<property name="Justification">The Xamarin.iOS and Mono.Android libraries are not present when running the trimmer analysis during our build. A consuming application will get a warning if these libraries aren't present when trimming the full app.</property>
</attribute>
</assembly>
</linker>