Tighten NodeLaunchData.EnvironmentOverrides nullability to IDictionary<string, string?>?#13815
Draft
Copilot wants to merge 2 commits into
Draft
Tighten NodeLaunchData.EnvironmentOverrides nullability to IDictionary<string, string?>?#13815Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Contributor
|
Hello @copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
…y<string, string?>? Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/2e8dcdf9-a529-41ff-87b3-72b3b671a758 Co-authored-by: OvesN <150850103+OvesN@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix nullability mismatch in NodeLaunchData.EnvironmentOverrides
Tighten NodeLaunchData.EnvironmentOverrides nullability to IDictionary<string, string?>?
May 19, 2026
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.
Context
DotnetHostEnvironmentHelper.CreateDotnetRootEnvironmentOverrides()returnsIDictionary<string, string?>?where null values are intentional sentinels meaning "remove this variable from the child environment" (consumed byApplyEnvironmentOverrides→environment.Remove(key)to clearDOTNET_ROOT_*arch-specific variants). ButNodeLaunchData.EnvironmentOverrideswas typedIDictionary<string, string>?, forcing both call sites to paper over the mismatch —MSBuildClient.cswith!,NodeProviderOutOfProc.csvia#nullable disable.Changes Made
INodeLauncher.cs:EnvironmentOverrides→IDictionary<string, string?>?.DotnetHostEnvironmentHelper.cs:ApplyEnvironmentOverridesoverrides param and foreach KVP retyped; drop straynull!(target dict is alreadyDictionary<string, string?>).MSBuildClient.cs: drop!and the#13761workaround comment.NodeLauncher.BuildEnvironmentBlock,DetouredNodeLauncher.CreateEnvironmentVariables: param retyped. Files are#nullable disable, so the signature is wrapped in a narrow#nullable enable annotations/#nullable disable annotationsblock rather than flipping the whole file.NodeProviderOutOfProcTaskHost.cs: local switched tovarto flow the nullable element type through without touching the file's#nullable disablecontext.Testing
Full repo build (net472 + net10.0) clean with 0 warnings.
AppHostSupport_Testspass.Notes
Type-system tightening only — no runtime behavior change. The
#nullable enable annotationsscoping inNodeLauncher.cs/DetouredNodeLauncher.csis a deliberately minimal alternative to converting those files to#nullable enablewholesale.