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: 13241900 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 76A8EC77B7D for ; Mon, 15 May 2023 17:35:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244422AbjEORfV (ORCPT ); Mon, 15 May 2023 13:35:21 -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 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, 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: 13241901 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 31121C77B7D for ; Mon, 15 May 2023 17:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243327AbjEORfh (ORCPT ); Mon, 15 May 2023 13:35:37 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org 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 ****************