From bd9fef71ec005be3c3a6d7f8b99d8116daf70c4f Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Wed, 2 Oct 2024 16:54:51 -0600 Subject: oeqa: Set LANG in wine tests Glib likes to try and determine the local name using the Windows GetConsoleOutputCP(), which doesn't work well running under wine in our test cases (it seems to be linked to stdin not being a terminal). This results in the error message: GLib-WARNING (recursed) **: Failed to determine console output code page: Invalid access.. Falling back to UTF-8 and then Glib falls back to the locale "UTF-8", which is invalid and the program will likely crash. In particular, pkg-config seems to be sensitive to this on some hosts (e.g. Ubuntu 24.04) Set the LANG variable to a valid language to make sure that this codepath in Glib is not triggered. Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- lib/oeqa/sdkmingw/context.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/oeqa/sdkmingw/context.py') diff --git a/lib/oeqa/sdkmingw/context.py b/lib/oeqa/sdkmingw/context.py index 5319223..5869e57 100644 --- a/lib/oeqa/sdkmingw/context.py +++ b/lib/oeqa/sdkmingw/context.py @@ -40,6 +40,12 @@ class OESDKMinGWTestContext(OESDKTestContext): # Convenience variables to make test cases easier to write env['SDK_DIR'] = getattr(self, 'wine_sdk_dir', '') + # Set the language. If this is not set to a valid language, then + # program that use glib will attempt to determine the language from + # stdin, which results in an error, fallback to "UTF-8" which is + # invalid and crash + env["LANG"] = "C.UTF-8" + return env def wine_path(self, p): -- cgit v1.2.3-54-g00ecf