Skip to content

Comments

Improve dotnetup Muxer Handling, In-Use Muxer + Perf#9

Closed
nagilson wants to merge 2 commits intonagilson-dnup-install-runtimes-implfrom
nagilson-dotnetup-in-use-muxer
Closed

Improve dotnetup Muxer Handling, In-Use Muxer + Perf#9
nagilson wants to merge 2 commits intonagilson-dnup-install-runtimes-implfrom
nagilson-dotnetup-in-use-muxer

Conversation

@nagilson
Copy link
Owner

@nagilson nagilson commented Jan 27, 2026

When moving the .NET SDK build to use dotnetup in #8, I hit several issues. The main issue is that the dotnet muxer may be in use when dotnetup tries to replace it, which would cause a failure.

I don't think we want to fail in this case and instead we want to emit a warning. I've added an option to fail instead, however.

What I also realized is that the approach of renaming the muxer even if it doesn't need to be replaced would cause the warning message to appear even if we didn't need to replace the muxer. Then I realized, we can do something clever. The windowsdesktop runtime has no runtime so we can skip muxer logic there. The other runtimes versions are the deciding factor for the muxer version since the muxer doesn't have its own version, so we can skip the resolution to find the version there. For the SDK, what we can do to avoid an extra rename of the existing muxer if it doesn't need to be replaced, is to extract out the new muxer to a different name temporarily, and then look and see if the latest runtime in the dotnet install root target changed after that install. If so then the runtime that came with the SDK is newer so the new muxer should be used. This lets us gracefully handle when the muxer is in use as well as avoid any extra work we don't need to do.

When moving the .NET SDK build to use `dotnetup`, I hit several issues. The main issue is that the dotnet muxer may be in use when dotnetup tries to replace it, which would cause a failure.

I don't think we want to fail in this case and instead we want to emit a warning. Maybe there should be an option to fail instead, however.

What I also realized is that the approach of renaming the muxer even if it doesn't need to be replaced would cause the warning message to appear even if we didn't need to replace the muxer.  Then I realized, we can do something clever. The windowsdesktop runtime has no runtime so we can skip muxer logic there. The other runtimes versions are the deciding factor for the muxer version since the muxer doesn't have its own version, so we can skip the resolution to find the version there. For the SDK, what we can do to avoid an extra rename of the existing muxer if it doesn't need to be replaced, is to extract out the new muxer to a different name temporarily, and then look and see if the latest runtime in the dotnet install root target changed after that install. If so then the runtime that came with  the SDK is newer so the new muxer should be used. This lets us gracefully handle when  the muxer is in use as well as avoid any extra work we don't need to do.
@nagilson nagilson marked this pull request as ready for review January 27, 2026 21:08
@nagilson nagilson closed this Jan 27, 2026
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.

1 participant