Skip to content

Commit

Permalink
Exec: use C instead of en_US.UTF-8 to set the Exec locale. (#9391)
Browse files Browse the repository at this point in the history
The en_US locale can't be used on systems where it is not installed. This is common in container images.

On such systems, setting the locale to en_US.UTF-8 causes unexpected warnings to be written to standard error.

When Exec.LogStandardErrorAsError is set, these warnings cause the Task to fail due to logging errors.

This changes to use the 'Computer English' C.UTF-8 locale, which is always available.

Fixes #4194

@rainersigwald @wfurt @janvorli ptal

cc @mthalman @omajid
  • Loading branch information
tmds authored Nov 6, 2023
1 parent 31c4d33 commit 7a6b2dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tasks/Exec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ protected internal override void AddCommandLineCommands(CommandLineBuilderExtens
{
commandLine.AppendSwitch("-c");
commandLine.AppendTextUnquoted(" \"");
commandLine.AppendTextUnquoted("export LANG=en_US.UTF-8; export LC_ALL=en_US.UTF-8; . ");
commandLine.AppendTextUnquoted(". ");
commandLine.AppendFileNameIfNotNull(batchFileForCommandLine);
commandLine.AppendTextUnquoted("\"");
}
Expand Down

0 comments on commit 7a6b2dd

Please sign in to comment.