[release/8.0.4xx] Fix defaulting of which Runtime(s) to containerize that led to always publishing multiple containers#46067
Merged
marcpopMSFT merged 5 commits intodotnet:release/8.0.4xxfrom Jan 21, 2025
Conversation
…vertend multi-arch publishing
* using Container-specific properties to target a single RID * using normal RID properties to target a single RID
Member
Author
|
I've added two tests for user-facing scenarios that should work but currently done. Need to send more code changes to get them green. |
…ngle/multi rid checking
…fter we've checked all possible user-provided values
Member
Author
|
The build failure is the known-failing build that the IL folks say isn't a real thing. |
Member
Author
|
/backport to release/9.0.1xx |
Member
Author
|
/backport to release/9.0.2xx |
Contributor
|
Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/12893805681 |
Contributor
|
Started backporting to release/9.0.2xx: https://github.com/dotnet/sdk/actions/runs/12893807807 |
Contributor
|
@baronfel backporting to "release/9.0.1xx" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix typo in condition check for container publishing that led to inadvertend multi-arch publishing
Applying: Add two new failing tests detailing scenarios that should work:
Using index info to reconstruct a base tree...
A src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs
Falling back to patching base and 3-way merge...
Auto-merging test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs
Applying: Green up one of the two tests by making the _IsMultiRIDBuild condition more correct
error: sha1 information is lacking or useless (src/Containers/packaging/build/Microsoft.NET.Build.Containers.targets).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0003 Green up one of the two tests by making the _IsMultiRIDBuild condition more correct
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
Contributor
|
@baronfel backporting to "release/9.0.2xx" failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix typo in condition check for container publishing that led to inadvertend multi-arch publishing
Applying: Add two new failing tests detailing scenarios that should work:
Using index info to reconstruct a base tree...
A src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs
Falling back to patching base and 3-way merge...
Auto-merging test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs
Applying: Green up one of the two tests by making the _IsMultiRIDBuild condition more correct
error: sha1 information is lacking or useless (src/Containers/packaging/build/Microsoft.NET.Build.Containers.targets).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0003 Green up one of the two tests by making the _IsMultiRIDBuild condition more correct
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
This was referenced Jan 21, 2025
Member
This was referenced Jan 22, 2025
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #46053 and part of #46015.
Description and impact
There were two bugs in the multi-architecture container publishing that led to some projects always publishing for all container architectures:
win-x64from the set of RIDs to containerizeThe net effect of these changes is to make most multi-RID projects publish for all RIDs regardless of the
-rCLI parameter, and to also make the documented workarounds ineffective - using the container-specific RID properties.These scenarios were hit almost immediately after the release, with customers logging issues, tagging on social media, and via Discord.
Regression
Yes - the multi-arch containers work introduced this.
Risk
Low/Medium - the changes are targeted and in all cases more safe than before - they defer to user inputs in a safer way, they make complex boolean conditionals more simple to understand and more easily visible in the binlog, and we have added significant additional test coverage.
Testing
New automated test cases have been added that verify
Manual testing on sample projects confirms this. Providing the same targets changes to customers (cc @wasabii) has validated that pre-January-release behaviors are back.
Technical Details
Here's a simple app that demonstrates the various problems:
In January's releases of 8.0.4xx and 9.0.1xx, running
dotnet publish -t:PublishContainer -r linux-64for this project will cause bothContainerRuntimeIdentifiersRIDs to be built. If a user tries to workaround this by runningdotnet publish -t:PublishContainer -p ContainerRuntimeIdentifier=linux-x64, the workaround will not take effect and both RIDs will also be built.After these changes, the following scenarios all now work: