All of lore.kernel.org
 help / color / mirror / Atom feed
* couple questions about proper PACKAGECONFIG usage
@ 2016-10-29  8:08 Robert P. J. Day
  2016-10-31  8:45 ` Jussi Kukkonen
  2016-10-31 10:26 ` Burton, Ross
  0 siblings, 2 replies; 4+ messages in thread
From: Robert P. J. Day @ 2016-10-29  8:08 UTC (permalink / raw)
  To: OE Core mailing list


  one or two curiosities(?) i've run across re: PACKAGECONFIG usage,
and as i'm writing a short tutorial page on that feature, i better
make sure i understand the nuance.

  first, AIUI, for any recipe, *any* possible flag value that can be
assigned to PACKAGECONFIG should be accompanied by the actual set of
values assigned to that ... flag(?). random example: gnutls.inc:

  PACKAGECONFIG ??= "libidn zlib"

  PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn"
  PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
  PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
  PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers"
  PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"

so while the default PACKAGECONFIG flag settings are "libidn" and
"zlib", that recipe clearly(?) defines five possible flags. i'm
assuming it would be an error for any possible flag value to not be
accompanied by a corresponding flag setting (not sure of the correct
terminology here, i better check that).

  next, i've noticed a very small number of recipes that define
"empty" flag strings, like this from opkg-utils_git.bb:

  PACKAGECONFIG = "python update-alternatives"
  PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
  PACKAGECONFIG[update-alternatives] = ",,,"      <----- there

that last line clearly represents a no-op in the context of
PACKAGECONFIG, and i was puzzled for a minute until it occurred that
the only way it would have value is if it were tested somewhere else
in the recipe, and sure enough, further down:

  do_install() {
        oe_runmake PREFIX=${prefix} DESTDIR=${D} install
        if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
                rm -f "${D}${bindir}/update-alternatives"
        fi
  }

so "no-op" PACKAGECONFIG flag settings like that:

meta/recipes-devtools/opkg-utils/opkg-utils_git.bb:PACKAGECONFIG[update-alternatives] = ",,,"
meta/recipes-multimedia/pulseaudio/pulseaudio.inc:PACKAGECONFIG[autospawn-for-root] = ",,,"
meta/recipes-connectivity/openssl/openssl.inc:PACKAGECONFIG[perl] = ",,,"

appear to be just a kludgy way to pass a config value to a recipe that
really just uses the PACKAGECONFIG mechanism to hand it over, without
using actual PACKAGECONFIG processing, is that a fair way to describe
that? (put another way, if any recipe defines a "no-op" like that, it
better test that setting somewhere else manually; otherwise, there's
no real point to it, yes?)

  actually, that might be it for this post ... am i missing any other
subtleties involving PACKAGECONFIG worth mentioning? another
PACAKGECONFIG-related post coming shortly, but it's more focused so
i'll post it separately.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



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

* Re: couple questions about proper PACKAGECONFIG usage
  2016-10-29  8:08 couple questions about proper PACKAGECONFIG usage Robert P. J. Day
@ 2016-10-31  8:45 ` Jussi Kukkonen
  2016-10-31 10:26 ` Burton, Ross
  1 sibling, 0 replies; 4+ messages in thread
From: Jussi Kukkonen @ 2016-10-31  8:45 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 4465 bytes --]

On 29 October 2016 at 11:08, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
>
>   one or two curiosities(?) i've run across re: PACKAGECONFIG usage,
> and as i'm writing a short tutorial page on that feature, i better
> make sure i understand the nuance.
>
>   first, AIUI, for any recipe, *any* possible flag value that can be
> assigned to PACKAGECONFIG should be accompanied by the actual set of
> values assigned to that ... flag(?). random example: gnutls.inc:
>
>   PACKAGECONFIG ??= "libidn zlib"
>
>   PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn"
>   PACKAGECONFIG[libtasn1] =
"--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
>   PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
>   PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers"
>   PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"
>
> so while the default PACKAGECONFIG flag settings are "libidn" and
> "zlib", that recipe clearly(?) defines five possible flags. i'm
> assuming it would be an error for any possible flag value to not be
> accompanied by a corresponding flag setting (not sure of the correct
> terminology here, i better check that).
>
>   next, i've noticed a very small number of recipes that define
> "empty" flag strings, like this from opkg-utils_git.bb:
>
>   PACKAGECONFIG = "python update-alternatives"
>   PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
>   PACKAGECONFIG[update-alternatives] = ",,,"      <----- there
>
> that last line clearly represents a no-op in the context of
> PACKAGECONFIG, and i was puzzled for a minute until it occurred that
> the only way it would have value is if it were tested somewhere else
> in the recipe, and sure enough, further down:
>
>   do_install() {
>         oe_runmake PREFIX=${prefix} DESTDIR=${D} install
>         if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives',
'true', 'false', d)}; then
>                 rm -f "${D}${bindir}/update-alternatives"
>         fi
>   }
>
> so "no-op" PACKAGECONFIG flag settings like that:
>
> meta/recipes-devtools/opkg-utils/opkg-utils_git.bb:PACKAGECONFIG[update-alternatives]
= ",,,"
>
meta/recipes-multimedia/pulseaudio/pulseaudio.inc:PACKAGECONFIG[autospawn-for-root]
= ",,,"
> meta/recipes-connectivity/openssl/openssl.inc:PACKAGECONFIG[perl] = ",,,"
>
> appear to be just a kludgy way to pass a config value to a recipe that
> really just uses the PACKAGECONFIG mechanism to hand it over, without
> using actual PACKAGECONFIG processing, is that a fair way to describe
> that? (put another way, if any recipe defines a "no-op" like that, it
> better test that setting somewhere else manually; otherwise, there's
> no real point to it, yes?)

