Skip to content

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

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

Activity

  1. safern commented on Aug 25, 2020

    @safern
    Member

    Yeah on Windows we don't fail if we can't load it and we fall back to NLS. Unless the user opted into app local, then we fail with the app-local message you're referring to.

    I agree we should update the message. Self-assigned.

  2. self-assigned this
    on Aug 25, 2020
  3. safern commented on Aug 25, 2020

    @safern
    Member

    @danmosemsft I guess it makes sense to fix for 5.0.0?

  4. danmoseley commented on Aug 25, 2020

    @danmoseley
    ContributorAuthor

    @safern 5.0 only if we have data this is a point of confusion ? otherwise I don't think I could justify it. folks can Bing the message and find this issue.

  5. added this to the 6.0.0 milestone on Aug 25, 2020
  6. safern commented on Aug 25, 2020

    @safern
    Member

    Ok, makes sense. Set to 6.0.0

  7. removed
    untriagedNew issue has not been triaged by the area owner
    on Aug 25, 2020
  8. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 27, 2021
  9. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jan 28, 2021
  10. ghost locked as resolved and limited conversation to collaborators on Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions