Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497606 - Feature request: Add bdepend/rdepend functions that respect PHP_TARGETS
Summary: Feature request: Add bdepend/rdepend functions that respect PHP_TARGETS
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-09 03:00 UTC by Michael Orlitzky
Modified: 2014-01-22 16:57 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 Michael Orlitzky gentoo-dev 2014-01-09 03:00:50 UTC
This is a feature request based on a bug I just discovered in an ebuild I'm writing. The ebuild is for a PHP application with an extensive test suite. I therefore have,

  RDEPEND="dev-lang/php[cli,xml,xmlreader]"
  DEPEND="test? ( ${RDEPEND}
                  dev-php/phpunit )"

DEPEND contains RDEPEND because, if the tests are to be run, I need to run the application (which needs its RDEPENDs). The problem is that I don't just need these USE flags for *some* dev-lang/php, I need them for *all* versions installed by PHP_TARGETS. Furthermore, at build time, the eselected version of cli php must have these USE flags set or else installation will fail.

So, what we'd need is a way to set (R)DEPEND for each version of php mentioned in PHP_TARGETS. We should only set (R)DEPEND for the versions in PHP_TARGETS -- nothing more -- because that's what the user asked us to do. That still means that installation can fail if the user is running a version of php that isn't in PHP_TARGETS. But we know which USE flags are required; it should be possible to do an automatic check for their presence at build time using e.g. php-config. We could then die with a helpful error message if the running php is not in PHP_TARGETS and is missing some of the necessary build-time USE flags.

The ruby language had a similar problem with its RUBY_TARGETS. I don't believe they do the running-interpreter check, but they do have two functions in an eclass that add {b,r}depends automatically based on the value of RUBY_TARGETS:

  1. ruby_add_bdepend
  2. ruby_add_rdepend

Both can be found in ruby-ng.eclass. If PHP could copy this idea, it would at least prevent build failures for the users who aren't doing anything sneaky.
Comment 1 Michael Orlitzky gentoo-dev 2014-01-09 03:29:25 UTC
A quick followup after asking on #gentoo-ruby.

The ruby-ng eclass doesn't have a special case for the eselected interpreter; instead, they run the tests with each version of interpreter in RUBY_TARGETS.

This could work for PHP as well, as long as nobody requests two versions of PHP_TARGETS that are incompatible.
Comment 2 Ole Markus With (RETIRED) gentoo-dev 2014-01-22 12:44:19 UTC
PHP_TARGETS is not used for php code, only for the C extensions. We do not support having multiple PHP versions installed with different USE flags since this is a very uncommon setup.
Comment 3 Michael Orlitzky gentoo-dev 2014-01-22 16:57:55 UTC
Ok, no problem. Thought I'd ask.