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

Use the app container's icudt.dat file in app extensions #17877

Closed
rolfbjarne opened this issue Mar 22, 2023 · 5 comments
Closed

Use the app container's icudt.dat file in app extensions #17877

rolfbjarne opened this issue Mar 22, 2023 · 5 comments
Labels
app-size enhancement The issue or pull request is an enhancement
Milestone

Comments

@rolfbjarne
Copy link
Member

The icudt.dat file is copied to all app extensions as well as the app container.

This is rather useless, we only need one copy, and we can use the one in the app container.

This should save ~1.9mb per app extension.

@rolfbjarne rolfbjarne added enhancement The issue or pull request is an enhancement app-size labels Mar 22, 2023
@rolfbjarne rolfbjarne added this to the .NET 8 milestone Mar 22, 2023
@rolfbjarne
Copy link
Member Author

@akoeplinger were you looking at hardcoding the path to the icudt.dt file for NativeAOT? Once we fix this issue, the icudt.dt file might not be inside the app bundle anymore for app extensions (we'll still know the path to the icudt.dat file, relative to the root of the app bundle, at build time).

@akoeplinger
Copy link
Member

Right now we use this fallback path if the ICU_DAT_FILE_PATH AppContext key isn't set:

https://github.com/dotnet/runtime/blob/e56db76481726cc451b8fcf499500f9f3218de63/src/native/libs/System.Globalization.Native/pal_locale.m#L32

I think we could easily modify this to always pass in a path via that key and just assume it is relative to the bundle root.

akoeplinger added a commit to akoeplinger/runtime that referenced this issue Jun 20, 2023
We consider it relative to the app bundle root.

Required for xamarin/xamarin-macios#17877 and NativeAOT scenarios.
akoeplinger added a commit to dotnet/runtime that referenced this issue Jun 20, 2023
)

We consider it relative to the app bundle root.

Required for xamarin/xamarin-macios#17877 and NativeAOT scenarios.
@akoeplinger
Copy link
Member

The runtime change to support a relative ICU_DAT_FILE_PATH was merged and will show up in 8.0-preview6

@akoeplinger
Copy link
Member

.NET 9 uses "hybrid globalization" which doesn't rely on bundling ICU with the app anymore so this should no longer be needed going forward.

@rolfbjarne
Copy link
Member Author

Closing as per last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-size enhancement The issue or pull request is an enhancement
Projects
Status: Done
Development

No branches or pull requests

2 participants