[Rubygems-developers] r1841 --destdir behaviour

Caspar Florian Ebeling florian.ebeling at gmail.com
Wed Aug 20 04:58:19 EDT 2008

On Wed, Aug 20, 2008 at 12:42 AM, Luis Lavena <luislavena at gmail.com> wrote:
> On Mon, Aug 18, 2008 at 10:21 PM, Richard Brown <rbrown at exherbo.org> wrote:
>> Hi, I wrote the initial patch for --destdir support, and I have a
>> couple of issues with r1841, I did email Luis and say I would have a
>> look at the end of last month, but I've been a little tied up, sorry.
> Glad to have you back :-D
>> It uses RbConfig::TOPDIR, which on my x86_64 machine is nil, because
>> of the way mkconfig generates TOPDIR. (It has a hardcoded 'lib' in it,
>> my ruby is installed to 'lib64'. It looks like using
>> RbConfig:CONFIG['prefix'] would be a better choice.
> Since there was no documentation on the expected results I just came
> up with something that I was able to understand.
> For the me idea was that --destdir will generate the same tree
> hierarchy used by ruby and it's components, but having as parent
> folder a different one.
> so:
> --destdir=/foo/bar
> will prepend /foo/bar to the /lib/ruby/gems/1.8 and related folder structure...
> I think was a wrong assumption.
>> This patch has also changed the behaviour of --destdir, and I'm not
>> sure if this is intentional or not. My intent in adding --destdir was
>> to replicate the functionality of
>> make DESTDIR="/image" install
>> So setup.rb --destdir="/foo" would install to
>> "/foo/usr/lib64/ruby/site_ruby/1.8" with this revision it would now be
>> installed to "/foo/lib64/ruby/site_ruby/1.8", which is incorrect.
> The thing with that is /usr is not part of the ruby installation
> structure, but the underliying OS/distro installation structure. /usr
> has no meaning on Windows (XP, x64):

Then idea of destdir is to "install" to a certain location and
then wrap this up as a binary package (or sometimes to a
depot location, like in MacPorts). So the path has to contain
the full PREFIX. Obviously this does not make a lot of sense on
Windows with it's multi-device setup. I don't know what would
be the right thing to do in that environment with this option.
I guess you don't really need it.

A good place to start reading about destdir might be this here:



Florian Ebeling
florian.ebeling at gmail.com

More information about the Rubygems-developers mailing list