Hopefully Someone Will Check and Comment on My Logic [OT Maybe?]

2011-03-12 Thread Dan McGhee
What might make this OT is that it's not a question specifically about 
building LFS, but rather a question of a script that I use to build LFS 
not working the way I want it to.  If this is really OT, maybe someone 
will respond privately if the any have any ideas.

As many of you know, I use the More Control with Package Users 
management system.  I have  modified the build scripts in the hint to 
minimize the pedantic work at the keyboard that's involved with a 
build.  The script is designed to find the tarball, un-tar it and the 
configure, make,make check and install.  Additionally, I add other 
necessary commands from the book in the appropriate places; e.g.  
patches, creating symlinks and moving files around.

The script has evolved over six years and, much to my chagrin right now, 
I've not been good at keeping the old versions or maintaining a changelog.

One thing I want it to do is recover from a failed 'make' or 'install' 
without have to run the whole script again.  This feature *used to* 
work.  It now doesn't.  If everything is OK, the script runs from the 
beginning to the successful end of a build.  But if there is a glitch, 
the recovery doesn't happen.

The most common interruption in a build, when using more control, is 
write permissions to a directory.  This causes the 'install' to abort.  
The fix is simple.  Change the write permissions and re-run the script.  
I want it to pick up with the make install command, but right now it 
goes to the make command on any abort.  I thing the testing for 
conditions is failing, and I cannot see the flaw in the logic or 
construction.  It is in this area that I'd like some help.  A fresh set 
of eyes, so to speak.

Following is the script from the variable definition through the logic 
tests.  I've eliminated all the extra stuff.

#! /bin/bash

# Begin Build for PACKAGE

# Run this script from the package user's home directory by invoking it
# with the package name--ex. vim-7.2. ./build vim-7.2 or ./build 
$(whoami) It will find
# the tarball in $PACKAGES, untar it, change to the created directory
# and configure, make, make check and make install.  Then it will 
clean up
# by creating a list of the installed files and remove the source tree.

# It will create 6 log files in the $HOME directory:
#   configure.log: All messages output during configure
#   configure.err: Just the errors output during configure
#   make.log: All messages output during make
#   make.err: Just the errors output during make
#   install.log: All messages output during make install
#   install.err: Just the errors output during make install

# variables
package=$@
logdir=$package-logs
PACKAGES=/sources
CURRENT=$package

took out a lot of stuff
# Begin tests and function calls for fresh and failed builds.

# This one recovers from failed make.
if [ -e $logdir/make-`echo $package`.err ]  \
[ ! -e $logdir/install-`echo $package`.err ]; then  #Now build

removed make, make check and make install sections
fi

# This one recovers from a failed install
if [ -e $logdir/make-`echo $package`.log ]  \
[ ! -e $HOME/$package-files.list ]; then

removed make install section

fi

# This one does everything through configure, make, make install
if [ ! -e $logdir ];  then

removed configure, make, make check and make install sections

removed extra commands and clean up sections.
fi


# End Build

This script creates six logs: configure.{log,err}, make.{log,err} and 
install.{log,err}, which I put in a log directory, $logdir.  The very 
last thing is does is create a list of files installed, 
$package-files.list.  Therefore, and here comes the testing logic, at 
the beginning there is no log directory, and  the test becomes [ ! -e 
$logdir ].

The necessary and sufficient conditions to define a failed make are a 
make log or configure log that exists and an install log or package file 
list that does not exist.  If an install fails, there will be a make 
log but no file list.  An install log *may* exist so I don't consider it 
in the logic.

The preceding two paragraphs are my logic.  Would someone please, using 
that, compare the logic to the test statements to see if they match, if 
the tests are constructed properly or if I need different logic.

As I said, if all is well, the script runs like a charm.  If there's a 
hiccup, a failed install, the script starts from the make test.  
Doesn't that mean the the logic failed?

I've removed a lot of stuff in the script trying to make things relevant 
and specific to only the question.  Please feel free to ask for 
additional info.

I'm hoping that someone can point me to better constructs or better logic.

Thanks,
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Hopefully Someone Will Check and Comment on My Logic [OT Maybe?]

2011-03-12 Thread Aleksandar Kuktin
On Sat, 12 Mar 2011 18:00:56 -0600
Dan McGhee beesnee...@att.net wrote:

 
 [snip]
 
 Following is the script from the variable definition through the
 logic tests.  I've eliminated all the extra stuff.
 
 [snip]
 
 # This one recovers from a failed install
 if [ -e $logdir/make-`echo $package`.log ]  \
 [ ! -e $HOME/$package-files.list ]; then
 
 [snip]
 
 I've removed a lot of stuff in the script trying to make things
 relevant and specific to only the question.  Please feel free to ask
 for additional info.
 
 [snip]


