Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 419467 - app-editors/emacs-24.1_rc: make better use of REQUIRED_USE
Summary: app-editors/emacs-24.1_rc: make better use of REQUIRED_USE
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-03 11:22 UTC by Martin von Gagern
Modified: 2012-06-03 17:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2012-06-03 11:22:31 UTC
There are many USE flag combinations for emacs where one flags overrides another, making the latter irrelevant. Knowing the exact logic requires inspection of the ebuild. Most illegal combinations will trigger ewarn messages, but REQUIRED_USE is preferable to ewarn.

I believe it would be far better if the REQUIRED_USE variable were used to express which combinations are valid and which are not. Any combination where the current logic ignores some flag, REQUIRED_USE should force that flag to off.

To be more precise, I propose the following set of REQUIRED_USE elements:

gtk? ( X !athena !Xaw3d !motif )
gtk3? ( X gtk )
athena? ( X !gtk !motif )
Xaw3d? ( X !gtk !athena )         # Or use athena without !, not sure there
motif? ( X !gtk !athena !Xaw3d )
aqua? ( !X )                      # This one is already present in the ebuild
!X? ( !gconf !gsettings !toolkit-scroll-bars !wide-int
      !gif !jpeg !png !svg !tiff !xpm !imagemagick !xft )
m17n-lib? ( xft )

Some exclusions are stated more than once. For example, the mutual exclusion between gtk and motif is listed both in the gtk and the motif line. Benefits of this approach:
- More symmetric form will probably yield more symmetric suggestions from
  package managers as to what changes might make a USE flag combination valid
- Easier to read by users, I believe
- Better to maintain, as it's harder to forget exclusions that way
But of course you could also change things to state each exclusion only once.

Not sure whether Xaw3d is a variant on the Athena toolkit, like gtk3 is a variant on the gtk toolkit. If it is, then Xaw3d should perhaps FORCE the athena flag, the way gtk3 forces gtk. If you consider Xaw3d a different toolkit, then it should FORBID the athena flag, the way I wrote it above. In that case, you might want to enable the other exclusion "athena? ( … !Xaw3d )" as well, to be consistent with the other exclusions I stated twice.

One other approach would be using the "exactly-one-of" syntax for REQUIRED_USE:
X? ( ^^ ( gtk athena Xaw3d motif no-toolkit ) )
Doing so qould require the introduction of a new USE flag for --with-x-toolkit=no but on the whole would be the syntax most easy to read and maintain.
Comment 1 Ulrich Müller gentoo-dev 2012-06-03 17:58:30 UTC
> There are many USE flag combinations for emacs where one flags overrides
> another, making the latter irrelevant. Knowing the exact logic requires
> inspection of the ebuild. Most illegal combinations will trigger ewarn
> messages, but REQUIRED_USE is preferable to ewarn.

No, it isn't. The policy is that REQUIRED_USE should be used sparingly:
<http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags>

# Occasionally, ebuilds will have conflicting USE flags for functionality.
# Checking for them and returning an error is not a viable solution.
# Instead, you must pick one of the USE flags in conflict to favour and
# should alert the user that a particular flag is being used instead.
#
# Note: In order to avoid forcing users to micro-manage flags too much,
# REQUIRED_USE should be used sparingly. Follow the normal policy whenever
# it is possible to do a build that will presumably suit the user's needs. 

In fact, the issue was already discussed in the Emacs team last year, before above policy was in place. Quoting from my own e-mail message of 7 Feb 2011 (I think this refers to emacs-23.2):

| In voller Schönheit mit Ausschluß aller widersprüchlichen
| Kombinationen würde es übrigens wie folgt aussehen:
| 
| REQUIRED_USE="
|         alsa? ( sound )
|         X? (
|                 !aqua
|                 m17n-lib? ( xft )
|                 ^^ (
|                         gtk
|                         motif
|                         Xaw3d
|                         ( !gtk !motif !Xaw3d )
|                 )
|                 toolkit-scroll-bars? ( || ( gtk motif Xaw3d ) )
|         )
|         !X? (
|                 !gconf
|                 !gif
|                 !gtk
| 
|                 !imagemagick
|                 !jpeg
|                 !libxml
|                 !m17n-lib
|                 !motif
|                 !png
|                 !svg
|                 !tiff
|                 !toolkit-scroll-bars
|                 !Xaw3d
|                 !xft
|                 !xpm
|         )"
| 
| Vielleicht sollte man mal in -dev klären, ob der alte Grundsatz aus
| <http://devmanual.gentoo.org/general-concepts/use-flags/#conflicting-use-flags>
| noch gilt, oder jetzt so etwas wie oben gewünscht ist.
| In Bug 347353 wurde schon darauf hingewiesen, daß das Ganze ein
| Erfüllbarkeitsproblem ist, das im allgemeinen Fall NP-vollständig ist.

Closing as invalid.