-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[master] Update dependencies from nuget/nuget.client #12897
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
[master] Update dependencies from nuget/nuget.client #12897
Conversation
…5.8.0.6776 NuGet.Build.Tasks From Version 5.8.0-preview.1.6753 -> To Version 5.8.0-preview.2.6776
Auto-Merge StatusThis pull request has not been merged because Maestro++ is waiting on the following merge policies.
|
sfoslund
left a comment
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.
Requesting changes to avoid automerge
bd8996e to
004f651
Compare
|
For test It_fails_gracefully_if_targetframework_should_be_targetframeworks:
It looks like we might have 2 separate issues here, restore is failing before we can get to build, where we should be erroring in this test. |
Auto-Merge StatusThis pull request has not been merged because Maestro++ is waiting on the following merge policies.
|
004f651 to
b50756f
Compare
|
Update: b50756f should fix the issue from this comment. NuGet started looking at the TargetFrameworkIdentifier with this change, so we need to update the logic to take this into account. |
Auto-Merge StatusThis pull request has not been merged because Maestro++ is waiting on the following merge policies.
|
| public static NuGetFramework GetTargetFramework(string targetFrameworkMoniker, string targetPlatformMoniker) | ||
| { | ||
| var targetFramework = NuGetUtils.ParseFrameworkName(targetFrameworkMoniker); | ||
| if (targetPlatformMoniker != null && !targetPlatformMoniker.Equals(string.Empty)) |
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.
Any reason not to use !string.IsNullOrEmpty here?
|
@sfoslund Is there an issue for this on the dotnet side that we can track as blocking our insertion on our own end? |
Auto-Merge StatusThis pull request has not been merged because Maestro++ is waiting on the following merge policies.
|
| <FilterResolvedFiles AssetsFilePath="$(ProjectAssetsFile)" | ||
| ResolvedFiles ="@(_ResolvedCopyLocalPublishAssets)" | ||
| PackagesToPrune="$(PackagesToPrune)" | ||
| TargetFramework="$(TargetFrameworkMoniker)" |
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.
I think you want TargetFramework here.
Then you can ask NuGet about the framework based on the alias.
| { | ||
| try | ||
| { | ||
| var targetPlatform = NuGetUtils.ParseFrameworkName(targetPlatformMoniker); |
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.
In https://github.com/NuGet/NuGet.Client/compare/dev-nkolev92-tfmImprovements?expand=1 I am adding a ParseComponents method that should take a TFM & TPM.
|
|
||
| internal static class NuGetTargetFrameworkUtils | ||
| { | ||
| public static NuGetFramework GetTargetFramework(string targetFrameworkMoniker, string targetPlatformMoniker) |
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.
For all tasks that make use of the assets file, ideally instead of looking it up by framework, you'd look up by the alias.
|
|
||
| return constructedFramework; | ||
| } | ||
| catch |
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.
We should generally avoid generic catch blocks like this. What exception are we expecting?
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.
I was seeing an exception with invalid target platform versions without this change, which was odd because I couldn't repro it locally. In general I agree, but as this is a work around and should be removed soon I think it should be okay.
| --> | ||
| <Target Name="_CheckForUnsupportedTargetFramework" | ||
| BeforeTargets="_CheckForInvalidConfigurationAndPlatform;RunResolvePackageDependencies;GetFrameworkPaths;GetReferenceAssemblyPaths" | ||
| BeforeTargets="_CheckForInvalidConfigurationAndPlatform;RunResolvePackageDependencies;GetFrameworkPaths;GetReferenceAssemblyPaths;Restore" |
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.
@zkat @nkolev92 What kind of impact will this have?
As a result of NuGet/NuGet.Client#3548, NuGet restore now fails when you have a (singular) TargetFramework property with a semicolon in it, with the message:
F:\workspace_work\1\s\artifacts\bin\redist\Debug\dotnet\sdk\5.0.100-ci\NuGet.targets(128,5): error : Invalid restore input. Invalid target framework 'unsupported'.
So now we will run our target to check for that case before restore, so we generate a better error message.
Will this cause problems for scenarios where restore could succeed, or partially succeed when there was an invalid TargetFramework? What about VS restore, which doesn't even run the Restore target?
@clairernovotny, the comment in the updated test seems to indicate that MSBuild.Sdk.Extras might be impacted by this. Can you comment on that?
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.
Sorry, which comment in which test?
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.
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.
NuGet won't restore if it ever detects an "unsupported" framework.
NuGet could probably try to throw a better error though.
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.
As far as hinging it off of restore, it won't run in VS.
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.
Fairly sure this was to ensure that we could define the right additional properties from the TFM so that restore would work.
For example, it'd set TPV, TFV and others: https://github.com/novotnyllc/MSBuildSdkExtras/blob/master/Source/MSBuild.Sdk.Extras/Build/Platforms/Windows.targets
I don't think it ever explicitly cared/supported having an extra semi-colon in a TargetFramework element.
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.
The above invalid target framework 'unsupported' is exactly what we're hitting at the moment in dotnet/aspnetcore and dotnet/aspnetcore-tooling with VS 16.8.0 preview 2.0 (Int Preview) installed. Will the ;Restore addition here fix that❔
/fyi builds in the dotnet/aspnetcore repo primarily use dotnet msbuild. We hit this error there only when attempting to use desktop msbuild for *.vcxproj and *.wixproj projects. Errors go away when only the external preview version of VS (16.8.0 preview 1.0) is visible to the build.
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.
(Believe users of the "master" version of VS also see the above error.)
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.
Adding ;Restore will cause a different failure if the issue is that TargetFramework is being used instead of TargetFrameworks otherwise, this is a different issue.
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.
I haven't checked aspnetcore-tooling but aspnetcore does not use @(TargetFramework) items with semicolons in them. We do have a mix of projects, some using @(TargetFramework) and those that are multi-targeted using @(TargetFrameworks). In addition, the only projects given to desktop msbuild in the aspnetcore failure case are *.proj and *.vcxproj projects. So, if it isn't this bug that's breaking us, what is❔
My error for the aspnetcore case with the Int Preview version of Visual Studio and .NET SDK version 5.0.100-rc.1.20379.10:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(128,5): error : Invalid restore input. Invalid target framework 'unsupported'. Input files: C:\Users\dougbu\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20403.5\tools\Tools.proj. [C:\Users\dougbu\.nuget\packages\microsoft.dotnet.arcade.sdk\5.0.0-beta.20403.5\tools\Tools.proj]
The Tools.proj project contains <TargetFramework>net472</TargetFramework> and doesn't use an SDK. Is not specifying an SDK no longer supported❔
If this fix does address our problem (even if accidentally), will we need more of NuGet/Home#9911 to build successfully or just an update of our .NET SDK to a verioin with this fix in it❔
|
seeing this failure in the test run for test suggesting that these tests are running against a version of the compiler that is too old. We restricted the version of MSBuild on these tests to be "16.8" but that is apparently not enough. The version of MSBuild in VS 16.8 preview 1 is not new enough. |
Auto-Merge StatusThis pull request has not been merged because Maestro++ is waiting on the following merge policies.
|
3a105ea to
4753910
Compare
a936110 to
19a636d
Compare
This pull request updates the following dependencies
From https://github.com/NuGet/NuGet.Client