Skip to content

Commit

Permalink
Clean up dead code in illink targets (#85741)
Browse files Browse the repository at this point in the history
Removes TFM version checks, and adds a warning when using
explicit ILLink package reference.

We reference ILLink as a packagereference that versions with the
runtime, so the 8.0 linker is only supported when targeting
`net8.0`, and we can remove the TFM checks. We don't want to
support someone adding a PackageReference to an 8.0 linker, while
targeting an older TFM, in an attempt to get newer linker bits
but with settings that were closer to what we shipped with that
TFM.

---------

Co-authored-by: Marek Safar <[email protected]>
Co-authored-by: Vitek Karas <[email protected]>
  • Loading branch information
3 people authored May 16, 2023
1 parent ddd748e commit 0cfc81d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 208 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<Target Name="GenerateILCompilerExplicitPackageReferenceWarning" Condition="'$(SuppressGenerateILCompilerExplicitPackageReferenceWarning)' == '' and '$(ILCompilerTargetsPath)' != ''"
BeforeTargets="ImportRuntimeIlcPackageTarget">
<Warning Condition="'%(PackageReference.Identity)' == 'Microsoft.DotNet.ILCompiler' And '%(PackageReference.IsImplicitlyDefined)' != 'true'"
Text="Delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file. Explicit 'Microsoft.DotNet.ILCompiler' package reference can run into version errors." />
Text="Delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file to avoid versioning problems." />
</Target>

<!-- Locate the runtime package according to the current target runtime -->
Expand Down
1 change: 0 additions & 1 deletion src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
<!-- Note: 'build/Microsoft.NET.ILLink.targets' should not match the package name, because we don't want the targets
to be imported by nuget. The SDK will import them in the right order. -->
<None Include="**\*.props;**\*.targets" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="build/6.0_suppressions.xml" Pack="true" PackagePath="build/" />
<None Include="..\ILLink.RoslynAnalyzer\Microsoft.NET.ILLink.Analyzers.props" Pack="true" PackagePath="build/" />
</ItemGroup>

Expand Down
156 changes: 0 additions & 156 deletions src/tools/illink/src/ILLink.Tasks/build/6.0_suppressions.xml

This file was deleted.

Loading

0 comments on commit 0cfc81d

Please sign in to comment.