PACKAGECONFIG provides a means of (en/dis)abling features on a per-recipe
basis. How the recipe accomplishes that is really just an implementation
detail. It would be nice if the upstream project supported the required
configure flags but sometimes it does not. Without knowing the opkg-utils
case in detail I'd guess the best option would have been to add a
"--enable-update-alternatives" configuration flag upstream and making
install work without 'kludges' but that may have been considerably more
work than modifying do_install() in the recipe.

If PACKAGECONFIG sets no configure flags or dependencies and it is not used
elsewhere in the recipe to modify the resulting build or packaging, it is
indeed not doing anything.

>   actually, that might be it for this post ... am i missing any other
> subtleties involving PACKAGECONFIG worth mentioning? another
> PACAKGECONFIG-related post coming shortly, but it's more focused so
> i'll post it separately.

No additional monkey business that I know of.

Cheers,
  Jussi

> rday
>
> --
>
> ========================================================================
> Robert P. J. Day                                 Ottawa, Ontario, CANADA
>                         http://crashcourse.ca
>
> Twitter:                                       http://twitter.com/rpjday
> LinkedIn:                               http://ca.linkedin.com/in/rpjday
> ========================================================================
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

[-- Attachment #2: Type: text/html, Size: 5648 bytes --]

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

* Re: couple questions about proper PACKAGECONFIG usage
  2016-10-29  8:08 couple questions about proper PACKAGECONFIG usage Robert P. J. Day
  2016-10-31  8:45 ` Jussi Kukkonen
@ 2016-10-31 10:26 ` Burton, Ross
  2016-10-31 10:40   ` Robert P. J. Day
  1 sibling, 1 reply; 4+ messages in thread
From: Burton, Ross @ 2016-10-31 10:26 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 738 bytes --]

On 29 October 2016 at 09:08, Robert P. J. Day <rpjday@crashcourse.ca> wrote:

>   actually, that might be it for this post ... am i missing any other
> subtleties involving PACKAGECONFIG worth mentioning? another
> PACAKGECONFIG-related post coming shortly, but it's more focused so
> i'll post it separately.
>

The only interesting thing is that the behaviour has changed recently: the
PACKAGECONFIG implementation now sets PACKAGECONFIG_CONFARGS and it's up to
the recipe and/or class to do what it needs with it.  autotools.bbclass
adds it to EXTRA_OECONF, cmake.bbclass adds it to EXTRA_OECMAKE, and so
on.  In the past it was added directly to EXTRA_OECONF but that made
integration with non-autotools harder.

Ross

[-- Attachment #2: Type: text/html, Size: 1243 bytes --]

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

* Re: couple questions about proper PACKAGECONFIG usage
  2016-10-31 10:26 ` Burton, Ross
@ 2016-10-31 10:40   ` Robert P. J. Day
  0 siblings, 0 replies; 4+ messages in thread
From: Robert P. J. Day @ 2016-10-31 10:40 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

On Mon, 31 Oct 2016, Burton, Ross wrote:

> On 29 October 2016 at 09:08, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>         actually, that might be it for this post ... am i missing any other
>       subtleties involving PACKAGECONFIG worth mentioning? another
>       PACAKGECONFIG-related post coming shortly, but it's more focused so
>       i'll post it separately.
>
> The only interesting thing is that the behaviour has changed
> recently: the PACKAGECONFIG implementation now sets
> PACKAGECONFIG_CONFARGS and it's up to the recipe and/or class to do
> what it needs with it.  autotools.bbclass adds it to EXTRA_OECONF,
> cmake.bbclass adds it to EXTRA_OECMAKE, and so on.  In the past it
> was added directly to EXTRA_OECONF but that made integration with
> non-autotools harder.

  yes, i'd noticed that, definitely going to add that to my
explanation.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

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

end of thread, other threads:[~2016-10-31 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-29  8:08 couple questions about proper PACKAGECONFIG usage Robert P. J. Day
2016-10-31  8:45 ` Jussi Kukkonen
2016-10-31 10:26 ` Burton, Ross
2016-10-31 10:40   ` Robert P. J. Day

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.