From patchwork Fri May 3 15:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 794392 Delivered-To: patch@linaro.org Received: by 2002:adf:a153:0:b0:34d:5089:5a9e with SMTP id r19csp792106wrr; Fri, 3 May 2024 08:20:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXrj7HfFs+Ds1IrxzVTaE3Ia+E5KqdfCbg7wbBiWWZ+SDo+qJHi8qKXRBEZ8wFudDVoFlhc64+CzCEZjkIhCs90 X-Google-Smtp-Source: AGHT+IGJHrHb/t2WBlCGqSPRvW/Th6ovNZQI4zT0NI1ysff1xcAtTcomoRPbKKtRkWhnfDGlRTsN X-Received: by 2002:adf:f0d1:0:b0:34c:8b03:48b6 with SMTP id x17-20020adff0d1000000b0034c8b0348b6mr2156484wro.23.1714749613328; Fri, 03 May 2024 08:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714749613; cv=none; d=google.com; s=arc-20160816; b=mlgBznzdPVFQtiCb/R7ONAer8TLSurr47thmGI2mZLJLYcTjVzUdfO23Ze22QcbWJL 6BbRrSrFx/b9bVCYVQ9KG/SYsg1QigHCmgtU2rf8uBfUbm2r/UH+sy36LO03b1Gbg/en I4ck9ygqpgRkpAkTUfklCSIfRflyKvRmx+AhYLg3ra1k/ytcpRKmMgwz/bPDt8+8mlE0 oTb0oHkyF7dMtH6QBnxVPysJnOeLdpxhrXpHzoKaCt5caLbAhD2bIVAov32Jnt66XxsV hnY+nrj+KmsMYLVbqohrL3lre+e6lo3QQSGh3uL25U2ot1lP6zoueh0DElUUplGinQJX Cn1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=6Y42fwSjksQRwDGFraYnUZDma/DZsRCxPs9jYWEMwxU=; fh=X+tNz5foP4SNY8eXpJNBWxgo5Iw6COaLanpgHf+UKP4=; b=lAzUGUcVA1l+/tjiJiLk+f2xYP2sWo0f1iH90+Gokgu5DWuSWZPymPzWC1eZyDL1v2 3USPjQ1uQzLSGdzVC6hZp27gkovx3hqrqeAe3CFisz/jWQWcV53sqtXIFYXsf8M0E5R1 zlr+1tGYSWuhEqbI0Tw5WueQMsRVzu8P6atj45tXZvVoF54Wbpe4COBqd6nDMNHl8uf8 1Cignf9v9xoM2YpHUTfonnl2IDhYMWcK2WoO8KlbMdFMWf11uW5vde7s+B88aNTM9P4i kBybe2hEIEUYzLvxv5DIWn1MN+hRnOyaek8gql09t9Coa6og4XpZOfO3O+gknoZZhiS3 D1qw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qYzvkGCp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id p4-20020adf9d84000000b0034d6a996e49si2045858wre.139.2024.05.03.08.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 08:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qYzvkGCp; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1E848882B1; Fri, 3 May 2024 17:20:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qYzvkGCp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E7D6A882D7; Fri, 3 May 2024 17:20:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 101BB882A7 for ; Fri, 3 May 2024 17:20:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a599c55055dso95123666b.0 for ; Fri, 03 May 2024 08:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714749607; x=1715354407; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6Y42fwSjksQRwDGFraYnUZDma/DZsRCxPs9jYWEMwxU=; b=qYzvkGCp3L4iL5YTUBqV5q96PvqeqmCA6xP2gSZoZatWCABabpbAiWDhoHeOh2L5/z Xo90Cm0CQA12mDHMeUbz5yXKgd5s5Y6Ygr2Ij1tMZLtYbRT+Ai5k5pobJxpB9omgX6jJ 6/RR2YIiFET1du6RRy8zyRMNDRuPK+ohJ8gMEloQ2DEiiAYXlu4grKr7/51btMdMIYIl u3SnwbnFrQmMaL1msKB81ggNZ52MMIYR2lIPV0HFxsxIVTL6GmNwAaCLkw6V2TsU8oaE rdP8nWFFjV1w621pvlytfB6WCMI7jv4BxOagOM5Jk45KM9DATWqniabW6FRRx157KQID Zt2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714749607; x=1715354407; 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=6Y42fwSjksQRwDGFraYnUZDma/DZsRCxPs9jYWEMwxU=; b=G8eQDL8tOmwNOABH/paFuchrrVV5SPE+EQlOkhaTXl3tT4IlYC852JZjXRZLq6XS+m 3m1JI0wJmArGu2vUCLg1FrW9qNLjN5HTtmTms1ZF4bx6xgdgiL/kJOcg0/JpoAojq8w3 goY+I++SahhCBI1ysEAKPKAaxNBKMbbhsJdpTPR3k/PNrE+hnNvhi3lMMNBGzu14zeRR ksiUUg51gw7JnbJrbTCLY6TIG9OF4e4mgzoxrUsEwvByYGPrFYsh4oLaB638Aj+vYH0a NIbVumPE+iUhMlr3U7HgDLnwgpJx0A2ISspbt7WVR2oI5wSxH6q31WRtzisFQpHv4ZVt a7tA== X-Gm-Message-State: AOJu0YxFqvujs7yeQOVVrQNP1jlCHqe3V/Whbok4QbJZ5GoqDVA38lfl BkJeFlT2twB78xFHwtAKRt5WtV6dijEZdR5vJaKmUkGiiPRkVoOD8u+JC5AgkMg= X-Received: by 2002:a17:906:158c:b0:a55:b25d:9c9e with SMTP id k12-20020a170906158c00b00a55b25d9c9emr1603412ejd.74.1714749607469; Fri, 03 May 2024 08:20:07 -0700 (PDT) Received: from cymric.caleb.rex.connolly.tech ([2a02:8109:aa0d:be00::11db]) by smtp.gmail.com with ESMTPSA id z21-20020a170906715500b00a599c8b6531sm309609ejj.178.2024.05.03.08.20.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 08:20:06 -0700 (PDT) From: Caleb Connolly To: Brandon Maier , Caleb Connolly , Joao Marcos Costa , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH] scripts: gen_compile_commands: fix invalid escape sequence warning Date: Fri, 3 May 2024 17:18:36 +0200 Message-ID: <20240503152000.2819669-1-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Since Python 3.12 unrecognised escape sequences trigger a SyntaxWarning. Convert the '\#' string to a raw string so the backslash is correctly used as a literal. Ported from Linux commit dae4a0171e25 ("gen_compile_commands: fix invalid escape sequence warning"). This updates the script to be in-line with Linux 6.9-rc6. Signed-off-by: Caleb Connolly Reviewed-by: João Marcos Costa --- scripts/gen_compile_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gen_compile_commands.py b/scripts/gen_compile_commands.py index fec513e55474..e746adddd929 100755 --- a/scripts/gen_compile_commands.py +++ b/scripts/gen_compile_commands.py @@ -171,9 +171,9 @@ def process_line(root_directory, command_prefix, file_path): # The .cmd files are intended to be included directly by Make, so they # escape the pound sign '#', either as '\#' or '$(pound)' (depending on the # kernel version). The compile_commands.json file is not interepreted # by Make, so this code replaces the escaped version with '#'. - prefix = command_prefix.replace('\#', '#').replace('$(pound)', '#') + prefix = command_prefix.replace(r'\#', '#').replace('$(pound)', '#') # Return the canonical path, eliminating any symbolic links encountered in the path. abs_path = os.path.realpath(os.path.join(root_directory, file_path)) if not os.path.exists(abs_path):