1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-08 03:27:04 +09:00
Satori/eng/liveILLink.targets
Sven Boemer c5f2d4f122
Revert ILLink's usage of dependency analysis framework (#104267)
See
https://github.com/dotnet/runtime/issues/103987#issuecomment-2197798838
for context.

Custom steps rely on getting a chance to see a type before we
build the type info (and in particular the interface method
mapping), but we make no such
guarantee. https://github.com/dotnet/runtime/issues/104266 tracks
this problem.

Our use of the dependency analysis framework exacerbated this
because `MarkType` was split into two pieces, with the part that
calls into the custom step being delayed through a dependency
analysis framework node, making it more likely to be run too late
to influence the type info.

This reverts ILLink's usage of the dependency analysis framework
to bring us back to a state where the ordering still isn't
guaranteed, but works for the testcase that got regressed. We
should bring this back as soon as possible with a proper fix that
actually guarantees the ordering required by custom steps. This
doesn't look completely straightforward, but should be possible
to do with the dependency analysis framework.

Fixes https://github.com/dotnet/runtime/issues/103987 (but we
need a better long-term fix for
https://github.com/dotnet/runtime/issues/104266).
2024-07-02 12:19:17 -07:00

51 lines
3 KiB
XML

<Project>
<!-- NOTE: these targets should be a no-op, unless _RequiresLiveILLink, computed below, is true. -->
<PropertyGroup>
<!-- Keep these conditions in sync with _RequiresILLinkPack in
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets -->
<_RequiresLiveILLink Condition="'$(_RequiresLiveILLink)' == '' And (
'$(PublishAot)' == 'true' Or
'$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or
'$(PublishTrimmed)' == 'true' Or
'$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or
'$(EnableSingleFileAnalyzer)' == 'true')">true</_RequiresLiveILLink>
</PropertyGroup>
<PropertyGroup Condition="'$(_RequiresLiveILLink)' == 'true'">
<_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\</_ILLinkTasksSourceDir>
<ILLinkAnalyzersPropsPath>$(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath>
</PropertyGroup>
<Import Project="$(_ILLinkTasksSourceDir)build\Microsoft.NET.ILLink.Tasks.props" Condition="'$(_RequiresLiveILLink)' == 'true'" />
<PropertyGroup Condition="'$(_RequiresLiveILLink)' == 'true'">
<!-- Don't use SDK's trimming functionality. -->
<_RequiresILLinkPack>false</_RequiresILLinkPack>
<!-- Keep in sync with SetTargetFramework metadata on the ProjectReference below. -->
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll</ILLinkTasksAssembly>
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(ToolsILLinkDir)$(NetFrameworkToolCurrent)\ILLink.Tasks.dll</ILLinkTasksAssembly>
</PropertyGroup>
<ItemGroup Condition="'$(_RequiresLiveILLink)' == 'true'">
<!-- The assembly shouldn't be referenced, nor promoted to a package dependency, nor copied to the output directory. -->
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all"
Private="false"
SetConfiguration="Configuration=$(ToolsConfiguration)">
<!-- Keep TFMs in sync with ILLink.Tasks.csproj -->
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(NetCoreAppToolCurrent)</SetTargetFramework>
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">TargetFramework=$(NetFrameworkToolCurrent)</SetTargetFramework>
</ProjectReference>
<!-- Need to reference the analyzer project separately, because there's no easy way to get it as a transitive reference of ILLink.Tasks.csproj -->
<ProjectReference Include="$(_ILLinkTasksSourceDir)..\ILLink.RoslynAnalyzer\ILLink.RoslynAnalyzer.csproj"
ReferenceOutputAssembly="false"
Private="false"
OutputItemType="Analyzer"
SetConfiguration="Configuration=$(ToolsConfiguration)" />
</ItemGroup>
</Project>