Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 226389 - FEATURES=test, RESTRICT=test should not USE=test
Summary: FEATURES=test, RESTRICT=test should not USE=test
Status: RESOLVED DUPLICATE of bug 273272
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-13 18:48 UTC by Doug Goldstein (RETIRED)
Modified: 2012-03-23 13:53 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 Doug Goldstein (RETIRED) gentoo-dev 2008-06-13 18:48:59 UTC
If someone has FEATURES="test", but the ebuild has RESTRICT="test". The package manager should not enable USE="test" anyway. Behavior observed with the latest portage.

Test Case:

pkg_setup() {
use test && echo "test"
}

Cases:

1) FEATURES="test"
2) FEATURES="-test"
3) FEATURES="test", RESTRICT="test"
4) FEATURES="-test", RESTRICT="test"

Expected Results:
1) echo
2) no echo
3) no echo
4) no echo

Actual Results:
1) echo
2) no echo
3) echo
4) no echo
Comment 1 Doug Goldstein (RETIRED) gentoo-dev 2008-06-13 18:51:59 UTC
Based on testing done by Patrick with the x11-libs/cairo-1.6.4 (latest version removes the legacy code, so you need to grab it from CVS)
Comment 2 Doug Goldstein (RETIRED) gentoo-dev 2008-06-13 20:37:10 UTC
Let me clarify a little bit. I expected a certain behavior, that turned out to not be the case. I looked for some documentation and couldn't find any. Since it technically is an ebuild syntax issue and how the package manager responds, I'm asking the PMS guys to weigh in before kicking it over to Portage as a bug.

Basically how the USE=test, is enabled and disabled differs between package managers.

<Cardoe> zlin: if you enable tests in paludis, and the ebuild has RESTRICT="test". Will paludis enable USE=test?
<zlin> no. paludis will enable USE=test if and only if you enable it via use.conf.
<zlin> and yes, the current situation is clearly less than ideal, but harder to fix properly than you'd think.

For example, I have a package that to be able to run "make test" requires dev-libs/check. But for normal operation, it does not. I, as the ebuild author, don't want to add dev-libs/check unconditionally to DEPEND since that's not a correct dependency. (I know some people will say labels address this, but that's not the discussion right now.)

This is where USE=test came into play. However, each package manager enables USE=test differently, which is what we need to address.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-09-11 08:50:55 UTC
USE=test is not in the PMS at all. We can either close this as a dup of portage bug which you seen in the first place or turn this into 'PMS doesn't describe USE=test at all' bug, I think.
Comment 4 Ulrich Müller gentoo-dev 2011-09-11 09:15:53 UTC
All that PMS has to say about USE flags is: "USE is a variable calculated by
the package manager and exported to the ebuild environment."

I don't think that we should document specific USE flags. That's outside the scope of PMS.

(In reply to comment #3)
> We can either close this as a dup of portage bug which you seen in the first
> place[...]

Yes.

*** This bug has been marked as a duplicate of bug 273272 ***