From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949017; cv=none; d=zoho.com; s=zohoarc; b=Ox3aTnfF9oDwFH/T4BKwLDT4emeEbvZjacnOGa48v7TQp/TyaY4xtGwBne0iKrWkELQKjloMDclYgqmLJiFyrl9SAfj+4TGFHAIhWsKKxpIB/mWHdSn2QGyiTRp025JY3SCMfcGtOA8CXYeezHig44+JhUGY5KZgfthuofsf/iY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949017; 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:ARC-Authentication-Results; bh=/s/e9UkTjZFiIB61wIQXszNz3xJyMXHl8LwC47AU8SU=; b=X8JOLuNWvxbTrdnE+PMSWHwhxBCBHcrjrdfPdZO579dcUDz01puiFOUNncWY2zEcVJwyxJ2YPIVBqzXaC1Qw1KL+1Tz7U+bC5I2an802NyRRP2uS4/wsWjOzu8gz8cufdQtBTxHlvZEZ33l6EanZ6IPurKGDx5GdGgKL/NgBWkk= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949017195456.08743961896243; Fri, 16 Aug 2019 02:50:17 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 179DE3066FD9; Fri, 16 Aug 2019 09:50:16 +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 DB88D84635; Fri, 16 Aug 2019 09:50:15 +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 A01E52551D; Fri, 16 Aug 2019 09:50:15 +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 x7G9nx3o019710 for ; Fri, 16 Aug 2019 05:49:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id 353A783B8F; Fri, 16 Aug 2019 09:49:59 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B502B8261E for ; Fri, 16 Aug 2019 09:49:58 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:45 +0200 Message-Id: <20190816094954.30096-2-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 01/10] ci: Fix /etc/sub{u,g}id parsing 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 16 Aug 2019 09:50:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The $ needs to be escaped when calling shell code from a Makefile. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- Makefile.ci | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.ci b/Makefile.ci index 977e0445c6..14d595a00f 100644 --- a/Makefile.ci +++ b/Makefile.ci @@ -114,8 +114,8 @@ ifeq ($(CI_ENGINE),podman) # need to be higher, but that only happens when your /etc/sub{u,g}id allow # users to have more IDs. Unless --keep-uid is supported, let's do this = in a # way that should work for everyone. - CI_MAX_UID =3D $(shell sed -n "s/^$USER:[^:]\+://p" /etc/subuid) - CI_MAX_GID =3D $(shell sed -n "s/^$USER:[^:]\+://p" /etc/subgid) + CI_MAX_UID =3D $(shell sed -n "s/^$$USER:[^:]\+://p" /etc/subuid) + CI_MAX_GID =3D $(shell sed -n "s/^$$USER:[^:]\+://p" /etc/subgid) ifeq ($(CI_MAX_UID),) CI_MAX_UID =3D 65536 endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949004; cv=none; d=zoho.com; s=zohoarc; b=O2q25cZPpfY2OEYZ9E7wY/cf70e8HhUMjC6ftXG7PeqHLlf5gGfwmx/ZEzYu+CQZCOmLWtSKXATpKe7TI1KVxJIjN1toE3Z7cdScO5UEfq6KaoS/RK+AWi4R3ke2pGwnj3X53D9u41y3HX+0LkeZdzZm35G9jUUx45cEDuup08w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949004; 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:ARC-Authentication-Results; bh=tCubK9ZbXuEZ6QMK1GdDyNmzK7ZeCKpnK8MiqNzX8Y8=; b=BEIUmgNYT1OMc+opOVlzksgbKShlidDEXVyuQtQg+9J255i2nwflxLNjPqAVgkox0ruszj8I0GnLud6gf6Yq1pnXUdXUdIWE8Mge6FnycEF/DD4oRe9ZXasX5VTdgWCKFf1qhhH9oZyFBwEP2g18ahzKI6ig4GIeiPPXi1/10mo= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949004603364.27371749257804; Fri, 16 Aug 2019 02:50:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01AC7307D868; Fri, 16 Aug 2019 09:50:03 +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 7E1C083BA6; Fri, 16 Aug 2019 09:50:02 +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 1DB2218005B9; Fri, 16 Aug 2019 09:50:01 +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 x7G9o0fZ019718 for ; Fri, 16 Aug 2019 05:50:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 14EDF83B9A; Fri, 16 Aug 2019 09:50:00 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 815418261E for ; Fri, 16 Aug 2019 09:49:59 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:46 +0200 Message-Id: <20190816094954.30096-3-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 02/10] ci: Drop $(CI_SUBMODULES) 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 16 Aug 2019 09:50:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We only use the list of submodules once, so no need to store it in a variable. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- Makefile.ci | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile.ci b/Makefile.ci index 14d595a00f..86e936aef8 100644 --- a/Makefile.ci +++ b/Makefile.ci @@ -42,10 +42,6 @@ CI_MAKE_ARGS =3D # Any extra arguments to pass to configure CI_CONFIGURE_ARGS =3D =20 -# Avoid pulling submodules over the network by locally -# cloning them -CI_SUBMODULES =3D $(shell git submodule | awk '{ print $$2 }') - # Location of the container images we're going to pull # Can be useful to overridde to use a locally built # image instead @@ -182,7 +178,7 @@ ci-prepare-tree: ci-check-engine cp /etc/group $(CI_SCRATCHDIR); \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ - for mod in $(CI_SUBMODULES) ; \ + for mod in $$(git submodule | awk '{ print $$2 }') ; \ do \ test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \ echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949021; cv=none; d=zoho.com; s=zohoarc; b=Kq0usI4tiRm7snSQAcr5052AxWFGVkcVOevtlr4OFj78P+dqgqwYBjR0Z/PSaIQLTgACs/PKtw40JJWR0z7unVgf/7CDjXXSLsTa1dIalTUUJp90ifjV9G9CaHk0QnXC6XE2a1eu7G2j3FBmtzTUKd1kdEJobtT58BE5bNcjsIY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949021; 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:ARC-Authentication-Results; bh=NyRYci46pOMNeJu/aEaRlHuo0GYakwtbewuQd3PrH8U=; b=jIaRzwZbjQFshxPwZJvXuw32NZMUlIIRUGKcVkle60Yp6/nB1Y9rJu4hPUYQltLkqc8I2brNYTqFf/vchVutOp3bfusczHSXh3a+h+6Y0PvxCEFJtwnZkTpzYW1mICAYxlvebCIrMYyTfcFXS98IkhDQEB9ksjEyHA1d+/Os4RE= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949021311616.3193768043102; Fri, 16 Aug 2019 02:50:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id A00503090FF4; Fri, 16 Aug 2019 09:50:19 +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 781F58CFBD; Fri, 16 Aug 2019 09:50:19 +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 3502C2551F; Fri, 16 Aug 2019 09:50:19 +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 x7G9o3Ad019741 for ; Fri, 16 Aug 2019 05:50:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC6838261E; Fri, 16 Aug 2019 09:50:03 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3631983BAA for ; Fri, 16 Aug 2019 09:50:00 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:47 +0200 Message-Id: <20190816094954.30096-4-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 03/10] ci: Move everything to a separate directory 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 16 Aug 2019 09:50:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" We're going to have a few more CI-related files in a second, and it makes sense to have a separate directory for them rather than littering the root directory. $(CI_SCRATCHDIR) can now also be created inside the CI directory, and as a bonus the make rune necessary to start CI builds without running configure first becomes shorter. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- .gitignore | 2 +- .travis.yml | 8 ++++---- Makefile.am | 4 ++-- Makefile.ci =3D> ci/Makefile | 17 ++++++++--------- 4 files changed, 15 insertions(+), 16 deletions(-) rename Makefile.ci =3D> ci/Makefile (96%) diff --git a/.gitignore b/.gitignore index dd5d35c762..82495e8692 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,7 @@ /autom4te.cache /build-aux/* /build/ -/ci-tree/ +/ci/scratch/ /confdefs.h /config.cache /config.guess diff --git a/.travis.yml b/.travis.yml index b510c81083..db573fd496 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,28 +22,28 @@ matrix: - IMAGE=3D"ubuntu-18" - MAKE_ARGS=3D"syntax-check distcheck" script: - - make -f Makefile.ci ci-build@$IMAGE CI_MAKE_ARGS=3D"$MAKE_ARGS" + - make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS=3D"$MAKE_ARGS" - services: - docker env: - IMAGE=3D"centos-7" - MAKE_ARGS=3D"syntax-check distcheck" script: - - make -f Makefile.ci ci-build@$IMAGE CI_MAKE_ARGS=3D"$MAKE_ARGS" + - make -C ci/ ci-build@$IMAGE CI_MAKE_ARGS=3D"$MAKE_ARGS" - services: - docker env: - IMAGE=3D"fedora-rawhide" - MINGW=3D"mingw32" script: - - make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE=3D"$MINGW-confi= gure" + - make -C ci/ ci-build@$IMAGE CI_CONFIGURE=3D"$MINGW-configure" - services: - docker env: - IMAGE=3D"fedora-rawhide" - MINGW=3D"mingw64" script: - - make -f Makefile.ci ci-build@$IMAGE CI_CONFIGURE=3D"$MINGW-confi= gure" + - make -C ci/ ci-build@$IMAGE CI_CONFIGURE=3D"$MINGW-configure" - compiler: clang language: c os: osx diff --git a/Makefile.am b/Makefile.am index 27c49280c4..b743b4b08b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,7 +35,6 @@ EXTRA_DIST =3D \ libvirt-qemu.pc.in \ libvirt-lxc.pc.in \ libvirt-admin.pc.in \ - Makefile.ci \ Makefile.nonreentrant \ autogen.sh \ cfg.mk \ @@ -51,6 +50,7 @@ EXTRA_DIST =3D \ build-aux/prohibit-duplicate-header.pl \ build-aux/useless-if-before-free \ build-aux/vc-list-files \ + ci/Makefile \ $(NULL) =20 pkgconfigdir =3D $(libdir)/pkgconfig @@ -123,4 +123,4 @@ gen-AUTHORS: fi =20 ci-%: - $(MAKE) -f Makefile.ci $@ + $(MAKE) -C ci/ $@ diff --git a/Makefile.ci b/ci/Makefile similarity index 96% rename from Makefile.ci rename to ci/Makefile index 86e936aef8..350eb636cd 100644 --- a/Makefile.ci +++ b/ci/Makefile @@ -1,16 +1,15 @@ # -*- makefile -*- # vim: filetype=3Dmake =20 -# Figure out name and path to this file. This isn't -# portable but we only care for modern GNU make -CI_MAKEFILE =3D $(abspath $(firstword $(MAKEFILE_LIST))) +# The root directory of the libvirt.git checkout +CI_GIT_ROOT =3D $(shell git rev-parse --show-toplevel) + +# The root directory for all CI-related contents +CI_ROOTDIR =3D $(CI_GIT_ROOT)/ci =20 # The directory holding content on the host that we will # expose to the container. -CI_SCRATCHDIR =3D $(shell pwd)/ci-tree - -# The root directory of the libvirt.git checkout -CI_GIT_ROOT =3D $(shell git rev-parse --show-toplevel) +CI_SCRATCHDIR =3D $(CI_ROOTDIR)/scratch =20 # The directory holding the clone of the git repo that # we will expose to the container @@ -178,7 +177,7 @@ ci-prepare-tree: ci-check-engine cp /etc/group $(CI_SCRATCHDIR); \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ - for mod in $$(git submodule | awk '{ print $$2 }') ; \ + for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') = ; \ do \ test -f $(CI_GIT_ROOT)/$$mod/.git || continue ; \ echo "Cloning $(CI_GIT_ROOT)/$$mod to $(CI_HOST_SRCDIR)/$$mod"; \ @@ -221,7 +220,7 @@ ci-build@%: ci-prepare-tree @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : =20 ci-check@%: - $(MAKE) -f $(CI_MAKEFILE) ci-build@$* CI_MAKE_ARGS=3D"check" + $(MAKE) -C $(CI_ROOTDIR) ci-build@$* CI_MAKE_ARGS=3D"check" =20 ci-shell@%: ci-prepare-tree $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) /b= in/bash --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949011; cv=none; d=zoho.com; s=zohoarc; b=AGtw49E1YqyMkH0lawArQMexAWnTHNeD1mFvLVIEUn1SitI1bqd7r6gBogFZQCpIxjiiUn2Y88Ff6xrWpsDDL9KBOTdHMLjuT/KekA+8eTI11/I/cLgnym9yA+AeM0792gTO2nWJN8elZSdJm4KwyEXbvV10kAFXbrsNqevcVIQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949011; 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:ARC-Authentication-Results; bh=PWyzqPoomCcP3hvRJfSivddHD7RaTAbCRC5a1VRiiTc=; b=c2MqAlCz0NjfQpeRX9BzoqSST2+v3QWir3lWzF2nc6MnSt+A+maV6YtTxUiGNG8sh6axliRPe2YYmlyVidVjyAmdtdQ5OOX1eiqu00sFOxUpb55rgXCL47LKT/wa4R+OniNJ1yYWEm40+PLXIj3J/em3v1zCRkNFXELBvTHsMag= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949011198485.16851478474075; Fri, 16 Aug 2019 02:50:11 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DE242308212D; Fri, 16 Aug 2019 09:50:09 +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 B58DD43FFF; Fri, 16 Aug 2019 09:50: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 7466F180124D; Fri, 16 Aug 2019 09:50:09 +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 x7G9o81o019762 for ; Fri, 16 Aug 2019 05:50:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1BEC8261E; Fri, 16 Aug 2019 09:50:08 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A33D83BA1 for ; Fri, 16 Aug 2019 09:50:03 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:48 +0200 Message-Id: <20190816094954.30096-5-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 04/10] ci: Create user's home directory in the container 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 16 Aug 2019 09:50:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Some applications expect the user's home directory to be present on the system and require workarounds when that's not the case. Creating the home directory along with everything else is easy enough for us, so let's just do that. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- ci/Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index 350eb636cd..f52a0bf621 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -65,6 +65,11 @@ CI_REUSE =3D 0 CI_UID =3D $(shell id -u) CI_GID =3D $(shell id -g) =20 +# We also need the user's login and home directory to prepare the +# environment the way some programs expect it +CI_USER_LOGIN =3D $(shell echo "$$USER") +CI_USER_HOME =3D $(shell echo "$$HOME") + CI_ENGINE =3D auto # Container engine we are going to use, can be overridden per make # invocation, if it is not we try podman and then default to docker. @@ -87,6 +92,10 @@ CI_PWDB_MOUNTS =3D \ --volume $(CI_SCRATCHDIR)/passwd:/etc/passwd:ro,z \ $(NULL) =20 +CI_HOME_MOUNTS =3D \ + --volume $(CI_SCRATCHDIR)/home:$(CI_USER_HOME):z \ + $(NULL) + # Docker containers can have very large ulimits # for nofiles - as much as 1048576. This makes # libvirt very slow at exec'ing programs. @@ -109,8 +118,8 @@ ifeq ($(CI_ENGINE),podman) # need to be higher, but that only happens when your /etc/sub{u,g}id allow # users to have more IDs. Unless --keep-uid is supported, let's do this = in a # way that should work for everyone. - CI_MAX_UID =3D $(shell sed -n "s/^$$USER:[^:]\+://p" /etc/subuid) - CI_MAX_GID =3D $(shell sed -n "s/^$$USER:[^:]\+://p" /etc/subgid) + CI_MAX_UID =3D $(shell sed -n "s/^$(CI_USER_LOGIN):[^:]\+://p" /etc/subui= d) + CI_MAX_GID =3D $(shell sed -n "s/^$(CI_USER_LOGIN):[^:]\+://p" /etc/subgi= d) ifeq ($(CI_MAX_UID),) CI_MAX_UID =3D 65536 endif @@ -159,6 +168,7 @@ CI_ENGINE_ARGS =3D \ --tty \ $(CI_PODMAN_ARGS) \ $(CI_PWDB_MOUNTS) \ + $(CI_HOME_MOUNTS) \ --volume $(CI_HOST_SRCDIR):$(CI_CONT_SRCDIR):z \ --workdir $(CI_CONT_SRCDIR) \ --ulimit nofile=3D$(CI_ULIMIT_FILES):$(CI_ULIMIT_FILES) \ @@ -175,6 +185,7 @@ ci-prepare-tree: ci-check-engine mkdir -p $(CI_SCRATCHDIR); \ cp /etc/passwd $(CI_SCRATCHDIR); \ cp /etc/group $(CI_SCRATCHDIR); \ + mkdir -p $(CI_SCRATCHDIR)/home; \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') = ; \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949026; cv=none; d=zoho.com; s=zohoarc; b=KGN42/7xYB8iPQEAIWE7nd3+mQy/twb0/rwAcEz5n/kFQ8e/VIw9dCy/Z9crZhRvF4CspyzODwISexDlszkGp5ZK8HjhNhcb93zcc8u6RDhKH9CnNDiS8eY06/tMXjpn/q0RphyN2xxyGH5PSRgXjINT6FQeZ8ppu168d2Gz1Tg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949026; 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:ARC-Authentication-Results; bh=AW5kLSzgen582C+ooaW0QOzp0CwarLhgakq6OxC314Y=; b=H4vS0yvTh77HXA+U9M3+uGdGohzH1naftYFC5O1tXTVOnd9m+v40ggLKPpBoGd+lhfqC2aebA20uPkZ/mBWULqXtmqM0lcYIsPJPbdjQaGuRiFlES6/WQfshuJgeMtbQkkKGkSAUXpUWvdB+OfPzUd9v+uzLknUhnapiZUHRBzk= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15659490260441019.1544073161979; Fri, 16 Aug 2019 02:50:26 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D5689309C0F5; Fri, 16 Aug 2019 09:50:24 +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 B1B5384280; Fri, 16 Aug 2019 09:50:24 +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 73F0F180BAA2; Fri, 16 Aug 2019 09:50:24 +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 x7G9oBuR019773 for ; Fri, 16 Aug 2019 05:50:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC52983B9F; Fri, 16 Aug 2019 09:50:11 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66F5683BA0 for ; Fri, 16 Aug 2019 09:50:08 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:49 +0200 Message-Id: <20190816094954.30096-6-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 05/10] ci: Move source directory under $(CI_USER_HOME) 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 16 Aug 2019 09:50:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Now that we have a home directory for the user, storing the source there rather than in a custom top-level directory is the obvious choice. Later on we're also going to add some more files related to builds, and storing everything in the user's home directory will keep things nice and tidy. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- ci/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/Makefile b/ci/Makefile index f52a0bf621..dc7ee6c037 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -18,7 +18,7 @@ CI_HOST_SRCDIR =3D $(CI_SCRATCHDIR)/src # The directory holding the source inside the # container, i.e. where we want to expose # the $(CI_HOST_SRCDIR) directory from the host -CI_CONT_SRCDIR =3D /src +CI_CONT_SRCDIR =3D $(CI_USER_HOME)/libvirt =20 # Relative directory to perform the build in. This # defaults to using a separate build dir, but can be --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949017; cv=none; d=zoho.com; s=zohoarc; b=mZ0KFGPY6GArmncN+s9k4Ib+zuIwwUdQs2pdy1Anzo32ctAr7D6sEUYwURQgkUlj39qGpMZYLaTow5JODm1CEtnnz83z6EPaUlpUqVCYzLh5Mv9yjc2rcqwd+Dysj4/mlL4OPW3P9wbCAlK+0sT7dO1ItIw4aefqcFvAB9pRtWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949017; 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:ARC-Authentication-Results; bh=rVmtxd+PLJSeBkLjPh7Q52V36nzVC8exLcoLzJU18nc=; b=MoHZd7WHzgarrwGkzFdE+/Hjl0nLPIPIGk5txCXongdJabW5PIJQ24MVozCsab76zjA86gfuemYawJqOGP7vIQX/iiUdnPURtbhHETGCcKZNo06si9bJZkR6ch1S5WmxjA0Bh4JQc00CcI9Rv7o7qvUwxymsZszRxnfuIyJT5hE= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15659490175721002.487622321443; Fri, 16 Aug 2019 02:50:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 36B26EC557; Fri, 16 Aug 2019 09:50:16 +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 133E110013A7; Fri, 16 Aug 2019 09:50:16 +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 C950D180BA9C; Fri, 16 Aug 2019 09:50:15 +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 x7G9oCgE019783 for ; Fri, 16 Aug 2019 05:50:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id B530083B9A; Fri, 16 Aug 2019 09:50:12 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3411C8261E for ; Fri, 16 Aug 2019 09:50:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:50 +0200 Message-Id: <20190816094954.30096-7-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 06/10] ci: Introduce $(CI_BUILD_SCRIPT) 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 16 Aug 2019 09:50:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Instead of hardcoding build instructions into the Makefile, move them to a separate script that's mounted into the container. This gives us a couple of advantages: we no longer have to deal with the awkward quoting required when embedding shell code in a Makefile, and we also provide the users with a way to override the default build instructions with their own. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- Makefile.am | 1 + ci/Makefile | 48 ++++++++++++++++++------------------------------ ci/build.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 30 deletions(-) create mode 100644 ci/build.sh diff --git a/Makefile.am b/Makefile.am index b743b4b08b..96fac92186 100644 --- a/Makefile.am +++ b/Makefile.am @@ -51,6 +51,7 @@ EXTRA_DIST =3D \ build-aux/useless-if-before-free \ build-aux/vc-list-files \ ci/Makefile \ + ci/build.sh \ $(NULL) =20 pkgconfigdir =3D $(libdir)/pkgconfig diff --git a/ci/Makefile b/ci/Makefile index dc7ee6c037..f7e31b4f97 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -41,6 +41,9 @@ CI_MAKE_ARGS =3D # Any extra arguments to pass to configure CI_CONFIGURE_ARGS =3D =20 +# Script containing build instructions +CI_BUILD_SCRIPT =3D $(CI_ROOTDIR)/build.sh + # Location of the container images we're going to pull # Can be useful to overridde to use a locally built # image instead @@ -96,6 +99,10 @@ CI_HOME_MOUNTS =3D \ --volume $(CI_SCRATCHDIR)/home:$(CI_USER_HOME):z \ $(NULL) =20 +CI_SCRIPT_MOUNTS =3D \ + --volume $(CI_SCRATCHDIR)/build:$(CI_USER_HOME)/build:z \ + $(NULL) + # Docker containers can have very large ulimits # for nofiles - as much as 1048576. This makes # libvirt very slow at exec'ing programs. @@ -169,6 +176,7 @@ CI_ENGINE_ARGS =3D \ $(CI_PODMAN_ARGS) \ $(CI_PWDB_MOUNTS) \ $(CI_HOME_MOUNTS) \ + $(CI_SCRIPT_MOUNTS) \ --volume $(CI_HOST_SRCDIR):$(CI_CONT_SRCDIR):z \ --workdir $(CI_CONT_SRCDIR) \ --ulimit nofile=3D$(CI_ULIMIT_FILES):$(CI_ULIMIT_FILES) \ @@ -186,6 +194,8 @@ ci-prepare-tree: ci-check-engine cp /etc/passwd $(CI_SCRATCHDIR); \ cp /etc/group $(CI_SCRATCHDIR); \ mkdir -p $(CI_SCRATCHDIR)/home; \ + cp "$(CI_BUILD_SCRIPT)" $(CI_SCRATCHDIR)/build; \ + chmod +x "$(CI_SCRATCHDIR)/build"; \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') = ; \ @@ -196,38 +206,16 @@ ci-prepare-tree: ci-check-engine done ; \ fi =20 -# $CONFIGURE_OPTS is a env that can optionally be set in the container, -# populated at build time from the Dockerfile. A typical use case would -# be to pass --host/--target args to trigger cross-compilation -# -# This can be augmented by make local args in $(CI_CONFIGURE_ARGS) -# -# gl_public_submodule_commit=3D to disable gnulib's submodule check -# which breaks due to way we clone the submodules ci-build@%: ci-prepare-tree $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ - /bin/bash -c '\ - mkdir -p $(CI_CONT_BUILDDIR) || exit 1 ; \ - cd $(CI_CONT_BUILDDIR) ; \ - NOCONFIGURE=3D1 $(CI_CONT_SRCDIR)/autogen.sh || exit 1 ; \ - $(CI_CONFIGURE) $${CONFIGURE_OPTS} $(CI_CONFIGURE_ARGS) ; \ - if test $$? !=3D 0 ; \ - then \ - test -f config.log && cat config.log ; \ - exit 1 ; \ - fi; \ - find -name test-suite.log -delete ; \ - export VIR_TEST_DEBUG=3D1 ; \ - make -j$(CI_SMP) gl_public_submodule_commit=3D $(CI_MAKE_ARGS) ; \ - if test $$? !=3D 0 ; then \ - LOGS=3D`find -name test-suite.log` ; \ - if test "$${LOGS}" !=3D "" ; then \ - echo "=3D=3D=3D LOG FILE(S) START =3D=3D=3D" ; \ - cat $${LOGS} ; \ - echo "=3D=3D=3D LOG FILE(S) END =3D=3D=3D" ; \ - fi ; \ - exit 1 ;\ - fi' + /bin/bash -c ' \ + export CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)"; \ + export CI_CONT_BUILDDIR=3D"$(CI_CONT_BUILDDIR)"; \ + export CI_SMP=3D"$(CI_SMP)"; \ + export CI_CONFIGURE=3D"$(CI_CONFIGURE)"; \ + export CI_CONFIGURE_ARGS=3D"$(CI_CONFIGURE_ARGS)"; \ + export CI_MAKE_ARGS=3D"$(CI_MAKE_ARGS)"; \ + $(CI_USER_HOME)/build || exit 1' @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : =20 ci-check@%: diff --git a/ci/build.sh b/ci/build.sh new file mode 100644 index 0000000000..0874c2d1d9 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,40 @@ +# This script is used to build libvirt inside the container. +# +# You can customize it to your liking, or alternatively use a +# completely different script by passing +# +# CI_BUILD_SCRIPT=3D/path/to/your/build/script +# +# to make. + +mkdir -p "$CI_CONT_BUILDDIR" || exit 1 +cd "$CI_CONT_BUILDDIR" + +export VIR_TEST_DEBUG=3D1 +NOCONFIGURE=3D1 "$CI_CONT_SRCDIR/autogen.sh" || exit 1 + +# $CONFIGURE_OPTS is a env that can optionally be set in the container, +# populated at build time from the Dockerfile. A typical use case would +# be to pass --host/--target args to trigger cross-compilation +# +# This can be augmented by make local args in $CI_CONFIGURE_ARGS +"$CI_CONFIGURE" $CONFIGURE_OPTS $CI_CONFIGURE_ARGS +if test $? !=3D 0; then + test -f config.log && cat config.log + exit 1 +fi +find -name test-suite.log -delete + +# gl_public_submodule_commit=3D to disable gnulib's submodule check +# which breaks due to way we clone the submodules +make -j"$CI_SMP" gl_public_submodule_commit=3D $CI_MAKE_ARGS + +if test $? !=3D 0; then \ + LOGS=3D$(find -name test-suite.log) + if test "$LOGS"; then + echo "=3D=3D=3D LOG FILE(S) START =3D=3D=3D" + cat $LOGS + echo "=3D=3D=3D LOG FILE(S) END =3D=3D=3D" + fi + exit 1 +fi --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949028; cv=none; d=zoho.com; s=zohoarc; b=nSRqQh+/yHWlicVY/gBW3b2nHQk6/h0jwES8J98BipErQcXo0Y7jbj0ZpzhBkOSSH6ToF+WpOqa74YrcSUfcMdmEd+osaayCZj1UEl/tnQDuATnoQGan2myVDR3jnY5d3uoxaJNnEc75CsJ7LXNWn2ljI2kwnhiUj+dbmYhJKzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949028; 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:ARC-Authentication-Results; bh=BARwbltPqdCtuu7FMCtX46P/Yg0cROzusICgo6xH0V0=; b=Ki0BLa1do1iyMU1VE0HfxH975Lp9+hBOrZroC/T4KS9mQ6WfTJ6zTZL7FZ4W6G76ghkxMTPcAhwbvKWPEB8I1wykq8d8zeoYkLa4IBpcK2GRUC7mj7kPxvKCeBNaPkOfb5F1R/faosohozBwFiDxWDx0/ldWRzmlPWYcWLrITMk= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949028981751.4428316506434; Fri, 16 Aug 2019 02:50:28 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id D93BEC04B2FF; Fri, 16 Aug 2019 09:50:27 +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 AC6028462A; Fri, 16 Aug 2019 09:50:27 +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 750C824F34; Fri, 16 Aug 2019 09:50: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 x7G9oDkH019790 for ; Fri, 16 Aug 2019 05:50:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7680B8261E; Fri, 16 Aug 2019 09:50:13 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01D8383B8F for ; Fri, 16 Aug 2019 09:50:12 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:51 +0200 Message-Id: <20190816094954.30096-8-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 07/10] ci: Generalize running commands inside the container 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 16 Aug 2019 09:50:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Both for ci-build and ci-shell we want to execute basically the same setup and cleanup logic, the only difference being that for the former we then run the build script and with the latter a shell. Rework the targets so that they both call the generic ci-run-command rule passing an appropriate $(CI_COMMAND). Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- ci/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index f7e31b4f97..2b5be97238 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -206,7 +206,7 @@ ci-prepare-tree: ci-check-engine done ; \ fi =20 -ci-build@%: ci-prepare-tree +ci-run-command@%: ci-prepare-tree $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ /bin/bash -c ' \ export CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)"; \ @@ -215,16 +215,18 @@ ci-build@%: ci-prepare-tree export CI_CONFIGURE=3D"$(CI_CONFIGURE)"; \ export CI_CONFIGURE_ARGS=3D"$(CI_CONFIGURE_ARGS)"; \ export CI_MAKE_ARGS=3D"$(CI_MAKE_ARGS)"; \ - $(CI_USER_HOME)/build || exit 1' + $(CI_COMMAND) || exit 1' @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : =20 +ci-shell@%: + $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND=3D"/bin/bash" + +ci-build@%: + $(MAKE) -C $(CI_ROOTDIR) ci-run-command@$* CI_COMMAND=3D"$(CI_USER_HOME)/= build" + ci-check@%: $(MAKE) -C $(CI_ROOTDIR) ci-build@$* CI_MAKE_ARGS=3D"check" =20 -ci-shell@%: ci-prepare-tree - $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) /b= in/bash - @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : - ci-help: @echo "Build libvirt inside containers used for CI" @echo --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949021; cv=none; d=zoho.com; s=zohoarc; b=gHjQQhLco/Kl42j2sN0X1bVHM97TY49eXTvljy/ezNlatT0xFf+WrfNH0f1FiHj/a53M6ZJDVMvIflX2zTF0H1ou9nA9HsaMgN+xNqYHPIGb4ft6wJUOpyhJGLgnQSA1Mn2bTFmOd8GMurGnvugUg61CaXCGHmX/mlM+IsHqY10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949021; 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:ARC-Authentication-Results; bh=V8cwIND5Hcw3peErOvtJ90yOoFPh8YGyo6KhqYoAikE=; b=Vq8s+RzVNCgB/WkYAdyhNS0I5f9JqMSt9mUyhCUWQz+TTmo6rXBtIECwh7MxO5LFB4R7bm/4bgzzkZGwm6QtBmFy6DvklYjD2tcBQ4XIkYdydUQHqtE5ArGfwQxSA14qfYBp8eBt7/8tuKVKlpuIvhAZqfb1BKRN6ggLUbh8w1M= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949021143312.65722245005225; Fri, 16 Aug 2019 02:50:21 -0700 (PDT) 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 B9CC330860C8; Fri, 16 Aug 2019 09:50:19 +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 949817DA52; Fri, 16 Aug 2019 09:50:19 +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 50BBC24FDF; Fri, 16 Aug 2019 09:50:19 +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 x7G9oHrV019812 for ; Fri, 16 Aug 2019 05:50:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C5C88261E; Fri, 16 Aug 2019 09:50:17 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EBC4083B9F for ; Fri, 16 Aug 2019 09:50:13 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:52 +0200 Message-Id: <20190816094954.30096-9-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 08/10] ci: Introduce $(CI_PREPARE_SCRIPT) 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, 16 Aug 2019 09:50:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This script is run before $(CI_BUILD_SCRIPT) and can be used to tweak the environment as necessary before the build starts. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- Makefile.am | 1 + ci/Makefile | 8 +++++++- ci/prepare.sh | 9 +++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ci/prepare.sh diff --git a/Makefile.am b/Makefile.am index 96fac92186..cf9ff94f4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -52,6 +52,7 @@ EXTRA_DIST =3D \ build-aux/vc-list-files \ ci/Makefile \ ci/build.sh \ + ci/prepare.sh \ $(NULL) =20 pkgconfigdir =3D $(libdir)/pkgconfig diff --git a/ci/Makefile b/ci/Makefile index 2b5be97238..17d85d407f 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -41,6 +41,9 @@ CI_MAKE_ARGS =3D # Any extra arguments to pass to configure CI_CONFIGURE_ARGS =3D =20 +# Script containing environment preparation steps +CI_PREPARE_SCRIPT =3D $(CI_ROOTDIR)/prepare.sh + # Script containing build instructions CI_BUILD_SCRIPT =3D $(CI_ROOTDIR)/build.sh =20 @@ -100,6 +103,7 @@ CI_HOME_MOUNTS =3D \ $(NULL) =20 CI_SCRIPT_MOUNTS =3D \ + --volume $(CI_SCRATCHDIR)/prepare:$(CI_USER_HOME)/prepare:z \ --volume $(CI_SCRATCHDIR)/build:$(CI_USER_HOME)/build:z \ $(NULL) =20 @@ -194,8 +198,9 @@ ci-prepare-tree: ci-check-engine cp /etc/passwd $(CI_SCRATCHDIR); \ cp /etc/group $(CI_SCRATCHDIR); \ mkdir -p $(CI_SCRATCHDIR)/home; \ + cp "$(CI_PREPARE_SCRIPT)" $(CI_SCRATCHDIR)/prepare; \ cp "$(CI_BUILD_SCRIPT)" $(CI_SCRATCHDIR)/build; \ - chmod +x "$(CI_SCRATCHDIR)/build"; \ + chmod +x "$(CI_SCRATCHDIR)/prepare" "$(CI_SCRATCHDIR)/build"; \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') = ; \ @@ -209,6 +214,7 @@ ci-prepare-tree: ci-check-engine ci-run-command@%: ci-prepare-tree $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ /bin/bash -c ' \ + $(CI_USER_HOME)/prepare || exit 1; \ export CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)"; \ export CI_CONT_BUILDDIR=3D"$(CI_CONT_BUILDDIR)"; \ export CI_SMP=3D"$(CI_SMP)"; \ diff --git a/ci/prepare.sh b/ci/prepare.sh new file mode 100644 index 0000000000..f70107bd62 --- /dev/null +++ b/ci/prepare.sh @@ -0,0 +1,9 @@ +# This script is used to prepare the environment that will be used +# to build libvirt inside the container. +# +# You can customize it to your liking, or alternatively use a +# completely different script by passing +# +# CI_PREPARE_SCRIPT=3D/path/to/your/prepare/script +# +# to make. --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949032; cv=none; d=zoho.com; s=zohoarc; b=UYOyJkSmgE23TgNoX6YvFV87bnzfdKABfNHELoMDj4QZGor70eF1hrFsYVxRr/Em64b0P1O06T2fj5wFt8dk5q6A9ulrgfJ/gzVqqgIGziM1R6X/76CkrBW3fBlUk8OiR2bp5APpfuAyOIr1PMpDcynbTmDhXvkizvi4yv00JRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949032; 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:ARC-Authentication-Results; bh=CrA7dIs7kF06hUaK2s78RcoiiVyVo+3mEtXSqmuUBQ4=; b=NiEbEQARbxU2tp4FcCtjuAL/P05m2rnZkgwMkG9AcwmeSxCaFoSxfp7EiYk1WKMBkH9+7F6dztoT7Qqf+bNxZ5bMm94fKoksEGGXXTopmMRWJnlICvp7F9Qn5vBQlVOGFknTAMTxARmx0OP7gRF3bc4u4B5GxmQ9tcvb59CKxrU= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949032449456.2228284092847; Fri, 16 Aug 2019 02:50:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3EF05300CB2C; Fri, 16 Aug 2019 09:50:31 +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 177A9A4F9F; Fri, 16 Aug 2019 09:50: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 D1FB624F39; Fri, 16 Aug 2019 09:50:30 +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 x7G9oIr5019822 for ; Fri, 16 Aug 2019 05:50:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 161C983BA4; Fri, 16 Aug 2019 09:50:18 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B9A9A83B9F for ; Fri, 16 Aug 2019 09:50:17 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:53 +0200 Message-Id: <20190816094954.30096-10-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 09/10] ci: Run $(CI_PREPARE_SCRIPT) as root 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 16 Aug 2019 09:50:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" In order for the prepare script to be really useful, it needs to be able to perform privileged operations such as installing additional packages or setting up custom mount points. In order to achieve that, we now run the container as root, run the prepare script with full privilege, and only then switch to the unprivileged account with sudo. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- ci/Makefile | 19 +++++++++++-------- ci/prepare.sh | 4 ++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index 17d85d407f..86a07049ac 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -174,7 +174,6 @@ CI_GIT_ARGS =3D \ # --tty Ensure we have ability to Ctrl-C the build CI_ENGINE_ARGS =3D \ --rm \ - --user $(CI_UID):$(CI_GID) \ --interactive \ --tty \ $(CI_PODMAN_ARGS) \ @@ -215,13 +214,17 @@ ci-run-command@%: ci-prepare-tree $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ /bin/bash -c ' \ $(CI_USER_HOME)/prepare || exit 1; \ - export CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)"; \ - export CI_CONT_BUILDDIR=3D"$(CI_CONT_BUILDDIR)"; \ - export CI_SMP=3D"$(CI_SMP)"; \ - export CI_CONFIGURE=3D"$(CI_CONFIGURE)"; \ - export CI_CONFIGURE_ARGS=3D"$(CI_CONFIGURE_ARGS)"; \ - export CI_MAKE_ARGS=3D"$(CI_MAKE_ARGS)"; \ - $(CI_COMMAND) || exit 1' + sudo \ + --login \ + --user=3D"#$(CI_UID)" \ + --group=3D"#$(CI_GID)" \ + CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)" \ + CI_CONT_BUILDDIR=3D"$(CI_CONT_BUILDDIR)" \ + CI_SMP=3D"$(CI_SMP)" \ + CI_CONFIGURE=3D"$(CI_CONFIGURE)" \ + CI_CONFIGURE_ARGS=3D"$(CI_CONFIGURE_ARGS)" \ + CI_MAKE_ARGS=3D"$(CI_MAKE_ARGS)" \ + $(CI_COMMAND) || exit 1' @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : =20 ci-shell@%: diff --git a/ci/prepare.sh b/ci/prepare.sh index f70107bd62..da6fc9a1b5 100644 --- a/ci/prepare.sh +++ b/ci/prepare.sh @@ -7,3 +7,7 @@ # CI_PREPARE_SCRIPT=3D/path/to/your/prepare/script # # to make. +# +# Note that this script will have root privileges inside the +# container, so it can be used for things like installing additional +# packages. --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 21:25:53 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1565949022; cv=none; d=zoho.com; s=zohoarc; b=UkdBtreYqYQPXI3HTMWU9L+nVOvF0RGekddqr4jNVAmDYc72F9KmrKWXEZ8DQHQoHT9ciib8SpnH/AJ5mZvPIyR0jnXslDcrn36fbFs+rN+sdVTGuHLCCgkmw/8lIXQeOqXXogTWs7pK3Nbkd7EUna+14rTODMA1nodJJlZj79E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565949022; 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:ARC-Authentication-Results; bh=wR+hrEft1T3+KjszIyvMmA0fxE26AtmYtlsluuuMKuY=; b=EwreeanWwUJGqZuoccYDwc6t8ZCAk/vYaAFmPMfqY5TX2HGiMZpwPo2O5DLVmv6t2fNKafZK16yUUm8vs7fE8X7FOIo0FECoOJc7FFXmve1o0R/P1a0JW1i/uNtH15QmGsX3jUf+ZCO6Gu/0a6IuXuXUyaG2xK/sMSmyE3bmvUM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1565949022233740.2481103372047; Fri, 16 Aug 2019 02:50:22 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 14EE051EFB; Fri, 16 Aug 2019 09:50:21 +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 E24308F6C3; Fri, 16 Aug 2019 09:50:20 +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 A8C9524F32; Fri, 16 Aug 2019 09:50:20 +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 x7G9oIgh019830 for ; Fri, 16 Aug 2019 05:50:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id D882983BA4; Fri, 16 Aug 2019 09:50:18 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 62C5F83B9F for ; Fri, 16 Aug 2019 09:50:18 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Fri, 16 Aug 2019 11:49:54 +0200 Message-Id: <20190816094954.30096-11-abologna@redhat.com> In-Reply-To: <20190816094954.30096-1-abologna@redhat.com> References: <20190816094954.30096-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 Subject: [libvirt] [PATCH 10/10] ci: Stop using --workdir 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 16 Aug 2019 09:50:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Now that we're using sudo, the initial work directory is no longer relevant since the user will find themselves in their home directory when they get control anyway. Signed-off-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- ci/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index 86a07049ac..35a35d6082 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -168,7 +168,6 @@ CI_GIT_ARGS =3D \ # as dev so that file ownership matches host # instead of root:root # --volume to pass in the cloned git repo & config -# --workdir to set cwd to vpath build location # --ulimit lower files limit for performance reasons # --interactive # --tty Ensure we have ability to Ctrl-C the build @@ -181,7 +180,6 @@ CI_ENGINE_ARGS =3D \ $(CI_HOME_MOUNTS) \ $(CI_SCRIPT_MOUNTS) \ --volume $(CI_HOST_SRCDIR):$(CI_CONT_SRCDIR):z \ - --workdir $(CI_CONT_SRCDIR) \ --ulimit nofile=3D$(CI_ULIMIT_FILES):$(CI_ULIMIT_FILES) \ --cap-add=3DSYS_PTRACE \ $(NULL) --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list