Skip to content
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

[Breaking change]: GetOSVersion on MacCatalyst now normalizes the build component to 0 if undefined (-1) #43156

Open
1 of 3 tasks
kotlarmilos opened this issue Oct 22, 2024 · 1 comment
Assignees
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged
Milestone

Comments

@kotlarmilos
Copy link
Member

kotlarmilos commented Oct 22, 2024

Description

This update ensures that MacCatalyst version components retrieved from the OS are always normalized to three components: major, minor, and build. The build component is set to 0 if undefined (-1), ensuring consistent behavior between iOS and MacCatalyst versions for version checks.

dotnet/runtime#108694

Version

.NET 10 Preview 1

Previous behavior

The build component in Version was not previously normalized, which led to incorrect version checks on MacCatalyst when only two components (major and minor) were provided. This resulted in invalid version checks.

New behavior

The MacCatalyst build component is now normalized to 0, ensuring consistent version checks. The revision component is always set to -1, as it is not specified on MacCatalyst or iOS.

Type of breaking change

  • Binary incompatible: Existing binaries might encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code might require source changes to compile successfully.
  • Behavioral change: Existing binaries might behave differently at run time.

Reason for change

Prevent incorrect version checks and align MacCatalyst versioning with iOS, ensuring consistent version components.

Recommended action

Use versions of up to three components (major, minor, and build) on MacCatalyst.

Feature area

Core .NET libraries

Affected APIs

public static bool IsMacCatalystVersionAtLeast (int major, int minor = 0, int build = 0);
public static bool IsOSPlatformVersionAtLeast (string platform, int major, int minor = 0, int build = 0, int revision = 0);
public static string Environment.OSVersion.Version.ToString()
@kotlarmilos kotlarmilos added breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 labels Oct 22, 2024
@kotlarmilos kotlarmilos added this to the October 2024 milestone Oct 22, 2024
@dotnetrepoman dotnetrepoman bot added ⌚ Not Triaged Not triaged labels Oct 22, 2024
@gewarren gewarren removed the ⌚ Not Triaged Not triaged label Oct 22, 2024
@dotnetrepoman dotnetrepoman bot added the ⌚ Not Triaged Not triaged label Oct 22, 2024
@jeffhandley
Copy link
Member

@kotlarmilos -- To answer a question you asked in email, once the breaking change PR is merged into dotnet/runtime, you do not need to close this issue. The content from this issue will be turned into a breaking change document on the https://learn.microsoft.com/dotnet/core/compatibility/breaking-changes portion of the docs site. The docs team will close this issue once that's completed. We don't yet have a .NET 10 section in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change doc-idea Indicates issues that are suggestions for new topics [org][type][category] Pri1 High priority, do before Pri2 and Pri3 ⌚ Not Triaged Not triaged
Projects
Status: 🔖 Ready
Development

No branches or pull requests

3 participants