From patchwork Mon May 15 17:32:16 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: 94258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp7095495vqo; Mon, 15 May 2023 10:59:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4GM+W+3JUrAD9b4+G8Z+YqqU0PRxO62akCC3EbOpZNg5ZyrJWftSQfGhOwH433ojlUjIj7 X-Received: by 2002:a05:6a00:2442:b0:63b:854c:e0f6 with SMTP id d2-20020a056a00244200b0063b854ce0f6mr48116743pfj.21.1684173561433; Mon, 15 May 2023 10:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684173561; cv=none; d=google.com; s=arc-20160816; b=BjtfUeuxwEadJUzapBnF5XghmP9qxM/iPXtp6o8FT9+XXs9dPURRjfbu4Rrjjjz/20 9MeFRAi6Y34q81+vcsHaKIyfF9OgDJNK3BDRY4cfKX5swNktf0pjXnuurpKRhtlmqOIu d/nVcLyKEXEWkztAktamod5jrbR6prGxyAuBUzayI7OWdbX4VkV6yH3DLe/kaXDlwunn xIY0R6ZQ0cKR/VfoVKMMPElCebtbJeVkJ58OxTPK7R3wRfI+y9EuWQ0AT/hjQcjAfEQY L+EEUys48AJUnvMVW5nOAZzxdy74YZWgUUagGJEXBVpgkWNmwsBIOnjucMc1/a8TQ1oC 58Jw== 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=7JcTY167EpnrleC2mpr2M2UN+8AlsjHmk6YdFvgjV/U=; b=xmDOTBiwxRw2GVT5LaYBkL4GLqhHukiEvNdVVanhPDSfmf/3V8BDHnlXtNwQZt3GaI OrY6rE1wR0KM1oxIAIfNeYTC0idhf8A7t+6FFmisGr5fZKubVnQI4cmXu3s5Y2teD8f4 GlhgzKjRzy9gp8gjF4kO86S/dUj4W45X2GL3mFI8u5cgcz/ZTf6Uc30djOSzVQcq3zuo vJvKsk8UkBz9e7frPCY1zVj0uGxCJoXlY1aVcdEFpqeXkVnz8kJ5Z8tJLoOGj6IQYqS5 ip+ba+Ke/ux+h13c+vESN0djliL9Xy6Y2/8ow/r+prNnfzROOinJ/OHFm4TwbMTywyHT nLBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZYkOi4JJ; dkim=neutral (no key) header.i=@linutronix.de header.b=hpbSqhlE; 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 h16-20020a056a00001000b0064693201e15si17639047pfk.344.2023.05.15.10.59.07; Mon, 15 May 2023 10:59:21 -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=ZYkOi4JJ; dkim=neutral (no key) header.i=@linutronix.de header.b=hpbSqhlE; 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 S244154AbjEORfW (ORCPT + 99 others); Mon, 15 May 2023 13:35:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244462AbjEORfE (ORCPT ); Mon, 15 May 2023 13:35:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD2FDD8A; Mon, 15 May 2023 10:33:06 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684171985; 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=7JcTY167EpnrleC2mpr2M2UN+8AlsjHmk6YdFvgjV/U=; b=ZYkOi4JJELeuwIPLt6cfI5OF2YVAzlCX2LhHyRsYIns5b0NvhQFSp0KgccM5TpSFAHGJqD SL5Jt/StgCFgm3+oM5yEK7dUhXqYJ2is11dmSi9snAU18xDheiKbLImCxNuNOeK4RDHSbS 6uAYHRKg99diFHy7JRvVgY7g7aUGuLqkFi01kRBcsHyuPFnchwoVVuZPwfv7z2hLZjgN+B Fdxsj15LYkRBFl0lCKbSuH8JY6z1p963+I+GS+ryNwV13fRzhCFs+TB8XkCQ31Il95ADa1 2VDx7Zf8ZrB3JhQyhYMLip7B7DaDvK03x7o3uHbEyPIShtMJEg2iv8DL5aaV3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684171985; 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=7JcTY167EpnrleC2mpr2M2UN+8AlsjHmk6YdFvgjV/U=; b=hpbSqhlEB/kdZTiH9IukQH5xSziRb43dM67KuRhssJnM9M90RpbzPBq675pAw3TY0LDRva B8z94xV3CydpJ6Aw== To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Jonathan Corbet Cc: Thomas Gleixner , linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, LKML , "Ahmed S. Darwish" Subject: [PATCH v3 1/2] scripts/tags.sh: Resolve gtags empty index generation Date: Mon, 15 May 2023 19:32:16 +0200 Message-Id: <20230515173217.64864-2-darwi@linutronix.de> In-Reply-To: <20230515173217.64864-1-darwi@linutronix.de> References: <20230509012616.81579-1-darwi@linutronix.de> <20230515173217.64864-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 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?1765378300728517582?= X-GMAIL-MSGID: =?utf-8?q?1765983976512785637?= gtags considers any file outside of its current working directory "outside the source tree" and refuses to index it. For O= kernel builds, or when "make" is invoked from a directory other then the kernel source tree, gtags ignores the entire kernel source and generates an empty index. Force-set gtags current working directory to the kernel source tree. Due to commit 9da0763bdd82 ("kbuild: Use relative path when building in a subdir of the source tree"), if the kernel build is done in a sub-directory of the kernel source tree, the kernel Makefile will set the kernel's $srctree to ".." for shorter compile-time and run-time warnings. Consequently, the list of files to be indexed will be in the "../*" form, rendering all such paths invalid once gtags switches to the kernel source tree as its current working directory. If gtags indexing is requested and the build directory is not the kernel source tree, index all files in absolute-path form. Note, indexing in absolute-path form will not affect the generated index, as paths in gtags indices are always relative to the gtags "root directory" anyway (as evidenced by "gtags --dump"). Signed-off-by: Ahmed S. Darwish Cc: --- scripts/tags.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/tags.sh b/scripts/tags.sh index ea31640b2671..f6b3c7cd39c7 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -32,6 +32,13 @@ else tree=${srctree}/ fi +# gtags(1) refuses to index any file outside of its current working dir. +# If gtags indexing is requested and the build output directory is not +# the kernel source tree, index all files in absolute-path form. +if [[ "$1" == "gtags" && -n "${tree}" ]]; then + tree=$(realpath "$tree")/ +fi + # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH if [ "${ALLSOURCE_ARCHS}" = "" ]; then ALLSOURCE_ARCHS=${SRCARCH} @@ -131,7 +138,7 @@ docscope() dogtags() { - all_target_sources | gtags -i -f - + all_target_sources | gtags -i -C "${tree:-.}" -f - "$PWD" } # Basic regular expressions with an optional /kind-spec/ for ctags and From patchwork Mon May 15 17:32:17 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: 94263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp7097196vqo; Mon, 15 May 2023 11:01:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4L8yyOwioDi4RctZJllvHpi+fTlrvX2otQpAQmnHnIf4y0j+/LG29sA8sXB5Eze+ko7Q+M X-Received: by 2002:a05:6a00:2343:b0:644:d775:60bb with SMTP id j3-20020a056a00234300b00644d77560bbmr41727419pfj.20.1684173696396; Mon, 15 May 2023 11:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684173696; cv=none; d=google.com; s=arc-20160816; b=oo+wMpX12sPSb0Y1+LSwKc6AoAHm28Ft0nSz50IhDqUrZssqhKMLr4a76/hC/sbdb4 V531AFRt3ZfcSD0d3IiudOBakSBo6/aBia2cgg2UiPkDG9GRIY4X4C7UgTzad2Rb48NI S+fQFVl26uwiwBNIvpiM8WUO1rkHzZkpxpQ6gCgoEN3T/BXILchXzzSQl2pDdz4K9S5V Say+aaMLTR1jwA6k3MNWK6PvPqdvm/MMvCNdMS7MX+6kA00jxvVmFgWe9C6vt62ppyVr aIIEsEuz/asv70GkWbo/dqzCxxyqHIwWekmQGqar/2RbNBwUQuLsui/3TQovmiNNYs+h lEyA== 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=rYa4NIoRwK77mO2jcboViBt+jqXZhNpE7ckEwsEc9Bc=; b=h3AXeaKynWj4ZjH438B+dgC3IdltNLixnRi7towlv62U1SZb9+6yp3b3kdO+sL1PUA KRq9fyDE7NaV8lBiIVVwfNYeLlqjxAkC5oGNZdnNAe/x7BHEq870Uqv13Pg/K+V2qgWM B946tQvAEOC0CQEcKD6hHqeyTmdYwTEwitNcx42NWnTsbCr52r48ADCJWTVA29KOdYWY OIJ+jVNNSTKUArD+L8STOW7h9YE0x+2myGUR3T8S7lGYDFA40xnoBIVUs7cSbeULrBWb aonxwWwM6FLCH7QENkDuBS/Y5Mv3RqJTXd1mAiYArCWBq3oA5dnO6mGbb4hs8smbeywW 25ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Vqt01Sx+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=YPomW4tf; 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 b19-20020aa79513000000b006262bc88219si17422990pfp.160.2023.05.15.11.01.19; Mon, 15 May 2023 11:01:36 -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=Vqt01Sx+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=YPomW4tf; 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 S244453AbjEORfk (ORCPT + 99 others); Mon, 15 May 2023 13:35:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243342AbjEORfN (ORCPT ); Mon, 15 May 2023 13:35:13 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ACB41560C; Mon, 15 May 2023 10:33:08 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684171987; 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=rYa4NIoRwK77mO2jcboViBt+jqXZhNpE7ckEwsEc9Bc=; b=Vqt01Sx+MgrLW7k3LIc6jc5YvFkISrk/2rBg9ogFTG/hd4A2PO6SBYi9Gx8TmjTVljEH5i 4n3KrEu5+L+S1YVDVfg4lp+d5XlSvphHZPOxKMuc6ecc7w2qvHOPWHRaU68qcskZqTIYlD FpKwFHSFm9RGvaWLxcCvlKPZE0X3DZaiYqvepnkCEDxoLuZrCQaOv0Abngl+/xt9oKGKaP cgv2ND0hPoHl2OHx5NV5ITw3eYSSYKoeQ+i+dX4fvBbc2X9ikpZa/Dq6SM3LE9MSDJquQx Wa8ihw+DQ2GSTxsFVm9Pb8SCNhb14nA2/sxRx/jKpKJLxUSGEnI00HmMyAWVkQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684171987; 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=rYa4NIoRwK77mO2jcboViBt+jqXZhNpE7ckEwsEc9Bc=; b=YPomW4tfQ86omjkiMiVy0O3HDWpJ1KA3stQ3WtxlxAtCtB/akzOUPTCE92zKHc1XEp04ba bnaeCxQVBOuOX3CQ== To: Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Jonathan Corbet Cc: Thomas Gleixner , linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, LKML , "Ahmed S. Darwish" Subject: [PATCH v3 2/2] docs: Set minimal gtags / GNU GLOBAL version to 6.6.5 Date: Mon, 15 May 2023 19:32:17 +0200 Message-Id: <20230515173217.64864-3-darwi@linutronix.de> In-Reply-To: <20230515173217.64864-1-darwi@linutronix.de> References: <20230509012616.81579-1-darwi@linutronix.de> <20230515173217.64864-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 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?1765378112224244529?= X-GMAIL-MSGID: =?utf-8?q?1765984117484947957?= Kernel build now uses the gtags "-C (--directory)" option, available since GNU GLOBAL v6.6.5. Update the documentation accordingly. Signed-off-by: Ahmed S. Darwish Cc: Link: https://lists.gnu.org/archive/html/info-global/2020-09/msg00000.html --- Documentation/process/changes.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index ef540865ad22..a9ef00509c9b 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -60,6 +60,7 @@ openssl & libcrypto 1.0.0 openssl version bc 1.06.95 bc --version Sphinx\ [#f1]_ 1.7 sphinx-build --version cpio any cpio --version +gtags (optional) 6.6.5 gtags --version ====================== =============== ======================================== .. [#f1] Sphinx is needed only to build the Kernel documentation @@ -174,6 +175,12 @@ You will need openssl to build kernels 3.7 and higher if module signing is enabled. You will also need openssl development packages to build kernels 4.3 and higher. +gtags / GNU GLOBAL (optional) +----------------------------- + +The kernel build requires GNU GLOBAL version 6.6.5 or later to generate +tag files through ``make gtags``. This is due to its use of the gtags +``-C (--directory)`` flag. System utilities ****************