From nobody Sun May 5 13:37:50 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) client-ip=205.139.111.44; envelope-from=libvir-list-bounces@listman.redhat.com; helo=us-smtp-delivery-44.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613494664; cv=none; d=zohomail.com; s=zohoarc; b=ONV1Noa/zuaTbr7PWXUTz/BfeMHs4MNWAAcxKq2SNr/mTPpvtFd5hwCe8DcProM+rUOEDYHQt5DZOWZS0pGlApd8pl0I/7Z2GKpjeZnoZk6QsLkdwuO8EWyGJqoH+LS3aJcv6OwRjmz1vPYzj4VmRE4UzYNnbx0oC2SVAFP2++0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613494664; 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=QE49K+hKyLNTL6L2uX7aW/AUMyCT9SFXsibtzTG27iE=; b=Ak+D/vaKjpOdYy/bSDS0OxghWrnE/R1upuJ4RbQ7VIZ2mEf7mAvcfBz4nGzwTGuJbECq5QrgC19OcWpvllPnu4tye5at86id0iopaAcFxAJNCYH4PIkzRg6Bb2L9V86juw33mhRd0fREtKoxvBfItRjfBFjuxKs2VDFdWALwda0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 205.139.111.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by mx.zohomail.com with SMTPS id 1613494664179765.0045221885554; Tue, 16 Feb 2021 08:57:44 -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-278-QJrTkNe7P8qE-O7BH4uMog-1; Tue, 16 Feb 2021 11:57:38 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9599874980; Tue, 16 Feb 2021 16:57:32 +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 7574D60D43; Tue, 16 Feb 2021 16:57:31 +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 125FC58074; Tue, 16 Feb 2021 16:57:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11GGvP5R007889 for ; Tue, 16 Feb 2021 11:57:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id E351C1349A; Tue, 16 Feb 2021 16:57:25 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.196.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 14DF570481 for ; Tue, 16 Feb 2021 16:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613494662; 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=QE49K+hKyLNTL6L2uX7aW/AUMyCT9SFXsibtzTG27iE=; b=HXSKFOODxfV49IczTinYtxKRhSw/erf1s7BB5RhAHvlRXp/klcwsUSayorbcCBgOQ1CcTS qdtC3HTJs9y6t1hX4QKRdgzUYlU8VAizl7UEpuNx1S2SYhepuCWDgnXzScsMmueQ7e/RIZ 4hlHS2d3QuMAF25P5kpuAibPCkPXLm8= X-MC-Unique: QJrTkNe7P8qE-O7BH4uMog-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] ci: Remove Debian 9 special case Date: Tue, 16 Feb 2021 17:57:15 +0100 Message-Id: <20210216165716.143434-2-abologna@redhat.com> In-Reply-To: <20210216165716.143434-1-abologna@redhat.com> References: <20210216165716.143434-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@listman.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@listman.redhat.com Errors-To: libvir-list-bounces@listman.redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@listman.redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: listman.redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We no longer target this platform. Signed-off-by: Andrea Bolognani --- ci/containers/refresh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/containers/refresh b/ci/containers/refresh index a39d0b0996..f38d3634b5 100755 --- a/ci/containers/refresh +++ b/ci/containers/refresh @@ -28,8 +28,7 @@ do debian-*) for cross in aarch64 armv6l armv7l i686 mips mips64el mipsel ppc64= le s390x do - if test "$host-cross-$cross" =3D "debian-9-cross-i686" || - test "$host-cross-$cross" =3D "debian-sid-cross-mips" + if test "$host-cross-$cross" =3D "debian-sid-cross-mips" then continue fi --=20 2.26.2 From nobody Sun May 5 13:37:50 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 207.211.30.44 is neither permitted nor denied by domain of listman.redhat.com) client-ip=207.211.30.44; envelope-from=libvir-list-bounces@listman.redhat.com; helo=us-smtp-delivery-44.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 207.211.30.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613494684; cv=none; d=zohomail.com; s=zohoarc; b=DKHRvzKqfmGmQKtFUcST721Rh/cKdiIFY3juYWeoPduMcJDKAeWLl3YoW7beLgRkdwZpv0THL5iqw2lYeRQXN8I9LmIQ2qbQpeUOkbrnbpxuxgfZTSiiOKqVlzCQAVQ+Z/zGRyYhUiHmC0CNwtyVF6PI8ok0lXcdxeyvnnKZF54= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613494684; 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=b7QpCsvgJUFviO4/foltdQduHvt+ZyZOAksLmn0ES38=; b=OEi0iO0WhGkOuVib5hd81LQypOlwyoYCNDRag0H+MU3qUQhDdV0d2WZis9WVfBcDyAxmDGDkxyaVviYK2hI0WlrlBBl71F5bFVCGFKr+o8EDl6QK0LogsQFq8X1dR2TnJcnXJMk0xOWv9LcqxOpQtRjjrVzMTilirGiazC5VnO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=none (zohomail.com: 207.211.30.44 is neither permitted nor denied by domain of listman.redhat.com) smtp.mailfrom=libvir-list-bounces@listman.redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by mx.zohomail.com with SMTPS id 1613494684297367.11281005837225; Tue, 16 Feb 2021 08:58:04 -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-211-g0Ofg7SdMveGwL2N2vQpVA-1; Tue, 16 Feb 2021 11:57:58 -0500 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 84D89C73A8; Tue, 16 Feb 2021 16:57:50 +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 5E1F45D74C; Tue, 16 Feb 2021 16:57:50 +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 E2C601809C90; Tue, 16 Feb 2021 16:57:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11GGvRHG007903 for ; Tue, 16 Feb 2021 11:57:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6288D1349A; Tue, 16 Feb 2021 16:57:27 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.196.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63C9A6F450 for ; Tue, 16 Feb 2021 16:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613494683; 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=b7QpCsvgJUFviO4/foltdQduHvt+ZyZOAksLmn0ES38=; b=e+IJiMOaEnb5p9pIYSZcbvpGR6/eZOlzTVpZD+Z893K1zBL9U3st13OPXgtlTg1FHDNqex KGbGELqV/r1JkEkoXtIfdzr/edBnuuG8Pjj9FaMDhFgKyDtoQ8TBX2A5xLVlmsi37Get2S 0ZsMLUYKL6ZjY1SyKtCzkZPf3JCwZK8= X-MC-Unique: g0Ofg7SdMveGwL2N2vQpVA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] ci: Add helper script Date: Tue, 16 Feb 2021 17:57:16 +0100 Message-Id: <20210216165716.143434-3-abologna@redhat.com> In-Reply-To: <20210216165716.143434-1-abologna@redhat.com> References: <20210216165716.143434-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@listman.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@listman.redhat.com Errors-To: libvir-list-bounces@listman.redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@listman.redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: listman.redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is intended to be the entry point for a number of CI-related operations that currently are implemented in various different scripts written in various different programming languages; in this first iteration, it simply replaces the two existing refresh scripts. Advantages: * it refreshes all lcitool-generated files in one go; * it can be called from the top-level source directory; * it automatically finds lcitool if it's somewhere in the user's $PATH; * it produces some output to keep the user updated on the progress of the current operation; * it's written in a real programming language, which will hopefully help maintainability. Signed-off-by: Andrea Bolognani --- ci/cirrus/refresh | 22 -------- ci/containers/refresh | 41 --------------- ci/helper | 118 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 63 deletions(-) delete mode 100755 ci/cirrus/refresh delete mode 100755 ci/containers/refresh create mode 100755 ci/helper diff --git a/ci/cirrus/refresh b/ci/cirrus/refresh deleted file mode 100755 index 63ca794134..0000000000 --- a/ci/cirrus/refresh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -if test -z "$1" -then - echo "syntax: $0 PATH-TO-LCITOOL" - exit 1 -fi - -LCITOOL=3D$1 - -if ! test -x "$LCITOOL" -then - echo "$LCITOOL is not executable" - exit 1 -fi - -HOSTS=3D$($LCITOOL hosts | grep -E 'freebsd|macos') - -for host in $HOSTS -do - $LCITOOL variables "$host" libvirt >"$host.vars" -done diff --git a/ci/containers/refresh b/ci/containers/refresh deleted file mode 100755 index f38d3634b5..0000000000 --- a/ci/containers/refresh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -if test -z "$1" -then - echo "syntax: $0 PATH-TO-LCITOOL" - exit 1 -fi - -LCITOOL=3D$1 - -if ! test -x "$LCITOOL" -then - echo "$LCITOOL is not executable" - exit 1 -fi - -HOSTS=3D$($LCITOOL hosts | grep -Ev 'freebsd|macos') - -for host in $HOSTS -do - case "$host" in - fedora-rawhide) - for cross in mingw32 mingw64 - do - $LCITOOL dockerfile $host libvirt --cross $cross > ci-$host-cr= oss-$cross.Dockerfile - done - ;; - debian-*) - for cross in aarch64 armv6l armv7l i686 mips mips64el mipsel ppc64= le s390x - do - if test "$host-cross-$cross" =3D "debian-sid-cross-mips" - then - continue - fi - $LCITOOL dockerfile $host libvirt --cross $cross > ci-$host-cr= oss-$cross.Dockerfile - done - ;; - esac - - $LCITOOL dockerfile $host libvirt > ci-$host.Dockerfile -done diff --git a/ci/helper b/ci/helper new file mode 100755 index 0000000000..c0ca34bd28 --- /dev/null +++ b/ci/helper @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 +# +# Copyright (C) 2021 Red Hat, Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. If not, see +# . + +import argparse +import os +import shutil +import subprocess +import sys + +def lcitool_run(lcitool_path, lcitool_args): + if not lcitool_path: + lcitool_path =3D "lcitool" + if not shutil.which(lcitool_path): + sys.exit("error: 'lcitool' not installed") + + lcitool_out =3D subprocess.check_output([lcitool_path] + lcitool_args) + return lcitool_out.decode("utf-8") + +def lcitool_get_hosts(context): + lcitool_path =3D context["lcitool"] + + lcitool_out =3D lcitool_run(lcitool_path, ["hosts"]) + return lcitool_out.splitlines() + +def generate_dockerfile(context, host, cross=3DNone): + basedir =3D context["basedir"] + lcitool_path =3D context["lcitool"] + + lcitool_args =3D ["dockerfile", host, "libvirt"] + outfile =3D f"{basedir}/containers/ci-{host}.Dockerfile" + + if cross: + lcitool_args.extend(["--cross", cross]) + outfile =3D f"{basedir}/containers/ci-{host}-cross-{cross}.Dockerf= ile" + + lcitool_out =3D lcitool_run(lcitool_path, lcitool_args) + with open(outfile, "w") as f: + f.write(lcitool_out) + +def generate_vars(context, host): + basedir =3D context["basedir"] + lcitool_path =3D context["lcitool"] + + lcitool_out =3D lcitool_run(lcitool_path, ["variables", host, "libvirt= "]) + with open(f"{basedir}/cirrus/{host}.vars", "w") as f: + f.write(lcitool_out) + +def refresh_containers(context): + for host in lcitool_get_hosts(context): + if "freebsd" in host or "macos" in host: + continue + + if host =3D=3D "fedora-rawhide": + for cross in ["mingw32", "mingw64"]: + print(f"containers/{host} ({cross})") + generate_dockerfile(context, host, cross) + + if "debian-" in host: + for cross in ["aarch64", "armv6l", "armv7l", "i686", "mips", "= mips64el", "mipsel", "ppc64le", "s390x"]: + if host =3D=3D "debian-sid" and cross =3D=3D "mips": + continue + print(f"containers/{host} ({cross})") + generate_dockerfile(context, host, cross) + + print(f"containers/{host}") + generate_dockerfile(context, host) + +def refresh_cirrus(context): + for host in lcitool_get_hosts(context): + if "freebsd" not in host and "macos" not in host: + continue + + print(f"cirrus/{host}") + generate_vars(context, host) + +def refresh(context): + refresh_containers(context) + refresh_cirrus(context) + +def main(): + parser =3D argparse.ArgumentParser() + subparsers =3D parser.add_subparsers(dest=3D"action", metavar=3D"ACTIO= N") + subparsers.required =3D True + refreshparser =3D subparsers.add_parser( + "refresh", + help=3D"refresh data in containers/ and cirrus/ directories", + ) + refreshparser.add_argument( + "--lcitool", + metavar=3D"PATH", + help=3D"path to lcitool", + ) + args =3D parser.parse_args() + + if args.action =3D=3D "refresh": + context =3D { + "lcitool": args.lcitool, + "basedir": os.path.dirname(os.path.realpath(__file__)), + } + refresh(context) + +if __name__ =3D=3D "__main__": + main() --=20 2.26.2