Well... DOES the script add all the logfiles it is supposed to add?
Are you /sure/? Have you checked?

The tests look kosher, as far as that matters, but I would turn my
attention to the creation of logfiles.

Other than that, my money is on the `echo $package` substitutions.
If ${package} has a space in it, that could break it.
You can fix this by doing ''[ -e ${logdir}/make-${package}.log ]''.

Take a small package (gzip?), and build it in such a way that it breaks
at various points, then inspect the relevant directories to see what is
there and what is not.

-- 
-Aleksandar Kuktin
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Hopefully Someone Will Check and Comment on My Logic [OT Maybe?]

2011-03-12 Thread Dan McGhee
On 03/12/2011 06:47 PM, Aleksandar Kuktin wrote:
 On Sat, 12 Mar 2011 18:00:56 -0600
 Dan McGheebeesnee...@att.net  wrote:


 [snip]

 Following is the script from the variable definition through the
 logic tests.  I've eliminated all the extra stuff.

 [snip]

 # This one recovers from a failed install
 if [ -e $logdir/make-`echo $package`.log ]  \
 [ ! -e $HOME/$package-files.list ]; then

 [snip]

 I've removed a lot of stuff in the script trying to make things
 relevant and specific to only the question.  Please feel free to ask
 for additional info.

 [snip]

Thank you, Aleksandar.
 Well... DOES the script add all the logfiles it is supposed to add?
 Are you /sure/? Have you checked?
Yes, yes and yes.
 The tests look kosher, as far as that matters, but I would turn my
 attention to the creation of logfiles.

 Other than that, my money is on the `echo $package` substitutions.
 If ${package} has a space in it, that could break it.
 You can fix this by doing ''[ -e ${logdir}/make-${package}.log ]''.
This is what I was hoping to hear--that the logic is sound,but that 
there might be a problem in the construct. I've shied away from ( ) and 
{} in $ xxx statements because I'm really shaky on what they mean. I've 
also never seen the ' ' [ ] ' ' construct. I use the Advanced Bash 
Scripting Guide as my reference. Thank you for your feedback. I'll play 
with this.
 Take a small package (gzip?), and build it in such a way that it breaks
 at various points, then inspect the relevant directories to see what is
 there and what is not.
I've done this with GDBM by adding `exit 1` at various points. The 
results are as I have described in my first post.

I appreciate your input. We'll see what happens.

Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: Hopefully Someone Will Check and Comment on My Logic [OT Maybe?]

2011-03-12 Thread Neal Murphy
On Saturday 12 March 2011 19:00:56 Dan McGhee wrote:
 # This one recovers from failed make.
 if [ -e $logdir/make-`echo $package`.err ]  \
 [ ! -e $logdir/install-`echo $package`.err ]; then  #Now build
 
 removed make, make check and make install sections
 fi
 
 # This one recovers from a failed install
 if [ -e $logdir/make-`echo $package`.log ]  \
 [ ! -e $HOME/$package-files.list ]; then

Technically, you may be mixing metaphors with this syntax. Perhaps the syntax 
is valid, but it isn't doing what you expect. Try:
  if [ -e file_1 -a ! -e file_2 ]; then
commands
  fi
  # equivalent: if test -e $file_1 -a ! -e file_2; then

OR use:
  [ -e file_1 ]  [ ! -e file_2 ]  {
commands;
  }
  # equivalent: test -e $file_1  test ! -e file_2  {

OR even use:
  [ -e file_1 -a ! -e file_2 ]  {
commands;
  }
  # equivalent: test -e file_1 -a ! -e file_2  {

Also, the syntax '-e $logdir/make-${package}.log' will eliminate a smidgeon 
of complexity even though what you did is correct. Any time you aren't sure if 
a shell var like $var will be, or is being, parsed correctly in context, put 
the name in braces, as in ${var}.

Nothing else on your script pokes me in the eye with a sharp stick.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


gcc test failures

2011-03-12 Thread Alex Bosworth
Here's the synopsis:

