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: 90224 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp597171vqo; Thu, 4 May 2023 13:46:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dvd0RXs2TnWT9bWrIAlxkhDkMw5Hn4apo5V48gzFBYT3PXxMa6/vc/uH9GU2UtIVAG6bP X-Received: by 2002:a05:6a20:3ca5:b0:f3:cac4:ca5d with SMTP id b37-20020a056a203ca500b000f3cac4ca5dmr4485357pzj.35.1683233184413; Thu, 04 May 2023 13:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683233184; cv=none; d=google.com; s=arc-20160816; b=l7NSePAhK7ki7stIoM2wKwCw9rhYvG/EzG2O8iy5Es0W6aIloWi6MmZm19QAAiMt7P cXtcN+uznoUQRxCNIjZYdlYkqLgdjIhuEEtNN8ab3U11f3g7+eJ5BupK7zTfb8nl4D/h kZ0eVm9EEtndCOT9/KyeE7zFOLoyT9fiRnLFHBh5tqJR1X+7Mo2MYyjr+GWFhGZ4O9Wo EugXsl4srfWjjjg9ugABt2JTD6vH1cHiuZrM/A8NKHxbgMqU6VHYqOUbzB3jtCXrwbRX rG4alc3+PCQBse2IsquNqseoWYTwfjpwXSbtIbSyI2PGnZ0VpXXLjuGoB3z7SImAYLX6 2HGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=XQ86TMvno5qeng6U0rCVgoMQaGJVwnTJIy9oD2h9Q1A=; b=j+U+DKsHVv4J8jeme3WbHuhQ8d1BjIiBaR39B9Yz8Xlf4Fw6SF3eDLi6HP4oAMdcq7 DrmsdbEGlB7oMnuuce4Et2Rtm67/tZs+Gp2FQTzqm+Tz7CP5qRQfqxme9AFFNBZybblm yLAitxyc8ku8EazVCzx9WJE91R+AT8L+p7bEIJjUpL+qiAcp0+TlVRr8DIUr2WhOV75d troNGS1iQ0ATIohuhXa8MUg7CSNPGB9tmNliPPLG3MYgQhqJ55wSFGkoo9eH+LzzEOuU GN798Tqk1tNyU2c4fsHt2eBYASjjmLpzDX9BjUUopGCbsLmDAkdbTGEqNWu3frdQoaz9 43Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="BEE9oUQ/"; dkim=neutral (no key) header.i=@linutronix.de header.b=M4w+POcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o30-20020a637e5e000000b00513af1fa0b5si212670pgn.797.2023.05.04.13.46.11; Thu, 04 May 2023 13:46:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="BEE9oUQ/"; dkim=neutral (no key) header.i=@linutronix.de header.b=M4w+POcj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229970AbjEDUbb (ORCPT + 99 others); Thu, 4 May 2023 16:31:31 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764997919927306189?= X-GMAIL-MSGID: =?utf-8?q?1764997919927306189?= 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