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

Avoid loading ICU data early during mono startup #100587

Closed
wants to merge 2 commits into from

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Apr 3, 2024

Current mono startup does
AssemblyNameParser -> CreateCultureWithInvariantData -> GlobalizationMode.Invariant -> GlobalizationMode.Settings.cctor -> LoadICU during startup.

This is attempt to postpone loading ICU until really needed.
It matters to Browser OS because we could start the runtime before the ICU data are finished downloading.

We could make this conditional for #if !TARGET_BROWSER if necessary.

@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Globalization os-browser Browser variant of arch-wasm labels Apr 3, 2024
@pavelsavara pavelsavara added this to the 9.0.0 milestone Apr 3, 2024
@pavelsavara pavelsavara self-assigned this Apr 3, 2024
Copy link
Contributor

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

Copy link
Contributor

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

@pavelsavara
Copy link
Member Author

Now we need to test/prove this is enough to start runtime without ICU data.

@pavelsavara
Copy link
Member Author

Let's continue after #99924 landed

There is nice Log

[08:18:41] fail: [out of order message from the browser]: http://127.0.0.1:46569/_framework/dotnet.runtime.js 2 [MONO] System.TypeInitializationException: TypeInitialization_Type, <Module>
                  ---> System.TypeInitializationException: TypeInitialization_Type, Settings
                  ---> System.Exception: Pavel: Testing if this will fail during startup or only when in use
                    at System.Globalization.GlobalizationMode.Settings..cctor()
                    Exception_EndOfInnerExceptionStack
                    at System.Globalization.GlobalizationMode.Settings.get_Invariant()
                    at System.Globalization.GlobalizationMode.get_Invariant()
                    at System.Globalization.CultureData.GetNFIValues(NumberFormatInfo )
                    at System.Globalization.NumberFormatInfo..ctor(CultureData )
                    at System.Globalization.CultureInfo.get_NumberFormat()
                    at System.Globalization.NumberFormatInfo.<GetInstance>g__GetProviderNonNull|58_0(IFormatProvider )
                    at System.Globalization.NumberFormatInfo.GetInstance(IFormatProvider )
                    at System.Int32.TryParse(ReadOnlySpan`1 , NumberStyles , IFormatProvider , Int32& )
                    at System.Version.TryParseComponent(ReadOnlySpan`1 , String , Boolean , Int32& )
                    at System.Version.ParseVersion(ReadOnlySpan`1 , Boolean )
                    at System.Version.TryParse(ReadOnlySpan`1 , Version& )
                    at System.Environment.get_Version()
                    at System.Runtime.InteropServices.JavaScript.__GeneratedInitializer.__Net7SelfInit_()
                    at <Module>..cctor()
                    Exception_EndOfInnerExceptionStack

cc @kg

@pavelsavara
Copy link
Member Author

closing in favor of #100141

@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2024
@pavelsavara pavelsavara deleted the delay_icu_load branch September 2, 2024 15:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Globalization os-browser Browser variant of arch-wasm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants