You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a target is skipped due to a condition during the project's build, and
Other projects depend on this target (commonly an initial target)
This situation can cause delays in the build process for dependent projects.
Symptoms
Significant variance in build times between builds.
MSBuild tasks show inconsistent performance between builds.
When switching to graph build mode, MSBuild tasks take considerably longer to resolve than expected (they should normally resolve almost immediately).
Technical details
When the initial target of a project (or another target necessary for a dependent project's build) is skipped due to a condition:
-The ResultsCache does not resolve this target in the main node when the build results are requested by a dependent project.
-Instead, the project is rescheduled to build the skipped target again. It waits in the queue for a build node, and if the condition still evaluates to false, the node resolves the target immediately with the same "skipped" result.
-If the build node is occupied, this can lead to delays in the overall build process.
For more details, refer to #11637.
Fix
To address this issue:
Check for conditional targets on which dependent projects rely (e.g., conditional initial targets).
If such targets are found, consider:
Removing the condition, or
Removing the dependency link from this target.
The text was updated successfully, but these errors were encountered:
We have had a fix idea: by default accept "skipped" as a valid result for the target and let skipped targets not to cause ResultsCache miss.
It seems like current behavior on conditional targets would not allow us to make this change. See this test. The condition outside of the target is evaluated during evaluations, conditions inside of the target - on runtime, but conditions on the target itself are computed also during the run. So, there could be situation when the skipped target gets executed again and the condition could be evaluated differently: documentation link. Whoever relies on this behavior might be broken if the target would be resolved from the results cache as skipped.
AR-May
changed the title
Conditionally skipped initial target results in ResultsCache miss.
Conditionally skipped targets may lead to bad performance of a build.
Apr 30, 2025
Next steps: revisit SDK and MSBuild common targets and fix the issue there instead of modifying the MSBuild behavior, similar as arcade fix was done: dotnet/arcade#15743.
Uh oh!
There was an error while loading. Please reload this page.
Description
When building a project:
This situation can cause delays in the build process for dependent projects.
Symptoms
Technical details
When the initial target of a project (or another target necessary for a dependent project's build) is skipped due to a condition:
-The ResultsCache does not resolve this target in the main node when the build results are requested by a dependent project.
-Instead, the project is rescheduled to build the skipped target again. It waits in the queue for a build node, and if the condition still evaluates to false, the node resolves the target immediately with the same "skipped" result.
-If the build node is occupied, this can lead to delays in the overall build process.
For more details, refer to #11637.
Fix
To address this issue:
The text was updated successfully, but these errors were encountered: