Skip to content

Error in fresh Ubuntu 22.04.2 install: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) crossgen-corelib.proj #82873

Closed

Description

@carlossanlop

I recently formatted my Surface Pro X (ARM64), installed WSL, and added Ubuntu 22.04.2 LTS.
I cloned runtime, installed all the required dependencies for building, and ran the command:

build.sh clr+libs -rc release -arch arm64

Unfortunately, the build failed with an error that crashed my WSL and I had to restart my laptop. This was the error that showed up multiple times before freezing the WSL terminal window:

setlocale: LC_ALL: cannot change locale (en_US.UTF-8) crossgen-corelib.proj

Unfortunately, I was unable to see the exact line where it failed. As mentioned, this message showed up many times and the window was frozen.

I searched this error and found an AskUbuntu thread that suggested running these commands against the desired locale:

sudo locale-gen <localeID>
sudo update-locale LANG=<localeID>

I tried running it using the one that showed up in the error and it succeeded:

carlos@calopearm:~$ sudo locale-gen en_US.UTF-8
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
carlos@calopearm:~$ sudo update-locale LANG=en_US.UTF-8
<no output here, so I assume it succeeded>

After that, I built runtime again (same command), and it succeded.

What could've caused the error when building? Is this some misconfiguration in our build scripts that we need to fix, or some problem with this Ubuntu version?

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Mar 2, 2023
  2. am11 commented on Mar 2, 2023

    @am11
    Member

    I recently formatted my Surface Pro X (ARM64), installed WSL, and added Ubuntu 22.04.2 LTS. I cloned runtime, installed all the required dependencies for building, and ran the command:

    build.sh clr+libs -rc release -arch arm64
    

    On Debian / Ubuntu the quickest way to set runtime build environment is by running: eng/install-native-dependencies.sh which sets up with default locales for you.

    What could've caused the error when building?

    e.g. MSBuild Exec task require locales during the build: dotnet/dotnet-buildtools-prereqs-docker#284. Debian-like distros don't come with preconfigured locale in base installation.

  3. carlossanlop commented on Mar 2, 2023

    @carlossanlop
    ContributorAuthor

    Thanks @am11. Good info.

    The error message I saw wasn't helpful enough. I expect more than one user hitting this problem and scratching their heads. So I wonder if we should improve the way we handle this:

    • Is it possible to check if preconfigured locale is available? If yes, we could add a check that fails quite early in the build, with a more meaningful message.
    • If it's not possible, then we could look for the place that failed, capture the error, and print a better message with steps to manually fix the locale issue. As I said, I was unable to determine the exact file/line that failed because the whole console screen had the error message repeated multiple times, and it was frozen so I couldn't scroll.
  4. carlossanlop commented on Mar 2, 2023

    @carlossanlop
    ContributorAuthor

    Alternatively, we could simply improve our workflow documentation to include locales in the list of dependencies to install, and describe the manual steps to execute on Debian-like distros to prevent the error:

    https://github.com/dotnet/runtime/blob/main/docs/workflow/requirements/linux-requirements.md#toolchain-setup

    Similar to what the docker PR fixed: https://github.com/dotnet/dotnet-buildtools-prereqs-docker/pull/284/files

  5. mangod9 commented on Mar 17, 2023

    @mangod9
    Member

    dont think this is a crossgen2 specific issue, rather something with infra?

  6. mangod9 commented on Jul 24, 2023

    @mangod9
    Member

    Closing since this is not crossgen2 related. @carlossanlop, please reopen if you are still hitting any failures.

  7. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 24, 2023
  8. ghost locked as resolved and limited conversation to collaborators on Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions