From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576328; cv=none; d=zohomail.com; s=zohoarc; b=MJLw6oG3W43xaoIHgyXbp+/UuJ+JIKuaeRbUWjVYdsinV0QrVQYkirif4EpX5COIk9KDUZW60rKHU05Ertx+DwTI0Aa2Vdra/B/MXm2bW5W/T8b9jYP++IIgb+F5hMz7M5+o7wGsZqJHTAky9h5UFNTHPw2O9v6alAnYTiCMpc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576328; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=BdgNn3lUnQzmA9m/1ezGpFmd+V2YKIrPbC1sLMYdTfY=; b=W++75ErUiKvhKJR1m7yk3Yk3HQ24Ee9/jJFUL2A6sUL2D3oHKCc+bGVtoEZfM4uNmGoLeY+n4U2xoEu77XBg8cORDDFXT9V7bGBy2LdkDAXoNSY7NEyzmj/YgTe0spwxDKXEYg60HATquQLZX8Ase0P8u8AvwDdLNf5rHYMXFPw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576328532214.34151429638223; Wed, 22 Apr 2020 10:25:28 -0700 (PDT) Received: from localhost ([::1]:54860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ7l-0008SB-VN for importer@patchew.org; Wed, 22 Apr 2020 13:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34212) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6T-0006yG-V0 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6Q-0004Ma-5O for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57509 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 1jRJ6P-0004IC-O7 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:01 -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-503-il8OglxoN4q61VgtJbeGsQ-1; Wed, 22 Apr 2020 13:23:54 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB9748017FC; Wed, 22 Apr 2020 17:23:53 +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 22B4A6084B; Wed, 22 Apr 2020 17:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BdgNn3lUnQzmA9m/1ezGpFmd+V2YKIrPbC1sLMYdTfY=; b=i7AplU73SqhK9Kt+I9XGIVFJJH1VPZy2suEfjERdOiOWzhLAJ3ff602vlsCaQWmAYAUJHH HhhTD78TR2TedLJ1+1VIeRI10BSpt7gjLCgqnhH5UiTbgUlA/yQ5mPsh+VVNvKobCtAsGZ CS0Y2Us5gvoQAlAD3El6spSe9sU5jLc= X-MC-Unique: il8OglxoN4q61VgtJbeGsQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 1/8] docker.py/build: support -t and -f arguments Date: Wed, 22 Apr 2020 13:23:44 -0400 Message-Id: <20200422172351.26583-2-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/04/22 09:07:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576328; cv=none; d=zohomail.com; s=zohoarc; b=hHN/qmPlNIL24rj34xqbeJiEb05qNLHVn19e2RQyWlyDCno/2Qvw+JPBTn/YUeIUvM4Oug4Mt5SonLLYVR9aMrI0XQSz+ZGU2vNyPAZD4wWWs2OZXmJIgYHrM0H6sl7gwwrphcZ3n/4PvQRspkFhQd91I20iE2HkmSrIhsQXHZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576328; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=FTbps+SS2Slp3h4Pf3Tt8s/+r7sD0evJW0cmToiLmrc=; b=SZQU5hjoKjJDlmHp2XGOISzKyLaoZN3N7DoNnj1aUmFHOLt/fAkMEgqyyEQo6fePfP293PUS3OuKqexhFqmXjpAHiqmDonkPNIe68bocVmKFGMT4fX57Q3ir3lTWBjTpa6soIk7FjLpXkMzSylq2pE6OhsT8UPdghLF2ExvXG4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576328887639.7394219434469; Wed, 22 Apr 2020 10:25:28 -0700 (PDT) Received: from localhost ([::1]:54862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ7m-0008WN-Ft for importer@patchew.org; Wed, 22 Apr 2020 13:25:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34182) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6Q-0006up-Ch for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6P-0004L6-6E for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:01 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:47639 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 1jRJ6O-0004JL-Mw for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:00 -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-189-U4YNkAZNNlSee_fAC_GRcg-1; Wed, 22 Apr 2020 13:23:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FFE4DB61; Wed, 22 Apr 2020 17:23:54 +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 DC3D36084B; Wed, 22 Apr 2020 17:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FTbps+SS2Slp3h4Pf3Tt8s/+r7sD0evJW0cmToiLmrc=; b=XU1h++jn/AEDqXkIGA48sw6401ktBqO+gNBC3OBYvso64s8mWqgC4MVehEJSaLwziW/0zv uCpe/U1Vnu6tOv6ABQRexZSo8o4Al/9RYCTZ68r1PJz/+lu+xvg9fXuyCuVC1XTcn4oAb8 B+tXB5iPUcCTZ8sR3FUwmfgqd6w/eNg= X-MC-Unique: U4YNkAZNNlSee_fAC_GRcg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 2/8] docker.py/build: support binary files in --extra-files Date: Wed, 22 Apr 2020 13:23:45 -0400 Message-Id: <20200422172351.26583-3-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/04/22 02:12:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Read the --extra-files in binary mode to avoid encoding errors. Signed-off-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576603; cv=none; d=zohomail.com; s=zohoarc; b=hEwUUTLMlqyvbLGutvrACt0+i4uN5FWYz5vjKJIyPtckZK4YuaezSLA97Z6eJdq4B3eLtXDyXaqWzZA5str3gKS7KhE6HGS42Vj3l1pEASdB10WbPTLTnBM5UQFOOGZGLUVBSUF4Vo6sjcuGqhl3F1M6zer/goIGFFRURgBnj74= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576603; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=QURyugqsBfA9ZpZvz1fnKy9b+23158RatjoiGUDeC9M=; b=HBOye3uN/Hfib0iIUMuHcK3Ni6DFZe7tLMF9Q+xbMOB6x2xFyAzhdjpnhgDAoM5XT8qGkI0dhPv8Lgd8gTfy7mxz8noxm360kwSktqOji5C0G8PLPCMYzJco4zW/XjX3HBFtKqr7MQU5qi8VKym59nxQVuaVixAWo2wa4gozV5Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576603371382.76182797741444; Wed, 22 Apr 2020 10:30:03 -0700 (PDT) Received: from localhost ([::1]:54942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJCC-0006rs-W9 for importer@patchew.org; Wed, 22 Apr 2020 13:30:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34240) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6V-0006zz-CL for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6S-0004Ot-Di for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:07 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:46272 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 1jRJ6S-0004Oi-27 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:04 -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-121-PDc78mVMN6iH6WfH64G-aA-1; Wed, 22 Apr 2020 13:23:56 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34E66800FF0; Wed, 22 Apr 2020 17:23:55 +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 9F5196084B; Wed, 22 Apr 2020 17:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QURyugqsBfA9ZpZvz1fnKy9b+23158RatjoiGUDeC9M=; b=TW45bl3POljHDCdVICjSQQiggps8fLEkTf3xd+8GFE9vRe15vfvfU5DlE0sBLrAZ5Ipqh1 GogJ4sD2i9cP491PTzRJNrmW7jhHNtRzGgPsyzjFsvxjgqTaGqj5gLBL8EXxSIXxKEqh3F 8lmiPz2HoL66uKAHHYjg17k6D4RbID4= X-MC-Unique: PDc78mVMN6iH6WfH64G-aA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 3/8] run-coverity-scan: get Coverity token and email from special git config section Date: Wed, 22 Apr 2020 13:23:46 -0400 Message-Id: <20200422172351.26583-4-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/04/22 02:12:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: pass (identity @redhat.com) MIME-Version: 1.0 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. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- scripts/coverity-scan/run-coverity-scan | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/coverity-scan/run-coverity-scan b/scripts/coverity-sca= n/run-coverity-scan index 2e067ef5cf..f7325b570c 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 @@ -62,7 +63,7 @@ check_upload_permissions() { =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 @@ -100,14 +101,14 @@ update_coverity_tools () { 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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576424; cv=none; d=zohomail.com; s=zohoarc; b=Vi0FNODZkeot71cRHtN1tH1pOuc2w604Cy28p3O5mVQu6gDdqZU864NKCXFd6ceLjLNJBLU21GjOO1PnCvTl/+nGyjPo6a99eZrnnWM5zIL5kH1lp5Qa8VmmFelQJf0fS4WtFi8nJ+nSaDp8JkA30WX2dWwEpPc/61q8xIk8ZxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576424; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/kAXIjlf0ZyGEYURBbLw3pFu+02FXS2Wib+zTp7XjI8=; b=jqbYorY8EOZJ1wSm+UujvDmVv401En+cW74lsS7LTdmYzu4JbNFU9RZC8guN4jcfZqVBTXqUcHaECLX000a1Q3zBpqufQqiYTRMrHVeu2cgrmI4xDAxy7rOC9A+diCEdPA3mzTYv58Cnm0cadlzpWGqMOhrxzUmbl6oLB43H//E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576424589677.5689941318964; Wed, 22 Apr 2020 10:27:04 -0700 (PDT) Received: from localhost ([::1]:54892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ9L-0002nx-Cq for importer@patchew.org; Wed, 22 Apr 2020 13:27:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34228) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6U-0006zE-Nd for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6Q-0004Na-Cw for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:06 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:20719 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 1jRJ6Q-0004LB-0s for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:02 -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-356-rDlhdHXXNGOLTmS198zrvw-1; Wed, 22 Apr 2020 13:23:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 000EC8017F3; Wed, 22 Apr 2020 17:23:55 +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 63FAE6084B; Wed, 22 Apr 2020 17:23:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/kAXIjlf0ZyGEYURBbLw3pFu+02FXS2Wib+zTp7XjI8=; b=gYyMOckx5s1hi2qyeFtgnbFwiGGadgJ7Pq9shtQlYMiYMyW685yF9l4uiV902x2OsoZVJb ZQ0pP8W4bsI9rT3Bxr3VHxAuXOzDRFqjfjo/YjO4dTSbj2479s8cECBZ0oaqepJgdQtKYs W9OybDCk10brfScMzyJeIRwu55HYZh0= X-MC-Unique: rDlhdHXXNGOLTmS198zrvw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 4/8] run-coverity-scan: use docker.py Date: Wed, 22 Apr 2020 13:23:47 -0400 Message-Id: <20200422172351.26583-5-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/22 02:57:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: pass (identity @redhat.com) MIME-Version: 1.0 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. This also removes the need for DOCKER_BUILDKIT=3D1. Signed-off-by: Paolo Bonzini --- Later in the series, the secret will not be used in "docker build" at all. scripts/coverity-scan/coverity-scan.docker | 2 +- scripts/coverity-scan/run-coverity-scan | 23 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 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 f7325b570c..ae1fc7ae76 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -197,6 +197,12 @@ while [ "$#" -ge 1 ]; do ;; --docker) DOCKER=3Dyes + DOCKER_ENGINE=3Dauto + shift + ;; + --docker=3D*) + DOCKER=3Dyes + DOCKER_ENGINE=3D${1#--docker=3D} shift ;; *) @@ -283,9 +289,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 +305,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 +326,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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576703; cv=none; d=zohomail.com; s=zohoarc; b=Im1Rm5g30frkQujzuCvr2hLnZd1k63CHTI+bi9E/9KYGQzOuahLuo+Uv1ArnsxU+AvJghayFlhAo2a7WmYWwrpOXZkbzhqOPU5BZcDuptQmxezD/Zy0MbRb4vjHwBrwGoiPiLtsTHF4QObX3JAkkXQhm+73D4Wi2UWd+3xjXKHY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576703; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Qo/78xll3eTysL0pv7Kk3fEWiAu3sqbSrU00zi1Q9jc=; b=E4/MvRhaNZwUcjfOwsC9VpweE568y0F/Y1C6+tg7VrSgtZHO3UX+ixSXY1DCGDbuxr+IPbBTVgXmkLJYYJZ66lulJROG6/hDgGoVzd9UijfUgnQl/cOPYlv9z1Bbx53uwww7CijsAJSv4NWnNnY4od8Ul1ia9AlrRhXtn0baZzc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576703276930.7406466475975; Wed, 22 Apr 2020 10:31:43 -0700 (PDT) Received: from localhost ([::1]:54978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJDp-0000FD-Vi for importer@patchew.org; Wed, 22 Apr 2020 13:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34244) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6V-00070H-Jh for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6R-0004OP-4q for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:50820 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 1jRJ6P-0004JN-OE for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:02 -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-476-fOJeiifTMBygC1A09ybFZQ-1; Wed, 22 Apr 2020 13:23:57 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B073B190B2A8; Wed, 22 Apr 2020 17:23:56 +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 293BA6084B; Wed, 22 Apr 2020 17:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Qo/78xll3eTysL0pv7Kk3fEWiAu3sqbSrU00zi1Q9jc=; b=ExqITkhjebr+Okhi5es5KYteH014y/KOd3Hjb9teEYOWhOKD4sRU2OO+93bLMMlzX1t1kp M7VZFGvlQIpQGPOQzVgQcXDojm8bRqgZXeTPyqUCS00pi6XnSPC4mVrjfKodNnWGM0LHYe yY6L9y0XJlDKWoryHS+QeNuDpGZ0ZzA= X-MC-Unique: fOJeiifTMBygC1A09ybFZQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 5/8] run-coverity-scan: add --no-update-tools option Date: Wed, 22 Apr 2020 13:23:48 -0400 Message-Id: <20200422172351.26583-6-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/04/22 04:15:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: pass (identity @redhat.com) MIME-Version: 1.0 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. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- 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 ae1fc7ae76..9403429849 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -31,6 +31,7 @@ # --dry-run : run the tools, but don't actually do the upload # --docker : create and work inside a docker container # --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) @@ -128,7 +129,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 @@ -137,9 +138,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 @@ -238,12 +243,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. @@ -286,7 +291,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 @@ -301,14 +305,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 @@ -343,7 +350,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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576504; cv=none; d=zohomail.com; s=zohoarc; b=UNRpEv+fdusR26u2OXTMHTdw/ZTOKg6MhEEGunzBFfi7m4ze/d6LHJQinmViQHqaOF9tT5lczNYx1kluLbscwlN+Jd71npNoUvrU+zTUAZpZ8hDtGyBd7tK73/sCXfaVeWXueIqS0ZxYOPqJvs333frNIu4zShsDjKypXB3Npew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=TuB60exFZOVxc3L6T8y64lcDmB9bKM9IPSAni+oZjKg=; b=GgWgl9BiaoBb9b2DEvpZLEe3N8KrPL7LaGyntkkJOkpFGBoSrIb0+r2haN3x4FJja46vZ9Wel0gUhbHCkqlsKFbVtfSDXHqW4JaVHQRAQR0SlSP6M29C3IprEmfb+x3nBHDuFefDqi8KAd/If71tVgJlL8YQ8MPIftAYYMEdaj0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576504168708.5143500034023; Wed, 22 Apr 2020 10:28:24 -0700 (PDT) Received: from localhost ([::1]:54910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJAc-0004u4-Pl for importer@patchew.org; Wed, 22 Apr 2020 13:28:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34236) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6V-0006zi-65 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6R-0004OW-65 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:06 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:23038 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 1jRJ6Q-0004Ne-Ps for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:02 -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-350-dntXZBs_PIi2xQ9pk0oIBg-1; Wed, 22 Apr 2020 13:23:58 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73F56DB60; Wed, 22 Apr 2020 17:23:57 +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 E10476084B; Wed, 22 Apr 2020 17:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TuB60exFZOVxc3L6T8y64lcDmB9bKM9IPSAni+oZjKg=; b=InO9ItUWYQ6EWspESg5jlI6UUn4RrYxX4nZvQHNXgTKEs8sXqEgM6aFBtAJVQfJN6roWYb HKz1pQ35U/w8vn3i0Fnq211wsDilRAcPZifRtgDMP6o0cED0utmNJVVCYz9PCZCu+iKjPq NEx0TUNwRsaeLNYIhMbuKu0kECyG1u4= X-MC-Unique: dntXZBs_PIi2xQ9pk0oIBg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 6/8] run-coverity-scan: use --no-update-tools in docker run Date: Wed, 22 Apr 2020 13:23:49 -0400 Message-Id: <20200422172351.26583-7-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/22 02:57:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Tools are already updated via the docker build. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- 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 9403429849..0c2c0e4087 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -318,17 +318,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. @@ -336,8 +335,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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576424; cv=none; d=zohomail.com; s=zohoarc; b=Rekmvt8LcM4hvk8xg9d8Xk6gwni7cqmg3fM1qiORMqoV8LgJV40yVc3iKxd+HqtGjP2vJuokqU8P4Q+S0KWubBvqd+1aYEK8OD7PPyZQpe1Vm7nJRFiGb7RtbGzX9reKoeap0ufDROTnvVPhVmBfH3F1V8BpE3Y6jyHk+0q8JOg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576424; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=sbNUyR2X80XAt9gdGYyjU4QQjkaQE1JBi/X/D4xnlgw=; b=feR1IGAkxNvrydXyXFoUOFnru1VkVl0UGUqNtChpO3kZYo/N5QvZdMmwCPS+70gwxoyBuK2zcqyhW+K0AcAmGaVpWY+U5mx1h7UqL8pvjKKL7bcJ5RiyYVIMQYVw2pCvfpot3SHW4DVhABdqcyFYAt1/ejYBsbqG6Dk6O9sT2eQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576424585126.63674362508459; Wed, 22 Apr 2020 10:27:04 -0700 (PDT) Received: from localhost ([::1]:54894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ9L-0002om-Ba for importer@patchew.org; Wed, 22 Apr 2020 13:27:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34232) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6U-0006zP-TI for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6R-0004OK-3x for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:06 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:50128 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 1jRJ6Q-0004LZ-O4 for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:02 -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-500-v11_MVcONiGCSVQsxYdaMg-1; Wed, 22 Apr 2020 13:23:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A2F7DB62; Wed, 22 Apr 2020 17:23:58 +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 A49DA6084B; Wed, 22 Apr 2020 17:23:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sbNUyR2X80XAt9gdGYyjU4QQjkaQE1JBi/X/D4xnlgw=; b=VE1DqB5DITgCu1PkHg8ReS/g4Efn0l8Oyu2QA2/McfYuv2RgA1k2ivNCJaHUYzUw8DmdZ5 yDP5dMqcv4bgQNiyrIGCfNPqyUB2lM9yJPuFEIsT1rMRlbf8NAJzVQgvXmBL4zROSg0LIg jClGFM4GTaMae3F3xWg8CuU1fVKnwoM= X-MC-Unique: v11_MVcONiGCSVQsxYdaMg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 7/8] run-coverity-scan: download tools outside the container Date: Wed, 22 Apr 2020 13:23:50 -0400 Message-Id: <20200422172351.26583-8-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/04/22 02:57:52 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 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: pass (identity @redhat.com) MIME-Version: 1.0 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. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- 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 0c2c0e4087..49df8dcc06 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -114,15 +114,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 @@ -289,6 +291,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 @@ -308,13 +318,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" @@ -345,14 +355,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.18.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1587576378; cv=none; d=zohomail.com; s=zohoarc; b=LGF4rEoEC6dEwG+GpSZ4U/rb6l6ouKQHgdEURCOxo1tOEfZVdyO9U5TXRe9By3/+ddHxlOcxIPGYMANDm4ejadK6UoagTj+ZPUry6j6giLMw8Fyvj2ficQ4LUnOB3rYZOmNgrVLg73rrZIRrJmv02lXSXXi3CsYAOGicUM8HE+o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587576378; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=UfbHAUK4NA4e7RJFR+eYDU5CnrMdlw5f1uZu0oZM0Vo=; b=NwB1MMaykYIReVut77XwFJEbJHm/OsTjjPzLrYoKt/qEeen3KfhQh7aD/Uh9YMlfBfBF2gM22ygqlJXMTxCLbnZmsh21CBEpzvkYSUuwgbyb31YGN9jog6t3sDXH3nXBG/ytztrKAH9XnzZYpZJxTvLuCcEhWT1MwjCbS1HXYg0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1587576378699188.32960169428713; Wed, 22 Apr 2020 10:26:18 -0700 (PDT) Received: from localhost ([::1]:54888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ8b-0001fd-8g for importer@patchew.org; Wed, 22 Apr 2020 13:26:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34250) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRJ6V-00070a-PA for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRJ6U-0004Q2-Ak for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:44360 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 1jRJ6T-0004Pc-UG for qemu-devel@nongnu.org; Wed, 22 Apr 2020 13:24:05 -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-28-r8DeF8LnMReveaYx5mxqtQ-1; Wed, 22 Apr 2020 13:23:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F12A4100CC88; Wed, 22 Apr 2020 17:23:58 +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 6892D6084B; Wed, 22 Apr 2020 17:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587576245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UfbHAUK4NA4e7RJFR+eYDU5CnrMdlw5f1uZu0oZM0Vo=; b=fgDoglv0u24+08p8DA3Lbp1ZByAP34XDKtvF4alzqXzPyj5n7K3eGQPxPywwP1VaXIwy2N Wvh//oyjzwIkwcxD2+3aELKdcNxo/vIdcdL7ALtOWw9+lxbJDfsUSbqmwrOIkQp+rOqRsc etkbJV0fKBCfee/FW2vL+FewT0DDmBo= X-MC-Unique: r8DeF8LnMReveaYx5mxqtQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 8/8] run-coverity-scan: support --update-tools-only --docker Date: Wed, 22 Apr 2020 13:23:51 -0400 Message-Id: <20200422172351.26583-9-pbonzini@redhat.com> In-Reply-To: <20200422172351.26583-1-pbonzini@redhat.com> References: <20200422172351.26583-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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/04/22 04:15:03 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 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: pass (identity @redhat.com) MIME-Version: 1.0 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. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell --- 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 49df8dcc06..900ce9dd14 100755 --- a/scripts/coverity-scan/run-coverity-scan +++ b/scripts/coverity-scan/run-coverity-scan @@ -93,6 +93,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) @@ -126,6 +138,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 @@ -245,15 +262,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 @@ -315,17 +333,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.18.2