-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[release/8.0.4xx] Fix defaulting of which Runtime(s) to containerize that led to always publishing multiple containers #46067
[release/8.0.4xx] Fix defaulting of which Runtime(s) to containerize that led to always publishing multiple containers #46067
Conversation
…vertend multi-arch publishing
* using Container-specific properties to target a single RID * using normal RID properties to target a single RID
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
The build failure is the known-failing build that the IL folks say isn't a real thing. |
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.
Looks great!
/backport to release/9.0.1xx |
/backport to release/9.0.2xx |
Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/12893805681 |
Started backporting to release/9.0.2xx: https://github.com/dotnet/sdk/actions/runs/12893807807 |
@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 128 Please backport manually! |
@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 128 Please backport manually! |
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-x64
from 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
-r
CLI 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-64
for this project will cause bothContainerRuntimeIdentifiers
RIDs 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: