From nobody Mon Feb 2 07:25:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1768576979; cv=none; d=zohomail.com; s=zohoarc; b=LiOel1czNL2/QZSlvMO7U/bROEjxpr7cDnEht8gwQyCfo4SWhZoAIQvVZKmLa2yxu4oLW/WIk/qz9FAExU/QdBG574mVkF0PJ1dtw1wnLrRfd/9apW3+tYLNkK2QJzMBmJruaG9PFYIm6EVD+yVSVYp2/dgX8OOfPSSAH/K5i9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768576979; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=9qDTXLU88IatQjujjdqdqP+dZ8pSAadtCX/vy9qCkpY=; b=CY9Lh82efEfzVl8I0nKDCdleiEdde67QpscwRvnUjFZeCt56vHCYnvRg2Bu/gw2mWO3GuQsD98YunIE7d67+xGPdoIaCgfw+oTzOuie3/zQfTH4jB57YJIQcX3KpclA3gwKVzoMkKLyGIPJICLIKdPjVhNNiZkOALU649n3vgUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1768576979244511.8296178440838; Fri, 16 Jan 2026 07:22:59 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0AAD041B64; Fri, 16 Jan 2026 10:22:59 -0500 (EST) Received: from [172.19.199.3] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 2DAFD43E74; Fri, 16 Jan 2026 10:20:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0892F3F330; Fri, 16 Jan 2026 10:20:26 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7C7883F328 for ; Fri, 16 Jan 2026 10:20:25 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-688-TSuuI9weNmG86h_ua9GjHQ-1; Fri, 16 Jan 2026 10:20:23 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 91A8518002CA for ; Fri, 16 Jan 2026 15:20:22 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.135]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B468D30002D6; Fri, 16 Jan 2026 15:20:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1768576825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9qDTXLU88IatQjujjdqdqP+dZ8pSAadtCX/vy9qCkpY=; b=gx0BLQn25F0ug5jcIySd6LGYcj2uKyUIY6fOVmlTS+AWXCLcHrO3kKwspG+qCA+CUdE2GY nV6zYTGlZpLpvA9zm/H4hD39bpHPWVmVW9cMh+WqkZ/dJVouWSJ1H7tAYk/uSXUQr6T67s YdTlfyZTGjEegj4ur1p7L0oIkqgq0No= X-MC-Unique: TSuuI9weNmG86h_ua9GjHQ-1 X-Mimecast-MFC-AGG-ID: TSuuI9weNmG86h_ua9GjHQ_1768576822 To: devel@lists.libvirt.org Subject: [PATCH 2/3] meson: write all warning flags to 'c-warnings.txt' Date: Fri, 16 Jan 2026 15:20:16 +0000 Message-ID: <20260116152017.1165526-3-berrange@redhat.com> In-Reply-To: <20260116152017.1165526-1-berrange@redhat.com> References: <20260116152017.1165526-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ZgF_WVf2xHXwdIF8kVJZBVO-ylIIhQOP7LNnRKDDNfk_1768576822 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: FXTRKAYRWWIKEGC2AKFZNSPJWGB5EGUF X-Message-ID-Hash: FXTRKAYRWWIKEGC2AKFZNSPJWGB5EGUF X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1768576989925158500 From: Daniel P. Berrang=C3=A9 Passing warning flags to the C compiler results in incredibly long command lines, which in turns results in incredibly large CI log files. Our logs are so large that they often exceed the GitLab file limits. We've cut out the irrelevant cruft from the logs and they're still too large. The only option left is to stop passing so many args to the compiler. Fortunately it is easy to achieve this with GCC/CLang as when seeing an argument "@somepath" they will treat each line in "somepath" as being an additional compiler argument. Putting the warning flags in a 'c-warnings.txt' file is fairly easy and a massive win. We don't loose anything from the CI logs as we print the full set of warning flags at the end of running 'meson'. Meanwhile for interactive builds the flags are visible in the c-warning.txt file in the build directory root. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 114 ++++++++++++++++++++------------------ scripts/meson-warnings.py | 9 +++ 2 files changed, 69 insertions(+), 54 deletions(-) create mode 100644 scripts/meson-warnings.py diff --git a/meson.build b/meson.build index d72c8e7a23..964d1fa4e1 100644 --- a/meson.build +++ b/meson.build @@ -232,6 +232,59 @@ libvirt_revision =3D arr_version[2].to_int() libvirt_lib_version =3D '@0@.@1@.@2@'.format(libvirt_so_version, libvirt_a= ge, libvirt_revision) =20 =20 +# Where we look for daemons and admin binaries during configure + +libvirt_sbin_path =3D [] + +if host_machine.system() !=3D 'windows' + libvirt_sbin_path +=3D [ + '/sbin', + '/usr/sbin', + '/usr/local/sbin', + ] +endif + + +# required programs check + +required_programs =3D [ + 'perl', + 'python3', + 'xmllint', + 'xsltproc', +] + +foreach name : required_programs + prog =3D find_program(name, dirs: libvirt_sbin_path) + varname =3D name.underscorify() + set_variable('@0@_prog'.format(varname), prog) +endforeach + +# optional programs + +optional_programs =3D [ + 'augparse', + 'black', + 'flake8', + 'pdwtags', + 'pytest', +] + +missing_optional_programs =3D [] +foreach name : optional_programs + prog =3D find_program(name, required: false, dirs: libvirt_sbin_path) + varname =3D name.underscorify() + if prog.found() + prog_path =3D prog.full_path() + else + prog_path =3D name + missing_optional_programs +=3D [ name ] + endif + + set_variable('@0@_prog'.format(varname), prog) +endforeach + + # check compile flags =20 cc =3D meson.get_compiler('c') @@ -534,7 +587,13 @@ if get_option('warning_level') =3D=3D '2' endif =20 endif -add_project_arguments(supported_cc_flags, language: 'c') + +run_command([python3_prog, + 'scripts' / 'meson-warnings.py', + meson.current_build_dir() / 'c-warnings.txt'] + supported_cc_= flags, + check: true) + +add_project_arguments('@' + meson.current_build_dir() / 'c-warnings.txt', = language: 'c') =20 if cc.has_argument('-Wsuggest-attribute=3Dformat') conf.set('WITH_SUGGEST_ATTRIBUTE_FORMAT', 1) @@ -809,59 +868,6 @@ endforeach conf.set('SIZEOF_LONG', cc.sizeof('long')) =20 =20 -# Where we look for daemons and admin binaries during configure - -libvirt_sbin_path =3D [] - -if host_machine.system() !=3D 'windows' - libvirt_sbin_path +=3D [ - '/sbin', - '/usr/sbin', - '/usr/local/sbin', - ] -endif - - -# required programs check - -required_programs =3D [ - 'perl', - 'python3', - 'xmllint', - 'xsltproc', -] - -foreach name : required_programs - prog =3D find_program(name, dirs: libvirt_sbin_path) - varname =3D name.underscorify() - set_variable('@0@_prog'.format(varname), prog) -endforeach - -# optional programs - -optional_programs =3D [ - 'augparse', - 'black', - 'flake8', - 'pdwtags', - 'pytest', -] - -missing_optional_programs =3D [] -foreach name : optional_programs - prog =3D find_program(name, required: false, dirs: libvirt_sbin_path) - varname =3D name.underscorify() - if prog.found() - prog_path =3D prog.full_path() - else - prog_path =3D name - missing_optional_programs +=3D [ name ] - endif - - set_variable('@0@_prog'.format(varname), prog) -endforeach - - # early checks where lot of other packages depend on the result =20 if not get_option('driver_remote').disabled() diff --git a/scripts/meson-warnings.py b/scripts/meson-warnings.py new file mode 100644 index 0000000000..27b0d45631 --- /dev/null +++ b/scripts/meson-warnings.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +import shutil +import sys + +with open(sys.argv[1], "w") as out: + for w in sys.argv[2:]: + print(w, file=3Dout) + --=20 2.52.0