Skip to content

PowerShell build fails on GNU/Linux systems without the en_US locale #20941

Description

@xgqt

Prerequisites

Steps to reproduce

  1. check /etc/locale.gen it is does not contain any en_US locale, remove them,
  2. regen locales with locale-gen,
  3. switch to a non-en_US locale, for example on Gentoo use eselect locale set ...

I would like to know if we can use the C locale for build and the "why" if it is not possible.
If it is impossible to use other locale,
then from-source distributions like Gentoo, Guix, Nix, LFS, etc.
have to update their build scripts.

Expected behavior

Build passes with success, maybe with some features unavailable?

Actual behavior

Build fails.

Error details

> dotnet-8.0 build --configuration Release --no-restore --no-self-contained --output /var/tmp/portage/app-shells/pwsh-7.4.0/work/pwsh-7.4.0_net8.0_Release --runtime linux-x64 -maxCpuCount:6 -p:StripSymbols=true -p:NativeDebugSymbols=false -p:WarningLevel=1 src/powershell-unix/powershell-unix.csproj


MSBuild version 17.8.3+195e7f5a3 for .NET
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  /bin/sh: line 1: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
  PSVersionInfoGenerator -> /var/tmp/portage/app-shells/pwsh-7.4.0/work/pwsh-7.4.0_net8.0_Release/SMA.Generator.dll
/usr/lib64/dotnet-sdk-8.0/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssemblyInfo.targets(226,5): error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion". [/var/tmp/portage/app-shells/pwsh-7.4.0/work/pwsh-7.4.0/src/System.Management.Automation/System.Management.Automation.csproj]

Build FAILED.

/usr/lib64/dotnet-sdk-8.0/sdk/8.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.GenerateAssemblyInfo.targets(226,5): error MSB4044: The "GetAssemblyVersion" task was not given a value for the required parameter "NuGetVersion". [/var/tmp/portage/app-shells/pwsh-7.4.0/work/pwsh-7.4.0/src/System.Management.Automation/System.Management.Automation.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:06.59

Environment data

> Paste verbatim output from $PSVersionTable below.

None.

> locale


LANG=pl_PL.utf8
LC_CTYPE="pl_PL.utf8"
LC_NUMERIC="pl_PL.utf8"
LC_TIME="pl_PL.utf8"
LC_COLLATE=POSIX
LC_MONETARY="pl_PL.utf8"
LC_MESSAGES="pl_PL.utf8"
LC_PAPER="pl_PL.utf8"
LC_NAME="pl_PL.utf8"
LC_ADDRESS="pl_PL.utf8"
LC_TELEPHONE="pl_PL.utf8"
LC_MEASUREMENT="pl_PL.utf8"
LC_IDENTIFICATION="pl_PL.utf8"
LC_ALL=

Visuals

none.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs-ReproThe issue author needs to provide repro steps.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions