From patchwork Thu May 4 20:18:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ahmed S. Darwish" X-Patchwork-Id: 13231764 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17DF8C77B78 for ; Thu, 4 May 2023 20:31:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230377AbjEDUb2 (ORCPT ); Thu, 4 May 2023 16:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230084AbjEDUbO (ORCPT ); Thu, 4 May 2023 16:31:14 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D70D518DCA; Thu, 4 May 2023 13:20:03 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1683231558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XQ86TMvno5qeng6U0rCVgoMQaGJVwnTJIy9oD2h9Q1A=; b=BEE9oUQ/E2WZ1iOrhE5rFNn7EV5qH7DX8gPHCT11aJrUiXf3PxrF/5hqFdCeg9DOvCYFlm BKBTKhA9ABi4/TqM6rNfDfSRx2JGaBERFCwFZXC5kGnnvCap+TLx3LcNgMgq8Y/ymRxfUd vt7bOcG1QerPAeaEpEGYWq/74wVc0vaicLN8zg600580VpDNhhXjduFGMTxf1G9SYfq1jA Hpy//bDtkaLjtEuzlrhRaar6+4it0UgzSVtU+dp5u/PMBq5cYdcpNeVLK6yKGh3AzjHhrg 6cuwfvo95TTjBjcUYQJqJ8TeIMe3+JhImTMO8FEFu0acu/GaiEdgNFW9rgvrEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1683231558; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XQ86TMvno5qeng6U0rCVgoMQaGJVwnTJIy9oD2h9Q1A=; b=M4w+POcjZb2xIsQOBUzBJeslZ2v85/wkjHh+e8SvBtE9m4SbvpmFev6+6JmT61ROUnd4AX 10NbKaqPaMOxfuBQ== To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Cc: Thomas Gleixner , linux-kbuild@vger.kernel.org, LKML , "Ahmed S. Darwish" Subject: [PATCH v1 1/1] scripts/tags.sh: Fix gtags generation for O= kernel builds Date: Thu, 4 May 2023 22:18:33 +0200 Message-Id: <20230504201833.202494-2-darwi@linutronix.de> In-Reply-To: <20230504201833.202494-1-darwi@linutronix.de> References: <20230504201833.202494-1-darwi@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org gtags considers any file outside of its current working directory "outside the source tree" and refuses to index it. For O= kernel builds, scripts/tags.sh invokes gtags with the current working directory set to ${O}. This leads to gtags ignoring the entire kernel source and generating an empty index. For O= builds, set gtags' working directory to the kernel source tree and explicitly set its output path through parameters instead. Signed-off-by: Ahmed S. Darwish Reviewed-by: Nathan Chancellor --- scripts/tags.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index ea31640b2671..1a6db535503b 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -131,7 +131,14 @@ docscope() dogtags() { - all_target_sources | gtags -i -f - + # gtags refuses to index any file outside of the current working + # directory. For O= builds, set the current working directory to + # the kernel source tree and the output tags dir to ${O}. + suffixparams= + if [ -v O ]; then + suffixparams="-C $tree $O" + fi + all_target_sources | gtags -i -f - $suffixparams } # Basic regular expressions with an optional /kind-spec/ for ctags and