Been trying to compile LFS (from the latest svn version) on my laptop, I have 
tried four times so far (please note I'm making use of  JHLAFS).  During all 
the 
four builds, gcc tests don't seem to be satisfactory as the number of 
unexpected 
failures is too high and the number of expected passes is too low. I have tried 
changing the CFLAGS and tried to be conservative but, the result seems to be 
the 
same. The fourth time I chose to run tests both for the tools and the final 
system. As I can see tests for all other packages are successful (All # tests 
were successful) except for gcc ! The CFLAGS I used for the fourth build are 
-O3 -pipe -msse -msse2 -mmmx -march=native -mtune=native. The processor is an 
Intel Penitum4 Mobile.

The only deviations from the SVN book are m4 (using 1.4.16),  mpc (using 0.9), 
less (using 446).

Here's the grep -A7 Summ output:



 === libstdc++ Summary ===

FAIL: gcc.c-torture/execute/ieee/20010226-1.c compilation,  -Os 
FAIL: gcc.c-torture/execute/ieee/20011123-1.c compilation,  -O0 
FAIL: gcc.c-torture/execute/ieee/20011123-1.c compilation,  -O1 
FAIL: gcc.c-torture/execute/ieee/20011123-1.c compilation,  -O2 
FAIL: gcc.c-torture/execute/ieee/20011123-1.c compilation,  -O3 
-fomit-frame-pointer 

FAIL: gcc.c-torture/execute/ieee/20011123-1.c compilation,  -O3 -g 
--
=== libstdc++ Summary ===

AR=ar; export AR; \
RANLIB=ranlib; export RANLIB; \
if [ -z normal1 ] \
 [ -j = -j ]; then \
  make  check-DEJAGNUnormal0 check-DEJAGNUnormal1 \
  check-DEJAGNUnormal2 check-DEJAGNUnormal3; \
--
=== libstdc++ Summary ===

AR=ar; export AR; \
RANLIB=ranlib; export RANLIB; \
if [ -z normal2 ] \
 [ -j = -j ]; then \
  make  check-DEJAGNUnormal0 check-DEJAGNUnormal1 \
  check-DEJAGNUnormal2 check-DEJAGNUnormal3; \
--
=== libstdc++ Summary ===

AR=ar; export AR; \
RANLIB=ranlib; export RANLIB; \
if [ -z normal3 ] \
 [ -j = -j ]; then \
  make  check-DEJAGNUnormal0 check-DEJAGNUnormal1 \
  check-DEJAGNUnormal2 check-DEJAGNUnormal3; \
--
=== libstdc++ Summary ===

make[6]: Leaving directory 
`/sources/gcc-build/i686-pc-linux-gnu/libstdc++-v3/testsuite'
FAIL: gcc.c-torture/execute/ieee/pr28634.c compilation,  -O3 
-fomit-frame-pointer -funroll-loops 

FAIL: gcc.c-torture/execute/ieee/pr28634.c compilation,  -O3 
-fomit-frame-pointer -funroll-all-loops -finline-functions 

FAIL: gcc.c-torture/execute/ieee/pr28634.c compilation,  -O3 -g 
FAIL: gcc.c-torture/execute/ieee/pr28634.c compilation,  -Os 
FAIL: gcc.c-torture/execute/ieee/pr29302-1.c compilation,  -O0 
--
=== gcc Summary ===

# of expected passes414
# of unexpected failures11965
# of expected failures  33
# of unresolved testcases   866
# of unsupported tests  401
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed
--
=== gcc Summary ===

# of unexpected failures2692
# of unresolved testcases   2692
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed

make[4]: [check-parallel-gcc_1] Error 1 (ignored)
test -d testsuite || mkdir testsuite
--
=== gcc Summary ===

# of unexpected failures4628
# of unresolved testcases   4628
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed

make[4]: [check-parallel-gcc_2] Error 1 (ignored)
test -d testsuite || mkdir testsuite
--
=== gcc Summary ===

# of expected passes12
# of unexpected failures7232
# of unresolved testcases   42
# of unsupported tests  118
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed

--
=== gcc Summary ===

# of expected passes564
# of unexpected failures10695
# of unexpected successes   12
# of expected failures  29
# of unresolved testcases   93
# of unsupported tests  246
--
=== gcc Summary ===

# of unexpected failures2409
# of unresolved testcases   380
# of unsupported tests  273
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed

make[4]: [check-parallel-gcc_5] Error 1 (ignored)
--
=== gcc Summary ===

# of unexpected failures2425
# of unresolved testcases   80
# of unsupported tests  1277
Couldn't determine version of /sources/gcc-build/gcc/xgcc: spawn failed

make[4]: [check-parallel-gcc_6] Error 1 (ignored)
--
=== g++ Summary ===

# of expected passes6
# of unexpected failures3543
# of unexpected successes   6
# of unresolved testcases   255
# of unsupported tests  188
Couldn't determine version of