From nobody Mon Feb 9 09:22:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1615570210; cv=none; d=zohomail.com; s=zohoarc; b=H8UxkI8gomj6mhUFeTbDQM723Orsbn5zZ3bwFrncHDUViRphvW08/e+G/N/hPk1U78UcRy5Xmm/8wMPqc8gIoF4FkqOQJygDUpgGpTM65YcAHcRRokhtQrR+fVJxEOp9s9jweuTBS4S8LQnSQEiFR60RB0neQiS2ElaA+H59nBU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615570210; 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=f/+Rd7M1DxlW0QHlW8nMoP+AgdiD4MWUx/bFkOPJE0o=; b=jPxwuYTBumfVwLGAJkv/j+WK4fZ/hmKC3WoYKwQfRjPDRRWDP1wACMNCdQwG2olCoB00rq2aGKnjlyuv6qrC6X0G/FiuMd6HivM+G/v9Jkrs1fXDEHyUeb68t0iTjznk0PwnHH+5TeEvgrjOvgYlVN7D7kAqIr18Llwwv5RKvJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615570210563229.18537251102157; Fri, 12 Mar 2021 09:30:10 -0800 (PST) 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-567-pt3YsNSzPTqPenIu-91R5w-1; Fri, 12 Mar 2021 12:28:49 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8232851FE; Fri, 12 Mar 2021 17:28:43 +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 4D14922E20; Fri, 12 Mar 2021 17:28:43 +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 F0AFE180121E; Fri, 12 Mar 2021 17:28:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12CHSesR031410 for ; Fri, 12 Mar 2021 12:28:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id EFC705D6D7; Fri, 12 Mar 2021 17:28:40 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.194.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 109365D75F for ; Fri, 12 Mar 2021 17:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615570209; 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=f/+Rd7M1DxlW0QHlW8nMoP+AgdiD4MWUx/bFkOPJE0o=; b=I7DCnT9kGGxxstzv+/Ad36PCQzqc7t/1NetnRV9My/0A4M8aZr+i0TUM/ut2+T20WeWDid zuVCwzhNKXilNmjfh8LUSGppaUpnssf9CtZZeIpCnVoeI5DK0TGb/H1q6yA22+vQL8Ymb+ ofq4SZrnHE5HEoUbb2PO9LgTmKZjiNI= X-MC-Unique: pt3YsNSzPTqPenIu-91R5w-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v3 07/10] ci: Implement 'build' helper action Date: Fri, 12 Mar 2021 18:28:19 +0100 Message-Id: <20210312172822.244833-8-abologna@redhat.com> In-Reply-To: <20210312172822.244833-1-abologna@redhat.com> References: <20210312172822.244833-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.14 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) Content-Type: text/plain; charset="utf-8" This simply calls the underlying Makefile target, but allows additional arguments to be specified in a more convenient and discoverable way. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- ci/helper | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/ci/helper b/ci/helper index 8eb521ae40..4a552595df 100755 --- a/ci/helper +++ b/ci/helper @@ -55,6 +55,20 @@ class Parser: help=3D"use container images with non-default tags", ) =20 + # Options that are common to all actions that call the + # project's build system + mesonparser =3D argparse.ArgumentParser(add_help=3DFalse) + mesonparser.add_argument( + "--meson-args", + default=3D"", + help=3D"additional arguments passed to meson", + ) + mesonparser.add_argument( + "--ninja-args", + default=3D"", + help=3D"additional arguments passed to ninja", + ) + # Options that are common to all actions that use lcitool lcitoolparser =3D argparse.ArgumentParser(add_help=3DFalse) lcitoolparser.add_argument( @@ -72,6 +86,14 @@ class Parser: ) subparsers.required =3D True =20 + # build action + buildparser =3D subparsers.add_parser( + "build", + help=3D"run a build in a container", + parents=3D[containerparser, mesonparser], + ) + buildparser.set_defaults(func=3DApplication.action_build) + # shell action shellparser =3D subparsers.add_parser( "shell", @@ -115,7 +137,7 @@ class Application: target, ] =20 - if self.args.action =3D=3D "shell": + if self.args.action in ["build", "shell"]: args.extend([ f"CI_ENGINE=3D{self.args.engine}", f"CI_USER_LOGIN=3D{self.args.login}", @@ -123,6 +145,12 @@ class Application: f"CI_IMAGE_TAG=3D{self.args.image_tag}", ]) =20 + if self.args.action =3D=3D "build": + args.extend([ + f"CI_MESON_ARGS=3D{self.args.meson_args}", + f"CI_NINJA_ARGS=3D{self.args.ninja_args}", + ]) + if pty.spawn(["make"] + args) !=3D 0: sys.exit("error: 'make' failed") =20 @@ -200,6 +228,9 @@ class Application: print(f"cirrus/{host}") self.generate_vars(host) =20 + def action_build(self): + self.make_run(f"ci-build@{self.args.target}") + def action_shell(self): self.make_run(f"ci-shell@{self.args.target}") =20 --=20 2.26.2