From nobody Sat Feb 7 07:31:26 2026 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=1675691615; cv=none; d=zohomail.com; s=zohoarc; b=A4kYC+yFzUnTA7yXk/hq9QHGAXISe1fhMTcc8i5vX2XBmz4Pn+m0ua+JGYRxeD1HO6Ab6mlTf5yIVTL98t7RAaBf2i37iPFOjBRKUwyGkfWRt8OxbKmOgWHw0tfN+OFmxrvpU+qX63uWqGKiEHGfsHVj5/Rtlzi/LaTPcCHjkyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675691615; h=Content-Type:Content-Transfer-Encoding:Cc: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=1KHTrB5G+hXP6XNS6Ltv5zSUVrSHFgLXtijbaT8BQro=; b=i9eTMmPxzD75jzpbNHiDOc6hLvWWAFSq3iTnUQWZgcMeny652aIuvDmIwAKg7jsx7Y6HtBbnYOxNSyg5bMG+QGOm1cKEOBtMulud9C0OhCKlULurUPd7mMlvGTib1wRn+fEOYEp+pwTqtULUTn3+P0ab0K64ZqgBUzzAgLa0qkw= 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 1675691615944484.87856530830334; Mon, 6 Feb 2023 05:53:35 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-BaRp1leWM_G8YeZEXAfVxQ-1; Mon, 06 Feb 2023 08:53:31 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4F61858F09; Mon, 6 Feb 2023 13:53:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D251F40398A0; Mon, 6 Feb 2023 13:53:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B7D02194658C; Mon, 6 Feb 2023 13:53:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 298CF1946589 for ; Mon, 6 Feb 2023 13:53:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1BD2714171BB; Mon, 6 Feb 2023 13:53:25 +0000 (UTC) Received: from ridgehead.redhat.com (ovpn-193-197.brq.redhat.com [10.40.193.197]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8B1891410F36; Mon, 6 Feb 2023 13:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675691615; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1KHTrB5G+hXP6XNS6Ltv5zSUVrSHFgLXtijbaT8BQro=; b=LJF9sxZQQNRq1g4Zqwh1T2k1tJ+yuJtw9I3iyz0sZmQQh0sOh0Bwlgz55ET8A7xwKKvxKx iDeS2Rt8BPF11ARhW6e0AhETCQros1qktg//539YgJQLct4lxHLe6f/EHv0Vnv5zhxDCRR NbVdcLyiiQtnxtpUlArrOBz6mmjuTqg= X-MC-Unique: BaRp1leWM_G8YeZEXAfVxQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH 08/20] ci: build.sh: Move off of ninja command to directly calling meson Date: Mon, 6 Feb 2023 14:53:05 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Skultety Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1675691616662100003 Content-Type: text/plain; charset="utf-8"; x-default="true" This change however involves adding a couple of new environment variables as well as tuning the helper script to support local container executions properly. The overall motivation here is to move all script logic from .gitlab-ci.yml to the build.sh script so that the steps are consistent and identical when executing in local containers and GitLab. By adding the new env variables and increasing the granularity in meson commands executed in the script it gives us better options on how to port the existing code from .gitlab-ci.yml to a standalone Bash script. Signed-off-by: Erik Skultety --- ci/Makefile | 11 +++++++---- ci/build.sh | 3 ++- ci/helper | 21 ++++++++++++++------- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index 8f1be4318d..217eda3cc0 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -162,7 +162,9 @@ CI_ENGINE_ARGS =3D \ --workdir "$(CI_USER_HOME)" \ --env CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)" \ --env MESON_ARGS=3D"$(MESON_ARGS)" \ - --env NINJA_ARGS=3D"$(NINJA_ARGS)" \ + --env MESON_BUILD_ARGS=3D"$(MESON_BUILD_ARGS)" \ + --env MESON_RUN_TEST=3D$(MESON_RUN_TEST) \ + --env MESON_TEST_ARGS=3D"$(MESON_TEST_ARGS)" \ $(CI_PODMAN_ARGS) \ $(CI_PWDB_MOUNTS) \ $(CI_HOME_MOUNTS) \ @@ -209,7 +211,7 @@ ci-build@%: $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND=3D"$(CI_USER_HOME)/= build" =20 ci-test@%: - $(MAKE) -C $(CI_ROOTDIR) ci-build@$* CI_NINJA_ARGS=3Dtest + $(MAKE) -C $(CI_ROOTDIR) ci-build@$* =20 ci-help: @echo @@ -240,6 +242,7 @@ ci-help: @echo " CI_USER_LOGIN=3D - which user should run in the conta= iner (default is $$USER)" @echo " CI_IMAGE_PREFIX=3D - override to prefer a locally built= image, (default is $(CI_IMAGE_PREFIX))" @echo " CI_IMAGE_TAG=3D:latest - optionally use in conjunction with= 'CI_IMAGE_PREFIX'" - @echo " CI_MESON_ARGS=3D - extra arguments passed to meson" - @echo " CI_NINJA_ARGS=3D - extra arguments passed to ninja" + @echo " MESON_ARGS=3D - extra configure arguments passed to m= eson setup" + @echo " MESON_BUILD_ARGS=3D - extra build arguments passed to meson= compile" + @echo " MESON_TEST_ARGS=3D - extra arguments passed to meson test" @echo diff --git a/ci/build.sh b/ci/build.sh index 9489c4ab2f..2a83f756d5 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -11,4 +11,5 @@ export VIR_TEST_DEBUG=3D1 meson setup build --werror -Dsystem=3Dtrue $MESON_OPTS $MESON_ARGS || \ (cat build/meson-logs/meson-log.txt && exit 1) =20 -ninja -C build $NINJA_ARGS +meson compile -C build $MESON_BUILD_ARGS +meson test -C build $MESON_TEST_ARGS diff --git a/ci/helper b/ci/helper index fb562d55e1..7b8f2e6826 100755 --- a/ci/helper +++ b/ci/helper @@ -48,15 +48,21 @@ class Parser: # project's build system mesonparser =3D argparse.ArgumentParser(add_help=3DFalse) mesonparser.add_argument( - "--meson-args", + "--meson-configure-args", default=3D"", - help=3D"additional arguments passed to meson " - "(eg --meson-args=3D'-Dopt1=3Denabled -Dopt2=3Ddisabled')= ", + help=3D"additional arguments passed to meson setup" + "(eg --meson-configure-args=3D'-Dopt1=3Denabled -Dopt2=3D= disabled')", ) mesonparser.add_argument( - "--ninja-args", + "--meson-build-args", default=3D"", - help=3D"additional arguments passed to ninja", + help=3D"additional arguments passed to meson compile" + "(eg --meson-build-args=3D'--clean --jobs N ')", + ) + mesonparser.add_argument( + "--meson-test-args", + default=3D"", + help=3D"additional arguments passed to meson test", ) =20 # Options that are common to actions communicating with a GitLab @@ -152,8 +158,9 @@ class Application: =20 if self._args.action in ["build", "test"]: args.extend([ - f"MESON_ARGS=3D{self._args.meson_args}", - f"NINJA_ARGS=3D{self._args.ninja_args}", + f"MESON_ARGS=3D{self._args.meson_configure_args}", + f"MESON_BUILD_ARGS=3D{self._args.meson_build_args}", + f"MESON_TEST_ARGS=3D{self._args.meson_test_args}", ]) =20 if pty.spawn(["make"] + args) !=3D 0: --=20 2.39.1