From nobody Sat May 18 19:24:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615491017; cv=none; d=zohomail.com; s=zohoarc; b=fX3m7/nfIiNoJ4nBytZIuCD+mgZchVQ1QlIIX25hyxiEpqYx0zFirsq6P/kd4/d0uQHRDF5ZLKTLCcwmNZrzm6Zmbe34jn3y6J9f9wFEAsmmYOjaZd8zYQ8FYuHxKTjScaVMehbfwqqrsflLZu709euU66Fe0OYVZGTM8orxHgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615491017; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=GcEqEmej+eAfJ0qyKnp2VJXW8vNyKdRM5vBtvmN5s9c=; b=mm17FfdSrosz6gsvQwZnd7jsIfp3CRCdcefu3J5I99qOIGmvkhKT4bdBjzXvxQoRCvNTYMCQauiZ9bv8leqZYFzyDjm+gbbga5rt62rQs4xq0YHTOQq3p9zX6NmCzEChLtXZEBH4nYKxzxX24bPwS3fIjFTH4JIcECzlMDoAfFU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615491016943246.10189963710195; Thu, 11 Mar 2021 11:30:16 -0800 (PST) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-1-Ok0n2DFmMRSJ3m75A4VivQ-1; Thu, 11 Mar 2021 14:30:10 -0500 Received: by mail-wr1-f70.google.com with SMTP id m23so4982531wrh.7 for ; Thu, 11 Mar 2021 11:30:10 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (17.red-88-21-201.staticip.rima-tde.net. [88.21.201.17]) by smtp.gmail.com with ESMTPSA id o14sm4930675wri.48.2021.03.11.11.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 11:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615491014; 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; bh=GcEqEmej+eAfJ0qyKnp2VJXW8vNyKdRM5vBtvmN5s9c=; b=R+o3L3gOokPA+mzBH1HcS7B5YdJL6p3Dn5vud9ZKzMPmiTZigol9RfhaiqkRC5sOZyr3Zm QL/zRq6g6RC2D/+gnrjbAHbk4xS8c977AuiwBcxc9fgck/rRYiTt6zo/IzrJfAbQ0Oxlg6 S6GvBpo9Ij0KLI0S/IGpy+ZGzCNQq+w= X-MC-Unique: Ok0n2DFmMRSJ3m75A4VivQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=GcEqEmej+eAfJ0qyKnp2VJXW8vNyKdRM5vBtvmN5s9c=; b=rZIH8a3L9bbpzvzc2NnZEz+9s319PuTYDSWjn2EojWVmUpCbtiT0FLH3PpBwwGCyRn 7LgS+CEwy6xj+VUi8OWU+rww1OLmIVRFe/sGAmdDfDKXq4QTRd1UEwSIBFTGWiL7wPyb 348NIgLt1WzXx5GZf1TXJFHAaUPlQ4onmHWBBXvCC75Vkq2rpbVGGfk1ejgrINzAn6oL bK5H9rALxwMVFGxh7pSl3JozB5fCRxdNVqWXSQOM5bxOP8B1yyac+BsTXPoxAA4eB4X8 GE6QIggy5QR9MQ8v4BH8mcpSpNRvoqzZ2sJxuo3bG6okkD/auKKbFkA+/1YZwL4bwWV0 NxOg== X-Gm-Message-State: AOAM53241hLdWvohSRBxfc/3xMk8jhVhWlnFZk+ZZZ3ErSYQFdD7hcLV 64iea6q6eebhV8KYeemf0Bh5FtVej5uyEdR981TPIzXR0wU/VegEca/moawDKn5UtX7wWwqVyo/ T8INpa4ZBGnDSRQ== X-Received: by 2002:adf:d4ca:: with SMTP id w10mr10755713wrk.146.1615491009318; Thu, 11 Mar 2021 11:30:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzrLX0i1VXw7xm0QjrA9Nl6BM2gNPWxcjPoetDWw0KPkucsH5HjLpUulsJIa0HBf94m+Zp1g== X-Received: by 2002:adf:d4ca:: with SMTP id w10mr10755698wrk.146.1615491009063; Thu, 11 Mar 2021 11:30:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Vladimir Sementsov-Ogievskiy , Fam Zheng , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Thomas Huth Subject: [PATCH] gitlab-ci: Add a job to run common coccinelle checks Date: Thu, 11 Mar 2021 20:30:06 +0100 Message-Id: <20210311193006.1442775-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Add a job to run common coccinelle checks. We use spatch tool from Fedora 32 (Docker image) because more recent versions are failing. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Based-on: <20210311192700.1441263-1-philmd@redhat.com> --- .gitlab-ci.d/containers.yml | 5 ++++ .gitlab-ci.yml | 26 +++++++++++++++++++ .../dockerfiles/fedora-coccinelle.docker | 16 ++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/docker/dockerfiles/fedora-coccinelle.docker diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml index 33e4046e233..8f14afdccab 100644 --- a/.gitlab-ci.d/containers.yml +++ b/.gitlab-ci.d/containers.yml @@ -249,3 +249,8 @@ amd64-opensuse-leap-container: <<: *container_job_definition variables: NAME: opensuse-leap + +cocci-fedora-container: + <<: *container_job_definition + variables: + NAME: fedora-coccinelle diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 07202f6ffb2..615a0b98fe2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -746,6 +746,32 @@ build-libvhost-user: - meson - ninja =20 +check-cocci: + stage: build + needs: ['cocci-fedora-container'] + image: $CI_REGISTRY_IMAGE/qemu/fedora-coccinelle:latest + script: + - for script in + scripts/coccinelle/errp-guard.cocci + scripts/coccinelle/exec_rw_const.cocci + scripts/coccinelle/inplace-byteswaps.cocci + scripts/coccinelle/overflow_muldiv64.cocci + scripts/coccinelle/qom-parent-type.cocci + scripts/coccinelle/qom-parent-type.cocci + scripts/coccinelle/remove_local_err.cocci + scripts/coccinelle/remove_muldiv64.cocci + scripts/coccinelle/return_directly.cocci + scripts/coccinelle/typecast.cocci + scripts/coccinelle/use-after-abort-fatal-errp.cocci + ; do + spatch --macro-file scripts/cocci-macro-file.h + --sp-file $script + --timeout 137 + --jobs 2 + --use-gitgrep + --dir . + ; done + # Prepare for GitLab pages deployment. Anything copied into the # "public" directory will be deployed to $USER.gitlab.io/$PROJECT pages: diff --git a/tests/docker/dockerfiles/fedora-coccinelle.docker b/tests/dock= er/dockerfiles/fedora-coccinelle.docker new file mode 100644 index 00000000000..5392c73fcb2 --- /dev/null +++ b/tests/docker/dockerfiles/fedora-coccinelle.docker @@ -0,0 +1,16 @@ +# +# Docker image to run Coccinelle spatch +# (program matching and transformation engine) +# +# Copyright (C) 2021 Red Hat, Inc. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +FROM fedora:32 + +# Please keep this list sorted alphabetically +RUN dnf install -y \ + coccinelle \ + diffutils \ + findutils \ + git-core --=20 2.26.2