Skip to content

Fix linker incrementalism #18234

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 2 commits into from
Jan 10, 2020
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
<Target
Name="_BlazorCopyFilesToOutputDirectory"
DependsOnTargets="PrepareBlazorOutputs"
Inputs="@(BlazorOutputWithTargetPath)"
Outputs="@(BlazorOutputWithTargetPath->'$(TargetDir)%(TargetOutputPath)')"
AfterTargets="CopyFilesToOutputDirectory"
Condition="'$(OutputType.ToLowerInvariant())'=='exe'">

Expand Down Expand Up @@ -257,6 +255,8 @@
<Output TaskParameter="Dependencies" ItemName="_BlazorResolvedRuntimeDependencies" />
</ResolveBlazorRuntimeDependencies>

<WriteLinesToFile File="$(_BlazorApplicationAssembliesCacheFile)" Lines="@(_BlazorResolvedRuntimeDependencies)" Overwrite="true" />
Copy link
Member Author

@SteveSandersonMS SteveSandersonMS Jan 9, 2020

Choose a reason for hiding this comment

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

@pranavkm This is an entirely separate issue I noticed while looking at this. Previously, we never wrote the unlinked.output file to disk, which I guess is an unintentional omission, since some other code does try to read that file. Adding this line means we do write it to disk.

However, it's unclear to me that this achieves anything. The "input" items for _ResolveBlazorRuntimeDependencies include @(IntermediateAssembly), which is treated as changed on every build, even if you didn't modify your sources. As such, _ResolveBlazorRuntimeDependencies is never skipped, and hence we regenerate unlinked.output and @(_BlazorResolvedRuntimeDependencies) on every build.

So, what's the intention for unlinked.output? If we know the info will be recreated on every build, does that make it pointless to write it to disk?

Copy link
Contributor

Choose a reason for hiding this comment

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

include @(IntermediateAssembly), which is treated as changed on every build, even if you didn't modify your sources.

That seems really suspect. I'll have a look at it, but the rest of the change here looks great.


<ItemGroup>
<FileWrites Include="$(_BlazorApplicationAssembliesCacheFile)" />
</ItemGroup>
Expand Down