]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Enforce C.UTF-8 locale for all commands we run
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 27 May 2025 09:00:07 +0000 (11:00 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 27 May 2025 09:09:23 +0000 (11:09 +0200)
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.

mkosi/run.py

index e20f82cc3812f6f1da4d61ff777632cb33381f1e..05304d0fa585c9d93f7bad038cc4cbc728ca6cba 100644 (file)
@@ -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: