Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156972 - Ruby eclass may not handle installation correctly when using setup.rb
Summary: Ruby eclass may not handle installation correctly when using setup.rb
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-03 02:34 UTC by Hans de Graaff
Modified: 2009-12-14 13:43 UTC (History)
0 users

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


Attachments
setup.rb collection (ruby-setup.tar.gz,79.24 KB, application/octet-stream)
2006-12-08 10:53 UTC, Nguyen Thai Ngoc Duy (RETIRED)
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 2006-12-03 02:34:03 UTC
While writing an ebuild for RMagick 1.14.1 I encountered the problem that the ebuild would try to write the installation files directly into the live filesystem instead of into the image directory, see #155646 for details. 

The problem is that the setup.rb file distributed with RMagick 1.14.1 does not look at the config data when installing. Giving it an explicit --prefix during the  installation step solves this, and that is what I've done in the ebuild for RMagick. 

However, as kernelsensei mentions in that bug, this could well affect more ruby packages and may indicate that the bug is actually in ruby.eclass. Since I'm not very familiar yet with ruby packaging I'd rather open this bug about it rather than mucking about with the eclass.

Questions to look in to:
- Do we have any other ruby packages that use setup.rb? If so, do they also create access violations?
- Is the setup.rb in RMagick generic (which means we should adapt the eclass), or custom?
- Would it hurt other packages if we would give the --prefix option to setup.rb in the eclass always, to cover both cases.
Comment 1 Boris Fersing (RETIRED) gentoo-dev 2006-12-03 11:39:46 UTC
Hi,

I contacted the Rmagick main dev and he said that the setup.rb is generic : http://i.loveruby.net/en/projects/setup/
Comment 2 Caleb Tennis (RETIRED) gentoo-dev 2006-12-04 11:22:06 UTC
Hmm, I didn't write the ruby eclass so I can't answer whether --prefix would cause an issue or not.  But, perhaps we can try it and see what happens!
Comment 3 Hans de Graaff gentoo-dev Security 2006-12-04 12:30:10 UTC
My main concern is that we'd break existing packages using setup.rb. However, given that RMagick uses a standard setup.rb and that we install most packages as a gem that chance may not be very large. 
Comment 4 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2006-12-08 10:53:22 UTC
Created attachment 103639 [details]
setup.rb collection

I did a quick grep over dev-ruby to find non-gem packages, fetched them all and extract setup.rb. There are only 12 packages that have setup.rb. There are some very different setup.rb implementations. I think racc's setup.rb is more standard than RMagick's according to diff.
Anyway 12 is not a big deal, just test them all :)
Comment 5 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2006-12-16 16:53:35 UTC
I'm not really sure whether this is a good move. fusefs-0.6.0 fails to install if I append either --prefix=${D} or --prefix=${D}/usr

BTW Hans, may I know why you use --prefix=${D} instead of --prefix=${D}/usr in rmagick ebuild?
Comment 6 Hans de Graaff gentoo-dev Security 2006-12-17 02:27:15 UTC
I used --prefix=${D} because it worked. :-) I initially tried to use --prefix=${D}/usr but the package ended up in /usr/usr/bin etc. After investigating a bit more I've found the following:

'setup.rb install --prefix' determines the directory where the actual files are written, but respecting the --prefix given in the config step. So for Gentoo the install --prefix must be ${D}. Normally this would be / which is the default.

The 'setup.rb config --prefix' step seem to be redundant then, because it defaults to /usr. Leaving out would work fine, because all files would assume to be under /usr due to the default --prefix, and then written to ${D} due to the install --prefix. But...

...the post-install.rb script doesn't care at all about the install --prefix and only checks the config --prefix. So we need to do both to get everything to end up in the right place.
Comment 7 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-12-14 13:43:13 UTC
I think we can mark this as WONTFIX, ruby-ng.eclass does no longer have template functions for setup.rb.