dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.95k stars 4.65k forks source link

[mono] ICU data file is not part of the bundle in library mode #95124

Closed steveisok closed 1 month ago

steveisok commented 9 months ago

When using library mode NativeLib=shared|static with bundling turned on, the icu data file is not part of the bundle. This requires you to carry the file separately, which is something we don't want to do.

Since custom ICU is wasm specific, the data file should be added in their respective targets. At the end of the day, it should end up in:

https://github.com/dotnet/runtime/blob/ebf881ed4d954b007c3f53a443e201d418457764/src/mono/msbuild/common/LibraryBuilder.targets#L56-L60

ghost commented 9 months ago

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos See info in area-owners.md if you want to be subscribed.

Issue Details
When using library mode `NativeLib=shared|static` with bundling turned on, the icu data file is not part of the bundle. This requires you to carry the file separately, which is something we don't want to do. Since custom ICU is apple mobile and wasm specific, the data file should be added in their respective targets. At the end of the day, it should end up in: https://github.com/dotnet/runtime/blob/ebf881ed4d954b007c3f53a443e201d418457764/src/mono/msbuild/common/LibraryBuilder.targets#L56-L60
Author: steveisok
Assignees: -
Labels: `area-Infrastructure-mono`, `os-ios`
Milestone: 9.0.0
JCash commented 2 months ago

I'm also pinging here, as I'm currently hitting this case as well.

This requires you to carry the file separately

Are there any instructions on how to achieve this?

EDIT: To answer my own question, the workaround is to copy the file manually to your app: E.g `cp ${DUGET_PACKAGES}/microsoft.netcore.app.runtime.nativeaot.ios-arm64/8.0.4/runtimes/ios-arm64/native/icudt.dat ./example.app

ivanpovazan commented 2 months ago

@JCash https://gist.github.com/ivanpovazan/0f0c1c588895bb399ee5eacac552cce3 you might find this helpful (it is an unofficial set of notes for .net8/.net9 iOS library mode with NativeAOT)

ivanpovazan commented 1 month ago

@steveisok since we now use HybridGlobalization on iOS by default and the system ICU data file, should this be wasm library mode issue instead ?

steveisok commented 1 month ago

@steveisok since we now use HybridGlobalization on iOS by default and the system ICU data file, should this be wasm library mode issue instead ?

Yeah, that would be correct.

ivanpovazan commented 1 month ago

@lewing can someone from your team maybe pick this up?

steveisok commented 1 month ago

@lewing can someone from your team maybe pick this up?

Actually, this is specific to ios. Wasm has their own way. Should be ok to close

ivanpovazan commented 1 month ago

Thanks for the confirmation! Closing as not planned.