#30336 Default Dotnet Tool to Run on Latest Runtime - Build time change#31957
#30336 Default Dotnet Tool to Run on Latest Runtime - Build time change#31957JL03-Yue merged 4 commits intodotnet:mainfrom
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
nagilson
left a comment
There was a problem hiding this comment.
The change looks good so far bar a few questions and comments. :)
We should get a breaking change doc written for this when its merged. Feel free to reach out to me for help on that if you have any questions.
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets
Show resolved
Hide resolved
src/Tests/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs
Show resolved
Hide resolved
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets
Show resolved
Hide resolved
src/Tests/Microsoft.NET.ToolPack.Tests/GivenThatWeWantToPackAToolProject.cs
Outdated
Show resolved
Hide resolved
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <PackageType>DotnetTool</PackageType> | ||
| <RuntimeIdentifiers>$(RuntimeIdentifiers);$(PackAsToolShimRuntimeIdentifiers)</RuntimeIdentifiers> | ||
| <RollForward Condition="'$(RollForward)' == ''">Major</RollForward> |
There was a problem hiding this comment.
@baronfel Is it possible for us to add some logic to detect if we did do a roll-forward and then errored.. and if so warn the user about the roll forward and tell them to use an older SDK?
There was a problem hiding this comment.
This is not a bad idea. What happens with tools is that
- we eventually write a
DotnetToolSettings.xmlfile that looks like this:
<?xml version="1.0" encoding="utf-8"?>
<DotNetCliTool Version="1">
<Commands>
<Command Name="fsautocomplete" EntryPoint="fsautocomplete.dll" Runner="dotnet" />
</Commands>
</DotNetCliTool>
- the rollforward is set in the runtimeconfig.json to whatever we infer here
We probably need to set some other kind of data in the DotnetToolSettings.xml to signal that we opted the user into auto-rollforward so we could give an error here.
There was a problem hiding this comment.
I don't think we need to do this (add the data to do error detection) for this PR - I think this behavior is correct and good and what we should have done all along, and a breaking change notice is enough. Virtually every tool author I've spoken to has wondered why this wasn't the default, so I don't think there's a user experience gap that we need to cover here.
If we get feedback from users post-preview5 that this was confusing, we can certainly come back to this though!
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
This was a mistake. Changes are still needed.
…oolProject.cs Co-authored-by: Noah Gilson <[email protected]>
nagilson
left a comment
There was a problem hiding this comment.
Thanks for following up here :)
#30336 NET Tools should default to running on the latest available Runtime
Build time change:
Change the
RollForwardof all tools fromLatestPatchtoMajor, so that tools can be able to run on any .NET runtime equal or greater than the runtime the application originally targeted