Skip to content

When libicu is missing, message steers towards invariant mode not installing libicu #41350

@danmoseley

Description

@danmoseley

Install dotnet on Linux (eg., on Debian in my case just now)

dan@danmose3:~/git/performance$ tools/dotnet/x64/dotnet --info
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
   at System.Environment.FailFast(System.String)
[2020/08/25 12:48:23][INFO]    at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
[2020/08/25 12:48:23][INFO]    at System.Globalization.GlobalizationMode..cctor()
[2020/08/25 12:48:23][INFO]    at System.Globalization.CultureData.CreateCultureWithInvariantData()
[2020/08/25 12:48:23][INFO]    at System.Globalization.CultureData.get_Invariant()
[2020/08/25 12:48:23][INFO]    at System.Globalization.TextInfo..cctor()
[2020/08/25 12:48:23][INFO]    at System.String.ToLowerInvariant()
[2020/08/25 12:48:23][INFO]    at System.Text.EncodingHelper.GetCharset()
[2020/08/25 12:48:23][INFO]    at System.Text.EncodingHelper.GetEncodingFromCharset()
[2020/08/25 12:48:23][INFO]    at System.ConsolePal.GetConsoleEncoding()
[2020/08/25 12:48:23][INFO]    at System.Console.get_OutputEncoding()
[2020/08/25 12:48:23][INFO]    at System.Console.CreateOutputWriter(System.IO.Stream)
[2020/08/25 12:48:23][INFO]    at System.Console.<get_Out>g__EnsureInitialized|25_0()
[2020/08/25 12:48:23][INFO]    at System.Console.get_Out()
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Utils.Reporter.Reset()
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Utils.Reporter..cctor()
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Utils.Reporter.get_Output()
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Program.PrintInfo()
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Program.ProcessArgs(System.String[], Microsoft.DotNet.Cli.Telemetry.ITelemetry)
[2020/08/25 12:48:23][INFO]    at Microsoft.DotNet.Cli.Program.Main(System.String[])

Can we be more helpful here? We seem to be steering folks towards invariant mode, when the answer most users will want is likely to simply install libicu.

Yes, the installer likely earlier warned Warning: Unable to locate libicu. Probable prerequisite missing; install libicu. but that can be overlooked way back in the console output.

Could the message say something like eg?

Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true to run with no globalization support.

It's a little tricky because we don't know exactly what the package name is. Eg., on Debian apt-get install libicu did not work but apt-get install libicu-dev did work as did apt-get install libicu63 in my case.

I compared Windows, where the message just says Failed to load app-local ICU: <some.dll> but in that case I assume the user has already opted into app-local, so they have some idea of what ICU is and where it ought to be. Whereas on Unix, many folks encountering this message will not know what ICU is and nor should they need to know.
cc @safern

BTW we already improved this for libgdiplus: System.DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions