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

Reference latest MSBuild for netcore MSBuild stuff #40603

Merged
merged 2 commits into from
May 14, 2024

Conversation

rainersigwald
Copy link
Member

MSBuild references were changed in #38506 to use
MSBuildMinimumVersion in all non-source-build scenarios, but
that's not necessary: the SDK will deliver the latest .NET MSBuild
and use it for all CLI-driven builds.

Using the old version broke some tests because of a mismatch
between newer targets and the old engine that was being used
to execute tests.

Instead, split the reference based on the TF of the project that is
building: for net472, use the minimum version if available, but
for $(SdkTargetFramework) always use the latest.

MSBuild references were changed in dotnet#38506 to use
MSBuildMinimumVersion in all non-source-build scenarios, but
that's not necessary: the SDK will deliver the latest .NET MSBuild
and use it for all CLI-driven builds.

Using the old version broke some tests because of a mismatch
between newer targets and the old engine that was being used
to execute tests.

Instead, split the reference based on the TF of the project that is
building: for `net472`, use the minimum version if available, but
for `$(SdkTargetFramework)` always use the latest.
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels May 1, 2024
@rainersigwald rainersigwald marked this pull request as ready for review May 1, 2024 17:03
@rainersigwald rainersigwald requested a review from a team as a code owner May 1, 2024 17:03
modes will import a version override file after Versions.props. -->
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true' or '$(TargetFramework)' != 'net472'">
Copy link
Contributor

Choose a reason for hiding this comment

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

is
'$(DotNetBuildSourceOnly)' == 'true' / != 'true'
part of these conditions redundant? there is no netframework source build

Copy link
Member

Choose a reason for hiding this comment

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

netstandard?

Copy link
Contributor

Choose a reason for hiding this comment

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

should be enough to check:
'$(TargetFrameworkIdentifier)' == '.NETFramework'
'$(TargetFrameworkIdentifier)' != '.NETFramework'

@rainersigwald rainersigwald requested a review from mmitche May 1, 2024 18:25
@marcpopMSFT marcpopMSFT merged commit 34541c2 into dotnet:main May 14, 2024
16 checks passed
@marcpopMSFT
Copy link
Member

/backport to release/8.0.4xx

Copy link
Contributor

Started backporting to release/8.0.4xx: https://github.com/dotnet/sdk/actions/runs/9085698508

Copy link
Contributor

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

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

Applying: Reference latest MSBuild for netcore MSBuild stuff
Using index info to reconstruct a base tree...
M	Directory.Packages.props
M	eng/Versions.props
Falling back to patching base and 3-way merge...
Auto-merging eng/Versions.props
CONFLICT (content): Merge conflict in eng/Versions.props
Auto-merging Directory.Packages.props
CONFLICT (content): Merge conflict in Directory.Packages.props
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Reference latest MSBuild for netcore MSBuild stuff
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

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

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

@marcpopMSFT
Copy link
Member

@Forgind /please backport to release/8.0.4xx

@rainersigwald rainersigwald deleted the freshen-netcore-msbuild-refs branch May 28, 2024 18:44
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.

7 participants