Skip to content

Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory - #20458

Open
xperiandri wants to merge 2 commits into
dotnet:mainfrom
xperiandri:fix/fxresolver-debug-stdout-files
Open

Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory#20458
xperiandri wants to merge 2 commits into
dotnet:mainfrom
xperiandri:fix/fxresolver-debug-stdout-files

Conversation

@xperiandri

Copy link
Copy Markdown
Contributor

Description

FxResolver.executeProcess captures the stdout/stderr of the dotnet --version probe and, under #if DEBUG, also writes them to StandardOutput.txt / StandardError.txt in workingDir. workingDir is projectDir: the project directory when checking a project (TcConfigBuilder.implicitIncludeDir), or the script's own directory via GetProjectOptionsFromScript. So every Debug build of FCS drops two files into the user's source tree — once per directory per process (desiredDotNetSdkVersionForDirectoryCache) and again after each FxResolver.ClearStaticCaches().

In Visual Studio with a Debug VSIX this is more than clutter. SDK-style projects glob their folder, so a new file inside a project cone makes CPS re-evaluate the project → design-time build → NuGet nomination → restore of that project and everything depending on it → a new Roslyn Solution → every F# project snapshot rebuilt and re-checked. On a 39-project solution (Uno app, 4 TFMs × 4 RIDs, 6.4 MB dgspec) this kept devenv.exe at 250–500 % CPU while idle: the hottest thread was RestoreResult.CommitDgSpecFileAsync → JsonRuntimeFormat.WriteRuntimeGraph, a dozen MSBuild design-time nodes stayed alive, and each StandardOutput.txt creation (e.g. 04:59:48 in Console\Administration.Logic\Pages\) was followed about a minute later by a restore of the app project (05:00:50). The files themselves only ever contained 11.0.100-preview.6.26359.118.

The captured output is already returned to the caller and reaches the user through the scriptSdkNotDetermined diagnostic when the probe fails, so the files carry no extra diagnostic value. This PR removes the dump.

The build_StandardOutput.txt / nuget_StandardOutput.txt files written by FSharp.DependencyManager.Nuget are unaffected: their workingDir is the temporary #r "nuget" project folder, not the user's tree.

No issue was filed for this; happy to open one if you prefer to track it.

Checklist

  • Test cases added — none: this removes a Debug-only side effect, FxResolver.executeProcess has no existing tests, and the new behaviour is "no file is written".
  • Performance benchmarks added in case of performance changes — n/a.
  • Release notes entry updated: docs/release-notes/.FSharp.Compiler.Service/11.0.100.md.

🤖 Generated with Claude Code

…he project directory

FxResolver.executeProcess dumped the captured stdout/stderr of the `dotnet --version` probe into workingDir under #if DEBUG. workingDir is the project directory (or the script's directory via GetProjectOptionsFromScript), so a Debug VSIX in Visual Studio left StandardOutput.txt/StandardError.txt inside SDK-style project folders. Every new file in a project cone makes CPS re-evaluate the project, which runs a design-time build, nominates it to NuGet, restores it and its dependents, forks the Roslyn solution and rebuilds every F# snapshot - a loop that kept devenv at 250-500% CPU while idle.

The output is already returned to the caller and reported through scriptSdkNotDetermined on failure, so the files carried no extra diagnostics.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.100.md

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@xperiandri xperiandri changed the title Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory Sep 6, 2026
@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

1 participant