Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 572556 - for old EAPIs (5 and older) issue eqawarn when 'use' (and friends) are called in global scope
Summary: for old EAPIs (5 and older) issue eqawarn when 'use' (and friends) are called...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-21 22:21 UTC by Sergei Trofimovich (RETIRED)
Modified: 2016-05-20 21:15 UTC (History)
2 users (show)

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 Sergei Trofimovich (RETIRED) gentoo-dev 2016-01-21 22:21:18 UTC
Proposal:

    I propose to make global scope call of 'use' and others
    lead to:
    - an e(qa)warn for existing EAPIs
    - a fatal error for new EAPIs.

End of proposal :)

See bug #566534

https://dev.gentoo.org/~ulm/pms/head/pms.html:

 11.3.3.12 Use List Functions

  These functions provide behaviour based upon set or unset use flags. Ebuilds must
  not run any of these commands once the current phase function has returned. It is
  an error if an ebuild calls any of these functions in global scope.

  'use' ...

Currently portage does nothing to ebuilds using builtin 'use' functions
in global scope. Rumors say paludis crashes on such ebuilds.
ewarn/failure make such kind of breakage on portage improve
long-term ebuild portability.

Example ebuild:

    EAPI=5
    use x86 && QA_PREBUILT="*"
    SLOT=0

works just fine:

$ ebuild ghc-99999.ebuild clean install
>>> Unpacking source...
>>> Source unpacked in /tmp/portage/dev-lang/ghc-99999/work
>>> Preparing source in /tmp/portage/dev-lang/ghc-99999/work ...
>>> Source prepared.
>>> Configuring source in /tmp/portage/dev-lang/ghc-99999/work ...
>>> Source configured.
>>> Compiling source in /tmp/portage/dev-lang/ghc-99999/work ...
>>> Source compiled.
>>> Test phase: dev-lang/ghc-99999
>>> Completed testing dev-lang/ghc-99999

>>> Install ghc-99999 into /tmp/portage/dev-lang/ghc-99999/image/ category dev-lang
>>> Completed installing ghc-99999 into /tmp/portage/dev-lang/ghc-99999/image/

 * Final size of build directory: 0 KiB
 * Final size of installed tree: 0 KiB

Thanks!
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-21 22:26:18 UTC
PMS bans it in all EAPIs, and Portage respects the ban since EAPI 6.
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2016-01-21 22:31:21 UTC
Ok, i'll restate first point once again:

    I propose to make global scope call of 'use' and others
    lead to:
    - an e(qa)warn for existing EAPIs

Rumors say paludis crashes on such ebuilds.
ewarn/failure make such kind of breakage on portage improve
long-term ebuild portability.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-05-20 21:15:06 UTC
Now Portage completely bans them in all EAPIs. Enjoy.