Background
The VMR (dotnet/dotnet) added an opt-in to allow MSBuild node reuse on CI (which is otherwise forced off). It is implemented as an environment variable, MSBUILD_NODEREUSE_ENABLED, mirroring the existing MSBUILD_MT_ENABLED (-mt) pattern:
repo-projects/Directory.Build.props sets MSBUILD_NODEREUSE_ENABLED=1 when /p:DotNetBuildNodeReuse=true is passed.
- The Arcade
eng/common build / msbuild / tools scripts only force nodeReuse=false on CI when MSBUILD_NODEREUSE_ENABLED != 1, and gate the "Node reuse must be disabled in CI build" guard the same way.
See VMR PR: dotnet/dotnet#7211
Problem
Per Arcade convention, the controls in eng/common/tools.ps1 / tools.sh (and build.* / msbuild.*) are switch-based parameters, not environment variables. nodeReuse itself is already a switch (-nodeReuse / --nodeReuse). Using a magic env var to override it is inconsistent and less discoverable. The Arcade team owns these entry points.
Ask
Replace the MSBUILD_NODEREUSE_ENABLED env-var check in the Arcade eng/common scripts with a proper switch (e.g. -allowNodeReuseOnCI / --allow-node-reuse-on-ci) that:
- prevents the CI override that forces
nodeReuse=false, and
- suppresses the
"Node reuse must be disabled in CI build" guard in MSBuild-Core,
allowing the existing -nodeReuse switch to take effect on CI. The VMR would then pass that switch (from Directory.Build.props) instead of setting the env var.
Notes
- The current env-var approach is intentionally marked "internal testing only" in the VMR and is not meant to be a permanent blessed mechanism.
- Worth deciding whether a permanent, supported way to bypass the no-node-reuse-on-CI guard is desirable at all (that guard exists for determinism / stale tasks / locked-file reasons).
Background
The VMR (dotnet/dotnet) added an opt-in to allow MSBuild node reuse on CI (which is otherwise forced off). It is implemented as an environment variable,
MSBUILD_NODEREUSE_ENABLED, mirroring the existingMSBUILD_MT_ENABLED(-mt) pattern:repo-projects/Directory.Build.propssetsMSBUILD_NODEREUSE_ENABLED=1when/p:DotNetBuildNodeReuse=trueis passed.eng/commonbuild/msbuild/toolsscripts only forcenodeReuse=falseon CI whenMSBUILD_NODEREUSE_ENABLED != 1, and gate the "Node reuse must be disabled in CI build" guard the same way.See VMR PR: dotnet/dotnet#7211
Problem
Per Arcade convention, the controls in
eng/common/tools.ps1/tools.sh(andbuild.*/msbuild.*) are switch-based parameters, not environment variables.nodeReuseitself is already a switch (-nodeReuse/--nodeReuse). Using a magic env var to override it is inconsistent and less discoverable. The Arcade team owns these entry points.Ask
Replace the
MSBUILD_NODEREUSE_ENABLEDenv-var check in the Arcadeeng/commonscripts with a proper switch (e.g.-allowNodeReuseOnCI/--allow-node-reuse-on-ci) that:nodeReuse=false, and"Node reuse must be disabled in CI build"guard inMSBuild-Core,allowing the existing
-nodeReuseswitch to take effect on CI. The VMR would then pass that switch (fromDirectory.Build.props) instead of setting the env var.Notes