Skip to content
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

fix regression in --property forwarding with an invalid argument #43004

Merged

Conversation

baronfel
Copy link
Member

Fix a regression introduced in #42240 that caused dotnet/source-build#4579.

The test scenario is no longer relevant now that we are actually doing --property flag parsing in the CLI instead of delegating to MSBuild, so it's safe to remove it and rollback the changes to --property value forwarding that this specific test imposed on us in the first place.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Aug 26, 2024
@baronfel
Copy link
Member Author

This will need to be backported to release/9.0.1xx since #42240 is in the process of being backported there in #42987.

@@ -23,8 +23,6 @@ public GivenDotnetRunInvocation(ITestOutputHelper log)
[InlineData(new string[] { "-p", "prop1=true", "-p", "prop2=false" }, new string[] { "--property:prop1=true", "--property:prop2=false" })]
[InlineData(new string[] { "-p:prop1=true;prop2=false" }, new string[] { "--property:prop1=true", "--property:prop2=false" })]
[InlineData(new string[] { "-p", "MyProject.csproj", "-p:prop1=true" }, new string[] { "--property:prop1=true" })]
// The longhand --property option should never be treated as a project
[InlineData(new string[] { "--property", "MyProject.csproj", "-p:prop1=true" }, new string[] { "--property:MyProject.csproj", "--property:prop1=true" })]
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this test could be moved so that this is a different failure, like "you said --property but didn't specify one"?

@baronfel baronfel requested review from tmat, arunchndr and a team as code owners August 26, 2024 18:47
@mthalman
Copy link
Member

@baronfel - Getting this ported to 9.0 is a necessity. It's a blocker for source build for RC1.

@baronfel
Copy link
Member Author

Understood. As you can see I've been struggling with the CI system today - trying to get that cleared up ASAP.

@mthalman
Copy link
Member

Correction to my earlier post: this is not blocking RC1.

@baronfel baronfel merged commit ba17314 into dotnet:main Aug 26, 2024
37 checks passed
@baronfel baronfel deleted the fix-msbuild-property-forwarding-corner-case branch August 26, 2024 20:49
@baronfel
Copy link
Member Author

/backport to release/9.0.1xx

Copy link
Contributor

Started backporting to release/9.0.1xx: https://github.com/dotnet/sdk/actions/runs/10567064081

Copy link
Contributor

@baronfel backporting to release/9.0.1xx failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: fix regression in --property forwarding with an invalid argument
Using index info to reconstruct a base tree...
M	src/Cli/dotnet/OptionForwardingExtensions.cs
M	test/dotnet.Tests/dotnet-msbuild/GivenDotnetRunInvocation.cs
Falling back to patching base and 3-way merge...
Auto-merging test/dotnet.Tests/dotnet-msbuild/GivenDotnetRunInvocation.cs
CONFLICT (content): Merge conflict in test/dotnet.Tests/dotnet-msbuild/GivenDotnetRunInvocation.cs
error: Failed to merge in the changes.
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 0001 fix regression in --property forwarding with an invalid argument
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

@baronfel an error occurred while backporting to release/9.0.1xx, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

@baronfel
Copy link
Member Author

Since the backport failed I cherry-picked the fix onto the existing backport pr for the dotnet run enhancements: #42987

As a result we'll never be in the bad state in the RC2 branch, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants