From nobody Mon Feb 9 14:14:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552068071682526.697816755844; Fri, 8 Mar 2019 10:01:11 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4F08307EAA0; Fri, 8 Mar 2019 18:01:09 +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 886025C21E; Fri, 8 Mar 2019 18:01:09 +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 3D71E3D388; Fri, 8 Mar 2019 18:01:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x28I0wej009706 for ; Fri, 8 Mar 2019 13:00:58 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8C8311001E72; Fri, 8 Mar 2019 18:00:58 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0ED811001DFF for ; Fri, 8 Mar 2019 18:00:57 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 8 Mar 2019 19:00:49 +0100 Message-Id: <20190308180050.21764-4-abologna@redhat.com> In-Reply-To: <20190308180050.21764-1-abologna@redhat.com> References: <20190308180050.21764-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [dockerfiles PATCH 3/4] refresh: Add support for cross-compilation Dockerfiles 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 08 Mar 2019 18:01:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" lcitool can generate these Dockerfiles already, so we just need to parse the relevant information encoded in the file name and hand them over. Signed-off-by: Andrea Bolognani --- refresh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/refresh b/refresh index 5f7c41c..1e6c185 100755 --- a/refresh +++ b/refresh @@ -35,6 +35,7 @@ class MoveAlongException(Exception): class Dockerfile: =20 PREFIX =3D "buildenv-" + CROSS =3D "-cross-" SUFFIX =3D ".Dockerfile" =20 def __init__(self, path): @@ -49,7 +50,20 @@ class Dockerfile: raise Error("Invalid name '{}'".format(path.stem)) =20 self.path =3D path - self.os =3D path.stem[len(Dockerfile.PREFIX):] + stem =3D path.stem[len(Dockerfile.PREFIX):] + cross =3D stem.rfind(Dockerfile.CROSS) + + if cross >=3D 0: + # If we found CROSS, then everything before it is the name of + # the OS and everything after it the name of the architecture + # we're targeting for cross-compilation + self.os =3D stem[:cross] + self.cross_arch =3D stem[cross + len(Dockerfile.CROSS):] + else: + # Otherwise the entire stem is the name of the OS and there + # is no cross-compilation architecture + self.os =3D stem + self.cross_arch =3D None =20 # Fedora Rawhide is special in that we use it to perform MinGW # builds, so we need to add the corresponding projects @@ -63,6 +77,16 @@ class Dockerfile: args =3D [ lcitool, "dockerfile", + ] + + # Pass the cross-compilation architecture if present + if self.cross_arch is not None: + args +=3D [ + "--cross-arch", + self.cross_arch, + ] + + args +=3D [ "libvirt-" + self.os, self.projects, ] --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list