Re: [RFC PATCH v3 2/3] Documentation: add kconfirm
From: Nathan Chancellor
Date: Sun May 17 2026 - 05:40:55 EST
On Sun, May 17, 2026 at 08:05:30AM +0200, Miguel Ojeda wrote:
> On Sat, May 16, 2026 at 11:54 PM Julian Braha <julianbraha@xxxxxxxxx> wrote:
> > +In ``scripts/kconfirm/`` run the following to download the dependencies::
> > +
> > + cargo vendor
>
> I am not sure how important this is for `scripts/` and/or `tools/`
> (Kbuild may have a policy), but this should probably handle `O=`
> builds.
>
> In some cases, the source tree may even be read-only, i.e. we wouldn't
> be able to create `target/` there.
I guess this is kind of a weird/unique situation. I agree that the files
generated by 'cargo run' should absolutely be contained within the build
folder; at that point, $(srctree) could be read only and I would
consider it rude not to respect the user's choice of build directory.
For 'cargo vendor' however, I am not sure. They are source files and I
would expect that running 'cargo vendor' would be more considered part
of preparing the source tree, rather than the build one (so it should
not be read only).
At the same time, it might be safer for dependency updates and internal
consistency that they are confined to the build folder. I guess we would
only want to remove them with a 'distclean', rather than 'mrproper' or
'clean', in that case, to avoid requiring users to constantly run
'cargo vendor'. It might be more ergonomic for this to be a Kbuild
target ('kconfirmvendor'?) so that this could be handled automatically
based on the user's build command.
Additionally, can we detect explicitly when dependencies are not
properly vendored and error with a more helpful error message? The build
command in patch 1 just throws up its hands when the build fails and
asks if the dependencies have been set up but if we provided our own
vendoring build target, we could add some canary that says we vendored
successfully and if that is not present, error before even running the
build and say "hey, you need to explicitly run this target before you
build".
--
Cheers,
Nathan