Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
@ 2025-06-30  2:38 James Knight
  2025-06-30  7:48 ` Edgar Bonet via buildroot
  2025-07-01  7:02 ` Arnout Vandecappelle via buildroot
  0 siblings, 2 replies; 6+ messages in thread
From: James Knight @ 2025-06-30  2:38 UTC (permalink / raw)
  To: buildroot; +Cc: James Knight

Allows accepting board configuration events that are prefixed with a
`configs/` path. This provides a convenience for users where it can be
slightly easier/quicker to utilize shell completion to prepare a build.
For example:

    make configs/qemu_sparc64_sun4u_defconfig

Would be equivalent to:

    make qemu_sparc64_sun4u_defconfig

Signed-off-by: James Knight <git@jdknight.me>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c581067320..46b246245b 100644
--- a/Makefile
+++ b/Makefile
@@ -1026,7 +1026,7 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 		$(firstword \
 			$(foreach d, \
 				$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)), \
-				$(wildcard $(d)/configs/$@) \
+				$(wildcard $(d)/configs/$(@:configs/%=%)) \
 			) \
 		), \
 		$(error "Can't find $@") \
-- 
2.49.0.windows.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
  2025-06-30  2:38 [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events James Knight
@ 2025-06-30  7:48 ` Edgar Bonet via buildroot
  2025-07-01  7:04   ` Arnout Vandecappelle via buildroot
  2025-07-01  7:02 ` Arnout Vandecappelle via buildroot
  1 sibling, 1 reply; 6+ messages in thread
From: Edgar Bonet via buildroot @ 2025-06-30  7:48 UTC (permalink / raw)
  To: James Knight, buildroot

Hello all!

On 2025-06-30, James Knight wrote:
> Allows accepting board configuration events that are prefixed with a
> `configs/` path. This provides a convenience for users where it can be
> slightly easier/quicker to utilize shell completion to prepare a build.
> For example:
> 
>     make configs/qemu_sparc64_sun4u_defconfig
> 
> Would be equivalent to:
> 
>     make qemu_sparc64_sun4u_defconfig

I don't know how this is supposed to work but, in my experience, shell
completion on buildroot's make targets is painfully slow, and does not
work with defonfig targets.

With this patch applied:

    make qem<TAB> → make qemu
    make qemu_sp<TAB>arc64<TAB>  # no completion

    make conf<TAB> → make config␣  # where “␣” is a trailing space
    make configs/qe<TAB>mu_sp<TAB>arc64<TAB>  # no completion

It would be very cool to have usable shell completion though.

Context: Ubuntu 24.04, buildroot git master

Regards,

Edgar Bonet.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
  2025-06-30  2:38 [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events James Knight
  2025-06-30  7:48 ` Edgar Bonet via buildroot
@ 2025-07-01  7:02 ` Arnout Vandecappelle via buildroot
  2025-07-07  1:30   ` James Knight
  1 sibling, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2025-07-01  7:02 UTC (permalink / raw)
  To: James Knight, buildroot

  Hi James,

On 30/06/2025 04:38, James Knight wrote:
> Allows accepting board configuration events that are prefixed with a
> `configs/` path. This provides a convenience for users where it can be
> slightly easier/quicker to utilize shell completion to prepare a build.
> For example:
> 
>      make configs/qemu_sparc64_sun4u_defconfig
> 
> Would be equivalent to:
> 
>      make qemu_sparc64_sun4u_defconfig

  I agree with the principle (though I want to think a little more about the 
implications in corner cases). However...

> 
> Signed-off-by: James Knight <git@jdknight.me>
> ---
>   Makefile | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index c581067320..46b246245b 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1026,7 +1026,7 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
>   		$(firstword \
>   			$(foreach d, \
>   				$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)), \
> -				$(wildcard $(d)/configs/$@) \
> +				$(wildcard $(d)/configs/$(@:configs/%=%)) \

  We don't use this kind of substitution, instead use patsubst.

  And maybe it's simpler to use

	$(wildcard $(d)/configs/$@ $(d)/$@)

It would mean that any defconfig at the top of a br2-external would also work, 
but perhaps there's nothing wrong with that...

  Regards,
  Arnout

>   			) \
>   		), \
>   		$(error "Can't find $@") \

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
  2025-06-30  7:48 ` Edgar Bonet via buildroot
@ 2025-07-01  7:04   ` Arnout Vandecappelle via buildroot
  2025-07-01  7:51     ` Edgar Bonet via buildroot
  0 siblings, 1 reply; 6+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2025-07-01  7:04 UTC (permalink / raw)
  To: Edgar Bonet, James Knight, buildroot



On 30/06/2025 09:48, Edgar Bonet via buildroot wrote:
> Hello all!
> 
> On 2025-06-30, James Knight wrote:
>> Allows accepting board configuration events that are prefixed with a
>> `configs/` path. This provides a convenience for users where it can be
>> slightly easier/quicker to utilize shell completion to prepare a build.
>> For example:
>>
>>      make configs/qemu_sparc64_sun4u_defconfig
>>
>> Would be equivalent to:
>>
>>      make qemu_sparc64_sun4u_defconfig
> 
> I don't know how this is supposed to work but, in my experience, shell
> completion on buildroot's make targets is painfully slow, and does not
> work with defonfig targets.
> 
> With this patch applied:
> 
>      make qem<TAB> → make qemu
>      make qemu_sp<TAB>arc64<TAB>  # no completion
> 
>      make conf<TAB> → make config␣  # where “␣” is a trailing space
>      make configs/qe<TAB>mu_sp<TAB>arc64<TAB>  # no completion
> 
> It would be very cool to have usable shell completion though.

  In bash, you can use Ctrl-backslash to only use filename completion, not 
context-sensitive completion. But that only works if it's an actual filename, 
like in the example that James gives.

  The context-sensitive completion with TAB already works without James' patch.

  So basically, this patch is exactly a workaround for the problem you indicate 
(if you know what ctrl-backslash does).

  Regards,
  Arnout

> 
> Context: Ubuntu 24.04, buildroot git master
> 
> Regards,
> 
> Edgar Bonet.
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
  2025-07-01  7:04   ` Arnout Vandecappelle via buildroot
