Skip to content

[iOS][HybridGlobalization] Clean-up internal testing related to hybrid globalization #105130

Open

Description

@mkhamoyan

Clean up internal testing related to hybrid globalization: CI testing, performance testing, internal sample applications, builds, etc.

  • Modify documentation to not refer to hybrid globalization anymore but Apple native globalization
  • Change exception naming PlatformNotSupported_HybridGlobalizationWithCompareOptions
  • ....

Activity

  1. added this to the 10.0.0 milestone on Jul 19, 2024
  2. self-assigned this
    on Jul 19, 2024
  3. dotnet-policy-service commented on Jul 19, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
    See info in area-owners.md if you want to be subscribed.

  4. dotnet-policy-service commented on Jul 19, 2024

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-globalization
    See info in area-owners.md if you want to be subscribed.

  5. mkhamoyan commented on Sep 17, 2024

    @mkhamoyan
    ContributorAuthor
  6. removed their assignment
    on Jan 28, 2025
  7. kotlarmilos commented on Jul 14, 2025

    @kotlarmilos
    Member
  8. matouskozak commented on Jul 15, 2025

    @matouskozak
    Member

    /cc: @matouskozak

    This is not a blocking issue for .NET 10 but we should take a look and remove this tech debt out to simplify the logic before .NET 11 efforts.

  9. modified the milestones: 10.0.0, 11.0.0 on Jul 18, 2025
  10. added
    good first issue
    on Jul 18, 2025
  11. modified the milestones: 11.0.0, 12.0.0 on Jul 6, 2026
  12. BekAllaev commented on Nov 1, 2026

    @BekAllaev
    Contributor

    Hi! I'd like to help with this issue, starting with the test projects part.

    Since Hybrid mode is now always active on Apple mobile (unless Invariant is enabled), the separate Hybrid/ test projects seem redundant. There are five of them:

    • System.Globalization.Tests/Hybrid/AppleHybrid.Tests.csproj
    • System.Globalization.Tests/Hybrid/System.Globalization.IOS.Tests.csproj
    • System.Globalization.Calendars.Tests/Hybrid/System.Globalization.Calendars.IOS.Tests.csproj
    • System.Globalization.Extensions.Tests/Hybrid/System.Globalization.Extensions.iOS.Tests.csproj
    • System.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csproj

    What I checked:

    • Every source file compiled by these projects is also compiled by the corresponding main test project.
    • The main projects already run on Apple platforms in runtime-extra-platforms (e.g. System.Globalization.Tests and System.Runtime.Tests on maccatalyst), and the hybrid projects run alongside them, so the same tests are executed twice in the same configuration.
    • The only thing the hybrid projects add is <HybridGlobalization>true</HybridGlobalization>, which eng/testing/tests.ioslike.targets already sets for all Apple test builds.

    I'd propose removing these five projects in one PR. I'd leave the HybridGlobalization MSBuild property itself out of this change, since it's still used for the System.Globalization.Hybrid feature switch in ILLink.Substitutions.iOS.xml.

    Happy to split it into smaller PRs if you prefer.

  13. matouskozak commented on Nov 3, 2026

    @matouskozak
    Member

    @BekAllaev Thank you for your interested in working on this. I agree with removing the tests in one PR and leaving the HybridGlobalization property clean-up for a follow-up work. In case you are going to work on this, please make sure to maintain the test coverage (including any relevant AOT/R2R or trimmer settings).

  14. BekAllaev commented on Nov 3, 2026

    @BekAllaev
    Contributor

    Great @matouskozak, thank you. I have opened PR #136916, I would like to hear comments/suggestions. Thanks

  15. BekAllaev commented on Nov 11, 2026

    @BekAllaev
    Contributor

    @matouskozak, following up on #136916 - here's what I'd propose for the HybridGlobalization property clean-up.

    On MacCatalyst/iOS/tvOS the property no longer controls anything at runtime: GlobalizationMode.Settings.Hybrid is hard-coded to true and doesn't read any switch, so I believe the property can be removed.

    However, it looks like the property is still used indirectly by the linker. The SDK maps it to the System.Globalization.Hybrid feature switch (Microsoft.NET.Sdk.targets), and ILLink.Substitutions.iOS.xml applies the get_Hybrid() stubs only when that switch is true (feature="System.Globalization.Hybrid" featurevalue="true"). The comment in tests.ioslike.targets ("kept enabled for linker feature substitution") points the same way. I'd appreciate your thoughts on whether I'm reading this correctly.

    If so, I'd remove the condition from the XML as well: once the property is gone, the condition would never be met, and since Hybrid is always true on these platforms, it doesn't make sense anymore. The substitution file is only included when IsiOSLike is true (System.Private.CoreLib.Shared.projitems), which covers MacCatalyst, iOS (incl. simulator) and tvOS - exactly where GlobalizationMode.Hybrid exists.

    Proposed changes

    1. Remove feature/featurevalue from both entries in src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.iOS.xml.
    2. Remove the HybridGlobalization property from:
      • eng/testing/tests.ioslike.targets
      • src/tests/Directory.Build.props, src/tests/FunctionalTests/Directory.Build.props
      • src/mono/msbuild/apple/build/AppleBuild.targets, which passes the property to the AppleAppBuilder task
      • src/tasks/AppleAppBuilder: remove the HybridGlobalization property along with its usages. It's only used in Xcode.cs to add a HYBRID_GLOBALIZATION define.
      • src/mono/sample/iOS-NativeAOT/Makefile
    3. In System.Runtime.TrimmingTests.proj, drop the Hybrid-specific variants - with an unconditional substitution they're identical to the default ones.
    4. Update docs/design/features/globalization-hybrid-mode.md, which currently says the property is "retained for linker and native-build compatibility" - this will no longer be true.

    Based on this, I'd expect test apps to be trimmed the same way as today; CI on the Apple legs should confirm that. I also checked PlatformDetection.IsHybridGlobalization (PlatformDetection.cs), which many globalization tests depend on: it reads GlobalizationMode.Hybrid via reflection rather than the System.Globalization.Hybrid feature switch, so those tests are unaffected.

    Out of scope: renaming "hybrid" to "Apple native globalization" in docs and PlatformNotSupported_HybridGlobalization* resources (separate PR), and hybridGlobalization: True in the iOS perf jobs, which now live in dotnet/performance.

    Does this sound good to you? If so, I'll open a PR.

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

    area-System.Globalizationgood first issueos-ios

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions