You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[iOS][HybridGlobalization] Clean-up internal testing related to hybrid globalization #105130
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:
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.
@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).
@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
Remove feature/featurevalue from both entries in src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.iOS.xml.
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
In System.Runtime.TrimmingTests.proj, drop the Hybrid-specific variants - with an unconditional substitution they're identical to the default ones.
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.
Activity
dotnet-policy-service commentedon Jul 19, 2024
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Jul 19, 2024
Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.
mkhamoyan commentedon Sep 17, 2024
cc @vitek-karas
kotlarmilos commentedon Jul 14, 2025
/cc: @matouskozak
matouskozak commentedon Jul 15, 2025
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.
BekAllaev commentedon Nov 1, 2026
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.csprojSystem.Globalization.Tests/Hybrid/System.Globalization.IOS.Tests.csprojSystem.Globalization.Calendars.Tests/Hybrid/System.Globalization.Calendars.IOS.Tests.csprojSystem.Globalization.Extensions.Tests/Hybrid/System.Globalization.Extensions.iOS.Tests.csprojSystem.Runtime.Tests/Hybrid/System.Runtime.IOS.Tests.csprojWhat I checked:
runtime-extra-platforms(e.g.System.Globalization.TestsandSystem.Runtime.Testson maccatalyst), and the hybrid projects run alongside them, so the same tests are executed twice in the same configuration.<HybridGlobalization>true</HybridGlobalization>, whicheng/testing/tests.ioslike.targetsalready sets for all Apple test builds.I'd propose removing these five projects in one PR. I'd leave the
HybridGlobalizationMSBuild property itself out of this change, since it's still used for theSystem.Globalization.Hybridfeature switch inILLink.Substitutions.iOS.xml.Happy to split it into smaller PRs if you prefer.
matouskozak commentedon Nov 3, 2026
@BekAllaev Thank you for your interested in working on this. I agree with removing the tests in one PR and leaving the
HybridGlobalizationproperty 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).BekAllaev commentedon Nov 3, 2026
Great @matouskozak, thank you. I have opened PR #136916, I would like to hear comments/suggestions. Thanks
BekAllaev commentedon Nov 11, 2026
@matouskozak, following up on #136916 - here's what I'd propose for the
HybridGlobalizationproperty clean-up.On MacCatalyst/iOS/tvOS the property no longer controls anything at runtime:
GlobalizationMode.Settings.Hybridis hard-coded totrueand 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.Hybridfeature switch (Microsoft.NET.Sdk.targets), andILLink.Substitutions.iOS.xmlapplies theget_Hybrid()stubs only when that switch istrue(feature="System.Globalization.Hybrid" featurevalue="true"). The comment intests.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
Hybridis alwaystrueon these platforms, it doesn't make sense anymore. The substitution file is only included whenIsiOSLikeis true (System.Private.CoreLib.Shared.projitems), which covers MacCatalyst, iOS (incl. simulator) and tvOS - exactly whereGlobalizationMode.Hybridexists.Proposed changes
feature/featurevaluefrom both entries insrc/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.iOS.xml.HybridGlobalizationproperty from:eng/testing/tests.ioslike.targetssrc/tests/Directory.Build.props,src/tests/FunctionalTests/Directory.Build.propssrc/mono/msbuild/apple/build/AppleBuild.targets, which passes the property to theAppleAppBuildertasksrc/tasks/AppleAppBuilder: remove theHybridGlobalizationproperty along with its usages. It's only used inXcode.csto add aHYBRID_GLOBALIZATIONdefine.src/mono/sample/iOS-NativeAOT/MakefileSystem.Runtime.TrimmingTests.proj, drop the Hybrid-specific variants - with an unconditional substitution they're identical to the default ones.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 readsGlobalizationMode.Hybridvia reflection rather than theSystem.Globalization.Hybridfeature switch, so those tests are unaffected.Out of scope: renaming "hybrid" to "Apple native globalization" in docs and
PlatformNotSupported_HybridGlobalization*resources (separate PR), andhybridGlobalization: Truein the iOS perf jobs, which now live in dotnet/performance.Does this sound good to you? If so, I'll open a PR.