Skip to content

[EXPERIMENT] Stop forcing MSBuild nodeReuse=false on CI builds - #6838

Closed
JanProvaznik wants to merge 51 commits into
dotnet:mainfrom
JanProvaznik:experiment/nodereuse-default-on
Closed

JanProvaznik wants to merge 51 commits into
dotnet:mainfrom
JanProvaznik:experiment/nodereuse-default-on

Conversation

@JanProvaznik

Copy link
Copy Markdown
Member

EXPERIMENT — do not merge. No reviewers pinged on purpose.

This branch removes every CI-side nodeReuse=false opt-out from the VMR's
build scripts so MSBuild's default (nodeReuse=true) applies on CI. The
intent is to exercise a "node reuse on everywhere" configuration on
dnceng-public and observe whether real source-build / unified-build pipelines
tolerate it, which custom tasks misbehave under reuse, and what the perf
impact looks like.

Why this is an experiment, not a desirable change

  • CI environments are short-lived; node reuse mostly buys persistent caches
    that benefit interactive/local builds, not single-shot CI runs.
  • nodeReuse=false on CI has been the long-standing default for good
    reasons: build determinism, avoiding stale tasks across stages, and working
    around custom task assemblies that don't tolerate reuse.
  • Re-enabling it broadly is likely to surface regressions in custom tasks,
    task host lifecycle, and locked-file scenarios on Windows.

Scope (build infrastructure only)

