Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Brendan Jackman <jackmanb@google.com>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Bill Wendling <morbo@google.com>,
	linux-kernel@vger.kernel.org,
	Justin Stitt <justinstitt@google.com>,
	llvm@lists.linux.dev, linux-kbuild@vger.kernel.org,
	Nicolas Schier <nsc@kernel.org>
Subject: Re: [PATCH] .gitignore: ignore temporary files from 'bear'
Date: Fri, 29 Aug 2025 16:38:24 -0700	[thread overview]
Message-ID: <20250829233824.GB1983886@ax162> (raw)
In-Reply-To: <20250827-master-v1-1-19f9f367219c@google.com>

Hi Brendan,

On Wed, Aug 27, 2025 at 08:59:43AM +0000, Brendan Jackman wrote:
> Bear [0] is a tool for generating compile_commands.json. For Kbuild,
> Bear is not useful, since Kbuild already generates the necessary info
> and that can be converted to compile_commands.json by
> gen_compile_commads.py.
> 
> However, for code in tools/, it's handy. For example, this command
> updates compile_commands.json so that clangd code navigation will also
> work for the VMA unit tests:
> 
> 	bear --append -- make -C tools/testing/vma -j
> 
> Bear generates some temporary files. These are usually deleted again
> but having them show up ephemerally confuses tools that trigger
> recompilation on source code changes. Ignore them in Git so that these
> tools can tell they aren't source code.
> 
> [0]: https://github.com/rizsotto/Bear
> 
> Signed-off-by: Brendan Jackman <jackmanb@google.com>

We can likely take this via the Kbuild tree. I do wonder if this would
be better in a tools/.gitignore file since bear is really only of use
there but I am not sure it matters much.

> ---
>  .gitignore | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/.gitignore b/.gitignore
> index 929054df5212d68a32a1f5ee2b267389fcd1c8db..b07c8c8383bd791e903ce985c14c231cb6928411 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -53,6 +53,7 @@
>  *.tar
>  *.xz
>  *.zst
> +*.tmp

Please keep the globs alphabetized.

>  Module.symvers
>  dtbs-list
>  modules.order
> @@ -177,6 +178,9 @@ x509.genkey
>  
>  # Clang's compilation database file
>  /compile_commands.json
> +# Temporary files created by 'bear', a tool used for generating
> +# compile_commands.json for non-Kbuild code.
> +*.events.json

Please rebase this on kbuild-next, as '/' is no longer present in the
compile_commands.json line:

https://git.kernel.org/kbuild/l/kbuild-next

The comment feels a little lengthy compared to the rest of the file but
I am not sure it can really be slimmed down...

I am guessing the pattern cannot be made more specific, as I do wonder
if anyone would introduce files with this pattern but that is why we
have the check in scripts/misc-check, so it is probably not that big of
a deal.

>  
>  # Documentation toolchain
>  sphinx_*/
> 
> ---
> base-commit: fab1beda7597fac1cecc01707d55eadb6bbe773c
> change-id: 20250827-master-23458abb102d
> 
> Best regards,
> -- 
> Brendan Jackman <jackmanb@google.com>
> 
> 

       reply	other threads:[~2025-08-29 23:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20250827-master-v1-1-19f9f367219c@google.com>
2025-08-29 23:38 ` Nathan Chancellor [this message]
2025-08-30 19:25   ` [PATCH] .gitignore: ignore temporary files from 'bear' Nicolas Schier
2025-09-01 11:29     ` Brendan Jackman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250829233824.GB1983886@ax162 \
    --to=nathan@kernel.org \
    --cc=jackmanb@google.com \
    --cc=justinstitt@google.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=nsc@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox