From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6521574339082452992 X-Received: by 10.223.157.147 with SMTP id p19mr380862wre.30.1518587659593; Tue, 13 Feb 2018 21:54:19 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.163.205 with SMTP id m13ls3865530wrb.0.gmail; Tue, 13 Feb 2018 21:54:19 -0800 (PST) X-Google-Smtp-Source: AH8x227OHEmpFAsuZAdjgsuPAbNVbleA9O5QlqnUMWyIbfsGcZsyEKuBuq17vTLCiVS6XMBAGIr/ X-Received: by 10.223.182.161 with SMTP id j33mr363700wre.16.1518587659123; Tue, 13 Feb 2018 21:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518587659; cv=none; d=google.com; s=arc-20160816; b=GK3+6L6k5rN+fb4P1gwOQ+y6xRcEWvdsdyBg1I+mjc566hLDcMhhgmcFvCoQXhFgE4 NzAbkMeXR4NKiQdyZBBAq2QVWClNrTE9l+gMOPmzcbUB4VaIWeijHiD5CQQFOP4mvqRX 3PukegNioWh+htCQEeuJt+kZ+s+G9sbXa27j50i2ypjog/f2SPWWRVgFhtEqtABu4rqB +BV7cjj3+dSzdLPh6iAuqVtKo+cA6QdSu/fwz/ujOjRlV+/qhlu9inF2zi/S1Q9Ok7wc Uem2TclvkATNhHo2fTg8EmNi5FeKTYe8M7odoN4E+2CsP2wB3p/l4CP+sk9Uzm0wsWvx d2ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:subject:user-agent :references:in-reply-to:message-id:date:to:from :arc-authentication-results; bh=TGb+LVI9jxP5beBVMlvehOyroMHeIJZIn8dLyY5cezo=; b=YUoo+9Or3alpL8r7QodIV21JsIFc7qHnHsFiOqitFLYKtXqwb3RHQVwx3F0pz0vb9L g4otLWH5q3gFtSb8KUogxuhO0pAHL6PxuFgTDaBroI9d6x0UGTagfEKpNogyqR1rYIWY E/FexkJ1DLvTJU+QcY2dAUzVcfYVOdTFiHLBxkls+BQlq+ZSK55TC3UIoxP4R67PrybF tbXiT8Jf0CKB395QUFJw1GfJFR80uAtDTU3YkuUZKlUvEm8dNduw+1tRdQhT9ltFnq/C uRyyr7AozWAQDUWTwOzpuVU/cgyY9S2WHl/yv69J76yL0FXKHB/dLGc5Ko3muVaT9RNk n81Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id g70si487696wmc.3.2018.02.13.21.54.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 21:54:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [192.168.1.235] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w1E5sF4s009040; Wed, 14 Feb 2018 06:54:17 +0100 From: Alexander Smirnov To: Jan Kiszka , "isar-users" Date: Wed, 14 Feb 2018 08:54:30 +0300 Message-ID: <16192e0edf0.27ac.034a6b0541ed39b7fb4e17f4ac219eaa@ilbers.de> In-Reply-To: <4e4079c2-d3b5-cd05-8133-b31a38f2c814@siemens.com> References: <697b09bb60a515430f655989e859263922148264.1518552327.git.jan.kiszka@siemens.com> <640ea89d-7320-30b9-fd22-4747ee3f727f@ilbers.de> <4e4079c2-d3b5-cd05-8133-b31a38f2c814@siemens.com> User-Agent: AquaMail/1.10.0-403 (build: 101000001) Subject: Re: [PATCH v2 5/9] Move buildchroot mounts into dpkg-base class MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="UTF-8" Content-Transfer-Encoding: 8bit X-TUID: V4+jSBWzklHm Jan Kiszka 13 февраля 2018 г. 23:48:02 написал: > On 2018-02-13 21:17, Alexander Smirnov wrote: >> >> >> On 02/13/2018 11:05 PM, Jan Kiszka wrote: >>> From: Jan Kiszka >>> >>> This avoids the unfortunate setup_mounts task which is either not >>> executed on rebuilds or causes excessive package rebuilds. We just need >>> ensure prior to switching into the buildchroot that all mount points are >>> populated. >>> >>> Signed-off-by: Jan Kiszka >>> --- >>>   meta/classes/dpkg-base.bbclass                   | 13 +++++++++- >>>   meta/recipes-devtools/buildchroot/buildchroot.bb | 30 >>> +++--------------------- >>>   2 files changed, 15 insertions(+), 28 deletions(-) >>> >>> diff --git a/meta/classes/dpkg-base.bbclass >>> b/meta/classes/dpkg-base.bbclass >>> index a45fbce..66132da 100644 >>> --- a/meta/classes/dpkg-base.bbclass >>> +++ b/meta/classes/dpkg-base.bbclass >>> @@ -2,7 +2,7 @@ >>>   # Copyright (C) 2017 Siemens AG >>>     # Add dependency from buildchroot creation >>> -do_build[depends] = "buildchroot:do_setup_mounts" >>> +do_build[depends] = "buildchroot:do_build" >>>     # Add dependency between Isar recipes >>>   DEPENDS ?= "" >>> @@ -20,11 +20,22 @@ dpkg_runbuild() { >>>       die "This should never be called, overwrite it in your derived >>> class" >>>   } >>>   +mount_if_needed() { >>> + >>> +    # The test may race with parallel builds. So probe, mount if >>> needed, and >>> +    # then only fail if both the mount and yet another probe failed >>> as well. >>> +    grep -q $2 /proc/mounts || sudo mount $1 $2 || grep -q $2 >>> /proc/mounts >> >> This could lead to have lots of remounts on the same folder during >> parallel execution. This should be done in a separate task and protected >> by [lockfiles]. > > No, it won't - please re-read the code. It's a classic retry pattern, > and it's even detecting errors. > 'mount --bind' never fails. So if several do_build() have passed first grep in parallel, then each one will mount 'isar-apt'. Or I don't understand this. Alex > Jan > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE > Corporate Competence Center Embedded Linux -- With best regards, Alexander Smirnov ilbers GmbH Baierbrunner Str. 28c D-81379 Munich +49 (89) 122 67 24-0 http://ilbers.de/ Commercial register Munich, HRB 214197 General manager: Baurzhan Ismagulov