Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] a philosophical question about Config.in and "comment" directives
@ 2015-04-17 12:58 Robert P. J. Day
  2015-04-17 15:00 ` Yann E. MORIN
  0 siblings, 1 reply; 7+ messages in thread
From: Robert P. J. Day @ 2015-04-17 12:58 UTC (permalink / raw)
  To: buildroot


  mostly a pedantic question about Config.in file aesthetics, but
consider this one, ripped straight from the code base:

  config BR2_PACKAGE_A10DISP
        bool "a10disp"
        depends on BR2_arm
        depends on BR2_LINUX_KERNEL
        help
          Program to change the display mode of Allwinner ARM SOCs running
          the linux-sunxi kernel (and not the mainline kernel.)

          http://github.com/hglm/a10disp

  comment "a10disp needs a Linux kernel to be built"
        depends on BR2_arm
        depends on !BR2_LINUX_KERNEL

  yes, i can see what the above does ... first, it depends on arm to
even be processed. furthermore, it depends on the selection of a
linux kernel, otherwise the comment kicks in to warn the user that
that option requires a kernel. so far, fine. but here's the rub.

  as i see it, there are two levels of "dependency" for this option.
first, there's the dependency on arch being arm, and you can see that
the dependency line

   depends on BR2_arm

appears in *both* the config and comment directives. so without that,
you see *nothing* about that selection -- not the choice, nor the
comment warning you about it.

  OTOH, there is the dependency on a kernel, for which this file
*will* generate a comment stating that, if you want this selection,
you'll need a kernel. in *that* case, the user is being politely
notified that, while this selection is not currently available,
they're "close", and they can see it if only they select a kernel.

  from my perspective, those are two different levels of dependency.
the dependency on arch being arm should be treated as wrapping the
*entire* config file. i mean, you'd never generate a comment stating,
"this option requires you to have selected arch = arm" -- that would
be just silly. but telling someone they need a kernel to configure
this option *does* make sense.

  to distinguish between these two "levels" of dependency, i think it
would be far clearer to rewrite a file like that as:

  if BR2_arm

  config BR2_PACKAGE_A10DISP
        bool "a10disp"
        depends on BR2_LINUX_KERNEL
        help
          Program to change the display mode of Allwinner ARM SOCs running
          the linux-sunxi kernel (and not the mainline kernel.)

          http://github.com/hglm/a10disp

  comment "a10disp needs a Linux kernel to be built"
        depends on !BR2_LINUX_KERNEL

  endif

that layout makes it far clearer that the entire option depends on
arm or you see *nothing* and, further, internally, the dependencies
in the comment list *only* those dependencies that the user will be
warned that they need if they want this selection.

  i just think having the dependency line

  depends on BR2_arm

in both the config and comment directives is unnecessary duplication,
and that that kind of dependency should be moved up to encompass the
entire Config.in file, however that's best done.

  thoughts?

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] 7+ messages in thread

end of thread, other threads:[~2015-04-20 19:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-17 12:58 [Buildroot] a philosophical question about Config.in and "comment" directives Robert P. J. Day
2015-04-17 15:00 ` Yann E. MORIN
2015-04-17 16:18   ` Arnout Vandecappelle
2015-04-17 16:28     ` Robert P. J. Day
2015-04-17 16:35     ` Yann E. MORIN
2015-04-20 19:19     ` Peter Korsgaard
2015-04-20 19:29       ` Robert P. J. Day

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