Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory - #20458
Open
xperiandri wants to merge 2 commits into
Open
Stop Debug builds writing StandardOutput.txt/StandardError.txt into the project directory#20458xperiandri wants to merge 2 commits into
StandardOutput.txt/StandardError.txt into the project directory#20458xperiandri wants to merge 2 commits into
Conversation
…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>
Contributor
❗ Release notes requiredYou can open this PR in browser to add release notes: open in github.dev
|
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
StandardOutput.txt/StandardError.txt into the project directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
FxResolver.executeProcesscaptures the stdout/stderr of thedotnet --versionprobe and, under#if DEBUG, also writes them toStandardOutput.txt/StandardError.txtinworkingDir.workingDirisprojectDir: the project directory when checking a project (TcConfigBuilder.implicitIncludeDir), or the script's own directory viaGetProjectOptionsFromScript. So every Debug build of FCS drops two files into the user's source tree — once per directory per process (desiredDotNetSdkVersionForDirectoryCache) and again after eachFxResolver.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 keptdevenv.exeat 250–500 % CPU while idle: the hottest thread wasRestoreResult.CommitDgSpecFileAsync → JsonRuntimeFormat.WriteRuntimeGraph, a dozen MSBuild design-time nodes stayed alive, and eachStandardOutput.txtcreation (e.g. 04:59:48 inConsole\Administration.Logic\Pages\) was followed about a minute later by a restore of the app project (05:00:50). The files themselves only ever contained11.0.100-preview.6.26359.118.The captured output is already returned to the caller and reaches the user through the
scriptSdkNotDetermineddiagnostic when the probe fails, so the files carry no extra diagnostic value. This PR removes the dump.The
build_StandardOutput.txt/nuget_StandardOutput.txtfiles written byFSharp.DependencyManager.Nugetare unaffected: theirworkingDiris 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
FxResolver.executeProcesshas no existing tests, and the new behaviour is "no file is written".docs/release-notes/.FSharp.Compiler.Service/11.0.100.md.🤖 Generated with Claude Code