[Buildroot] [RFC PATCH v2] pkg-generic: detect incorrectly used package

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Aug 29 10:22:35 UTC 2015


Dear Peter Korsgaard,

On Sat, 29 Aug 2015 12:05:18 +0200, Peter Korsgaard wrote:

>  > Still sent as an RFC. Maybe we should make this optional, since it
>  > prevents from doing "make <pkg>" when "<pkg>" is not selected in
>  > menuconfig, which can be seen as annoying for power users. So maybe we
>  > could enable this only in the autobuilders? But then newcomers writing
>  > new packages would not notice their potential mistake.
> 
> Yes, that's indeed something I do very often. Alternatively we can
> perhaps extend the logic to also check MAKECMDGOALS and only trigger for
> empty / default builds.

That could be an option, indeed. Only enable this check if MAKECMDGOALS
is empty or "all" ?

>  > index 6a7d97e..7db5ab8 100644
>  > --- a/package/pkg-generic.mk
>  > +++ b/package/pkg-generic.mk
>  > @@ -143,6 +143,10 @@ $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
>  
>  >  # Configure
>  >  $(BUILD_DIR)/%/.stamp_configured:
>  > +	if test "$(TYPE)" = "target" -a -z "$($(KCONFIG_VAR))" ; then \
>  > +		echo "ERROR: package $(PKG) is being built but is not enabled in the configuration." ; \
>  > +		exit 1 ; \
>  > +	fi
> 
> This should imho also use @.

Aah, yes. I actually had a @ at some point during my development, until
the point where I had to debug this :)

> It would be good if the error message would be more clear about what the
> problem is and how to fix it. Something like:
> 
> A package must have added $(PKG) to its _DEPENDENCIES line but forgot to
> add the corresponding select / depends on $(KCONFIG_VAR). Please review
> your packages and try again.

Will fix.

Thanks for the suggestions!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the buildroot mailing list