Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 489608

Summary: ruby-ng.eclass forces RUBY_TARGETS to be set in pkg_setup even if ruby is optional
Product: Gentoo Linux Reporter: Sven Vermeulen (RETIRED) <swift>
Component: EclassesAssignee: Gentoo Ruby Team <ruby>
Status: CONFIRMED ---    
Severity: enhancement CC: binki, swift, uzytkownik2
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 497080    
Attachments: Sample logic in ruby-ng_pkg_setup to honor RUBY_OPTIONAL

Description Sven Vermeulen (RETIRED) gentoo-dev 2013-10-27 18:22:48 UTC
The ruby-ng eclass supports RUBY_OPTIONAL (cfr bug #373139) but does not check it in the ruby-ng_pkg_setup phase. As a result, users still need to set RUBY_TARGETS in their make.conf even if they have USE="-ruby" (see bug #488102).

Perhaps ruby-ng_pkg_setup() could check RUBY_OPTIONAL. If not set, or set to "yes" and USE="ruby" is set, only then execute its logic?

Reproducible: Always
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2013-10-27 18:24:21 UTC
Created attachment 362080 [details, diff]
Sample logic in ruby-ng_pkg_setup to honor RUBY_OPTIONAL

(Untested) example approach for in ruby-ng_pkg_setup() to honor the RUBY_OPTIONAL parameter before calling the ruby-specific logic.
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2014-01-13 05:55:39 UTC
This change is necessary to support installing net-irc/epic5 with USE=-ruby. I checked swift’s patch’s logic and tested it, fixes bug #497080 for me.
Comment 3 Manuel Rüger (RETIRED) gentoo-dev 2014-03-07 00:51:16 UTC
Can you be sure that ruby is always the USE-Flag set when depending on an optional ruby implementation?
Comment 4 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2014-03-25 06:20:25 UTC
(In reply to Manuel Rüger from comment #3)
> Can you be sure that ruby is always the USE-Flag set when depending on an
> optional ruby implementation?

So you are suggesting that some flag other than ruby could active the need to DEPEND on ruby. This is consistent with the documentation for ruby_implementations_depend() which specifies that the ebuild may trigger the dependencies with any sort of conditional syntax possible in {R,}DEPEND. Thus, no, it would be possible for other useflags to trigger optional ruby dependence. So perhaps instead the ebuild can be expected to inform ruby-ng.eclass of whether or not an optional ruby is needed at pkg_setup() time.

If it really comes down to the ebuild calculating, in pkg_setup(), whether or not ruby-ng_pkg_setup() should be called or not, then it seems that the “hack” of preventing ruby-ng_pkg_setup() from running when the package has ruby disabled is actually the correct way to go about solving this issue. Then, attachment 362080 [details, diff] is unnecessary. But, please update the documentation and examples around ruby_implementations_depend() and RUBY_OPTIONAL to state that RUBY_OPTIONAL=yes ebuilds *must* conditionally call ruby-ng_pkg_setup() in pkg_setup().

Also, as a separate issue I guess, it would be quite nice to update RUBY_OPTIONAL’s documentation. It should state that EAPI>3 ebuilds should include ruby_get_use_targets() in REQUIRED_USE surrounded by the same useflag conditionals as ruby_implementations_depend() is wrapped with in DEPEND.