From nobody Wed Dec 4 08:40:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1730393745; cv=none; d=zohomail.com; s=zohoarc; b=fauNvAVIaIPc+si6UTzuzPPxq191cDq+jdr9PBQ2TbwKvjnUDuaUF+JPIxku7d+ziKxY6txWpYwBaO8LFepMWIDrUzTGL0H3qO60eQdIlmmhheuNOfUAZztGcsIGJXi/ajKcE/znYscdiGB8QNyKhZpFPdSo4K6UaccqdlRRjCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730393745; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=09370oDJSKlXbcjbRkgjjIjt3qFIEKrQlsjk/b2aKC0=; b=bVETvkq1DHnfnt55GO162vCfA1izEdpRUHUhOVqRyNeDGG7Gb0jA5SzSVQod2F0z9y8vRFh1A4C2eFHZqAaGoZdsCWoFUL7sBQh2XkyDaLqMuRNwqvuE0cjWI4d4JTb77awRl07+aLPFZkQiTV3e+kQGAZNFdKThbhnhS09zKaY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1730393745901506.43025191819856; Thu, 31 Oct 2024 09:55:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.828838.1243861 (Exim 4.92) (envelope-from ) id 1t6YS5-0002lk-Jz; Thu, 31 Oct 2024 16:55:17 +0000 Received: by outflank-mailman (output) from mailman id 828838.1243861; Thu, 31 Oct 2024 16:55:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t6YS5-0002ld-HH; Thu, 31 Oct 2024 16:55:17 +0000 Received: by outflank-mailman (input) for mailman id 828838; Thu, 31 Oct 2024 16:55:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1t6YS3-0002lT-LI for xen-devel@lists.xenproject.org; Thu, 31 Oct 2024 16:55:15 +0000 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [2a00:1450:4864:20::634]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e2ffe69f-97a8-11ef-99a3-01e77a169b0f; Thu, 31 Oct 2024 17:55:09 +0100 (CET) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-a9a16b310f5so163278566b.0 for ; Thu, 31 Oct 2024 09:55:09 -0700 (PDT) Received: from andrewcoop.eng.citrite.net ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e565e0940sm85260366b.104.2024.10.31.09.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 09:55:07 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e2ffe69f-97a8-11ef-99a3-01e77a169b0f X-Custom-Connection: eyJyZW1vdGVpcCI6IjJhMDA6MTQ1MDo0ODY0OjIwOjo2MzQiLCJoZWxvIjoibWFpbC1lajEteDYzNC5nb29nbGUuY29tIn0= X-Custom-Transaction: eyJpZCI6ImUyZmZlNjlmLTk3YTgtMTFlZi05OWEzLTAxZTc3YTE2OWIwZiIsInRzIjoxNzMwMzkzNzA5LjI0Mjk4Niwic2VuZGVyIjoiYW5kcmV3LmNvb3BlckBjbG91ZC5jb20iLCJyZWNpcGllbnQiOiJ4ZW4tZGV2ZWxAbGlzdHMueGVucHJvamVjdC5vcmcifQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1730393708; x=1730998508; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=09370oDJSKlXbcjbRkgjjIjt3qFIEKrQlsjk/b2aKC0=; b=ngTeWNDrWkiPDj6+Isu1WoPt/+MnPdJ/LumbDxBkOIvJgXbc9aCG28K3jJZ8LUNmMV wM1VOUrbeHwHFpZLsvIiSTt1x2tTyq3gQCGUYDYt30vv5cKyj5wovyWzmGgKIu3jr0+7 gAJIQpsNtVvcHZjPZbU5VJPjgYXvWxSps2mNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730393708; x=1730998508; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=09370oDJSKlXbcjbRkgjjIjt3qFIEKrQlsjk/b2aKC0=; b=qjNsbRCk/hYHbxNLIp7yvrpqPhZx4tXftOPJXNAfXCygSHhSxk8HGeTb5h0Af5K5s8 PsW3FBLQ1+fxiS2SD0BQHiD8cpCocaJuzyhfCqjrotSkiI5jDZmbNwoohXYoBsqkYBZf pK2oFH/kqgFWlfEHlG8xHJZpB5mxdDA+Ar6AsZcwLFF588Yi0lVaAOHMYetL8c6d/+Yq 7/rFCszEK8UIFUn+I9dBZiJfnwW54YHFuBpANb36f95mpKlawt9G8NJCL8MfWI8TlHLj sYGKEcthFZ75A3MCVLu+i4Q4R1qk3Y+rgXaG+t8aBVt/y9iceDcbwNWUBlwEkP5ixAUo 6eYA== X-Gm-Message-State: AOJu0YzIUJvEnx5xTD6KwGotXZXYVKmbvNiNgZdR1oeX83HB1hhGRl+R U+qeMmIhrAmsNRjruy7ZVqv4ofBzGHPUBEikV1PliiqMvd7Ycs3MK9O48QfjQkuVni/bOs7ZKKS k X-Google-Smtp-Source: AGHT+IE81w4gpz1KZqxbqDxtYfZJOAujfRKAoZh46C9nZaY8Fki5t56vn8OhbbYaGX595T2agupaxw== X-Received: by 2002:a17:907:1c04:b0:a9a:423:3278 with SMTP id a640c23a62f3a-a9e50b948c5mr353741866b.49.1730393708219; Thu, 31 Oct 2024 09:55:08 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Luca Fancellu , Jan Beulich , Stefano Stabellini , Julien Grall Subject: [PATCH] CI: Fix cppcheck parallel build more Date: Thu, 31 Oct 2024 16:55:05 +0000 Message-Id: <20241031165505.3007713-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1730393746586116600 Content-Type: text/plain; charset="utf-8" A recent cppcheck run was found to fail: https://gitlab.com/xen-project/people/andyhhp/xen/-/jobs/8237167472 with: "type mismatch! call is() before get()" && is() make[3]: *** [arch/x86/boot/Makefile:28: arch/x86/boot/reloc-trampoline.3= 2.o] Error 1 This turns out to be a parallel build issue, combined with a recent change = to x86. Notably, we now have a case where we build both: CC arch/x86/boot/reloc-trampoline.32.o CC arch/x86/boot/reloc-trampoline.o from the same original C file, and cppcheck uses the source C file as the k= ey for generating it's intermediate files. Switch cppcheck to use the object file as the unique key instead. Fixes: 45bfff651173 ("xen/misra: xen-analysis.py: fix parallel analysis Cpp= check errors") Fixes: db8acf31f96b ("x86/boot: Reuse code to relocate trampoline") Suggested-by: Luca Fancellu Signed-off-by: Andrew Cooper Reviewed-by: Luca Fancellu Tested-by: Luca Fancellu --- CC: Luca Fancellu CC: Jan Beulich CC: Stefano Stabellini CC: Julien Grall https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1522120661 which seems to suggest that cppcheck is still happy. --- xen/tools/cppcheck-cc.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/tools/cppcheck-cc.sh b/xen/tools/cppcheck-cc.sh index 16a965edb7ec..8a58c3aa86b3 100755 --- a/xen/tools/cppcheck-cc.sh +++ b/xen/tools/cppcheck-cc.sh @@ -26,6 +26,7 @@ EOF =20 BUILD_DIR=3D"" CC_FILE=3D"" +OBJ_FILE=3D"" COMPILER=3D"" CPPCHECK_HTML=3D"n" CPPCHECK_PLAT_PATH=3D"" @@ -56,6 +57,7 @@ do then # This must be the path to the obj file, turn off flag and sav= e path OBJTREE_PATH=3D"$(dirname "${OPTION}")" + OBJ_FILE=3D"$(basename "${OPTION}")" obj_arg_content=3D"n" fi # Forward any argument to the compiler @@ -177,12 +179,12 @@ then done if [ "${IGNORE_PATH}" =3D "n" ] then - JDB_FILE=3D"${OBJTREE_PATH}/$(basename "${CC_FILE}".json)" + JDB_FILE=3D"${OBJTREE_PATH}/${OBJ_FILE}.json" =20 # Prepare the Json Compilation Database for the file create_jcd "${COMPILER} ${FORWARD_FLAGS}" =20 - out_file=3D"${OBJTREE_PATH}/$(basename "${CC_FILE%.c}".cppcheck.tx= t)" + out_file=3D"${OBJTREE_PATH}/${OBJ_FILE}.cppcheck.txt" =20 # Select the right target platform, ARCH is generated from Xen Mak= efile case ${ARCH} in @@ -211,7 +213,7 @@ then fi =20 # Generate build directory for the analysed file - cppcheck_build_dir=3D"${BUILD_DIR}/${OBJTREE_PATH}" + cppcheck_build_dir=3D"${BUILD_DIR}/${OBJTREE_PATH}/${OBJ_FILE}" mkdir -p "${cppcheck_build_dir}" =20 # Shellcheck complains about missing quotes on CPPCHECK_TOOL_ARGS,= but base-commit: 2478bed83fc6d8be1d129d9a9617eda2ab3c9790 --=20 2.39.5