Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#1977 closed defect (fixed)

Perl compile fails at autosplit phase

Reported by: Paul Lowman Owned by: dnicholson@…
Priority: normal Milestone:
Component: Book Version: 6.2
Severity: normal Keywords: preplibrary autosplit
Cc:

Description

Perl-5.8.8 compile fails with Make [preplibrary] Error 1. This is due to failure of miniperl to execute autosplit. The fix is to create lib/auto manually after the configure phase.

Attachments (3)

perl_make.log (2.4 KB ) - added by Paul Lowman 17 years ago.
stdout
perl_make_errors.log (5.5 KB ) - added by Paul Lowman 17 years ago.
stderr
shell.trace (542 bytes ) - added by Paul Lowman 17 years ago.

Download all attachments as: .zip

Change History (26)

comment:1 by dnicholson@…, 17 years ago

Owner: changed from lfs-book@… to dnicholson@…
Status: newassigned

Paul, what distro are you installing from?

comment:2 by bdubbs@…, 17 years ago

Milestone: 6.26.3

comment:3 by Paul Lowman, 17 years ago

I am using a build from CoreLinux - now no longer active. I am now using jhalfs with the lfs live CD and it appears to be all ok ..

comment:4 by dnicholson@…, 17 years ago

I had a hunch that it was because of the host's /bin/sh since I'd noticed some problems with that in a different context, but you should be using bash at that point if /tools/bin is at the front of your path.

I'd appreciate if you could help debug this since I can't reproduce it and there's another person with the same problem. Could you run this command before the build and log the output?

sed -i 's/^\([[:space:]]*\)@/\1/' Makefile.SH

That will cause make not to suppress the output from some commands. Hopefully the sed from CoreLinux can handle that, but I can't see why it shouldn't.

comment:5 by dnicholson@…, 17 years ago

I meant log the output from make, not from the sed :)

by Paul Lowman, 17 years ago

Attachment: perl_make.log added

stdout

by Paul Lowman, 17 years ago

Attachment: perl_make_errors.log added

stderr

comment:6 by Paul Lowman, 17 years ago

Here are the outputs from the make after executing the sed command.

comment:7 by dnicholson@…, 17 years ago

Looks like it fails silently. Thanks, perl! In the future, you can redirect one of the streams onto the other so that it comes out in a single stream. Here's one way:

do something > logfile 2>&1

Next question. After it fails, what happens if you just try to run the command on your own? What about if you remove the lib/auto directory first?

sh ./makedir lib/auto
echo $?

comment:8 by Paul Lowman, 17 years ago

the command returns an error of 1

the following works ...

mkdir lib/auto

also makedir works when root ...

the permissions of $LFS/sources/perl-5.8.8 all seem to be OK.

comment:9 by dnicholson@…, 17 years ago

Right, something in their shell script makedir is failing. In the end, the workaround might just be to mkdir -p lib/auto before make, but I'd like to know what the issue is. In the same circumstances as before, what happens when you turn on tracing in the shell?

sh -x ./makedir lib/auto
echo $?

If you could attach the output from the 'sh -x' call, that would be great.

Also, did you mean that just running ./makedir worked, or that calling mkdir worked?

by Paul Lowman, 17 years ago

Attachment: shell.trace added

comment:10 by Paul Lowman, 17 years ago

./makedir works as root mkdir works as lfs

shell.trace attached ...

comment:11 by dnicholson@…, 17 years ago

Interesting. For some reason, the for loop at the end of ./makedir doesn't work correctly. It ends up running mkdir with no arguments and failing.

When you are the lfs user, you have /tools/bin at the beginning of your path, right? What do you get when running "which sh"?

comment:12 by Paul Lowman, 17 years ago

lfs:~$ which sh /tools/bin/sh

comment:13 by dnicholson@…, 17 years ago

OK. I think there's something wrong with the bash that you built. Try this test case.

$ cat > test.sh << "EOF"
set ./lib ./lib/auto
for dir do
  echo $dir
done
EOF
$ /tools/bin/sh -x ./test.sh

It should echo ./lib and ./lib/auto on separate lines with some tracing output.

comment:14 by dnicholson@…, 17 years ago

Could you also execute the test script as "/tools/bin/bash -x ./test.sh"?

comment:15 by Paul Lowman, 17 years ago

[~]# /tools/bin/sh -x ./test.sh + set ./lib ./lib/auto + for dir in '""' + echo

comment:16 by dnicholson@…, 17 years ago

Now that is peculiar and it's a bug in bash. My next guess is, what version of bison does your host have? From my look at the bash sources, the parser that defines this behavior is created by bison. You can get this by running "bison --version" from the host.

comment:17 by Paul Lowman, 17 years ago

Bison version is 1.75

comment:18 by dnicholson@…, 17 years ago

On the support list, we were able to confirm that this is a bison issue. He also had bison-1.75, and updating his host to bison-2.2 solved the issue. I still have track down what the minimum required version is. I suspect 2.0.

http://linuxfromscratch.org/pipermail/lfs-support/2007-April/032888.html
http://linuxfromscratch.org/pipermail/lfs-support/2007-April/032909.html

The development book needs to have the host reqs page adjusted, and stable needs an errata entry (a more accurate one, anyway).

comment:19 by manuel@…, 17 years ago

With Bison-1.875a (using LFS-6.0 as host) Perl builds fine.

comment:20 by dnicholson@…, 17 years ago

Thanks, Manuel. I confirm that bash is broken with bison-1.75, but works with bison-1.875 and bison-2.0.

Can anyone remind me the story of bison 1.875a vs. 1.875? Is it acceptable to list 1.875 as the minimum version?

comment:21 by alexander@…, 17 years ago

The story is that Bison 1.875 could not generate valid C++ parsers. This was first discovered when building OpenOffice.org, the BLFS book even contained a note that the reader must downgrade Bison to 1.75 to avoid the error.

comment:22 by Matthew Burgess, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r8066.

comment:23 by Jeremy Huntwork, 17 years ago

Milestone: 6.3

Milestone 6.3 deleted

Note: See TracTickets for help on using tickets.