Tricky install question

Hi,

I’m trying to install ruby in our production environment, but that means I
have to “install” the code in a staging area, and then run our tools to
distribute it. The situation is something like this:

Final location is: /prod/language/ruby/1.6.8/
Compile area is: /dev/language/ruby/1.6.8/build/
Staging area is: /dev/language/ruby/1.6.8/install/

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Is there an easy way of persuading instruby to do the right thing in this
situation?

Setting DESTDIR to /dev gives /dev/prod/language/ruby/1.6.8/ which is no
good :slight_smile:

The only thing I could think of was to temporarily change (via ruby, sed,
or perl) rbconfig.rb during the ‘make install’ phase, then change it back
again afterwards. Is there a better way?

Cheers,
Mike

···


Mike Wyer mike@wyer.org www.wyer.org/mike 07974 254007

"I want to die peacefully in my sleep like my Grandfather...

… not screaming and yelling like the passengers in his car"

Hi,

I’m trying to install ruby in our production environment, but that means I
have to “install” the code in a staging area, and then run our tools to
distribute it. The situation is something like this:

Final location is: /prod/language/ruby/1.6.8/
Compile area is: /dev/language/ruby/1.6.8/build/
Staging area is: /dev/language/ruby/1.6.8/install/

What’s your platform? Doesn’t seem UNIX… If it’s DOSISH
system, 1.6 or later are relocatable.

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Is there an easy way of persuading instruby to do the right thing in this
situation?

Setting DESTDIR to /dev gives /dev/prod/language/ruby/1.6.8/ which is no
good :slight_smile:

If your system supports symbolic link, you could use it.

···

At Thu, 3 Apr 2003 21:17:59 +0900, Mike Wyer wrote:


Nobu Nakada

Would chroot help in this case?

Regards,
JJ

···

On Thu, 2003-04-03 at 07:17, Mike Wyer wrote:

Hi,

I’m trying to install ruby in our production environment, but that means I

Final location is: /prod/language/ruby/1.6.8/
Compile area is: /dev/language/ruby/1.6.8/build/
Staging area is: /dev/language/ruby/1.6.8/install/

Hi,

I’m trying to install ruby in our production environment, but that means I
have to “install” the code in a staging area, and then run our tools to
distribute it. The situation is something like this:

Final location is: /prod/language/ruby/1.6.8/
Compile area is: /dev/language/ruby/1.6.8/build/
Staging area is: /dev/language/ruby/1.6.8/install/

What’s your platform? Doesn’t seem UNIX… If it’s DOSISH
system, 1.6 or later are relocatable.

It’s a linux architecture where /prod is read-only NFS and /dev is
read-write. The problem is getting the right options to “make” to get the
relocation mentioned above.

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Is there an easy way of persuading instruby to do the right thing in this
situation?

Setting DESTDIR to /dev gives /dev/prod/language/ruby/1.6.8/ which is no
good :slight_smile:

If your system supports symbolic link, you could use it.

The /prod environment is read-only (hence the staging mechanism), so
symlinks won’t do the trick. I think instruby.rb is not designed for this
kind of install, but I would love to be wrong!

Cheers,
Mike

···

On Thu, 3 Apr 2003 nobu.nokada@softhome.net wrote:

At Thu, 3 Apr 2003 21:17:59 +0900, > Mike Wyer wrote:

Mike Wyer mike@wyer.org www.wyer.org/mike 07974 254007

"I want to die peacefully in my sleep like my Grandfather...

… not screaming and yelling like the passengers in his car"

DESTDIR provides pretty much that functionality and IS supported by
instruby, but it just moves the tree around rather than renaming some of
the branches. So if I do
make DESTDIR=/dev/language/ruby/1.6.8/install install
I end up with
/dev/language/ruby/1.6.8/install/prod/language/ruby/1.6.8/
which isn’t quite what I’m after :slight_smile:

For other ‘configure;make;make install’ type code, we supply different
parameters to make and make install. So the code is built with the right
paths, and then we lie at install time. The ruby install is too clever for
this, and keeps the values it was given at build time in rbconfig.rb and
then just reads that at install time.

I’m working on a small change to instruby.rb that will allow make to
override some values to allow this kind of install. I’ll send in the patch
once it works.

Thanks for the suggestions and encouragement.

Cheers,
Mike

···

On Fri, 4 Apr 2003, John Johnson wrote:

On Thu, 2003-04-03 at 07:17, Mike Wyer wrote:

Hi,

I’m trying to install ruby in our production environment, but that means I

Final location is: /prod/language/ruby/1.6.8/
Compile area is: /dev/language/ruby/1.6.8/build/
Staging area is: /dev/language/ruby/1.6.8/install/

Would chroot help in this case?


Mike Wyer mike@wyer.org www.wyer.org/mike 07974 254007

"I want to die peacefully in my sleep like my Grandfather...

… not screaming and yelling like the passengers in his car"

Hi,

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Is there an easy way of persuading instruby to do the right thing in this
situation?

Setting DESTDIR to /dev gives /dev/prod/language/ruby/1.6.8/ which is no
good :slight_smile:

If your system supports symbolic link, you could use it.

The /prod environment is read-only (hence the staging mechanism), so
symlinks won’t do the trick.

I meant symlink under /dev.

$ ln -s . /dev/prod
$ make DESTDIR=/dev install

I think instruby.rb is not designed for this
kind of install, but I would love to be wrong!

You are not wrong. instruby.rb just prepends $(DESTDIR) to
$(prefix).

···

At Thu, 3 Apr 2003 22:34:20 +0900, Mike Wyer wrote:


Nobu Nakada

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Just curious, are all your device files under /dev too?
I.e.
/dev
ttyS0
ttyS1
language/
fd0
etc?

Thanks,
JJ

Doh! /dev/ was a bad choice for an example directory name :slight_smile:
The actual paths are more like:
/afs/dev/ruby/core/1.6.8/install/.exec/ia32.linux2.4.libc6/bin
and
/afs/prod/ruby/SUB/core/1.6.8/.exec/ia32.linux2.4.libc6/bin

The install issue is independent of AFS, and there’s an awful lot of
distracting noise in those paths, so I picked something a bit simpler that
showed the same variation. Sorry for the confusion :slight_smile:

Cheers,
Mike

···

On Mon, 7 Apr 2003, John Johnson wrote:

So ruby must assume it’s going to be running from
/prod/language/ruby/1.6.8, but it has to install into
/dev/language/ruby/1.6.8/install

Just curious, are all your device files under /dev too?
I.e.
/dev
ttyS0
ttyS1
language/
fd0
etc?


Mike Wyer mike@wyer.org www.wyer.org/mike 07974 254007

"I want to die peacefully in my sleep like my Grandfather...

… not screaming and yelling like the passengers in his car"