@ 2025-07-01  7:51     ` Edgar Bonet via buildroot
  0 siblings, 0 replies; 6+ messages in thread
From: Edgar Bonet via buildroot @ 2025-07-01  7:51 UTC (permalink / raw)
  To: Arnout Vandecappelle, James Knight, buildroot

Hello!

Today, Arnout Vandecappelle wrote:
> In bash, you can use Ctrl-backslash to only use filename completion,
> not context-sensitive completion. But that only works if it's an
> actual filename, like in the example that James gives.

Today I learned something. Thanks! Now, on my system the key bindings
are different:

    Ctrl-\  →  send SIGQUIT (ignored by bash)
    Alt-/   →  filename completion

Regards,

Edgar.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events
  2025-07-01  7:02 ` Arnout Vandecappelle via buildroot
@ 2025-07-07  1:30   ` James Knight
  0 siblings, 0 replies; 6+ messages in thread
From: James Knight @ 2025-07-07  1:30 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: James Knight, buildroot

Arnout,

On Tue, Jul 1, 2025 at 3:02 AM Arnout Vandecappelle <arnout@rnout.be> wrote:
> We don't use this kind of substitution, instead use patsubst.

If using pathsubst is preferred (e.g. "$(wildcard $(d)/configs/$(call
pathsubst,configs/,,$@))"), or using the other suggested variant:

>         $(wildcard $(d)/configs/$@ $(d)/$@)

Let me know and I can set up a patch for it (if desired).

> ... I want to think a little more about the implications in corner cases...

And no worries if such a modification is not desired.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-07  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30  2:38 [Buildroot] [PATCH 1/1] Makefile: ignore configs/ prefix on configuration events James Knight
2025-06-30  7:48 ` Edgar Bonet via buildroot
2025-07-01  7:04   ` Arnout Vandecappelle via buildroot
2025-07-01  7:51     ` Edgar Bonet via buildroot
2025-07-01  7:02 ` Arnout Vandecappelle via buildroot
2025-07-07  1:30   ` James Knight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox