From nobody Sun Feb 8 18:09:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594894054; cv=none; d=zohomail.com; s=zohoarc; b=QktPjrgmUfTlflPZIwaOECvUCUPIhqa3kei0U3Tgf1mauNcXcfotQiK1NyIrkHJbQplTbn1dgizHKIYU21ChiJLQrnvelI3PDILhl8kzkVQb3M9nU41FlG+RmSliMA4wB42uJG+AzALTRchGGAFrLmK8nMSbDPLxg56XY5rIONQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594894054; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hL9ISwDFJVKS9HRaGhIwKWTUf3HWnhbbnRrKIZ5bFxs=; b=hHfaqgHdNM/bbAZ0ILkqxVwsISBDjgoAKju//gmtfrqnDWiJK7u3L2JbOX8JA1rfcrrHxfQJV2I5uJsQdbn9RjxWnfdD0H2dlEKYk5ZraPOXnvh3xnMsk4cGwfDVHiGynYEfujos9FiIctCGtxE3da213MES9X1ZyS2xtLAETS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594894054912907.0055111609449; Thu, 16 Jul 2020 03:07:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-448-1vffusSaPnaeDpFawPjtxg-1; Thu, 16 Jul 2020 06:07:31 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4793800400; Thu, 16 Jul 2020 10:07:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D91272ADF; Thu, 16 Jul 2020 10:07:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3F4729623C; Thu, 16 Jul 2020 10:07:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06GA3RPs017223 for ; Thu, 16 Jul 2020 06:03:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id E57CB2DE6B; Thu, 16 Jul 2020 10:03:27 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F9312B6DB for ; Thu, 16 Jul 2020 10:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594894053; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hL9ISwDFJVKS9HRaGhIwKWTUf3HWnhbbnRrKIZ5bFxs=; b=OOTj0vQ7+szGRvRmLePqFgqawb3X7zBqgCzPlKNmwHvLvAH4ppbrVibT+scTKMvlMZAG7G EtJaYIaNsu5u+8SAyENvXFjUWGdZMJ35NuW+JhFYSc9SXzeVdBQDkie3A6Y2pTwqL3HDxG yi1EK1bnYmSs9FnZV1WYoWjuWRjT7DI= X-MC-Unique: 1vffusSaPnaeDpFawPjtxg-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 126/351] meson: add runutf8 env vars and meson-python.sh script Date: Thu, 16 Jul 2020 11:56:02 +0200 Message-Id: <15f31fad6b6b565b963d3cc85f191e77140f1944.1594891445.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" With meson we have to use both env vars and wrapper script to run python with correct LANG settings. run_command() and test() have 'env' attribute so we can use it, but custom_target() doesn't support that attribute. Environment variables cannot by configured using 'command' because meson checks if the first item in the list is executable so we have to use a wrapper. Signed-off-by: Pavel Hrdina --- configure.ac | 7 ------- meson.build | 7 +++++++ scripts/meson-python.sh | 3 +++ scripts/meson.build | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 scripts/meson-python.sh diff --git a/configure.ac b/configure.ac index 5f931071b06..e6c7e50bb14 100644 --- a/configure.ac +++ b/configure.ac @@ -90,13 +90,6 @@ dnl Need to test if pkg-config exists PKG_PROG_PKG_CONFIG =20 =20 -dnl Python3 < 3.7 treats the C locale as 7-bit only. -dnl We must force env vars so it treats it as UTF-8 -dnl regardless of the user's locale. -RUNUTF8=3D"LC_ALL=3D LANG=3DC LC_CTYPE=3Den_US.UTF-8" -AC_SUBST(RUNUTF8) - - dnl MinGW checks LIBVIRT_WIN_CHECK_SYMBOLS LIBVIRT_WIN_CHECK_WINDRES diff --git a/meson.build b/meson.build index 9e0cbbad6d7..48db9aa0d0a 100644 --- a/meson.build +++ b/meson.build @@ -2182,6 +2182,13 @@ endif conf.set_quoted('TLS_PRIORITY', get_option('tls_priority')) =20 =20 +# Various definitions + +# Python3 < 3.7 treats the C locale as 7-bit only. We must force env vars = so +# it treats it as UTF-8 regardless of the user's locale. +runutf8 =3D [ 'LC_ALL=3D', 'LANG=3DC', 'LC_CTYPE=3Den_US.UTF-8' ] + + # define top include directory =20 top_inc_dir =3D include_directories('.') diff --git a/scripts/meson-python.sh b/scripts/meson-python.sh new file mode 100755 index 00000000000..9ba670fc1a5 --- /dev/null +++ b/scripts/meson-python.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +LC_ALL=3D LANG=3DC LC_CTYPE=3Den_US.UTF-8 "$@" diff --git a/scripts/meson.build b/scripts/meson.build index 941e40a0917..5d3f0af4793 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -18,6 +18,7 @@ scripts =3D [ 'header-ifdef.py', 'hvsupport.py', 'hyperv_wmi_generator.py', + 'meson-python.sh', 'mock-noinline.py', 'prohibit-duplicate-header.py', 'test-wrap-argv.py', --=20 2.26.2