Use ProcessSpec for invoking dotnet publish#9479
Merged
mitchdenny merged 2 commits intomainfrom May 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses apparent hangs during dotnet publish by updating the process invocation to use ProcessSpec for streaming output and error data.
- Replace ProcessStartInfo with ProcessSpec and its callbacks to prevent stdout buffer blockage.
- Adjust the return type of BuildProjectContainerImageAsync and update PublishCommand's activity loop condition.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs | Updated dotnet publish logic to stream process output and removed the string return value. |
| src/Aspire.Cli/Commands/PublishCommand.cs | Modified the publishing activities termination condition logic. |
Comments suppressed due to low confidence (2)
src/Aspire.Hosting/Publishing/ResourceContainerImageBuilder.cs:74
- The method signature has changed from returning a string to void. Please verify that all callers of BuildProjectContainerImageAsync are updated to reflect this change and that any dependencies on its return value are addressed.
private async Task BuildProjectContainerImageAsync(IResource resource, CancellationToken cancellationToken)
src/Aspire.Cli/Commands/PublishCommand.cs:232
- The updated return condition now depends on all activities being free of errors. Confirm that this logic accurately reflects the intended termination criteria for processing publishing activities.
return lastActivityUpdateLookup.All(kvp => !kvp.Value.IsError);
davidfowl
approved these changes
May 23, 2025
06c98d6 to
d6f037a
Compare
Contributor
|
/backport to release/9.3 |
Contributor
|
Started backporting to release/9.3: https://github.com/dotnet/aspire/actions/runs/15327499000 |
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 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.
This should fix apparent hangs when doing
aspire publish. The root issue was that when the process stdout buffer filled up the process would stop. This resolves that issue by reading out of that buffer as lines are written and piping them to stdout.We already do this for
docker buildbut hadn't yet done it todotnet publish.Fixes: #9233