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][non-icu] HybridGlobalization use system ICU #93220

Merged
merged 123 commits into from
Dec 19, 2023

Conversation

mkhamoyan
Copy link
Contributor

@mkhamoyan mkhamoyan commented Oct 9, 2023

With these changes we will not load ICU anymore for Apple mobile platforms and will use system ICU from Apple sdk.
This will make HybridGlobalization as default and only option for Apple mobile platforms.
As a follow up, we'll allow also to link in ICU.

Below is size comparison for System.Globalization.Tests app.

-- Hybrid mode Loading ICU
app size 37,8 MB 43,1 MB
ipa size 12,7 MB 14.7 MB

This will give us 2 MB improvement.

Contributes to #80689

@ghost
Copy link

ghost commented Oct 9, 2023

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

Issue Details

Load system ICU that Apple is using.

Contributes to #80689

Author: mkhamoyan
Assignees: -
Labels:

area-System.Globalization, os-ios

Milestone: -

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-ioslike

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-ioslikesimulator

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-maccatalyst

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@akoeplinger akoeplinger left a 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!

@@ -747,10 +747,9 @@ elseif(HOST_BROWSER)
set(STATIC_ICU 1)
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")
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

Comment on lines 28 to 29
#endif
#if !defined(__APPLE__) || (defined(__APPLE__) && !(TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS))
Copy link
Member

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?

@@ -61,7 +60,7 @@ static void GetParent(const char* localeID, char* parent, int32_t parentCapacity
int32_t i;

if (localeID == NULL)
localeID = [NSLocale systemLocale].localeIdentifier.UTF8String;
localeID = [NSLocale currentLocale].localeIdentifier.UTF8String;
Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -5,6 +5,7 @@
<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>
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-maccatalyst

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-ioslikesimulator

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Contributor Author

/azp run runtime-ioslike

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mkhamoyan
Copy link
Contributor Author

Failures are not related

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants