Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358349 - Fix ruby-ng.eclass to work properly with EAPI=4, backport RUBY_S to EAPI<=3
Summary: Fix ruby-ng.eclass to work properly with EAPI=4, backport RUBY_S to EAPI<=3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-11 07:52 UTC by Hans de Graaff
Modified: 2015-07-05 09:13 UTC (History)
1 user (show)

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


Attachments
Patch for make ruby-ng.eclass EAPI=4 compatible (ruby-ng-eapi4.diff,860 bytes, text/plain)
2011-04-24 08:29 UTC, Hans de Graaff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans de Graaff gentoo-dev Security 2011-03-11 07:52:49 UTC
A quick test shows that currently ruby-ng.eclass is not compatible with EAPI=4:

>>> Unpacking source...
 * Running unpack phase for all ...
 * Unpacking .gem file... ...                                                                              [ ok ]
 * Uncompressing metadata ...                                                                              [ ok ]
 * Unpacking data.tar.gz ...                                                                               [ ok ]
>>> Source unpacked in /var/tmp/portage/dev-ruby/racc-1.4.6/work
 * ERROR: dev-ruby/racc-1.4.6 failed (prepare phase):
 *   The source directory '/var/tmp/portage/dev-ruby/racc-1.4.6/work/racc-1.4.6' doesn't exist
 * 
 * Call stack:
 *   ebuild.sh, line 2342:  Called ebuild_main
 *   ebuild.sh, line 2249:  Called dyn_prepare
 *   ebuild.sh, line 1005:  Called die
 * The specific snippet of code:
 *   		die "The source directory '${S}' doesn't exist"

I have not yet investigated further.
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-03-11 15:00:26 UTC
Oh FFS that's not a bloody sanity check is it? =_=
Comment 2 Tomáš Chvátal (RETIRED) gentoo-dev 2011-04-19 21:37:48 UTC
We would really need that support :(
Comment 3 Hans de Graaff gentoo-dev Security 2011-04-20 05:11:24 UTC
Unfortunately this is very low priority on my own agenda because there are plenty of other things needing more attention in the ruby project. I'm not sure if Diego has any time for this soon, so if you really need this to move forward it might be best to investigate the issue yourself.
Comment 4 Hans de Graaff gentoo-dev Security 2011-04-24 08:02:18 UTC
The problem is caused by the change in S-WORKDIR-FALLBACK in EAPI=4 (see page 36 of PMS). In older EAPI's the ebuild would fall back to use $WORKDIR when $S was not a directory. Our ruby-ng_src_prepare expects to be in $WORKDIR when it does its magic of unpacking for all desired ruby targets, but right now we don't get that far since our S can't be found even before entering src_prepare.

A further complication is that we allow S to be set in the ebuild with special support for a wildcard, in order to handle github downloads more easily.

I've added portage to the bug, hopefully they can suggest a good way to fix this.
Comment 5 Hans de Graaff gentoo-dev Security 2011-04-24 08:29:32 UTC
Created attachment 270995 [details]
Patch for make ruby-ng.eclass EAPI=4 compatible

This patch circumvents the S-WORKDIR-FALLBACK check in EAPI=4, and uses RUBY_S as a way to influence the unpack path for e.g. github tarballs. Suggestions for cleaner bash are welcome. Also todo: documentation for RUBY_S.

@Diego: can you review this?
Comment 6 Hans de Graaff gentoo-dev Security 2011-04-25 06:28:03 UTC
This fix has now been committed to ruby-ng.eclass, so it is now EAPI=4 aware.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2011-09-14 20:08:47 UTC
Umm..  This change made to support EAPI=4:

_ruby_invoke_environment() {
        old_S=${S}
        case ${EAPI} in
                4)
                        if [ -z ${RUBY_S} ]; then
                                sub_S=${P}
                        else
                                sub_S=${RUBY_S}
                        fi
                        ;;
                *)
                        sub_S=${S#${WORKDIR}/}
                        ;;
        esac


...seems to negate the usage/support of ${RUBY_S} in EAPI<=3 ..  was that planned?  Alternatively, is RUBY_S a new EAPI=4 thing?  Would it be possible instead to simply make the EAPI=4 version of this the default for all EAPI versions?
Comment 8 Hans de Graaff gentoo-dev Security 2011-09-15 05:55:14 UTC
(In reply to comment #7)
> Umm..  This change made to support EAPI=4:

> ...seems to negate the usage/support of ${RUBY_S} in EAPI<=3 ..  was that
> planned?  Alternatively, is RUBY_S a new EAPI=4 thing?  Would it be possible
> instead to simply make the EAPI=4 version of this the default for all EAPI
> versions?

Older EAPI versions rely on trickery with ${S} itself which no longer works in EAPI=4. Hence the introduction of RUBY_S instead in EAPI=4.

I'm not sure what backporting would gain us. Why would you want to do that?
Comment 9 Hans de Graaff gentoo-dev Security 2011-09-19 18:49:56 UTC
As discussed on IRC this would be helpful for packages with optional ruby support that can't use EAPI=4. Moving this back to CONFIRMED because it might be easy to support this.
Comment 10 Johannes Huber (RETIRED) gentoo-dev 2011-10-29 21:23:44 UTC
Ping, any news on this?
Comment 11 Hans de Graaff gentoo-dev Security 2011-11-02 18:16:47 UTC
(In reply to comment #10)
> Ping, any news on this?

I'm not against this but I won't do the work. I'd be happy to review patches.
Comment 12 Hans de Graaff gentoo-dev Security 2015-07-05 09:13:29 UTC
Closing this as the main issue was already fixed and the backport never happened.