Skip to content

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

Merged
baronfel merged 2 commits intodotnet:mainfrom
baronfel:fix-msbuild-property-forwarding-corner-case
Aug 26, 2024
Merged

fix regression in --property forwarding with an invalid argument#43004
baronfel merged 2 commits intodotnet:mainfrom
baronfel:fix-msbuild-property-forwarding-corner-case

Conversation

@baronfel
Copy link
Copy Markdown
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.

@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Aug 26, 2024
@baronfel baronfel requested a review from rainersigwald August 26, 2024 15:41
@baronfel
Copy link
Copy Markdown
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.

[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
Copy Markdown
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 a team, arunchndr and tmat as code owners August 26, 2024 18:47
@mthalman
Copy link
Copy Markdown
Member

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

@baronfel
Copy link
Copy Markdown
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
Copy Markdown
Member

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

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

/backport to release/9.0.1xx

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
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!

@github-actions
Copy link
Copy Markdown
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
Copy Markdown
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