Repository navigation
Closed
Labels
Needs-ReproThe issue author needs to provide repro steps.
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
- check /etc/locale.gen it is does not contain any en_US locale, remove them,
- regen locales with locale-gen,
- 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.59Environment 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
Labels
Needs-ReproThe issue author needs to provide repro steps.
Activity
app-shells/pwsh: no WarningLevel, switch to en_US, misc tweaks
app-shells/pwsh: no WarningLevel, switch to en_US, misc tweaks
StevenBucher98 commentedon Dec 18, 2023
Thanks for the issue Maciej Barć (@xgqt)! Can you please provide better actionable reproducing steps to include information where you got the build, and specific commands you are running to get the build to fail.
xgqt commentedon Dec 18, 2023
Steven Bucher (@StevenBucher98)
First btw: we are also seeing a similar issue while building
dotnet-sdk, see: https://bugs.gentoo.org/920202The build I posted is while running under Portage, the Gentoo Linux from-source build system.
BUT I my case this is reproducible even on the current repo HEAD.
en_USlocale available, you can have any utf-8 locale, in my case Polish, but it will not matter.Reopen your login shell, eg
bash -lClone HEAD
git clone https://github.com/PowerShell/PowerShell cd PowerShellThrows:
More info:
rkeithhill commentedon Dec 20, 2023
Maciej Barć (@xgqt) Have you tried following these build instructions? https://github.com/PowerShell/PowerShell/blob/master/docs/building/internals.md
Ideally, you'd follow these build instructions but you'd need to install PowerShell first to run the PowerShell-based build scripts: https://github.com/PowerShell/PowerShell/blob/master/docs/building/linux.md
xgqt commentedon Dec 20, 2023
Keith Hill (@rkeithhill)
For this issue it is not a matter of throwing all that is possible to workaround the issue but rather a matter of explaining why it behaves this way and providing both the developer and user with required info.
The functions that force (and tamper with current operating system) are not okay, especially when the functions are undocumented.
For reference:
PowerShell/tools/ci.psm1
Line 226 in 2ad0315
I have searched in the docs, scripts and repo why this exists, but have no results.
Seeing that neither this 12dbdd9 has any answers, Im asking people who approved that PR if they know why this might be happening --- ping Rob Holt (@rjmholt) Adam Driscoll (@adamdriscoll) :)
rkeithhill commentedon Dec 20, 2023
The associated PR says the reason for setting the locale is:
Fixes daily CI issues on Linux where help tests fail due to bad locale settings.xgqt commentedon Dec 20, 2023
xgqt commentedon Dec 20, 2023
Supposedly this was a bug in msbuild that was fixed by dotnet/msbuild#9449
microsoft-github-policy-service commentedon Dec 20, 2023
📣 Hey Maciej Barć (@xgqt), how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://aka.ms/PSRepoFeedback