forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from dotnet:main #183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
This change introduces a new read only struct that is used in Dictionary for caching in TaskRegistry #12620 Without a proper equality check it spawns a new process due to mismatch. Experimental insertion without extra allocation reported: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/686770
β¦12679) ## Summary: Add MSBUILDDEBUGONSTART=3 to skip debugging TaskHost processes β **All tasks completed successfully** - [x] Explore repository structure and understand current implementation - [x] Understand how MSBUILDDEBUGONSTART works in XMake.cs and OutOfProcTaskHost.cs - [x] Identify that DebugUtils.cs has NodeMode detection capability - [x] Build repository successfully to verify starting state - [x] Create helper method IsInTaskHostNode() in DebugUtils.cs - [x] Update XMake.cs to support new environment variable value "3" (launches debugger conditionally) - [x] Update OutOfProcTaskHost.cs to handle value "3" (skips debugging for TaskHost) - [x] Add tests for the new IsInTaskHostNode() method - [x] Build and verify the changes work - [x] Run tests to ensure no regressions - [x] Manual verification of the feature - [x] Code review and address feedback - [x] **Fixed: Added IsInTaskHostNode() check in XMake.cs to handle sidecar TaskHost processes** - [x] **Updated documentation to reference new MSBUILDDEBUGONSTART=3 behavior** - [x] CodeQL security scan - [x] Final validation ## Changes Made (42 lines added/modified across 6 files): 1. **src/Shared/Debugging/DebugUtils.cs**: Added `IsInTaskHostNode()` public method to detect if current process is a TaskHost 2. **src/MSBuild/XMake.cs**: Added case "3" with conditional check - launches debugger only if NOT in TaskHost mode 3. **src/MSBuildTaskHost/OutOfProcTaskHost.cs**: Added case "3" to skip debugger launch for TaskHost processes 4. **src/Build.UnitTests/BackEnd/DebugUtils_tests.cs**: Added test to verify IsInTaskHostNode() works correctly 5. **documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md**: Updated debugging section with new value "3" 6. **documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md**: Updated breakpoints section with new value "3" ## How to Use: Set `MSBUILDDEBUGONSTART=3` before running MSBuild to debug the main process while skipping both: - MSBuildTaskHost.exe child processes - Sidecar TaskHost processes running in MSBuild.exe **Available values:** - `1`: Launch debugger for all processes (main + TaskHost) - `2`: Wait for manual debugger attach for all processes - `3` (NEW): Launch debugger for main MSBuild only, skip TaskHost processes ## Documentation: β Updated in two wiki pages: - Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md - Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md ## Security: β No security vulnerabilities detected by CodeQL ## Testing: β All tests pass (2/2 DebugUtils tests) β Build succeeds with no warnings or errors β Manual verification completed <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > There is the MSBUILDDEBUGONSTART environment variable that launches debugging at the start when set. However it launches it also for child processes that inherit the environment (e.g. the Sidecar TaskHost processes, which I don't want to debug every time). Please add a new value for the variable that when set first checks if the current process is a sidecar taskhost and in that case does not launch debugging. </details> <!-- START COPILOT CODING AGENT TIPS --> --- π¬ Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click [here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start the survey. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JanProvaznik <[email protected]>
This pull request updates the following dependencies [marker]: <> (Begin:369b758c-dad8-4fea-810a-64fb6b0308e9) ## From https://github.com/dotnet/arcade - **Subscription**: [369b758c-dad8-4fea-810a-64fb6b0308e9](https://maestro.dot.net/subscriptions?search=369b758c-dad8-4fea-810a-64fb6b0308e9) - **Build**: [20251105.6](https://dev.azure.com/dnceng/internal/_build/results?buildId=2832312) ([289702](https://maestro.dot.net/channel/8394/github:dotnet:arcade/build/289702)) - **Date Produced**: November 6, 2025 12:10:41 AM UTC - **Commit**: [987d1a73ea67d323c0fc7537bce8ec65d87eb43f](dotnet/arcade@987d1a7) - **Branch**: [release/10.0](https://github.com/dotnet/arcade/tree/release/10.0) [DependencyUpdate]: <> (Begin) - **Dependency Updates**: - From [10.0.0-beta.25531.2 to 10.0.0-beta.25555.6][1] - Microsoft.DotNet.Arcade.Sdk - Microsoft.DotNet.XUnitExtensions [1]: dotnet/arcade@fb1799f...987d1a7 [DependencyUpdate]: <> (End) - **Updates to .NET SDKs:** - Updates **tools.dotnet** to 10.0.100-rc.1.25451.107 [marker]: <> (End:369b758c-dad8-4fea-810a-64fb6b0308e9) Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
This pull request updates the following dependencies [marker]: <> (Begin:8a4332aa-2543-4c51-b941-e73f31e22328) ## From https://github.com/dotnet/roslyn - **Subscription**: [8a4332aa-2543-4c51-b941-e73f31e22328](https://maestro.dot.net/subscriptions?search=8a4332aa-2543-4c51-b941-e73f31e22328) - **Build**: [20251109.1](https://dev.azure.com/dnceng/internal/_build/results?buildId=2834824) ([290087](https://maestro.dot.net/channel/548/github:dotnet:roslyn/build/290087)) - **Date Produced**: November 9, 2025 7:47:54 PM UTC - **Commit**: [b28fc311e384c959fba1fea1ede591a1552c2c1e](dotnet/roslyn@b28fc31) - **Branch**: [main](https://github.com/dotnet/roslyn/tree/main) [DependencyUpdate]: <> (Begin) - **Dependency Updates**: - From [5.3.0-2.25551.1 to 5.3.0-2.25559.1][1] - Microsoft.Net.Compilers.Toolset [1]: dotnet/roslyn@f695099...b28fc31 [DependencyUpdate]: <> (End) [marker]: <> (End:8a4332aa-2543-4c51-b941-e73f31e22328) Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? π Please sponsor : )