[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] build: correct cppcheck-misra make rule


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 21 Sep 2022 15:32:07 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PRDo78G4PfJw+4DXqcUnT6xHLfTRuKR5iO8Bj15DWuk=; b=FNYHnRU542ztgF+Ek97HW33/vMuCelTnIF70/SFdQcJGrVJRhMUJKKTLyKZmpW471ccmAWyvE+/YLeL90vbWYXj59CnUv4CDx7/+cIaQZLOPeIrWBKucVOlz0x1KY1u2c+ouMNxHFWXHyFgbuWBg3lfbl4xdFV3cK/+NW/MYVp6qgpNN+tcOxKROozBMSlqP3CPpssFlcrKA9525z/Vqlmn1gyYuIwVXG5gq0buVD7LInVqW9pfZm7p9ILrEZIwJRlaQ7KJVzH/RmzFhWsFytpbyyeUY6vBJFoJyEdtuoXF37VZJT09PCW9NgTdwbnqlmWzUJOZzpOc75kS6TR85gw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PRDo78G4PfJw+4DXqcUnT6xHLfTRuKR5iO8Bj15DWuk=; b=h0Cpb7BavVpCCiUFiDKShJeUEo3sLuIj4nazNEq/konrzOek8bsec+UGUmANbuDkmw8SSzNeg0CIKqD/kr5FXxDavo18ky9EKYoe77yJmB95hCGfqRdjf83MO3MYYmY5eseWU8kaLnyDPLFO4YVXry1+2gCZrhQGxHXEM3FRunDx6P1dHeXQHKjVHj+AqwpKgb9Tl2S++G5zc78iegiiDpkqTkmkZygzp2cq8g42WmBrAF3tJaKPYiPs4mX7zpRvQ51lloAcN+rLGUrKobSHeb22NrZXd0SeYvulkyAv8e1HzTcdVegrGqiKEGEodUkN3hS+Qm1rVd5nRWPDvaqVeQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Yfplw0K3rSiuC+qPz7xNDPvFHe2qt6GmrKnO1/R3HAubLkTReq2bTXoWc12xaVtNWcXHzau+Tul6CeXrs5yaQAl742CckWztYXAhxL8gI3iSeOlm3JhBXIsl6NYbUhNnjoSiWDFbwzZKczwZkIzVrS+zesx0eagKanNiz5qohdmIt4ueJLOdg6TnaSCVre5ETA6Sk9YZXvc/WdoYl+Q3ZBKvXhAsELQd2ev3LPnVpT/e95zcTDA/yLF9c6mrsKSwZmnqgeiL7AYI/36ZQ+n5/XRX+kmk2+J60sOFjOaMCUVhehbk11QdRlwb1amx5s09jemgS1/8HdLwh5OU8b0ykA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nqp7PystVYa/ZKkestB3s5hzsdD7Vcf8QeNWjfWe9CHzyjo8AgBdZdh2eWPveulr9qDlDYMnGwmWC3XO8ysgbmRszB57akxYY4uHbhl9rdmWYneGlfpWN1NeyG39z1y4Ly/OusvkV9bG95C1M00zbKdzUratctLTV6NLGKwai4rz5UyKIyv87tBQtb1FzVAk6diA9z2wtr5pag+3dIyj01cWO2bvKrMgjco5NF+YmbmEnDBSfAMdVV9wCTygBC+s50GldBTo3HAUrnR4DugyJod/EXGk1S2SGwPoc4TIyYxFTZ/qQ5cLq4ykze1nZVNUFrAbSKZbC59CrGNSRl2yBw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 21 Sep 2022 15:32:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYxnN181ZyqpP7MEOQ4AIPrjEu+K3qEbaA
  • Thread-topic: [PATCH v2] build: correct cppcheck-misra make rule

Hi Jan,

> On 12 Sep 2022, at 07:46, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> 
> Having cppcheck-misra.json depend on cppcheck-misra.txt does not
> properly address the multiple targets problem. If cppcheck-misra.json
> is deleted from the build tree but cppcheck-misra.txt is still there,
> nothing will re-generate cppcheck-misra.json.
> 
> With GNU make 4.3 or newer we could use the &: grouped target separator,
> but since we support older make as well we need to use some other
> mechanism. Convert the rule to a pattern one (with "cppcheck" kind of
> arbitrarily chosen as the stem), thus making known to make that both
> files are created by a single command invocation. Since, as a result,
> the JSON file is now "intermediate" from make's perspective, prevent it
> being deleted again by making it a prereq of .PRECIOUS.
> 
> Fixes: 57caa5375321 ("xen: Add MISRA support to cppcheck make rule")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> v2: Add comment. Add Fixes: tag.
> ---
> It has been bothering me for a while that I made a bad suggestion during
> review; I'm sorry for that.
> 
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -746,11 +746,12 @@ cppcheck-version:
> # documentation file. Also generate a json file with the right arguments for
> # cppcheck in json format including the list of rules to ignore.
> #
> -cppcheck-misra.txt: $(XEN_ROOT)/docs/misra/rules.rst 
> $(srctree)/tools/convert_misra_doc.py
> -     $(Q)$(PYTHON) $(srctree)/tools/convert_misra_doc.py -i $< -o $@ -j 
> $(@:.txt=.json)
> -
> -# convert_misra_doc is generating both files.
> -cppcheck-misra.json: cppcheck-misra.txt
> +# convert_misra_doc.py, producing both targets at the same time, should be
> +# executed only once. Utilize a pattern rule to achieve this effect, with the
> +# stem kind of arbitrarily chosen to be "cppcheck".
> +.PRECIOUS: %-misra.json
> +%-misra.txt %-misra.json: $(XEN_ROOT)/docs/misra/rules.rst 
> $(srctree)/tools/convert_misra_doc.py
> +     $(Q)$(PYTHON) $(srctree)/tools/convert_misra_doc.py -i $< -o 
> $*-misra.txt -j $*-misra.json
> 
> # Put this in generated headers this way it is cleaned by include/Makefile
> $(objtree)/include/generated/compiler-def.h:




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.