microsoft / sarif-sdk

.NET code and supporting files for working with the 'Static Analysis Results Interchange Format' (SARIF, see https://github.com/oasis-tcs/sarif-spec)
Other
194 stars 93 forks source link

[SARIF Multitool] Allow running as tool on .NET 6.0 runtime (.NET Core 3.1 support ended in December 2022) #2511

Open KalleOlaviNiemitalo opened 2 years ago

KalleOlaviNiemitalo commented 2 years ago

The Sarif.Multitool package targets netcoreapp3.1 and net472. I tried to use it as a .NET tool on a computer that had Windows and .NET SDK 6.0.302 but no .NET Core 3.1 runtime. dotnet tool install installed it okay, but dotnet tool run sarif failed to launch and told me it needs the .NET Core 3.1 runtime. Because Microsoft will stop supporting .NET Core 3.1 on December 13, 2022, I'd like to start uninstalling its runtime from computers.

Could you change the Sarif.Multitool package so that it will work on .NET 6.0 without needing the .NET Core 3.1 runtime? Perhaps by multitargeting, or perhaps by configuring roll-forward.

(The Sarif.Multitool.Library package has no such problem, because it targets netstandard2.1 and net472.)

KalleOlaviNiemitalo commented 2 years ago

I can apparently override this by setting DOTNET_ROLL_FORWARD=Major in the environment. That feels a bit suspicious though, because if the tool started any child processes, they too would inherit the environment variable.

KalleOlaviNiemitalo commented 2 years ago

https://github.com/dotnet/sdk/issues/26417#issuecomment-1172672371 seems to recommend that .NET tool packages allow major version roll-forward.

KalleOlaviNiemitalo commented 1 year ago

.NET Core 3.1 support has now ended.