Use current runtime version in ILLink.Tasks package (#90197)
authorSven Boemer <sbomer@gmail.com>
Thu, 10 Aug 2023 00:32:37 +0000 (17:32 -0700)
committerGitHub <noreply@github.com>
Thu, 10 Aug 2023 00:32:37 +0000 (17:32 -0700)
commitc13739b6b1332b58165d4f11a4e3d688955b57e1
tree827c9830bf055ab1fc83bc7a5ca0b1da77b81cee
parent71fbbcef0e0934e12aae951eeb657c0aa0b8c90e
Use current runtime version in ILLink.Tasks package (#90197)

The ILLink.Tasks package should have a runtimeconfig.json that
matches the runtime version bundled with the SDK that references
it. This used to be done by stomping the runtime version in the
dotnet/sdk build, but ILLink.Tasks is no longer bundled with the
SDK so we need to do this ourselves.

Tests that use live ILLink bits need to continue working with the
SDK specified in global.json, so this preserves the existing
illink.runtimeconfig.json in the build output, but defines an
additional illink.runtimeconfig.pack.json file that uses the
current runtime version. The pack.json file is included in the
package (with the name illink.runtimeconfig.json) instead of the
original.

This includes a fix for 429a5c3a2ea096758c2b9b8907a8231d4e686a46:
we weren't actually using live illink for tests due to an
ordering issue introduced in response to feedback on that change.
The Directory.Build.props is imported too early (before the nuget
props that this is trying to override), so we need to import
Microsoft.NET.ILLink.props directly from the project file.

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
eng/packaging.targets
eng/testing/linker/SupportFiles/Directory.Build.props
eng/testing/linker/project.csproj.template
src/tools/illink/src/ILLink.Tasks/ILLink.Tasks.csproj
src/tools/illink/src/linker/Mono.Linker.csproj