From: Daan De Meyer Date: Tue, 27 May 2025 09:00:07 +0000 (+0200) Subject: Enforce C.UTF-8 locale for all commands we run X-Git-Tag: v26~214^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eda2ed533dbfe1bf7bf30b53355e6577fac97ba8;p=thirdparty%2Fmkosi.git Enforce C.UTF-8 locale for all commands we run So this is a shitty situation either way. We generally have no idea which locales will be available in the tools tree. Most likely, it'll just be the C.UTF-8 one. In that case, using the locale environment variables from the host is pointless and leads to annoying errors from lots of tools. We could make sure all locales are installed but glibc-all-langpacks is > 200M installed size on Fedora which feels like too much. So let's instead always use C.UTF-8, it's not like mkosi itself is locale aware anyway. --- diff --git a/mkosi/run.py b/mkosi/run.py index e20f82cc3..05304d0fa 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -196,7 +196,7 @@ def spawn( "PATH": os.environ["PATH"], "TERM": os.getenv("TERM", "vt220"), "LANG": "C.UTF-8", - **env, + **{k: v for k, v in env.items() if k != "LANG" and not k.startswith("LC_")}, } if "TMPDIR" in os.environ: