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

[iOS] Introduce support for linking ICU libs #97216

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3681a84
Create separate lib System.HybridGlobalization.Native
mkhamoyan Jan 19, 2024
6fd58f0
Fix build on Apple platforms
mkhamoyan Jan 22, 2024
d0a6820
HYBRID_GLOBALIZATION_DLL_NAME define only for Apple
mkhamoyan Jan 22, 2024
9d91003
Fix build failure
mkhamoyan Jan 22, 2024
29a248e
Fix non-Apple build
mkhamoyan Jan 22, 2024
8bc9d03
Fix syntax error
mkhamoyan Jan 22, 2024
50f4ce8
Fix linux builds
mkhamoyan Jan 22, 2024
b082055
Fix duplicate symbol issue
mkhamoyan Jan 23, 2024
e1ac526
Filter in Xcode libs depending on hybrid mode, pinvoke changes
mkhamoyan Jan 23, 2024
1566200
Revert not needed changes
mkhamoyan Jan 23, 2024
f660f6d
Revert changes
mkhamoyan Jan 23, 2024
4d009b1
Fix ICU lib flow
mkhamoyan Jan 23, 2024
f5d2926
Change hybrid casing and idn functions
mkhamoyan Jan 23, 2024
9f00a46
Merge branch 'main' into support_icu_libs
mkhamoyan Jan 25, 2024
a7cc352
temporary solution for library mode not include hybrid libs
mkhamoyan Jan 25, 2024
0587d2d
Merge branch 'main' into support_icu_libs
mkhamoyan Jan 25, 2024
01f9da0
Merge branch 'support_icu_libs' of https://github.com/mkhamoyan/runti…
mkhamoyan Jan 25, 2024
376dcb0
Refactoring and running tests on hybrid mode
mkhamoyan Jan 26, 2024
7534dc6
When hybrid mode don't include icu libs
mkhamoyan Jan 29, 2024
4db5989
Merge branch 'main' into support_icu_libs
mkhamoyan Jan 29, 2024
0ede71f
Fix syntax error
mkhamoyan Jan 29, 2024
6e3dc61
Fix OSX build failure
mkhamoyan Jan 29, 2024
23d91d9
Remove unused code
mkhamoyan Jan 30, 2024
2263998
Remove PKG_CONFIG_PATH info
mkhamoyan Jan 30, 2024
fc5d2c5
Move libe code under System.Globalization.Native
mkhamoyan Jan 31, 2024
7f436a7
Fix build
mkhamoyan Jan 31, 2024
910d640
Fix windows build
mkhamoyan Jan 31, 2024
7342955
clean up the code
mkhamoyan Jan 31, 2024
23f15fb
clean up the code, test both ICU and hybrid on CI
mkhamoyan Jan 31, 2024
9bef7b5
Merge branch 'main' into support_icu_libs
mkhamoyan Jan 31, 2024
aaacddb
Fix build
mkhamoyan Jan 31, 2024
e0fb75c
Make hybrid mode enabled by default
mkhamoyan Jan 31, 2024
9294637
Change setting Hybrid property
mkhamoyan Feb 1, 2024
f869884
Remove redundant test suites and add System.Globalization.Tests for iOS
mkhamoyan Feb 1, 2024
bbfed76
Fix HybridGlobalization value check
mkhamoyan Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/common/evaluate-default-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
- src/libraries/System.Private.CoreLib/*
- src/native/libs/Common/*
- src/native/libs/System.Globalization.Native/*
- src/native/libs/System.HybridGlobalization.Native/*
- src/native/libs/System.IO.Compression.Native/*
exclude:
- eng/Version.Details.xml
Expand All @@ -109,6 +110,7 @@ jobs:
- src/libraries/System.Private.CoreLib/*
- src/native/libs/Common/*
- src/native/libs/System.Globalization.Native/*
- src/native/libs/System.HybridGlobalization.Native/*
- src/native/libs/System.IO.Compression.Native/*
exclude:
- ${{ parameters._const_paths._wasm_specific_only }}
Expand Down
2 changes: 0 additions & 2 deletions eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" />

<PropertyGroup>
<!-- Default for now. If we can remove our ICU and rely on the system one, then HybridGlobalization becomes the default and we can remove checks for it -->
<HybridGlobalization>true</HybridGlobalization>
<IncludesTestRunner Condition="'$(IncludesTestRunner)' == ''">true</IncludesTestRunner>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(IsRuntimeTests)' != 'true' and '$(IncludesTestRunner)' == 'true'">AppleTestRunner.dll</MainLibraryFileName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ The .NET Foundation licenses this file to you under the MIT license.

<ItemGroup>
<NetCoreAppNativeLibrary Include="System.Native" />
<NetCoreAppNativeLibrary Include="System.Globalization.Native" Condition="'$(StaticICULinking)' != 'true' and '$(InvariantGlobalization)' != 'true'" />
<NetCoreAppNativeLibrary Include="System.Globalization.Native" Condition="'$(StaticICULinking)' != 'true' and '$(InvariantGlobalization)' != 'true' and (('$(_IsiOSLikePlatform)' == 'true' and '$(HybridGlobalization)' == 'false') or '$(_IsiOSLikePlatform)' != 'true')" />
<NetCoreAppNativeLibrary Include="System.HybridGlobalization.Native" Condition="'$(_IsiOSLikePlatform)' == 'true' and '$(StaticICULinking)' != 'true' and '$(InvariantGlobalization)' != 'true' and '$(HybridGlobalization)' != 'false'" />
<NetCoreAppNativeLibrary Include="System.IO.Compression.Native" />
<NetCoreAppNativeLibrary Include="System.Net.Security.Native" Condition="!$(_targetOS.StartsWith('tvos')) and '$(_linuxLibcFlavor)' != 'bionic'" />
<NetCoreAppNativeLibrary Include="System.Security.Cryptography.Native.Apple" Condition="'$(_IsApplePlatform)' == 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<ItemGroup>
<_pastShimFiles Include="System.Globalization.Native.dylib" />
<_pastShimFiles Include="System.Globalization.Native.so" />
<_pastShimFiles Include="System.HybridGlobalization.Native.dylib" />
<_pastShimFiles Include="System.HybridGlobalization.Native.so" />
<_pastShimFiles Include="System.IO.Compression.Native.a" />
<_pastShimFiles Include="System.IO.Compression.Native.dylib" />
<_pastShimFiles Include="System.IO.Compression.Native.so" />
Expand Down Expand Up @@ -80,6 +82,9 @@
<PlatformManifestFileEntry Include="libSystem.Globalization.Native.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Globalization.Native.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.Globalization.Native.so" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.HybridGlobalization.Native.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.HybridGlobalization.Native.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.HybridGlobalization.Native.so" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.IO.Compression.Native.a" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.IO.Compression.Native.dylib" IsNative="true" />
<PlatformManifestFileEntry Include="libSystem.IO.Compression.Native.so" IsNative="true" />
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/Common/src/Interop/Interop.Calendar.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ internal static partial class Interop
{
internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarsNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarsNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int GetCalendarsNative(string localeName, CalendarId[] calendars, int calendarsCapacity);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfoNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetCalendarInfoNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string GetCalendarInfoNative(string localeName, CalendarId calendarId, CalendarDataType calendarDataType);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEraNative")]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEraNative")]
internal static partial int GetLatestJapaneseEraNative();

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDateNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDateNative", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool GetJapaneseEraStartDateNative(int era, out int startYear, out int startMonth, out int startDay);

Expand Down
7 changes: 5 additions & 2 deletions src/libraries/Common/src/Interop/Interop.Casing.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ internal static partial class Interop
{
internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int ChangeCaseNative(string localeName, int lNameLen, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariantNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_ChangeCaseInvariantNative", StringMarshalling = StringMarshalling.Utf8)]
internal static unsafe partial int ChangeCaseInvariantNative(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, [MarshalAs(UnmanagedType.Bool)] bool bToUpper);

[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_InitOrdinalCasingPage", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial void InitOrdinalCasingPageNative(int pageNumber, char* pTarget);
}
}
10 changes: 5 additions & 5 deletions src/libraries/Common/src/Interop/Interop.Collation.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ internal struct Range

internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_CompareStringNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_CompareStringNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int CompareStringNative(string localeName, int lNameLen, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_EndsWithNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_EndsWithNative", StringMarshalling = StringMarshalling.Utf16)]
[MethodImpl(MethodImplOptions.NoInlining)]
internal static unsafe partial int EndsWithNative(string localeName, int lNameLen, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IndexOfNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_IndexOfNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial Range IndexOfNative(string localeName, int lNameLen, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, [MarshalAs(UnmanagedType.Bool)] bool fromBeginning);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_StartsWithNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_StartsWithNative", StringMarshalling = StringMarshalling.Utf16)]
[MethodImpl(MethodImplOptions.NoInlining)]
internal static unsafe partial int StartsWithNative(string localeName, int lNameLen, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKeyNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetSortKeyNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int GetSortKeyNative(string localeName, int lNameLen, char* str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options);
}
}
17 changes: 17 additions & 0 deletions src/libraries/Common/src/Interop/Interop.Idna.iOS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class Globalization
{

[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_ToAscii", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int ToAsciiNative(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);

[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_ToUnicode", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int ToUnicodeNative(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity);
}
}
18 changes: 9 additions & 9 deletions src/libraries/Common/src/Interop/Interop.Locale.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ internal static partial class Interop
{
internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleNameNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetDefaultLocaleNameNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string GetDefaultLocaleNameNative();

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoStringNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoStringNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string GetLocaleInfoStringNative(string localeName, uint localeStringData, string? uiLocaleName = null);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoIntNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoIntNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int GetLocaleInfoIntNative(string localeName, uint localeNumberData);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoPrimaryGroupingSizeNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoPrimaryGroupingSizeNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int GetLocaleInfoPrimaryGroupingSizeNative(string localeName, uint localeGroupingData);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoSecondaryGroupingSizeNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleInfoSecondaryGroupingSizeNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial int GetLocaleInfoSecondaryGroupingSizeNative(string localeName, uint localeGroupingData);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleNameNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleNameNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string GetLocaleNameNative(string localeName);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocalesNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocalesNative", StringMarshalling = StringMarshalling.Utf16)]
internal static partial int GetLocalesNative([Out] char[]? value, int valueLength);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormatNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetLocaleTimeFormatNative", StringMarshalling = StringMarshalling.Utf8)]
internal static partial string GetLocaleTimeFormatNative(string localeName, [MarshalAs(UnmanagedType.Bool)] bool shortFormat);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocaleNative", StringMarshalling = StringMarshalling.Utf8)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_IsPredefinedLocaleNative", StringMarshalling = StringMarshalling.Utf8)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static partial bool IsPredefinedLocaleNative(string localeName);
}
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/Common/src/Interop/Interop.Normalization.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ internal static partial class Interop
{
internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalizedNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_IsNormalizedNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int IsNormalizedNative(NormalizationForm normalizationForm, char* src, int srcLen);

[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeStringNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_NormalizeStringNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial int NormalizeStringNative(NormalizationForm normalizationForm, char* src, int srcLen, char* buffer, int bufferLength);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ internal static partial class Interop
{
internal static partial class Globalization
{
[LibraryImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayNameNative", StringMarshalling = StringMarshalling.Utf16)]
[LibraryImport(Libraries.HybridGlobalizationNative, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayNameNative", StringMarshalling = StringMarshalling.Utf16)]
internal static unsafe partial ResultCode GetTimeZoneDisplayNameNative(
string localeName,
int lNameLength,
Expand Down
1 change: 1 addition & 0 deletions src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal static partial class Libraries
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.OpenSsl";
internal const string CompressionNative = "libSystem.IO.Compression.Native";
internal const string GlobalizationNative = "libSystem.Globalization.Native";
internal const string HybridGlobalizationNative = "libSystem.HybridGlobalization.Native";
internal const string IOPortsNative = "libSystem.IO.Ports.Native";
internal const string HostPolicy = "libhostpolicy";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,9 @@
<Compile Include="$(CommonPath)Interop\Interop.Idna.cs">
<Link>Common\Interop\Interop.Idna.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Interop.Idna.iOS.cs" Condition="'$(IsiOSLike)' == 'true'">
<Link>Common\Interop\Interop.Idna.iOS.cs</Link>
</Compile>
<Compile Include="$(CommonPath)Interop\Interop.Locale.cs">
<Link>Common\Interop\Interop.Locale.cs</Link>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ private static partial class Settings
/// the GlobalizationMode.Invariant check. Globalization P/Invokes, e.g. in CompareInfo.GetSortKey,
/// rely on ICU already being loaded before they are called.
/// </summary>
#if !TARGET_MACCATALYST && !TARGET_IOS && !TARGET_TVOS
static Settings()
{
#if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS
if (GlobalizationMode.Hybrid)
return;
#endif
// Use GlobalizationMode.Invariant to allow ICU initialization to be trimmed when Invariant=true
// and PredefinedCulturesOnly is unspecified.
if (!GlobalizationMode.Invariant)
Expand All @@ -33,7 +36,6 @@ static Settings()
}
}
}
#endif

private static string GetIcuLoadFailureMessage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ internal static partial class GlobalizationMode
private static partial class Settings
{
internal static bool Invariant { get; } = AppContextConfigHelper.GetBooleanConfig("System.Globalization.Invariant", "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT");

#if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS
internal static bool Hybrid { get; } = true;
internal static bool Hybrid { get; } = AppContextConfigHelper.GetBooleanConfig("System.Globalization.Hybrid", "DOTNET_SYSTEM_GLOBALIZATION_HYBRID", true);
#elif TARGET_BROWSER
internal static bool Hybrid { get; } = AppContextConfigHelper.GetBooleanConfig("System.Globalization.Hybrid", "DOTNET_SYSTEM_GLOBALIZATION_HYBRID");
#endif
Expand Down
Loading
Loading