- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
[iOS][non-icu] HybridGlobalization use system ICU #93220
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
Conversation
| Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsLoad system ICU that Apple is using. Contributes to #80689 
 | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| /azp run runtime-ioslike | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| /azp run runtime-ioslikesimulator | 
| /azp run runtime-maccatalyst | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple questions, looks good otherwise. Thanks!
        
          
                src/mono/CMakeLists.txt
              
                Outdated
          
        
      | set(ICU_LIBS "icucore") | ||
| elseif(HOST_IOS OR HOST_TVOS OR HOST_MACCAT) | ||
| set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") | ||
| set(ICU_FLAGS "-DTARGET_UNIX -DTARGET_IOS -DTARGET_TVOS -DTARGET_MACCATALYST -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ok if we pass -DTARGET_IOS -DTARGET_TVOS -DTARGET_MACCATALYST unconditionally? I'd have expected we only pass on the respective platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks.
| #endif | ||
| #if !defined(__APPLE__) || (defined(__APPLE__) && !(TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS)) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't we just do #else here?
|  | ||
| if (localeID == NULL) | ||
| localeID = [NSLocale systemLocale].localeIdentifier.UTF8String; | ||
| localeID = [NSLocale currentLocale].localeIdentifier.UTF8String; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems unrelated to the system ICU change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, will revert it back.
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
| <IsTestProject Condition="'$(IsTestProject)' == ''">true</IsTestProject> | ||
| <IsFunctionalTest>true</IsFunctionalTest> | ||
| <HybridGlobalization Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst'">true</HybridGlobalization> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use TargetsAppleMobile here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, thanks.
| /azp run runtime-maccatalyst | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| /azp run runtime-ioslikesimulator | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| /azp run runtime-ioslike | 
| Azure Pipelines successfully started running 1 pipeline(s). | 
| Failures are not related | 
With these changes we will not load
ICUanymore forApple mobile platformsand will use systemICUfromApple sdk.This will make
HybridGlobalizationas default and only option forApple mobile platforms.As a follow up, we'll allow also to link in
ICU.Below is size comparison for
System.Globalization.Testsapp.This will give us 2 MB improvement.
Contributes to #80689