[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230504213246.GB1666363@dev-arch.thelio-3990X>
Date: Thu, 4 May 2023 14:32:46 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: "Ahmed S. Darwish" <darwi@...utronix.de>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nicolas Schier <nicolas@...sle.eu>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kbuild@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/1] scripts/tags.sh: Fix gtags generation for O=
kernel builds
On Thu, May 04, 2023 at 10:18:33PM +0200, Ahmed S. Darwish wrote:
> 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 <darwi@...utronix.de>
Reviewed-by: Nathan Chancellor <nathan@...nel.org>
> ---
> 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
I think
if [ -n "$O" ]; then
would match the style preferred by Kbuild (though that is usually for
portability sake, which probably does not matter here since bash is
explicitly requested). Perhaps not worth addressing if there is no other
reason for a v2.
> + suffixparams="-C $tree $O"
> + fi
> + all_target_sources | gtags -i -f - $suffixparams
> }
>
> # Basic regular expressions with an optional /kind-spec/ for ctags and
> --
> 2.30.2
>
Powered by blists - more mailing lists