Skip to content

Replace MSBUILD_NODEREUSE_ENABLED env var with a switch (allow node reuse on CI) #17013

@JanProvaznik

Description

@JanProvaznik

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions