public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Luis Augenstein <luis.augenstein@tngtech.com>
Cc: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	nsc@kernel.org, linux-kbuild@vger.kernel.org,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	maximilian.huber@tngtech.com
Subject: Re: [PATCH v2 00/14] Add SPDX SBOM generation tool
Date: Mon, 2 Feb 2026 17:40:32 -0700	[thread overview]
Message-ID: <20260203004032.GA52989@ax162> (raw)
In-Reply-To: <6ed0fe99-3724-40c2-8d98-3309a3cf0104@tngtech.com>

Hi Luis,

On Mon, Feb 02, 2026 at 05:28:39PM +0100, Luis Augenstein wrote:
> > I wonder if it would be better for this to live within scripts/ instead
> > of tools/, as that should allow it to be integrated into the build
> > process a little bit more naturally, such as using $(Q) instead of @,
> > $(PYTHON3) instead of the bare python3, being able to access
> > CONFIG_MODULES directly, and cleaning up the actual implementation of
> > the sbom target in Makefile.
> 
> Thanks, I wasn’t aware that targets under scripts/ have access to more
> Make variables by default. During development, we didn’t have strong

I think this is a byproduct of being fully within Kbuild at that point,
rather than in the tools/ build system.

> reasons for choosing either tools/ or scripts/. I’m happy to move it to
> scripts/ if that is the preferred location.

Yes please. If this tool is designed to run within and parse Kbuild, it
should live fully within Kbuild, as the "tools build system" comment in
Makefile added by Masahiro in commit 6e6ef2da3a28 ("Makefile: add
comment to discourage tools/* addition for kernel builds") notes (even
though this is not a C program so the hostprogs comment is irrelevant
here). scripts/sbom seems entirely reasonable to me.

> Regarding $(Q) and $(PYTHON3), I noticed that these variables are
> actually available within the tools/ directory as well, so we could
> switch to using them even if we stay under tools/.

Ah, good to know. I do not delve into the tools build system all too
much.

> CONFIG_MODULES and src_tree, on the other hand, need to be passed
> explicitly when staying in tools/, whereas they would be available by
> default under scripts/ in which case we could simply invoke the script via:
> ```Makefile
> PHONY += sbom
> sbom: all
> 	$(Q)$(MAKE) $(build)=scripts/sbom
> ```
> 
> So yes, I think it makes sense to move it to scripts then.

Yeah, that looks much cleaner to me. I suspect scripts/sbom/Makefile
could be cleaned up a little bit as a result of that move as well.

Also, two other comments I forgot to bring up:

1. With the movement out of tools/, I think the README should become a
   proper Documentation file so that its contents is more discoverable.
   That should probably be separate from the change that adds the
   initial SBOM scaffolding in Kbuild to help with review.

2. This depends on having a clean initial build tree (either empty
   directory or 'clean' as a make target) due to needing to parse the
   .cmd files, which could be stale if someone builds a kernel, changes
   their config, and rebuilds, right? This should be documented since I
   do not think it is possible to do something like what Masahiro did in
   commit 3d32285fa995 ("kbuild: wire up the build rule of
   compile_commands.json to Makefile") because of the drawback that it
   misses too many things.

Cheers,
Nathan

  reply	other threads:[~2026-02-03  0:40 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 11:53 [PATCH v2 00/14] Add SPDX SBOM generation tool Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 01/14] tools/sbom: integrate tool in make process Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 02/14] tools/sbom: setup sbom logging Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 03/14] tools/sbom: add command parsers Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 04/14] tools/sbom: add cmd graph generation Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 05/14] tools/sbom: add additional dependency sources for cmd graph Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 06/14] tools/sbom: add SPDX classes Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 07/14] tools/sbom: add JSON-LD serialization Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 08/14] tools/sbom: add shared SPDX elements Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 09/14] tools/sbom: collect file metadata Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 10/14] tools/sbom: add SPDX output graph Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 11/14] tools/sbom: add SPDX source graph Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 12/14] tools/sbom: add SPDX build graph Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 13/14] tools/sbom: add unit tests for command parsers Luis Augenstein
2026-01-22  6:00   ` Miguel Ojeda
2026-01-22 20:01     ` Luis Augenstein
2026-01-20 11:53 ` [PATCH v2 14/14] tools/sbom: add unit tests for SPDX-License-Identifier parsing Luis Augenstein
2026-01-20 15:40 ` [PATCH v2 00/14] Add SPDX SBOM generation tool Greg KH
2026-01-20 16:14   ` Luis Augenstein
2026-01-22  6:18 ` Miguel Ojeda
2026-01-22  6:35   ` Greg KH
2026-01-25 15:20     ` Miguel Ojeda
2026-01-25 15:33       ` Miguel Ojeda
2026-01-25 15:40         ` Greg KH
2026-01-25 15:34       ` Greg KH
2026-01-25 17:24         ` Miguel Ojeda
2026-01-27  8:03           ` Luis Augenstein
2026-01-27 23:10             ` Nathan Chancellor
2026-02-02 16:28               ` Luis Augenstein
2026-02-03  0:40                 ` Nathan Chancellor [this message]
2026-02-03 14:41                   ` Luis Augenstein
2026-02-03 20:51                     ` Nathan Chancellor
2026-01-22 20:32   ` Luis Augenstein
2026-01-25 15:30     ` Miguel Ojeda
2026-01-26  6:46       ` Luis Augenstein

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=20260203004032.GA52989@ax162 \
    --to=nathan@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis.augenstein@tngtech.com \
    --cc=maximilian.huber@tngtech.com \
    --cc=miguel.ojeda.sandonis@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