diff mbox series

[v2,1/2] Makefile: Create a file to indicate the config

Message ID 20220130155225.726890-1-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series [v2,1/2] Makefile: Create a file to indicate the config | expand

Commit Message

Simon Glass Jan. 30, 2022, 3:52 p.m. UTC
At present it is not actually possible to discover the defconfig file that
was used to build U-Boot, so far as I can tell. Write this out to a file
in the build directory, so this is visible.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 scripts/kconfig/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini Jan. 31, 2022, 2:24 p.m. UTC | #1
On Sun, Jan 30, 2022 at 08:52:24AM -0700, Simon Glass wrote:

> At present it is not actually possible to discover the defconfig file that
> was used to build U-Boot, so far as I can tell. Write this out to a file
> in the build directory, so this is visible.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

I don't think we need this really normally, it's just for the follow-up
patch.
Simon Glass Jan. 31, 2022, 4:13 p.m. UTC | #2
Hi Tom,

On Mon, 31 Jan 2022 at 07:24, Tom Rini <trini@konsulko.com> wrote:
>
> On Sun, Jan 30, 2022 at 08:52:24AM -0700, Simon Glass wrote:
>
> > At present it is not actually possible to discover the defconfig file that
> > was used to build U-Boot, so far as I can tell. Write this out to a file
> > in the build directory, so this is visible.
> >
> > Signed-off-by: Simon Glass <sjg@chromium.org>
>
> I don't think we need this really normally, it's just for the follow-up
> patch.

I'd argue that it is helpful to have this somewhere. Is there anywhere
else in the build directory where it can be discovered?

Regards,
Simon
Tom Rini Jan. 31, 2022, 4:21 p.m. UTC | #3
On Mon, Jan 31, 2022 at 09:13:07AM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 31 Jan 2022 at 07:24, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Sun, Jan 30, 2022 at 08:52:24AM -0700, Simon Glass wrote:
> >
> > > At present it is not actually possible to discover the defconfig file that
> > > was used to build U-Boot, so far as I can tell. Write this out to a file
> > > in the build directory, so this is visible.
> > >
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> >
> > I don't think we need this really normally, it's just for the follow-up
> > patch.
> 
> I'd argue that it is helpful to have this somewhere. Is there anywhere
> else in the build directory where it can be discovered?

It's not a guarantee to exist is my first problem.  My minor problems
are this needs to be in .gitignore and also I think this wasn't ensuring
output directory not source directory.  But I don't see the use case
this is filling.  If you're in-tree, you should know what you configured
and are working on.  If you're out of tree and didn't do any sort of
naming convention to your objdirs, did you also really care what
defconfig exactly (I use a mix of named and garbage-named temp dirs)?
And if you're a tool of some sort, you were told what to use at some
point I would assume.  Which all gets back to I don't see the use case
exactly for it.
Simon Glass Jan. 31, 2022, 5:27 p.m. UTC | #4
Hi Tom,

On Mon, 31 Jan 2022 at 09:21, Tom Rini <trini@konsulko.com> wrote:
>
> On Mon, Jan 31, 2022 at 09:13:07AM -0700, Simon Glass wrote:
> > Hi Tom,
> >
> > On Mon, 31 Jan 2022 at 07:24, Tom Rini <trini@konsulko.com> wrote:
> > >
> > > On Sun, Jan 30, 2022 at 08:52:24AM -0700, Simon Glass wrote:
> > >
> > > > At present it is not actually possible to discover the defconfig file that
> > > > was used to build U-Boot, so far as I can tell. Write this out to a file
> > > > in the build directory, so this is visible.
> > > >
> > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > >
> > > I don't think we need this really normally, it's just for the follow-up
> > > patch.
> >
> > I'd argue that it is helpful to have this somewhere. Is there anywhere
> > else in the build directory where it can be discovered?
>
> It's not a guarantee to exist is my first problem.  My minor problems

Do you mean there might not be a defconfig file? Yes I see. But
generally there is, e.g. with buildman.

> are this needs to be in .gitignore and also I think this wasn't ensuring
> output directory not source directory.  But I don't see the use case
> this is filling.  If you're in-tree, you should know what you configured
> and are working on.  If you're out of tree and didn't do any sort of
> naming convention to your objdirs, did you also really care what
> defconfig exactly (I use a mix of named and garbage-named temp dirs)?
> And if you're a tool of some sort, you were told what to use at some
> point I would assume.  Which all gets back to I don't see the use case
> exactly for it.

I was just surprised that there was no way to find it out, that's all.
It seems like a gap. But I agree that if we don't have a specific use
case (e.g. we figure out another way of doing the next patch) then we
could wait.

Regards,
Simon
diff mbox series

Patch

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 12e525ee31f..83a40c7eb3b 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -92,8 +92,10 @@  else
 endif
 endif
 
+# Write out the defconfig name to a file so we know which board was configured
 %_defconfig: $(obj)/conf
 	$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
+	$(Q)echo $(subst _defconfig,,$@) > .defconfig_name
 
 # Added for U-Boot (backward compatibility)
 %_config: %_defconfig