Perl 5.8.0 compilation fails in chrooted environment

V

vrihad

I am trying to compile perl 5.8.0 with gcc 3.2.3 on a Linux 2.4.18
system having glibc 2.3.2. I am doing it in a chrooted environment. My
configure command is: sh Configure -Dprefix=/usr/local/static -Uusedl

When I do make, after a while I start getting warning about not
finding the locale related info and the default locale("C") is used.
Then compilation fails on file lib/ExtUtils/MakeMaker.pm line 229.
This line is concerned with calling function cwd(). The line where
make fails is given below:

my $pwd = cwd() || die "Can't figure out your cwd!"

Apparently the module Cwd can't figure out the current working
directory in my chrooted envioronment. Also I am not sure how module
Cwd is built and works with perl interpreter which I am still
compiling.

What can I do to get the compilation going? Any type of hack is
acceptatble. In fact I tried to replace the function call with actual
path string. But something was wrong in this approach and it did not
work.


Thanks in advance
vrihad
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to

my $pwd = cwd() || die "Can't figure out your cwd!"

Apparently the module Cwd can't figure out the current working
directory in my chrooted envioronment. Also I am not sure how module
Cwd is built and works with perl interpreter which I am still
compiling.
What can I do to get the compilation going? Any type of hack is
acceptatble.

If `pwd' works, try replacing Cwd.pm with

package Cwd;
sub cwd { my $p = `pwd`; chop $p; $p }
1;
In fact I tried to replace the function call with actual
path string.

This call is made from tens of different directories.

Hope this helps,
Ilya
 
V

vrihad

Ilya Zakharevich said:
If `pwd' works, try replacing Cwd.pm with

package Cwd;
sub cwd { my $p = `pwd`; chop $p; $p }
1;

I replaced the file lib/Cwd.pm with the one having following content:

-----------------------------------------
package Cwd;

sub cwd { my $p = `pwd`; chop $p; $p }

1;
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
I replaced the file lib/Cwd.pm with the one having following content:
package Cwd;
sub cwd { my $p = `pwd`; chop $p; $p }
1;
Now the new error while doing make is:
Undefined subroutine &File::Spec::Unix::cwd called at
../../lib/File/Spec/Unix.pm line 457.

I see: you need to make Cwd::cwd() exportable. Insert the Exporter
boilerplate at start (e.g., see how the original Cwd did it).

Hope this helps,
Ilya

P.S. And, please, report the whole story as a bug via perlbug.
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
Bernie Cosell
} If `pwd' works, try replacing Cwd.pm with
}
} package Cwd;
} sub cwd { my $p = `pwd`; chop $p; $p }
} 1;

Meta-question: why use 'chop' instead of 'chomp'?

How do you know the current value of $/? chomp() has very little
usefulness in modules...
Isn't there a danger on a system that returns \r\n that chop will
leave the \r?

Perl's line end is \n. Do not see how system comes into consideration here...

Hope this helps,
Ilya
 
V

vrihad

I replaced the file lib/Cwd.pm with the one having following content:
I see: you need to make Cwd::cwd() exportable. Insert the Exporter
boilerplate at start (e.g., see how the original Cwd did it).
I went through the file Cwd.pm. I found that it is checking for unix
command pwd in directories /bin and /usr/bin. Since I was using busybox
for pwd and it was installed in /usr/local/bin, it was not getting detected.
I made a symlink of /usr/local/bin/pwd to /usr/bin/pwd and tried make again.
Now it has successfully passed through the sections where it was failing
before.

Though I am not familiar with perl, just a little more digging helped a lot.
Now my compilation is going fine without any hack. Thanks Illya for all the
help.
P.S. And, please, report the whole story as a bug via perlbug.
It seems to be not a bug in perl installation script. Just the position of
one binary in my system was not correct.

Thanks
vrihad
 
I

Ilya Zakharevich

[A complimentary Cc of this posting was sent to
I went through the file Cwd.pm. I found that it is checking for unix
command pwd in directories /bin and /usr/bin. Since I was using busybox
for pwd and it was installed in /usr/local/bin, it was not getting detected.
It seems to be not a bug in perl installation script. Just the position of
one binary in my system was not correct.

Still, it looks like a bug. Please report all the sides of it, so the
developers have enough info to decide whether /usr/local/bin is a good
place to add. [BTW, the spelling of my name down below is correct. ;-]

Yours,
Ilya
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top