Skip to content

Commit

Permalink
Revert ILLink's usage of dependency analysis framework (#104267)
Browse files Browse the repository at this point in the history
See
#103987 (comment)
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. #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 #103987 (but we
need a better long-term fix for
#104266).
  • Loading branch information
sbomer authored Jul 2, 2024
1 parent 7a9f84e commit c5f2d4f
Show file tree
Hide file tree
Showing 19 changed files with 257 additions and 353 deletions.
4 changes: 1 addition & 3 deletions eng/liveILLink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@

<ItemGroup Condition="'$(_RequiresLiveILLink)' == 'true'">
<!-- The assembly shouldn't be referenced, nor promoted to a package dependency, nor copied to the output directory. -->
<!-- ILLink.Tasks is architecture independent, so TargetArch and TargetOS should not be specified -->
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj"
ReferenceOutputAssembly="false"
PrivateAssets="all"
Private="false"
SetConfiguration="Configuration=$(ToolsConfiguration)"
GlobalPropertiesToRemove="TargetArchitecture;TargetOS" >
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>
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<InferPlatformFromTargetArchitecture Condition="'$(InferPlatformFromTargetArchitecture)' == ''">true</InferPlatformFromTargetArchitecture>
<InferPlatformFromTargetArchitecture>true</InferPlatformFromTargetArchitecture>

<!-- TODO: Clean-up casing and remove __BuildType to remove this block. -->
<Configuration Condition="'$(Configuration)' == ''">$(__BuildType)</Configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<Project>
<PropertyGroup>
<PlatformName>AnyCPU</PlatformName>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Library</OutputType>
<RootNamespace>ILCompiler.DependencyAnalysisFramework</RootNamespace>
Expand All @@ -12,10 +8,6 @@
<Platforms>x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<!-- Workaround for circular dependency (this => trim analyzers in illink.Tasks => Mono.Linker => this)-->
<_RequiresLiveILLink>false</_RequiresLiveILLink>
<!-- Mono.Linker requires the assembly to be signed -->
<SignAssembly>true</SignAssembly>

<!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
the same bits tests expect to see in artifacts/crossgen2. That way we never need to wonder which
Expand Down Expand Up @@ -58,5 +50,4 @@
<Link>Sorting\MergeSortCore.cs</Link>
</Compile>
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>

This file was deleted.

71 changes: 0 additions & 71 deletions src/tools/illink/src/linker/Linker.Steps/MarkStep.NodeFactory.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit c5f2d4f

Please sign in to comment.