-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Enhance IBuildEngine3 Yield/Reacquire documentation with task requirements #12014
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
Conversation
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. |
…requirements Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
src/Framework/IBuildEngine3.cs
Outdated
/// This method must be called to regain control after <see cref="Yield"/> has been called. | ||
/// After <see cref="Yield"/> is called, global process state like environment variables and current | ||
/// working directory can change arbitrarily until this method returns. Tasks should complete any work | ||
/// that depends on global process state before calling <see cref="Yield"/>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is interesting--just say it for Yield
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified the Reacquire() documentation to remove the redundant global state details, keeping only the essential requirement to call it after Yield(). The detailed explanation is now only in the Yield() method documentation. (72f4132)
Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ghogen if you get a second could you look at this doc change?
Co-authored-by: Gordon Hogenson <ghogen@microsoft.com>
The documentation for
IBuildEngine3.Yield()
andIBuildEngine3.Reacquire()
methods was too minimal and didn't explain the critical requirements and burdens that using these methods imposes on tasks.Changes Made
Enhanced the XML documentation for both methods to include detailed
<remarks>
sections that explain:Global process state changes: After calling
Yield()
, global process state like environment variables and current working directory can change arbitrarily untilReacquire()
returns.Task requirements: If tasks depend on any global state (e.g., opening files by relative path rather than calling
ITaskItem.GetMetadata("FullPath")
), they must complete that work before callingYield()
.Common pattern: The recommended approach is to figure out what all the long-running work is and start it before yielding.
Before
After
This documentation enhancement will help task authors understand the proper usage patterns and avoid common pitfalls when implementing long-running tasks that need to yield control.
Fixes #12013.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
dnceng.pkgs.visualstudio.com
dotnet build src/Framework/Microsoft.Build.Framework.csproj
(dns block)dotnet build src/Utilities.UnitTests/Microsoft.Build.Utilities.UnitTests.csproj
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.