Removed the if (\) { ... \ = \False } and
if [[ \"\\" == true ]]; then node_reuse=false; fi lines from:

  • VMR root: eng/build.ps1, eng/common/build.{ps1,sh}, eng/common/msbuild.{ps1,sh}
  • Arcade source: src/arcade/eng/common/build.{ps1,sh}, src/arcade/eng/common/msbuild.{ps1,sh}
  • Every per-repo mirror of those Arcade scripts under src/*/eng/common/
  • Repo-specific wrappers: src/aspnetcore/eng/build.ps1, src/msbuild/eng/build.ps1,
    src/msbuild/eng/cibuild_bootstrapped_msbuild.{ps1,sh},
    src/fsharp/eng/build.sh, src/nuget-client/eng/dotnet-build/build.{ps1,sh}

Left intentionally untouched (product code or tests that disable reuse on purpose):

  • src/nuget-client/src/NuGet.Clients/NuGet.CommandLine/MsBuildUtility.cs
  • src/{fsharp,roslyn}/eng/test-determinism.ps1
  • src/nuget-client/test/NuGet.Core.FuncTests/Dotnet.Integration.Test/DotnetIntegrationTestFixture.cs
  • src/roslyn/src/Compilers/Core/MSBuildTaskTests/**

Diff summary

104 files changed, +6 / −114 lines. After this patch the affected scripts no
longer pass /nr:false on CI, so the worker MSBuild processes will linger
between invocations until they idle out.

EXPERIMENTAL CI bring-up patch. Do NOT merge.

Today every Arcade-style build.ps1 / build.sh (and a few repo-specific
wrappers) force nodeReuse=false whenever --ci is passed, and a couple of
scripts hard-code /nr:false or --nodereuse false on the MSBuild command line.
This branch removes those forced opt-outs across the VMR so that MSBuild's
default (nodeReuse=true) applies. The goal is to exercise a 'node reuse on
everywhere' configuration on dnceng-public and observe whether real
source-build / unified-build pipelines tolerate it, which kinds of tasks or
task assemblies break under reuse, and what the perf impact is.

Why this is an experiment, not a desirable change:

- CI environments are short-lived; node reuse mostly buys persistent caches
  that benefit interactive/local builds, not single-shot CI runs.
- nodeReuse=false on CI has been the long-standing default for good reasons
  (build determinism, avoiding stale tasks across stages, working around
  custom task assemblies that don't tolerate reuse).
- Re-enabling it broadly is likely to surface regressions in custom tasks,
  task host process lifecycle, and locked-file scenarios on Windows.

Scope (build infrastructure only):

- Removed the 'if ci then nodeReuse=false' line from every Arcade
  eng/common/build.{ps1,sh} and eng/common/msbuild.{ps1,sh} mirrored in the
  VMR, including the arcade source under src/arcade/ and every per-repo copy.
- Removed the same override from VMR-root eng/build.ps1 and eng/common/*.
- Removed analogous overrides from custom build scripts in aspnetcore,
  msbuild, fsharp, and nuget-client:
  src/aspnetcore/eng/build.ps1
  src/msbuild/eng/build.ps1
  src/msbuild/eng/cibuild_bootstrapped_msbuild.{ps1,sh}
  src/fsharp/eng/build.sh
  src/nuget-client/eng/dotnet-build/build.{ps1,sh}
- Left product code and intentional-disable test code alone:
  src/nuget-client/src/NuGet.Clients/NuGet.CommandLine/MsBuildUtility.cs,
  src/{fsharp,roslyn}/eng/test-determinism.ps1,
  src/nuget-client/test/.../DotnetIntegrationTestFixture.cs,
  src/roslyn/src/Compilers/Core/MSBuildTaskTests/**.

After this patch the affected scripts no longer pass /nr:false on CI, so
MSBuild's default nodeReuse=true applies and worker MSBuild processes will
linger between invocations until they idle out.

Co-authored-by: Copilot <[email protected]>
@dotnet-policy-service
dotnet-policy-service Bot requested review from a team May 26, 2026 16:00
Without this, the previous commit had no effect: the first arcade build call
exits with `Node reuse must be disabled in CI build.` from
`MSBuild-Core` in Arcade's `tools.{ps1,sh}`. This commit drops that
guard in the VMR root `eng/common/tools.{ps1,sh}` and in the arcade source
at `src/arcade/eng/common/tools.{ps1,sh}` so the rest of the experiment
can actually exercise `nodeReuse=true` on CI.

Per-sub-repo `src/*/eng/common/tools.{ps1,sh}` mirrors are intentionally
left untouched because the VMR's ChangeValidation tool rejects direct
edits to those tooling-files paths.

Co-authored-by: Copilot <[email protected]>
@adamsitnik
adamsitnik removed the request for review from a team May 26, 2026 16:47

@ViktorHofer ViktorHofer left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert all the "eng/common" file changes except ones under the root /eng/common and src/arcade/eng/common. Those two locations are used for the other inner builds and are copied during the build. src/arcade/eng/common is also the "outgoing" source that flows to the subscribed repos.

<!-- Don't update arcade's eng/common layout as that is considered live even though it uses bootstrap Arcade. -->
<Target Name="UpdateEngCommonFiles" Condition="'$(RepositoryName)' != 'arcade'">

Of course, in order to get this to a mergeable state, we nodeReuse=false removal would need to be put under a flag.

@ViktorHofer

ViktorHofer commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

The source-build and Ubuntu job failure are just due to a syntax error:

/__w/1/s/src/nuget-client/eng/dotnet-build/build.sh: line 133: syntax error near unexpected token fi' /__w/1/s/src/nuget-client/eng/dotnet-build/build.sh: line 133: fi'

Everything else is actually passing.

dotnet-maestro Bot and others added 9 commits June 24, 2026 16:34
[[ commit created by automation ]]
[[ commit created by automation ]]
dotnet#7362)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7354)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
dotnet#7366)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7367)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Two failures in the VMR productBuild Linux pack of vstest packages,
both from the nuspec->SDK-pack migration:

1. NU5129 on Microsoft.NET.Test.Sdk and Microsoft.CodeCoverage: PackagePath
   used trailing backslashes (build\netstandard2.0\). On Linux NuGet does not
   treat a trailing backslash as a directory separator, producing a
   double-slash path (build/netstandard2.0//<PackageId>.props) that fails the
   package convention check. Use forward slashes so the path resolves cleanly
   on both Windows and Linux.

2. Microsoft.TestPlatform.CLI 'Could not find .../Release/net11.0': the
   non-Windows/source-build content group pulled files from
   $(OutputPath)$(NetCurrent) (net11.0), but only source-only builds produce a
   net11.0 output (Directory.Build.targets overrides TargetFrameworks to
   $(NetCurrent)). In the non-source-only Linux product build the project
   builds $(NetSDKTargetFramework) (net10.0). Introduce a mode-aware
   _CliContentTfm (= $(NetCurrent) when source-only, else
   $(NetSDKTargetFramework)) and use it for the content TFM so pack references
   the folder that is actually produced.

Co-authored-by: Copilot <[email protected]>
dotnet-sb-bot and others added 28 commits June 26, 2026 13:48
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…nt (dotnet#7415)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…oslyn libsqlite3mc.so (dotnet#7426)

Co-authored-by: Matt Mitchell (.NET) <[email protected]>
Co-authored-by: Copilot <[email protected]>
)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Matt Thalman <[email protected]>
…dotnet#7422)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…dotnet#7443)

[release/11.0.1xx-preview6] Source code updates from microsoft/vstest
…otnet#7457)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7479)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7483)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…ild-assets (dotnet#7468)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7515)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…ild-assets (dotnet#7507)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…nt (dotnet#7445)

[release/11.0.1xx-preview6] Source code updates from nuget/nuget.client
dotnet#7534)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7485)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…nt (dotnet#7539)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
…otnet#7573)

[release/11.0.1xx-preview6] Source code updates from dotnet/fsharp
[[ commit created by automation ]]
The Windows_x86 leg of build 1500300 failed with a non-deterministic
native crash (exit code 3221225477 / 0xC0000005 access violation) in
rollup while building the aspnetcore @microsoft/microsoft.components.customelements
JS bundle. The identical commit built successfully on Windows_x64 and every
other vertical, confirming a transient infrastructure failure rather than a
source defect. This empty commit re-triggers the pipeline.

Co-authored-by: Copilot <[email protected]>
Merge darc-release/11.0.1xx-preview6 (the branch this experiment was
forked from, now 339 commits ahead) into experiment/nodereuse-default-on.

All merge conflicts were in arcade-mirrored eng/common/*.{ps1,sh} scripts.
The base introduced the official MSBUILD_NODEREUSE_ENABLED opt-in
(dotnet/arcade#17013) that supersedes the experiment's manual removal of
the 'nodeReuse=false on CI' guards. Those eng/common files must match the
arcade upstream, and forcing node reuse on would trip the base's per-repo
'Node reuse must be disabled in CI build' hard guards and fail CI.
Resolved by adopting the base's canonical version for all affected files.

Co-authored-by: Copilot <[email protected]>
@JanProvaznik

Copy link
Copy Markdown
Member Author

outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants