Skip to content

Enable TaskHost Callbacks by default#13579

Merged
JanProvaznik merged 2 commits intomainfrom
exp/callbacks-final
Apr 21, 2026
Merged

Enable TaskHost Callbacks by default#13579
JanProvaznik merged 2 commits intomainfrom
exp/callbacks-final

Conversation

@JanProvaznik
Copy link
Copy Markdown
Member

@JanProvaznik JanProvaznik commented Apr 20, 2026

Fixes #12863

Context

final enablement without escape hatch

Notes

validated by vmr and vs expinsert

Callbacks are now always enabled via packet version negotiation.
Remove the temporary escape hatch env var and cross-version fallback tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JanProvaznik JanProvaznik requested a review from AR-May April 21, 2026 09:06
@JanProvaznik JanProvaznik marked this pull request as ready for review April 21, 2026 09:22
Copilot AI review requested due to automatic review settings April 21, 2026 09:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR finalizes default enablement of IBuildEngine callback forwarding for out-of-proc TaskHost execution by making the feature depend purely on the negotiated packet protocol version (and bumping that version), removing the temporary environment-variable escape hatch.

Changes:

  • Bump TaskHost/node packet protocol version to 4 to represent callback-capable communication.
  • Remove MSBUILDENABLETASKHOSTCALLBACKS (Traits escape hatch) and rely on packet version for callback support gating.
  • Update TaskHost callback integration tests to stop force-enabling callbacks via env var and remove “callbacks disabled” regression tests.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Shared/INodePacket.cs Bumps PacketVersion to 4 and updates the version history comment.
src/MSBuild/OutOfProcTaskHostNode.cs Removes env-var override; callback support now depends on packet version only.
src/Framework/Traits.cs Removes the EnableTaskHostCallbacks escape-hatch environment variable.
src/Build.UnitTests/BackEnd/TaskHostCallback_Tests.cs Removes env-var setup and deletes tests for the “callbacks not supported” path.
Comments suppressed due to low confidence (1)

src/Build.UnitTests/BackEnd/TaskHostCallback_Tests.cs:112

  • This file previously covered the “callbacks not supported”/cross-version path (MSB5022 for IsRunningMultipleNodes/BuildProjectFile and NotImplementedException for RequestCores). With callbacks now enabled by default, those regression tests were removed, leaving the fallback behavior untested even though the production code still has explicit !CallbacksSupported branches. Consider reintroducing at least one unit-style test that forces CallbacksSupported false (e.g., by constructing a minimal TaskHostConfiguration and setting a lower parent packet version) to keep the cross-version compatibility behavior from regressing.
        /// <summary>
        /// Verifies RequestCores callback works when task is explicitly run in TaskHost via TaskHostFactory.
        /// The first RequestCores call should always return at least 1 (the implicit core).
        /// </summary>
        [Fact]

Comment thread src/Shared/INodePacket.cs Outdated
Comment thread src/MSBuild/OutOfProcTaskHostNode.cs
Comment thread src/Shared/INodePacket.cs Outdated
Copy link
Copy Markdown
Member

@AR-May AR-May left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JanProvaznik JanProvaznik enabled auto-merge (squash) April 21, 2026 11:59
@JanProvaznik JanProvaznik merged commit 41c77a9 into main Apr 21, 2026
10 checks passed
@JanProvaznik JanProvaznik deleted the exp/callbacks-final branch April 21, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TaskHost Does Not Support Critical IBuildEngine Callbacks

3 participants