Re: [PATCH v4] scripts/tags.sh: fix "make COMPILED_SOURCE=1 cscope" command ends up with *.rlib, *.rmeta, *.so filenames in cscope.files

From: Nicolas Schier

Date: Wed Jul 01 2026 - 15:30:44 EST


Hi Sergei,

On Tue, Jun 02, 2026 at 02:15:21PM +0200, Sergei Litvin wrote:
> PROBLEM
>
> (1) When executing the command `make COMPILED_SOURCE=1 cscope`, the
> `cscope.files` file generated by it includes filenames with the
> extensions *.rlib, *.rmeta, and *.so (taken from *.cmd files, which, in turn,
> are generated from *.d dependency files by the `fixdep` utility).
>
> (2) When executing the command `make cscope`, the `cscope.files` file generated
> by it includes only filenames with the extensions *.h, *.c, *.S and not includes
> filenames with *.rs extensions.
>
> SOLUTION
>
> (1) Modify the regular expression in the `all_compiled_sources()` function so
> that only files with the extensions *.h, *.c, *.S, and *.rs are accepted.
>
> This causes `make COMPILED_SOURCE=1 cscope` command to generate the
> `cscope.files` file that contains only files with the extensions *.h, *.c, *.S,
> and *.rs.
>
> (2) Modify the functions `find_arch_sources()`, `find_arch_include_sources()`,
> `find_include_sources()`, and `find_other_sources()` so that they can accept an
> unlimited number of filename patterns as parameters for the search. Add the
> `setup_name_pattern()` function to convert these filename pattern parameters
> into a list of parameters that can be passed to the `find` utility via the new
> `pattern` variable.
>
> This causes `make cscope` command to generate a `cscope.files` file that
> contains *.rs files along with *.h, *.c, *.S
>
> Signed-off-by: Sergei Litvin <litvindev@xxxxxxxxx>
>
> ---

thanks for the patch, the actual diff looks good to me! Just two formal
nits:

1. Your patch contains two reasonable fixes that are valuable each by
themselves; in general it's better to have single patches for single
logical changes. That helps also for the second nit:

2. The subject line is too long:
Documentation/process/submiting-patches.rst recommends 70-75 characters
with regard to workflows and tools; splitting simplifies writing short subjects, e.g.:

scripts/tags.sh: Prevent binary files appearing in cscope.files
scripts/tags.sh: Add support for rust source files


Kind regards,
Nicolas