From nobody Wed May 15 12:26:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1642888570; cv=none; d=zohomail.com; s=zohoarc; b=fsxHpw53nPbC0Hm/aq4WI2AlhfE+NGptUWzy5/8EEH6VENKVOF81hg486B5tqWsF+VdjudALvFJjsDGTFYDt1YoZFsFo/lRTTyynuDdcub6cA0jzUbf+XH9PGXRRUZ0CwMPIOQBQifPghRF96lXpiFlDPezzQWgghOjm/kMzBnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642888570; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=obIKPxVN9qmXbPb9Q2gG/EaZpbh36U8KuPp50dk6mV4=; b=dUdl9EH0YR5bLPaWniaDHVHCX9SatoOU3GkT/6f6gBPtECHYyIydL7GUOTa0j2UlV1i8H2rpj0ne/KjTOJW0iJh9VNR+7gF0tynOoPFCk/gBwKz25qtqWnkPj9BAChJ7cGTC5nEItGgT//MFKx2p6KELwc/9ZiqOJLQtmMgP0Mg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1642888570180769.7556429203111; Sat, 22 Jan 2022 13:56:10 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-530-mppvrULqN8ibG7iPPesvJg-1; Sat, 22 Jan 2022 16:56:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 58D051853026; Sat, 22 Jan 2022 21:56:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D04DC1037F45; Sat, 22 Jan 2022 21:55:59 +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 1A1881809CB8; Sat, 22 Jan 2022 21:55:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20MLsrj6011668 for ; Sat, 22 Jan 2022 16:54:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id B405D492CA7; Sat, 22 Jan 2022 21:54:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AFED6492CA6 for ; Sat, 22 Jan 2022 21:54:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 94FF61C05EB7 for ; Sat, 22 Jan 2022 21:54:53 +0000 (UTC) Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-564-tFHIf6p6OM2n_2m2wdkTRw-1; Sat, 22 Jan 2022 16:54:51 -0500 Received: by mail-ej1-f70.google.com with SMTP id d18-20020a1709063ed200b006a5eeb2ee4dso1418746ejj.3 for ; Sat, 22 Jan 2022 13:54:51 -0800 (PST) Received: from carol.localdomain (k8r.cz. [95.82.177.71]) by smtp.gmail.com with ESMTPSA id h3sm3189995ejl.193.2022.01.22.13.54.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jan 2022 13:54:49 -0800 (PST) Received: from carol.redhat.com (carol.k8r.cz [IPv6:::1]) by carol.localdomain (Postfix) with ESMTP id CEE57C20024 for ; Sat, 22 Jan 2022 22:54:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642888569; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=obIKPxVN9qmXbPb9Q2gG/EaZpbh36U8KuPp50dk6mV4=; b=RAM6F2ZFbL3nwQS2NjSQv09WGuST80flIzEszG62MPvUunzHp63/0qezSA3kNF8fUP39/B 6zf4K59qdVUEjRfuWJbXm/q96yVFUENrDbHpX0iqpL8b0TP2tk95bH3IQgiftj7C+q+Jo5 UIOOjmiXWApVMH1MmmLBMD7xPPBPd8g= X-MC-Unique: mppvrULqN8ibG7iPPesvJg-1 X-MC-Unique: tFHIf6p6OM2n_2m2wdkTRw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=obIKPxVN9qmXbPb9Q2gG/EaZpbh36U8KuPp50dk6mV4=; b=8RxnB5cHUKYvG0pT58Cw8nzkAdQyuFRJ3rYdjy1vUzRZTcCRLkU1Q2iR4FPBpCUfv0 lrX+9uIHFGZLn8eoyuyBXvI3HONp20IX3JZgmjCebtCxwZLyJhoqrnODjL8QTBT/pmwZ +ewf4OeLCBSONH2xcWf3BNL7Fl7JwAxZmSTAFc6YqxCH4aXWSwz+xlX8qoQRA8tzq/3N rpt6L3hlyh/pCTAdrlMNp0MmwXBkKHWuiewKe4yAX2luOI4z9JfsY4tYfVYcSV6qsvrP oU1C/1mS2wqwm8mKyKFFYr8er7ZV97I8i8xwc37ygqY4kYk0dALklam8wZ3sX1R51p8O SQBw== X-Gm-Message-State: AOAM530eS2jmgc3akh1yQSo0CKW6ATDqevfAyG1XMH1Bg07FXruLA50d VG95I/O2q7XRjFn+rO5ozox2QVBvn5it6/PCHkb5vY7STM3b0UT5iHaW5hceDrVCYwXM3aCOHnf 9fVR8iS3rEQ+brHVWlmAl/gh85m8I94Lnq0gyLZ2RxmD4yD2HTMOsYlhXKsYr8Zx2RBRgYMY= X-Received: by 2002:a17:907:3d01:: with SMTP id gm1mr7604969ejc.749.1642888490044; Sat, 22 Jan 2022 13:54:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP0vYhV8Hg0PmGPG44YrWgeEwTFH4FfOo2IxiD/WGA/cfIsutfMheQ/7UAUYxV/GvmlAXG1g== X-Received: by 2002:a17:907:3d01:: with SMTP id gm1mr7604956ejc.749.1642888489701; Sat, 22 Jan 2022 13:54:49 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH] meson: Explicitly specify run_command's check parameter Date: Sat, 22 Jan 2022 22:54:45 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642888572610100001 Content-Type: text/plain; charset="utf-8" An update to meson 0.61.1 meant that it started showing warnings due to the= fact that the default for run_command's 'check' parameter is going to change. It unveiled the fact that we were even missing that parameter in some calls wh= ere we expected different outcome. To make sure the behaviour does not change specify the parameter explicitly. In places where we check for the return = code the parameter should be 'false' so that meson does not fail. In all other = cases the parameter should be set to 'true' to make sure possible failure also st= ops meson. The warning in meson was added in https://github.com/mesonbuild/meson/pull/= 9304 Signed-off-by: Martin Kletzander Reviewed-by: Tim Wiederhake --- build-aux/meson.build | 2 +- docs/meson.build | 4 ++-- meson.build | 22 ++++++++++++---------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/build-aux/meson.build b/build-aux/meson.build index e491bdeebc3f..f4d0130e3bf2 100644 --- a/build-aux/meson.build +++ b/build-aux/meson.build @@ -20,7 +20,7 @@ endif =20 if host_machine.system() =3D=3D 'freebsd' grep_prog =3D find_program('grep') - grep_cmd =3D run_command(grep_prog, '--version') + grep_cmd =3D run_command(grep_prog, '--version', check: true) if grep_cmd.stdout().startswith('grep (BSD grep') grep_prog =3D find_program('/usr/local/bin/grep', required: false) if not grep_prog.found() diff --git a/docs/meson.build b/docs/meson.build index 50c12cc3c255..54bba5e1b1fc 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -132,7 +132,7 @@ aclperms_gen =3D custom_target( ) =20 docs_timestamp =3D run_command( - python3_prog, meson_timestamp_prog.path(), env: runutf8 + python3_prog, meson_timestamp_prog.path(), env: runutf8, check: true, ).stdout().strip() =20 site_xsl =3D files('site.xsl') @@ -206,7 +206,7 @@ endforeach # # Use this knowledge to detect the version that we know doesn't work # for building libvirt and reject it -rst2html5_version =3D run_command(rst2html5_prog, '--version') +rst2html5_version =3D run_command(rst2html5_prog, '--version', check: true) rst2html5_version =3D rst2html5_version.stdout().split(' ') if rst2html5_version[1] !=3D '(Docutils' error('Please uninstall the rst2html5 package and install the docutils p= ackage') diff --git a/meson.build b/meson.build index 70843afcd546..ccb2b73624e0 100644 --- a/meson.build +++ b/meson.build @@ -14,10 +14,10 @@ project( =20 # figure out if we are building from git =20 -git =3D run_command('test', '-d', '.git').returncode() =3D=3D 0 +git =3D run_command('test', '-d', '.git', check: false).returncode() =3D= =3D 0 =20 if git and not get_option('no_git') - run_command('git', 'submodule', 'update', '--init') + run_command('git', 'submodule', 'update', '--init', check: true) endif =20 =20 @@ -45,7 +45,7 @@ endif if get_option('system') prefix =3D '/usr' libdir =3D prefix / 'lib64' - if run_command('test', '-d', libdir).returncode() !=3D 0 + if run_command('test', '-d', libdir, check: false).returncode() !=3D 0 libdir =3D prefix / 'lib' endif localstatedir =3D '/var' @@ -222,6 +222,7 @@ size_max =3D cc.sizeof('size_t', prefix: '#include ') alloc_max =3D run_command( 'python3', '-c', 'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max,= size_max), + check: true, ) =20 # sanitizer instrumentation may enlarge stack frames @@ -1096,7 +1097,7 @@ if not get_option('nls').disabled() endforeach =20 if xgettext_prog.found() and msgfmt_prog.found() and msgmerge_prog.found= () - rc =3D run_command(msgfmt_prog, '--version') + rc =3D run_command(msgfmt_prog, '--version', check: false) if rc.returncode() =3D=3D 0 and rc.stdout().contains('GNU gettext') have_gnu_gettext_tools =3D true endif @@ -1199,7 +1200,7 @@ selinux_dep =3D dependency('libselinux', required: ge= t_option('selinux')) if selinux_dep.found() selinux_mount =3D get_option('selinux_mount') if selinux_mount =3D=3D '' - if run_command('test', '-d', '/sys/fs/selinux').returncode() =3D=3D 0 + if run_command('test', '-d', '/sys/fs/selinux', check: false).returnco= de() =3D=3D 0 selinux_mount =3D '/sys/fs/selinux' else selinux_mount =3D '/selinux' @@ -1658,7 +1659,7 @@ if not get_option('driver_qemu').disabled() default_qemu_user =3D 'root' default_qemu_group =3D 'wheel' else - os_release =3D run_command('grep', '^ID=3D', '/etc/os-release').stdo= ut() + os_release =3D run_command('grep', '^ID=3D', '/etc/os-release', chec= k: true).stdout() if os_release.contains('arch') default_qemu_user =3D 'nobody' default_qemu_group =3D 'nobody' @@ -1682,8 +1683,8 @@ if not get_option('driver_qemu').disabled() # If the expected user and group don't exist, or we haven't hit any # of the cases above bacuse we're running on an unknown OS, the only # sensible fallback is root:root - if (run_command('getent', 'passwd', default_qemu_user).returncode() = !=3D 0 and - run_command('getent', 'group', default_qemu_group).returncode() = !=3D 0) + if (run_command('getent', 'passwd', default_qemu_user, check: false)= .returncode() !=3D 0 and + run_command('getent', 'group', default_qemu_group, check: false)= .returncode() !=3D 0) default_qemu_user =3D 'root' default_qemu_group =3D 'root' endif @@ -2178,7 +2179,8 @@ if git ) endforeach =20 - authors =3D run_command(python3_prog, meson_gen_authors_prog.path(), env= : runutf8) + authors =3D run_command(python3_prog, meson_gen_authors_prog.path(), + env: runutf8, check: true) authors_file =3D 'AUTHORS.rst.in' =20 authors_conf =3D configuration_data() @@ -2218,7 +2220,7 @@ configure_file( output: '@BASENAME@', configuration: run_conf, ) -run_command('chmod', 'a+x', meson.current_build_dir() / 'run') +run_command('chmod', 'a+x', meson.current_build_dir() / 'run', check: true) =20 =20 # generate developer tooling files --=20 2.34.1