Skip to content

Consider adding [NonVersionable] to OS and process architecture getters. #129949

Description

@teo-tsirpanis

Context: #129926 (comment)

In the context of an R2R compilation, the operating system and process architecture are constant values, aren't they? If so, it might be a good idea to mark [NonVersionable] the APIs to get the operating system or process architecture, in order to allow more dead code elimination in R2R. Specifically, I'm asking for the following APIs:

  • OperatingSystem.Is***()
    • I am not including the Is***VersionAtLeast APIs, because the OS version is not known at publish time. As a separate work item, crossgen could expand them as Is***() && Is***VersionAtLeast(x, y, z) to eliminate dead code if we are compiling for a completely different OS.
  • RuntimeInformation.ProcessArchitecture

We could also mark these APIs, but they are superseded by OperatingSystem.Is*** so it might not be needed:

  • The OSPlatform type.
  • RuntimeInformation.IsOSPlatform

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions