Skip to content

Commit

Permalink
Trigger a rebuild if ILC command line changes
Browse files Browse the repository at this point in the history
Incremental build wouldn't consider things like `OptimizationPreference` property changing as a thing that should trigger a rebuild. I feel like this is more a MSBuild bug, but it has been like this for a long time.

Turns out we can use `WriteIlcRspFileForCompilation` target as a sentinel:

* Run the target always. We only actually write out the file if it's different (`WriteOnlyWhenDifferent` is already set to `true`).
* ILC execution already specifies the RSP as one of its inputs. So if the RSP is more recent than the output, it will trigger a build.

Fixes #88725.
  • Loading branch information
MichalStrehovsky authored Aug 3, 2023
1 parent 22841c5 commit 7df2e2f
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ The .NET Foundation licenses this file to you under the MIT license.
</Target>

<Target Name="WriteIlcRspFileForCompilation"
Inputs="@(IlcCompileInput);@(RdXmlFile);@(TrimmerRootDescriptor)"
Outputs="%(ManagedBinary.IlcRspFile)"
DependsOnTargets="$(IlcCompileDependsOn)">

Expand Down

0 comments on commit 7df2e2f

Please sign in to comment.