From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065255; cv=none; d=zohomail.com; s=zohoarc; b=PeJZp14qNfzzNxOP7dlh6+0Jjh8fEO5PGMxji/FgTVPJjkBrwbuec/cX4oikGyQksaa+cbReWxQCSODbLLC9VGDuTArwEEOQG3781oArfQag067+uFf+RzsIp1gXSJ3gGD+9n8VYHeY6luGsxrmZad8D7lBNUqrKlUNYnfVHR34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065255; 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=bXEvneVjzgbu2ZEtxyoNELNsDsBTtVe8DgxO+NN781s=; b=H6LMm5gBGjxvQVQEYPKrrRdsFxRhyivbXZkniijbc2dTSxORiltomm2oRrlRR8Rl+sdlOy+Vox+NZbV2G0pslIYtUm+sT0VwYhYarM4c+MpGECu3zugIC2mrw0+wQcxvIao6M/rKVFiXRvlGVUg+rEfd7tBemF+id7auwNAk2As= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065255170851.9753885869075; Thu, 21 May 2020 05:47:35 -0700 (PDT) Received: from localhost ([::1]:33720 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkbk-0006Gq-0H for importer@patchew.org; Thu, 21 May 2020 08:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka1-0003Su-Ca for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:45 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:48642 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbkZz-00055F-Vq for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:45 -0400 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-419-T3QrDOlHMhiDmpRS9bSzJA-1; Thu, 21 May 2020 08:45:38 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 129438014D4; Thu, 21 May 2020 12:45:37 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 640DD341E9; Thu, 21 May 2020 12:45:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065142; h=from:from: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; bh=bXEvneVjzgbu2ZEtxyoNELNsDsBTtVe8DgxO+NN781s=; b=KX2SAgBZQf6Duwfjq8/8E9cw9QqqT5+zcFXJEdJSGBQ9NcBtpO0NSguStz4Ip4i2seL71C n6MyCcxeL/y7UyXimY2k1eRzRjXSx+/KrB4yKa16Qz7G7ug9OkB2Qa86e5tiU8vwgKvPRf aeChSggu8pTOUns7c+WH/wUoGUYOOlI= X-MC-Unique: T3QrDOlHMhiDmpRS9bSzJA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 1/8] docker.py/build: support -t and -f arguments Date: Thu, 21 May 2020 08:45:28 -0400 Message-Id: <20200521124535.5329-2-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 04:44:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The docker.py command line is subtly different from docker and podman's, in that the tag and Dockerfile are passed via positional arguments. Remove this gratuitous difference and just parse -f and -t. -f was previously used by --extra-files, only keep the long option. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- tests/docker/Makefile.include | 2 +- tests/docker/docker.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 43a8678688..262704663f 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -55,7 +55,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker else docker-image-%: $(DOCKER_FILES_DIR)/%.docker $(call quiet-command,\ - $(DOCKER_SCRIPT) build qemu:$* $< \ + $(DOCKER_SCRIPT) build -t qemu:$* -f $< \ $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ $(if $(NOUSER),,--add-current-user) \ $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\ diff --git a/tests/docker/docker.py b/tests/docker/docker.py index d8268c1111..ad61747bae 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -391,16 +391,16 @@ class BuildCommand(SubCommand): help=3D"""Specify a binary that will be copied= to the container together with all its dependent libraries""") - parser.add_argument("--extra-files", "-f", nargs=3D'*', + parser.add_argument("--extra-files", nargs=3D'*', help=3D"""Specify files that will be copied in= the Docker image, fulfilling the ADD directive fro= m the Dockerfile""") parser.add_argument("--add-current-user", "-u", dest=3D"user", action=3D"store_true", help=3D"Add the current user to image's passwd= ") - parser.add_argument("tag", + parser.add_argument("-t", dest=3D"tag", help=3D"Image Tag") - parser.add_argument("dockerfile", + parser.add_argument("-f", dest=3D"dockerfile", help=3D"Dockerfile name") =20 def run(self, args, argv): --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065234; cv=none; d=zohomail.com; s=zohoarc; b=HgrxGzjcQyi32UZ2hoXnM2pLwBlBKl74YvrlvfDC2VDAUaW6569H/dOzELaMYZTbpGorOI88MzAGzcRU5dA5ArCjMRJBs83aksm75+NPSpXuBLBYNSERXAWGpqUw3llHQ1RfqwrRHbeiOBJxwkMxtshXDjsWoKnmkvDCpP4NfmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065234; 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=JylNTLJ4Kj99nUd1RpSvGVjexBbIph/5MU6rV0q7Gbs=; b=EnieD8sqNVQIC5d/vv5ueOEbkyrxuccT8466UBDd9LPRQxYixznG9YkIYD+MrKPU+ielPRB2ZdVrCAF7g57YQZ824LO15jXy7IVxtIX5P1+VPiPGFn5jhkyubiTqNGF3CpDvqLWmG0FgvgvemBLeIpV8slnYpJD+BYKxb17B1m8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065234885637.4837867154711; Thu, 21 May 2020 05:47:14 -0700 (PDT) Received: from localhost ([::1]:33018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkbR-0005xM-IG for importer@patchew.org; Thu, 21 May 2020 08:47:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka0-0003RR-Tg for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:40111 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbkZz-00054g-BI for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:44 -0400 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-505-Ey2mx2JxM8-6ehGYG8Poxg-1; Thu, 21 May 2020 08:45:39 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E59CB100A8FB; Thu, 21 May 2020 12:45:37 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43272341E9; Thu, 21 May 2020 12:45:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065142; h=from:from: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; bh=JylNTLJ4Kj99nUd1RpSvGVjexBbIph/5MU6rV0q7Gbs=; b=gx7/4/45KVZ9pvPVOoedIFScs4lV+kbm4x8KiAJty9+myZcrVf0WHdntQmYKm08Ta+YvY/ CITnIm0G0zNoAVFtO/xE4jtCvo4qeEKGWRfKgTYJxkavM7toOCn7XNGOyLZrMWiiehBNPx hscHZWgCUXBuuv8efY+WMVX63IaAuTw= X-MC-Unique: Ey2mx2JxM8-6ehGYG8Poxg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 2/8] docker.py/build: support binary files in --extra-files Date: Thu, 21 May 2020 08:45:29 -0400 Message-Id: <20200521124535.5329-3-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 01:44:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Read the --extra-files in binary mode to avoid encoding errors. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- tests/docker/docker.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index ad61747bae..85e1dda10f 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -56,15 +56,19 @@ class EngineEnum(enum.IntEnum): =20 USE_ENGINE =3D EngineEnum.AUTO =20 +def _bytes_checksum(bytes): + """Calculate a digest string unique to the text content""" + return hashlib.sha1(bytes).hexdigest() + def _text_checksum(text): """Calculate a digest string unique to the text content""" - return hashlib.sha1(text.encode('utf-8')).hexdigest() + return _bytes_checksum(text.encode('utf-8')) =20 def _read_dockerfile(path): return open(path, 'rt', encoding=3D'utf-8').read() =20 def _file_checksum(filename): - return _text_checksum(_read_dockerfile(filename)) + return _bytes_checksum(open(filename, 'rb').read()) =20 =20 def _guess_engine_command(): --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065340; cv=none; d=zohomail.com; s=zohoarc; b=YNuCKSex71CAT0VUKXxN22TbX3f/InDW3DTx5WiT77hkvGZG3/Lb7/Ae0S8MxL3dTtTM45Lq49910VFJNDVbPKxRyS8ZKUf8XQ6CiLCa73wL0wrvQJ10MpQb+W6MVFy7QnZo3hbISDX0V/uk8qXogjTaG71S6EKutmSIjk7or5c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065340; 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=tJrxybmGdrfBbB987Z3tJ0S0qgwtOuPu1SkhX8bjTVs=; b=OpRJGYDmwMbsjWmNFEXxXQLvCTSo73APSpvXGXYMz2u0ZIrLvOZdpvzs/UysE+5pioUaiiFl26JYVAq8yIDJKdusSO4tf6WUfqL7wIcRkGiiMSNIkADkrJtvZV1QCrTTJNY9mmhdsm9A2soj2OETC/kLBctxIPSwORdEHCvjtsI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065340283614.2373637851996; Thu, 21 May 2020 05:49:00 -0700 (PDT) Received: from localhost ([::1]:40634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkd9-0000v1-1H for importer@patchew.org; Thu, 21 May 2020 08:48:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka3-0003Vm-7w for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:34046 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbka1-00057I-SV for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:46 -0400 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-358-7RhToScFNAe45_u0Q4goqg-1; Thu, 21 May 2020 08:45:39 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9C14107ACF4; Thu, 21 May 2020 12:45:38 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2176C341E9; Thu, 21 May 2020 12:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065145; h=from:from: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; bh=tJrxybmGdrfBbB987Z3tJ0S0qgwtOuPu1SkhX8bjTVs=; b=HEBkolKZnL72QHeWvokgqgFUTdG79EW8r14A3JKO5KTDZYweqiBfKRZ1X1HMDZn+PV1H1I kUJiaRkXLXiM8ZxQMQ9Kx4ceLXYZFDeCgWCTfldUY5lHikMvb/rUWuqC4Zy7zQK/N/59qF 5UwS45jC7YquoaO+8DjzcGAMvMQiit4= X-MC-Unique: 7RhToScFNAe45_u0Q4goqg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 3/8] run-coverity-scan: get Coverity token and email from special git config section Date: Thu, 21 May 2020 08:45:30 -0400 Message-Id: <20200521124535.5329-4-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 06:06:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Support a [coverity] section in .git/config. It can be used to retrieve the token and also, if it is different from user.email, the username of the submitter. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index 2e067ef5cf..990f75138d 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -41,9 +41,10 @@ # is intended mainly for internal use by the Docker supp= ort # # User-specifiable environment variables: -# COVERITY_TOKEN -- Coverity token +# COVERITY_TOKEN -- Coverity token (default: looks at your +# coverity.token config) # COVERITY_EMAIL -- the email address to use for uploads (default: -# looks at your git user.email config) +# looks at your git coverity.email or user.email config) # COVERITY_BUILD_CMD -- make command (default: 'make -jN' where N is # number of CPUs as determined by 'nproc') # COVERITY_TOOL_BASE -- set to directory to put coverity tools @@ -58,11 +59,11 @@ check_upload_permissions() { # with status 1 if the check failed (usually a bad token); # will exit the script with status 0 if the check indicated that we # can't upload yet (ie we are at quota) - # Assumes that PROJTOKEN, PROJNAME and DRYRUN have been initialized. + # Assumes that COVERITY_TOKEN, PROJNAME and DRYRUN have been initializ= ed. =20 echo "Checking upload permissions..." =20 - if ! up_perm=3D"$(wget https://scan.coverity.com/api/upload_permitted = --post-data "token=3D$PROJTOKEN&project=3D$PROJNAME" -q -O -)"; then + if ! up_perm=3D"$(wget https://scan.coverity.com/api/upload_permitted = --post-data "token=3D$COVERITY_TOKEN&project=3D$PROJNAME" -q -O -)"; then echo "Coverity Scan API access denied: bad token?" exit 1 fi @@ -94,20 +95,20 @@ check_upload_permissions() { update_coverity_tools () { # Check for whether we need to download the Coverity tools # (either because we don't have a copy, or because it's out of date) - # Assumes that COVERITY_TOOL_BASE, PROJTOKEN and PROJNAME are set. + # Assumes that COVERITY_TOOL_BASE, COVERITY_TOKEN and PROJNAME are set. =20 mkdir -p "$COVERITY_TOOL_BASE" cd "$COVERITY_TOOL_BASE" =20 echo "Checking for new version of coverity build tools..." - wget https://scan.coverity.com/download/linux64 --post-data "token=3D$= PROJTOKEN&project=3D$PROJNAME&md5=3D1" -O coverity_tool.md5.new + wget https://scan.coverity.com/download/linux64 --post-data "token=3D$= COVERITY_TOKEN&project=3D$PROJNAME&md5=3D1" -O coverity_tool.md5.new =20 if ! cmp -s coverity_tool.md5 coverity_tool.md5.new; then # out of date md5 or no md5: download new build tool # blow away the old build tool echo "Downloading coverity build tools..." rm -rf coverity_tool coverity_tool.tgz - wget https://scan.coverity.com/download/linux64 --post-data "token= =3D$PROJTOKEN&project=3D$PROJNAME" -O coverity_tool.tgz + wget https://scan.coverity.com/download/linux64 --post-data "token= =3D$COVERITY_TOKEN&project=3D$PROJNAME" -O coverity_tool.tgz if ! (cat coverity_tool.md5.new; echo " coverity_tool.tgz") | md5= sum -c --status; then echo "Downloaded tarball didn't match md5sum!" exit 1 @@ -205,6 +206,9 @@ while [ "$#" -ge 1 ]; do esac done =20 +if [ -z "$COVERITY_TOKEN" ]; then + COVERITY_TOKEN=3D"$(git config coverity.token)" +fi if [ -z "$COVERITY_TOKEN" ]; then echo "COVERITY_TOKEN environment variable not set" exit 1 @@ -225,7 +229,6 @@ if [ -z "$SRCDIR" ]; then SRCDIR=3D"$PWD" fi =20 -PROJTOKEN=3D"$COVERITY_TOKEN" PROJNAME=3DQEMU TARBALL=3Dcov-int.tar.xz =20 @@ -268,6 +271,9 @@ if [ -z "$DESCRIPTION" ]; then DESCRIPTION=3D"$(git rev-parse HEAD)" fi =20 +if [ -z "$COVERITY_EMAIL" ]; then + COVERITY_EMAIL=3D"$(git config coverity.email)" +fi if [ -z "$COVERITY_EMAIL" ]; then COVERITY_EMAIL=3D"$(git config user.email)" fi @@ -393,7 +399,7 @@ if [ "$DRYRUN" =3D yes ]; then exit 0 fi =20 -curl --form token=3D"$PROJTOKEN" --form email=3D"$COVERITY_EMAIL" \ +curl --form token=3D"$COVERITY_TOKEN" --form email=3D"$COVERITY_EMAIL" \ --form file=3D@"$TARBALL" --form version=3D"$VERSION" \ --form description=3D"$DESCRIPTION" \ https://scan.coverity.com/builds?project=3D"$PROJNAME" --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065217; cv=none; d=zohomail.com; s=zohoarc; b=N4/t4ssLOVL7iHQluCHdHgTlsDM0im9IkDf5+HHvaAn/2k5F/uU3FYdM2qR15mVlnd9a6cUrz1/x+97l6OnVkvz7utLOrn1pwGJlIouwKovO9jx+xEdxA3RB1LGPBzPkxnoqZXqxET2xshrFiHNknmCQx2h4OUaZ3ANxfDwioAI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065217; 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=1x1449wh9fFr7gq1V8OCFbpQf1TKKB1YZGtB8zf4V7c=; b=gMevr7TDgNu6aTLD5GZEW612ndq/2BshmP4ZxVCKRVXWAuWdyiK9ghGI+lX1+x95JXP6HIEY+VZdZBJTl49iFkABGy7kz4dFeQh/mnSH//klUsPE4l3HvepMXZn9zZJcL8eU6DdQiDzActEru2tA5uPZf1yr6vzpRpLK6xRGPxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065217648639.4694867840028; Thu, 21 May 2020 05:46:57 -0700 (PDT) Received: from localhost ([::1]:59272 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkb8-00059q-Cc for importer@patchew.org; Thu, 21 May 2020 08:46:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka0-0003Rh-U1 for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:44 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36189 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbkZz-00054p-Lt for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:44 -0400 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-190-dfaHOMhqPC2MO-S3r96W0g-1; Thu, 21 May 2020 08:45:40 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D7B2461; Thu, 21 May 2020 12:45:39 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAA0934201; Thu, 21 May 2020 12:45:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065142; h=from:from: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; bh=1x1449wh9fFr7gq1V8OCFbpQf1TKKB1YZGtB8zf4V7c=; b=YQ/gROl+X1qIJ/7/UB8Hd5aWAHRFZEYAfgFLgVEfJmhngcCxy1awlGJBP2FZOSsOQJamTX Ds982Vtsts9PuIdeMlrFqyz+CbgvIuSVRxIufi7ESWbC3ZugmD0Ps/7CkkDalaf9zWRWhh m/HJeCDBn7UGiTqD874RumPBRf2phnA= X-MC-Unique: dfaHOMhqPC2MO-S3r96W0g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 4/8] run-coverity-scan: use docker.py Date: Thu, 21 May 2020 08:45:31 -0400 Message-Id: <20200521124535.5329-5-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 06:06:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Our trusted docker wrapper allows run-coverity-scan to run with both docker and podman. For the "run" phase this is transparent; for the "build" phase however scripts are replaced with a bind mount (-v). This is not an issue because the secret option is meant for secrets stored globally in the system and bind mounts are a valid substitute for secrets that are known to whoever builds the container. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- scripts/coverity-scan/coverity-scan.docker | 2 +- scripts/coverity-scan/run-coverity-scan | 32 ++++++++++++++-------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/scripts/coverity-scan/coverity-scan.docker b/scripts/coverity-= scan/coverity-scan.docker index a4f64d1283..6f0460b66c 100644 --- a/scripts/coverity-scan/coverity-scan.docker +++ b/scripts/coverity-scan/coverity-scan.docker @@ -128,4 +128,4 @@ RUN rpm -q $PACKAGES | sort > /packages.txt ENV PATH $PATH:/usr/libexec/python3-sphinx/ ENV COVERITY_TOOL_BASE=3D/coverity-tools COPY run-coverity-scan run-coverity-scan -RUN --mount=3Dtype=3Dsecret,id=3Dcoverity.token,required ./run-coverity-sc= an --update-tools-only --tokenfile /run/secrets/coverity.token +RUN ./run-coverity-scan --update-tools-only --tokenfile /work/token diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index 990f75138d..e926623b3b 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -29,7 +29,9 @@ =20 # Command line options: # --dry-run : run the tools, but don't actually do the upload -# --docker : create and work inside a docker container +# --docker : create and work inside a container +# --docker-engine : specify the container engine to use (docker/podman/a= uto); +# implies --docker # --update-tools-only : update the cached copy of the tools, but don't r= un them # --tokenfile : file to read Coverity token from # --version ver : specify version being analyzed (default: ask git) @@ -197,6 +199,17 @@ while [ "$#" -ge 1 ]; do ;; --docker) DOCKER=3Dyes + DOCKER_ENGINE=3Dauto + shift + ;; + --docker-engine) + shift + if [ $# -eq 0 ]; then + echo "--docker-engine needs an argument" + exit 1 + fi + DOCKER=3Dyes + DOCKER_ENGINE=3D"$1" shift ;; *) @@ -283,9 +296,8 @@ if [ "$DOCKER" =3D yes ]; then # build docker container including the coverity-scan tools # Put the Coverity token into a temporary file that only # we have read access to, and then pass it to docker build - # using --secret. This requires at least Docker 18.09. - # Mostly what we are trying to do here is ensure we don't leak - # the token into the Docker image. + # using a volume. A volume is enough for the token not to + # leak into the Docker image. umask 077 SECRETDIR=3D$(mktemp -d) if [ -z "$SECRETDIR" ]; then @@ -300,12 +312,10 @@ if [ "$DOCKER" =3D yes ]; then # TODO: This re-downloads the tools every time, rather than # caching and reusing the image produced with the downloaded tools. # Not sure why. - # TODO: how do you get 'docker build' to print the output of the - # commands it is running to its stdout? This would be useful for debug. - DOCKER_BUILDKIT=3D1 docker build -t coverity-scanner \ - --secret id=3Dcoverity.token,src=3D"$SECRET" \ - -f scripts/coverity-scan/coverity-scan.docker \ - scripts/coverity-scan + tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ + -t coverity-scanner -f scripts/coverity-scan/coverity-s= can.docker \ + -v "$SECRETDIR:/work" \ + --extra-files scripts/coverity-scan/run-coverity-scan echo "Archiving sources to be analyzed..." ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz" if [ "$DRYRUN" =3D yes ]; then @@ -323,7 +333,7 @@ if [ "$DOCKER" =3D yes ]; then # Arrange for this docker run to get access to the sources with -v. # We pass through all the configuration from the outer script to the i= nner. export COVERITY_EMAIL COVERITY_BUILD_CMD - docker run -it --env COVERITY_EMAIL --env COVERITY_BUILD_CMD \ + tests/docker/docker.py run -it --env COVERITY_EMAIL --env COVERITY_BUI= LD_CMD \ -v "$SECRETDIR:/work" coverity-scanner \ ./run-coverity-scan --version "$VERSION" \ --description "$DESCRIPTION" $DRYRUNARG --tokenfile /work/token= \ --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065423; cv=none; d=zohomail.com; s=zohoarc; b=VSwQHfyejzR0zQx7506Yx8JPp5aqngeOo1nktOxRdqffEPrWROVd8ekR/uYWlNPz/WVFqkhKjPYK0DdW0x5MWxrjtduX+QGmXYNJ/fergOOLwgqYdcmznsktxuDMIMJ+IONBS8aa+uS7nkOXLscpQU6/maph94jU5RyqvyvkEl4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065423; 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=nEfu+WKuLGTbcmW54phLurwiymXP59SyP07hImE7S0M=; b=knXaIYhYYCm6kL8DLaDGZJA93CE/NaawdOJtkwk0sbqrgtc/7l64wUCFEXWNWnEcyonfDO52joUEluxIPITVcceVAbsHA3qLJmbKmbFZjMR2R3Je1ZYv5lhi8pzHxpuRfG7WmA4Mhyp+XSPGSgwPDz0UvJuQGfBqBk/y+bmOzP0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065423085836.3747511933007; Thu, 21 May 2020 05:50:23 -0700 (PDT) Received: from localhost ([::1]:45894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkeT-0003RT-Ub for importer@patchew.org; Thu, 21 May 2020 08:50:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka5-0003bB-NS for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:49 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:36673 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbka2-00057Y-Gv for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:49 -0400 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-133-1FbnthhCOb-6x0L2Xwy6FA-1; Thu, 21 May 2020 08:45:41 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 324F0800053; Thu, 21 May 2020 12:45:40 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E475341E9; Thu, 21 May 2020 12:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065145; h=from:from: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; bh=nEfu+WKuLGTbcmW54phLurwiymXP59SyP07hImE7S0M=; b=V018j6D5fuYhOmU5fdnPFQ9deJZeEw2HhYZQbVPqa7AvmfXy/KtwcMkp96l7w0iD0bxLro lUxwYRMpgl70f0a/0ZiBK11OVAl3L6ir1g/G50HnHk9qXvE0eJrMefkTFlwa6Xm01IfB6B D7CFZDwpYmxs0TiZTarp9XMjbgTHUQ4= X-MC-Unique: 1FbnthhCOb-6x0L2Xwy6FA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 5/8] run-coverity-scan: add --no-update-tools option Date: Thu, 21 May 2020 08:45:32 -0400 Message-Id: <20200521124535.5329-6-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 04:44:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Provide a quick way to skip building the container while we figure out how to get caching right. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 37 +++++++++++++++---------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index e926623b3b..bc9e12670b 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -33,6 +33,7 @@ # --docker-engine : specify the container engine to use (docker/podman/a= uto); # implies --docker # --update-tools-only : update the cached copy of the tools, but don't r= un them +# --no-update-tools : do not update the cached copy of the tools # --tokenfile : file to read Coverity token from # --version ver : specify version being analyzed (default: ask git) # --description desc : specify description of this version (default: ask= git) @@ -130,7 +131,7 @@ update_coverity_tools () { =20 # Check user-provided environment variables and arguments DRYRUN=3Dno -UPDATE_ONLY=3Dno +UPDATE=3Dyes DOCKER=3Dno =20 while [ "$#" -ge 1 ]; do @@ -139,9 +140,13 @@ while [ "$#" -ge 1 ]; do shift DRYRUN=3Dyes ;; + --no-update-tools) + shift + UPDATE=3Dno + ;; --update-tools-only) shift - UPDATE_ONLY=3Dyes + UPDATE=3Donly ;; --version) shift @@ -245,12 +250,12 @@ fi PROJNAME=3DQEMU TARBALL=3Dcov-int.tar.xz =20 -if [ "$UPDATE_ONLY" =3D yes ] && [ "$DOCKER" =3D yes ]; then +if [ "$UPDATE" =3D only ] && [ "$DOCKER" =3D yes ]; then echo "Combining --docker and --update-only is not supported" exit 1 fi =20 -if [ "$UPDATE_ONLY" =3D yes ]; then +if [ "$UPDATE" =3D only ]; then # Just do the tools update; we don't need to check whether # we are in a source tree or have upload rights for this, # so do it before some of the command line and source tree checks. @@ -293,7 +298,6 @@ fi =20 # Run ourselves inside docker if that's what the user wants if [ "$DOCKER" =3D yes ]; then - # build docker container including the coverity-scan tools # Put the Coverity token into a temporary file that only # we have read access to, and then pass it to docker build # using a volume. A volume is enough for the token not to @@ -308,14 +312,17 @@ if [ "$DOCKER" =3D yes ]; then echo "Created temporary directory $SECRETDIR" SECRET=3D"$SECRETDIR/token" echo "$COVERITY_TOKEN" > "$SECRET" - echo "Building docker container..." - # TODO: This re-downloads the tools every time, rather than - # caching and reusing the image produced with the downloaded tools. - # Not sure why. - tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ - -t coverity-scanner -f scripts/coverity-scan/coverity-s= can.docker \ - -v "$SECRETDIR:/work" \ - --extra-files scripts/coverity-scan/run-coverity-scan + if [ "$UPDATE" !=3D no ]; then + # build docker container including the coverity-scan tools + echo "Building docker container..." + # TODO: This re-downloads the tools every time, rather than + # caching and reusing the image produced with the downloaded tools. + # Not sure why. + tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ + -t coverity-scanner -f scripts/coverity-scan/coveri= ty-scan.docker \ + -v "$SECRETDIR:/work" \ + --extra-files scripts/coverity-scan/run-coverity-sc= an + fi echo "Archiving sources to be analyzed..." ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz" if [ "$DRYRUN" =3D yes ]; then @@ -350,7 +357,9 @@ fi =20 check_upload_permissions =20 -update_coverity_tools +if [ "$UPDATE" !=3D no ]; then + update_coverity_tools +fi =20 TOOLBIN=3D"$(cd "$COVERITY_TOOL_BASE" && echo $PWD/coverity_tool/cov-analy= sis-*/bin)" =20 --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065217; cv=none; d=zohomail.com; s=zohoarc; b=UH4tu6ZLA7PGlV2yGpE8Ux/g/IbqpEO5t7UwFmlrurtHnqtL4qMfEQe7nna0q6yD4dRDdRMo13OC0tfwmkBnFgGg67Y4UOk/keMxCp7U3LWTB2XL/dDqTvMyV2rYVb4ENrGRXuA6l6oIFQazl78CCPEQp87bnU2t6x4cr7xZbtw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065217; 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=RYYQUL0ofIRC+VTkLDVn89vPvmwrazQpp2d5+kAvCAk=; b=KUVmgR1CfxLaHrDxiUJ1VPgVAwaVklNuWpZHSrfAnkcYwalcvkI7aUobHuTfHB1CR0N0VmNxt7j7HW0S8cO+nVonTjmXqOKvN1xez6+J9HXjU1Uiu6FwiKsI+xJF0vaSrrvkuO7kWiARMyfTYzBCISkzNlhn59q5cOw+mkJ5PQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065217781222.4980211310003; Thu, 21 May 2020 05:46:57 -0700 (PDT) Received: from localhost ([::1]:59506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkbA-0005Fj-Bp for importer@patchew.org; Thu, 21 May 2020 08:46:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka5-0003Zq-44 for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:49 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:29493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbka2-00057S-Ep for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:48 -0400 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-10-LCi3rWuYMF67bfFWmY3aUQ-1; Thu, 21 May 2020 08:45:41 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC206464; Thu, 21 May 2020 12:45:40 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 629B3341E9; Thu, 21 May 2020 12:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065145; h=from:from: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; bh=RYYQUL0ofIRC+VTkLDVn89vPvmwrazQpp2d5+kAvCAk=; b=cB4seQusnQcmIyF0u8v8OUiK1EMD+2j8VNDK5Qp/mYdfGrbPphf3ht4IP0f/boaa6xkKpQ EMWYXMsh6zLjO8xhN9EMlfpbf7AH2kuMtRcwkqRYPc++yeII5Y1hWVEcTah0Xo3/xHVkp1 LUI6kCbGjt3bHrptORQhavARfcWZOW8= X-MC-Unique: LCi3rWuYMF67bfFWmY3aUQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 6/8] run-coverity-scan: use --no-update-tools in docker run Date: Thu, 21 May 2020 08:45:33 -0400 Message-Id: <20200521124535.5329-7-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 01:47:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Tools are already updated via the docker build. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index bc9e12670b..6bb38b4f48 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -325,17 +325,16 @@ if [ "$DOCKER" =3D yes ]; then fi echo "Archiving sources to be analyzed..." ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz" + ARGS=3D"--no-update-tools" if [ "$DRYRUN" =3D yes ]; then - DRYRUNARG=3D--dry-run + ARGS=3D"$ARGS --dry-run" fi echo "Running scanner..." # If we need to capture the output tarball, get the inner run to # save it to the secrets directory so we can copy it out before the # directory is cleaned up. if [ ! -z "$RESULTSTARBALL" ]; then - RTARGS=3D"--results-tarball /work/cov-int.tar.xz" - else - RTARGS=3D"" + ARGS=3D"$ARGS --results-tarball /work/cov-int.tar.xz" fi # Arrange for this docker run to get access to the sources with -v. # We pass through all the configuration from the outer script to the i= nner. @@ -343,8 +342,8 @@ if [ "$DOCKER" =3D yes ]; then tests/docker/docker.py run -it --env COVERITY_EMAIL --env COVERITY_BUI= LD_CMD \ -v "$SECRETDIR:/work" coverity-scanner \ ./run-coverity-scan --version "$VERSION" \ - --description "$DESCRIPTION" $DRYRUNARG --tokenfile /work/token= \ - --srcdir /qemu --src-tarball /work/qemu-sources.tgz $RTARGS + --description "$DESCRIPTION" $ARGS --tokenfile /work/token \ + --srcdir /qemu --src-tarball /work/qemu-sources.tgz if [ ! -z "$RESULTSTARBALL" ]; then echo "Copying results tarball to $RESULTSTARBALL..." cp "$SECRETDIR/cov-int.tar.xz" "$RESULTSTARBALL" --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065346; cv=none; d=zohomail.com; s=zohoarc; b=XhUY9i1/yvS6g2+ajVbTTlHWQ6fLrg4uw9tfdNGUs1n6ASLnd0j4/p1KJoCNe9mPx9GVeLNvyR+ITeV9Jl0X+EtH2NbssGexpAUfIVvbWJtI/AdkzPGq/yLiCaHCbvndNhzKex0wGJSze5CkYgpIxIbgbZp/QzBOu7iGafJYC0o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065346; 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=ucbm30v1gOPnBVovAjuwcDEPB4Pjf4KkcMD5kjEUqv0=; b=bKLBsNDWy9XHvnTZ7tBMdBv0gNTWtMVjxDW4a6MzfYprFENdq2Q60wFqG6Nxm8kvmM++1ZoFlxTyDW3vj00tvCPC6LGzbtwQg+qbMxwQ1Tg/WO4Ey+bMhS3Sle14dTWBoe8Y01mrXJbIjxDv4ChI/wY8QT2/PIkwk2pBEu39cmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065346287752.5674171920379; Thu, 21 May 2020 05:49:06 -0700 (PDT) Received: from localhost ([::1]:41228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkdF-00019Y-29 for importer@patchew.org; Thu, 21 May 2020 08:49:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50680) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka2-0003Ui-RU for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:46 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44001 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbka1-000578-K2 for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:46 -0400 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-168-GM5QclnOM4usfzC6l56Irg-1; Thu, 21 May 2020 08:45:42 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id B20CC8005AA; Thu, 21 May 2020 12:45:41 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2863D341E9; Thu, 21 May 2020 12:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065144; h=from:from: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; bh=ucbm30v1gOPnBVovAjuwcDEPB4Pjf4KkcMD5kjEUqv0=; b=PMT/fTzuxcd5aubI+ze4go6bBV0U8W5bQMmGdYTvVefy90cl/raqKFWE1FY+SX50shq3Kb F5Zwm7y4uP4/fVYYBzSpB8Vbxf9LBov1csmF5cv7GIkifCOZOWpODLgU+Qrl7JbdZ6av28 erje6xlVSrcbUZQR2M98/135lB8vflI= X-MC-Unique: GM5QclnOM4usfzC6l56Irg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 7/8] run-coverity-scan: download tools outside the container Date: Thu, 21 May 2020 08:45:34 -0400 Message-Id: <20200521124535.5329-8-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 06:06:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This lets us look at coverity_tool.md5 across executions of run-coverity-sc= an and skip the download. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/coverity-scan.docker | 3 +- scripts/coverity-scan/run-coverity-scan | 42 +++++++++++----------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/scripts/coverity-scan/coverity-scan.docker b/scripts/coverity-= scan/coverity-scan.docker index 6f0460b66c..efcf63224d 100644 --- a/scripts/coverity-scan/coverity-scan.docker +++ b/scripts/coverity-scan/coverity-scan.docker @@ -127,5 +127,6 @@ RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt ENV PATH $PATH:/usr/libexec/python3-sphinx/ ENV COVERITY_TOOL_BASE=3D/coverity-tools +COPY coverity_tool.tgz coverity_tool.tgz +RUN mkdir -p /coverity-tools/coverity_tool && cd /coverity-tools/coverity_= tool && tar xf /coverity_tool.tgz COPY run-coverity-scan run-coverity-scan -RUN ./run-coverity-scan --update-tools-only --tokenfile /work/token diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index 6bb38b4f48..8bff952bf5 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -116,15 +116,17 @@ update_coverity_tools () { echo "Downloaded tarball didn't match md5sum!" exit 1 fi - # extract the new one, keeping it corralled in a 'coverity_tool' d= irectory - echo "Unpacking coverity build tools..." - mkdir -p coverity_tool - cd coverity_tool - tar xf ../coverity_tool.tgz - cd .. - mv coverity_tool.md5.new coverity_tool.md5 - fi =20 + if [ "$DOCKER" !=3D yes ]; then + # extract the new one, keeping it corralled in a 'coverity_too= l' directory + echo "Unpacking coverity build tools..." + mkdir -p coverity_tool + cd coverity_tool + tar xf ../coverity_tool.tgz + cd .. + mv coverity_tool.md5.new coverity_tool.md5 + fi + fi rm -f coverity_tool.md5.new } =20 @@ -296,6 +298,14 @@ if [ -z "$COVERITY_EMAIL" ]; then COVERITY_EMAIL=3D"$(git config user.email)" fi =20 +# Otherwise, continue with the full build and upload process. + +check_upload_permissions + +if [ "$UPDATE" !=3D no ]; then + update_coverity_tools +fi + # Run ourselves inside docker if that's what the user wants if [ "$DOCKER" =3D yes ]; then # Put the Coverity token into a temporary file that only @@ -315,13 +325,13 @@ if [ "$DOCKER" =3D yes ]; then if [ "$UPDATE" !=3D no ]; then # build docker container including the coverity-scan tools echo "Building docker container..." - # TODO: This re-downloads the tools every time, rather than - # caching and reusing the image produced with the downloaded tools. + # TODO: This re-unpacks the tools every time, rather than caching + # and reusing the image produced by the COPY of the .tgz file. # Not sure why. tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ -t coverity-scanner -f scripts/coverity-scan/coveri= ty-scan.docker \ - -v "$SECRETDIR:/work" \ - --extra-files scripts/coverity-scan/run-coverity-sc= an + --extra-files scripts/coverity-scan/run-coverity-sc= an \ + "$COVERITY_TOOL_BASE"/coverity_tool.t= gz fi echo "Archiving sources to be analyzed..." ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz" @@ -352,14 +362,6 @@ if [ "$DOCKER" =3D yes ]; then exit 0 fi =20 -# Otherwise, continue with the full build and upload process. - -check_upload_permissions - -if [ "$UPDATE" !=3D no ]; then - update_coverity_tools -fi - TOOLBIN=3D"$(cd "$COVERITY_TOOL_BASE" && echo $PWD/coverity_tool/cov-analy= sis-*/bin)" =20 if ! test -x "$TOOLBIN/cov-build"; then --=20 2.26.2 From nobody Thu Mar 28 13:26:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590065433; cv=none; d=zohomail.com; s=zohoarc; b=JGfgEOi+l8VoUS7RRIgeuUO4HOZMeQ/oS7Wwuz6qle3U+gLeDwi7NkziI40MSk1M0qw+DHivEUuveVd0Ybb/4fgaoq5Q4zD/kJQzDOT2Oviyab3MKa0FBX2OL3opvjjYMY8XApiNZWXdAo7BBAymCfyO5irAbft3kA3G+h/qMi8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590065433; 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=j4FdChKq6cAC1AvirjpOGLQBCc9XB8opK4v+ZgHbNbU=; b=a5c9Oae0jQvllbSTWWnxbedKNt5QHipskjWhKmgul9n9sMs9wUTrouweQpHVqEDa7AQ6f/wLFE90u5H7IDDxxNoOeKqBBDtWXK10ZPGx0nw83kJYOrGJdzchqJZxtWt9P7H4QRqddwtgf63nQ+KF0aozaoAdpNtAEU1bTFWSSFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590065433940313.064645610557; Thu, 21 May 2020 05:50:33 -0700 (PDT) Received: from localhost ([::1]:46426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jbkee-0003oR-Mb for importer@patchew.org; Thu, 21 May 2020 08:50:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jbka3-0003X2-Rk for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:31613 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jbka2-00057M-0Y for qemu-devel@nongnu.org; Thu, 21 May 2020 08:45:47 -0400 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-287-GKADqYn6NVaODDiJDgJH2Q-1; Thu, 21 May 2020 08:45:43 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75D96108BD0B; Thu, 21 May 2020 12:45:42 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id E119A34209; Thu, 21 May 2020 12:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590065145; h=from:from: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; bh=j4FdChKq6cAC1AvirjpOGLQBCc9XB8opK4v+ZgHbNbU=; b=gt4itLhmbO/FTwOmyhkax2YP4wf6Bi/kFiyIQffHNif8wDsIV2vvQfWoKkbMU44MC9KJsp GmicmmcNOeeLv+TrGz4hkfeX9SejXRYBrjnuDt+TX8ADv2PHxrBIuE60G3mmldMjMzzVkk Zf18j6GNshdvqIRifcit144dMm6TA7U= X-MC-Unique: GKADqYn6NVaODDiJDgJH2Q-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 8/8] run-coverity-scan: support --update-tools-only --docker Date: Thu, 21 May 2020 08:45:35 -0400 Message-Id: <20200521124535.5329-9-pbonzini@redhat.com> In-Reply-To: <20200521124535.5329-1-pbonzini@redhat.com> References: <20200521124535.5329-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=pbonzini@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/21 01:44:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Just build the container when run-coverity-scan is invoked with --update-tools-only --docker. This requires moving the "docker build" logic into the update_coverity_tools function. The only snag is that --update-tools-only --docker requires access to the dockerfile. For now just report an error for --src-tarball, and "docker build" will fail if not in a source tree. Another possibility could be to host our container images on a public registry, and use "FROM qemu:fedora" to make the Dockerfile small enough that it can be included directly in the run-coverity-scan script. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/run-coverity-scan | 39 +++++++++++++++---------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index 8bff952bf5..03a791dec9 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -95,6 +95,18 @@ check_upload_permissions() { } =20 =20 +build_docker_image() { + # build docker container including the coverity-scan tools + echo "Building docker container..." + # TODO: This re-unpacks the tools every time, rather than caching + # and reusing the image produced by the COPY of the .tgz file. + # Not sure why. + tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ + -t coverity-scanner -f scripts/coverity-scan/coverity-s= can.docker \ + --extra-files scripts/coverity-scan/run-coverity-scan \ + "$COVERITY_TOOL_BASE"/coverity_tool.tgz +} + update_coverity_tools () { # Check for whether we need to download the Coverity tools # (either because we don't have a copy, or because it's out of date) @@ -128,6 +140,11 @@ update_coverity_tools () { fi fi rm -f coverity_tool.md5.new + cd "$SRCDIR" + + if [ "$DOCKER" =3D yes ]; then + build_docker_image + fi } =20 =20 @@ -252,15 +269,16 @@ fi PROJNAME=3DQEMU TARBALL=3Dcov-int.tar.xz =20 -if [ "$UPDATE" =3D only ] && [ "$DOCKER" =3D yes ]; then - echo "Combining --docker and --update-only is not supported" - exit 1 -fi - if [ "$UPDATE" =3D only ]; then # Just do the tools update; we don't need to check whether # we are in a source tree or have upload rights for this, # so do it before some of the command line and source tree checks. + + if [ "$DOCKER" =3D yes ] && [ ! -z "$SRCTARBALL" ]; then + echo --update-tools-only --docker is incompatible with --src-tarba= ll. + exit 1 + fi + update_coverity_tools exit 0 fi @@ -322,17 +340,6 @@ if [ "$DOCKER" =3D yes ]; then echo "Created temporary directory $SECRETDIR" SECRET=3D"$SECRETDIR/token" echo "$COVERITY_TOKEN" > "$SECRET" - if [ "$UPDATE" !=3D no ]; then - # build docker container including the coverity-scan tools - echo "Building docker container..." - # TODO: This re-unpacks the tools every time, rather than caching - # and reusing the image produced by the COPY of the .tgz file. - # Not sure why. - tests/docker/docker.py --engine ${DOCKER_ENGINE} build \ - -t coverity-scanner -f scripts/coverity-scan/coveri= ty-scan.docker \ - --extra-files scripts/coverity-scan/run-coverity-sc= an \ - "$COVERITY_TOOL_BASE"/coverity_tool.t= gz - fi echo "Archiving sources to be analyzed..." ./scripts/archive-source.sh "$SECRETDIR/qemu-sources.tgz" ARGS=3D"--no-update-tools" --=20 2.26.2