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

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

Closed
carlossanlop opened this issue Mar 2, 2023 · 5 comments

Comments

@carlossanlop
Copy link
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

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?

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 2, 2023
@am11
Copy link
Member

am11 commented Mar 2, 2023

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.

@carlossanlop
Copy link
Member Author

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.

@carlossanlop
Copy link
Member Author

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

@mangod9
Copy link
Member

mangod9 commented Mar 17, 2023

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

@mangod9
Copy link
Member

mangod9 commented Jul 24, 2023

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

@mangod9 mangod9 closed this as completed Jul 24, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 24, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants