All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] call with hooks
@ 2022-01-05 16:20 Danomi Manchego
  2022-01-06  9:39 ` Arnout Vandecappelle
  0 siblings, 1 reply; 3+ messages in thread
From: Danomi Manchego @ 2022-01-05 16:20 UTC (permalink / raw)
  To: buildroot

 Hello all,

I noticed a possible inconsistency, and thought I should post it.
Looking at places where buildroot uses hooks:

$ grep -r '$(hook))$(sep)' .
./Makefile: $(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_RSYNC_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_RSYNC_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_INSTALL_IMAGES_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_PRE_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
./package/pkg-generic.mk: $(foreach
hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))

Notice that the one hit in Makefile uses "$($(hook))$(sep)" while the
hits in pkg-generic.mk use "$(call $(hook))$(sep)".  My Make-fu isn't
powerful enough to understand if there is an actual problem - should
there be a "call" in the Makefile line?  The general syntax for call
is "$(call variable,param,param,…)" so I don't follow what the extra
call in $(call $(hook) is doing for us.

Thanks,
Danomi -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] call with hooks
  2022-01-05 16:20 [Buildroot] call with hooks Danomi Manchego
@ 2022-01-06  9:39 ` Arnout Vandecappelle
  2022-01-06 14:20   ` Danomi Manchego
  0 siblings, 1 reply; 3+ messages in thread
From: Arnout Vandecappelle @ 2022-01-06  9:39 UTC (permalink / raw)
  To: Danomi Manchego, buildroot



On 05/01/2022 17:20, Danomi Manchego wrote:
>   Hello all,
> 
> I noticed a possible inconsistency, and thought I should post it.
> Looking at places where buildroot uses hooks:
> 
> $ grep -r '$(hook))$(sep)' .

[snip]
> 
> Notice that the one hit in Makefile uses "$($(hook))$(sep)" while the
> hits in pkg-generic.mk use "$(call $(hook))$(sep)".  My Make-fu isn't
> powerful enough to understand if there is an actual problem - should
> there be a "call" in the Makefile line?  The general syntax for call
> is "$(call variable,param,param,…)" so I don't follow what the extra
> call in $(call $(hook) is doing for us.

  Historical accident.

  The person who first introduced the hooks back in the days didn't realize that 
$(call ...) is not for "something that looks like a function", but rather it is 
for "whenever you want to pass arguments". Reviewers also didn't realize this 
and just applied, and when more hooks were added later they copied the pattern.

  Regards,
  Arnout

> 
> Thanks,
> Danomi -
> _______________________________________________
> 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] 3+ messages in thread

* Re: [Buildroot] call with hooks
  2022-01-06  9:39 ` Arnout Vandecappelle
@ 2022-01-06 14:20   ` Danomi Manchego
  0 siblings, 0 replies; 3+ messages in thread
From: Danomi Manchego @ 2022-01-06 14:20 UTC (permalink / raw)
  To: Arnout Vandecappelle; +Cc: buildroot

Hu Arnout,

Thanks for the explanation.  I feel better now :)

Danomi -


On Thu, Jan 6, 2022 at 4:39 AM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
>
> On 05/01/2022 17:20, Danomi Manchego wrote:
> >   Hello all,
> >
> > I noticed a possible inconsistency, and thought I should post it.
> > Looking at places where buildroot uses hooks:
> >
> > $ grep -r '$(hook))$(sep)' .
>
> [snip]
> >
> > Notice that the one hit in Makefile uses "$($(hook))$(sep)" while the
> > hits in pkg-generic.mk use "$(call $(hook))$(sep)".  My Make-fu isn't
> > powerful enough to understand if there is an actual problem - should
> > there be a "call" in the Makefile line?  The general syntax for call
> > is "$(call variable,param,param,…)" so I don't follow what the extra
> > call in $(call $(hook) is doing for us.
>
>   Historical accident.
>
>   The person who first introduced the hooks back in the days didn't realize that
> $(call ...) is not for "something that looks like a function", but rather it is
> for "whenever you want to pass arguments". Reviewers also didn't realize this
> and just applied, and when more hooks were added later they copied the pattern.
>
>   Regards,
>   Arnout
>
> >
> > Thanks,
> > Danomi -
> > _______________________________________________
> > 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] 3+ messages in thread

end of thread, other threads:[~2022-01-06 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 16:20 [Buildroot] call with hooks Danomi Manchego
2022-01-06  9:39 ` Arnout Vandecappelle
2022-01-06 14:20   ` Danomi Manchego

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.