Skip to content

eng/Build.ps1 hard-disables MSBuild node reuse, hurting inner-loop perf and blocking MSBuild Server #20217

Description

@ViktorHofer

Summary

eng/Build.ps1 unconditionally disables MSBuild node reuse for every Windows build, including local developer inner-loop builds:

# eng/Build.ps1, in Process-Arguments()
$script:nodeReuse = $False;

There is no comment explaining why. It dates back to 7a6448eda0 ("reduce diff") in March 2019, so whatever motivated it is likely long gone.

Note that eng/build.sh does not do this — on Unix, F# already gets Arcade's default (node reuse on for local builds, off on CI). So the two entry points disagree, which suggests the PowerShell side is simply an accident that was never revisited.

Why this matters

Today: node reuse noticeably improves incremental build performance. Without it, every build.cmd invocation pays full MSBuild node startup, JIT and assembly-load cost from scratch. That's a real tax on the inner loop for everyone working on the compiler on Windows.

Going forward: this will block the repo from benefiting from ongoing MSBuild investments. Most importantly MSBuild Server — with node reuse disabled, the server process shuts down immediately after each build, so the repo gets none of the warm-process benefits. MSBuild Server is on by default starting with .NET 10 Preview 7, so this will silently opt dotnet/fsharp's Windows builds out of a headline performance feature.

Suggested fix

Delete the $script:nodeReuse = $False; line and let Arcade's default apply, matching what eng/build.sh already does. If a specific problem resurfaces, please scope the workaround to it and link a tracking issue rather than disabling node reuse repo-wide.

Related

As a stop-gap, dotnet/dotnet#8151 adds a -nodeReuse / --nodeReuse parameter to both entry points so an explicitly passed value wins over the hard-coded disable, letting the VMR turn node reuse on for fsharp. That's a workaround for a workaround, though — the default is what actually matters for the inner loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions