-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Remove references to PlatformAbstractions. #11076
Conversation
0634353
to
5304180
Compare
@dsplaisted @wli3 - thoughts on this? |
@eerhardt Is the RuntimeEnvironment class here a bunch of code copied from the PlatformAbstractions library? Is there a way to avoid adding it here? |
You can think of it as "moved" code from the PlatformAbstractions library. The main things that
You can see the discussion about these APIs at dotnet/runtime#26780.
The only way of avoiding it that I can think of is to change the callsites in As discussed in dotnet/runtime#26780 (comment), Since
So unless we want to change the telemetry information we are sending and change Another potential option would be to use RuntimeInformation.OSDescription instead, but that would still change the format of the telemetry information and the |
@eerhardt How likely is it that this logic will need to be updated moving forward? Who will be responsible for maintaining it? Also it looks like it still has its own implementation of getting the RuntimeIdentifier, can we remove that code and use the one that's being added to the BCL? |
I am very concerned about this change considering the left over part - RuntimeEnvironment.cs is still so big. Also there is mostly no test coverage for the entire file -- and it would be hard to test since it varies and requires testing on different machine config -- and that's why it is bad to be in SDK. SDK repo is not setup to test different combination of OSs. If I need to fix a bug in this code, it will be an edit and pray - and find a regression - and fix and pray again situation. Some ideas:
|
I can't really predict the future, but in the past 2.5 years, this has been the only substantive change: dotnet/core-setup#4085
I'm fine with me or someone from the libraries/runtime team maintaining it. But I don't see it as different than the current get libc version telemetry code we have today.
That implementation is used by the GetCurrentRuntimeInformation task in
If we can remove the telemetry and It looks like some of the version code in RuntimeEnvironment.cs can be refactored to instead use
I can add some tests for the functions. For the most part, there are only 3 main code paths: windows, osx, and linux.
This is not a viable solution. It is what we have today and what I'm trying to fix. The PlatformAbstractions library is in a weird "limbo" state, where it hasn't been officially approved, but it is in the same repo as the official BCL APIs. |
5304180
to
7f69728
Compare
@dsplaisted @wli3 - I believe I've addressed your feedback. Please let me know what you think. |
I actually made the same comment then that code was checked-in. And it is also maintained by runtime team |
This will allow us to remove the PlatformAbstractions library from dotnet/runtime. Contributes to dotnet/runtime#3470
b9881e0
to
cf1bcc2
Compare
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 I am OK with this. The use of this new code is restricted to telemetry and informational output.
As I commented, I think we can get rid of the duplicate GetRuntimeIdentifier implementation altogether.
d02ca6b
to
e07c170
Compare
* Update dependencies from https://github.com/dotnet/sdk build 20200417.2 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.2 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.2 * Update dependencies from https://github.com/dotnet/sdk build 20200417.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.3 * Update dependencies from https://github.com/dotnet/sdk build 20200417.4 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.4 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.4 * Update dependencies from https://github.com/dotnet/sdk build 20200417.5 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.5 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.5 * Update dependencies from https://github.com/dotnet/sdk build 20200417.6 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.6 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.6 * Update dependencies from https://github.com/dotnet/sdk build 20200417.7 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.7 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.7 * Update dependencies from https://github.com/dotnet/sdk build 20200417.8 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.8 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20217.8 * Update dependencies from https://github.com/dotnet/sdk build 20200418.1 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.1 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.1 * Update dependencies from https://github.com/dotnet/sdk build 20200418.2 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.2 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.2 * Update dependencies from https://github.com/dotnet/sdk build 20200418.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.3 * Update dependencies from https://github.com/dotnet/sdk build 20200418.4 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.4 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20218.4 * Update dependencies from https://github.com/dotnet/sdk build 20200419.1 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.1 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.1 * Update dependencies from https://github.com/dotnet/sdk build 20200419.2 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.2 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.2 * Update dependencies from https://github.com/dotnet/sdk build 20200419.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20219.3 * Update dependencies from https://github.com/dotnet/sdk build 20200420.1 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.1 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.1 * Update dependencies from https://github.com/dotnet/sdk build 20200420.2 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.2 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.2 * Update dependencies from https://github.com/dotnet/sdk build 20200420.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.3 * Switch to using RuntimeInformation APIs instead of deprecated PlatformAbstractions See dotnet/sdk#11076 * Update dependencies from https://github.com/dotnet/sdk build 20200420.4 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.4 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.4 * Update dependencies from https://github.com/dotnet/sdk build 20200420.5 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.5 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.5 * Update dependencies from https://github.com/dotnet/sdk build 20200420.7 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.7 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.7 * Update dependencies from https://github.com/dotnet/sdk build 20200420.8 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.8 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.8 * Update dependencies from https://github.com/dotnet/sdk build 20200420.10 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.10 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.10 * Update dependencies from https://github.com/dotnet/sdk build 20200420.12 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.12 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.12 * Update dependencies from https://github.com/dotnet/sdk build 20200420.13 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.13 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20220.13 * Update dependencies from https://github.com/dotnet/sdk build 20200421.1 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.1 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.1 * Update dependencies from https://github.com/dotnet/sdk build 20200421.2 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.2 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.2 * Update dependencies from https://github.com/dotnet/sdk build 20200421.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.3 * Update dependencies from https://github.com/dotnet/sdk build 20200421.4 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.4 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20221.4 * Update dependencies from https://github.com/dotnet/sdk build 20200421.5 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.5.20221.5 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.5.20221.5 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Daniel Plaisted <daplaist@microsoft.com>
* Update dependencies from https://github.com/dotnet/sdk build 20200423.3 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20223.3 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20223.3 * Update dependencies from https://github.com/dotnet/sdk build 20200423.5 - Microsoft.DotNet.MSBuildSdkResolver: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20223.5 - Microsoft.NET.Sdk: 5.0.100-preview.4.20217.1 -> 5.0.100-preview.4.20223.5 * Switch to using RuntimeInformation APIs instead of deprecated PlatformAbstractions See dotnet/sdk#11076 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Daniel Plaisted <daplaist@microsoft.com>
This will allow us to remove the PlatformAbstractions library from dotnet/runtime.
Contributes to dotnet/runtime#3470