Opened 18 years ago

Closed 17 years ago

#1892 closed defect (fixed)

"host pollution" of expect in ch5 breaks binutils testsuite in ch6

Reported by: brandon_peirce@… Owned by: Jeremy Huntwork
Priority: normal Milestone:
Component: Book Version: 6.2
Severity: normal Keywords:
Cc:

Description

If there is a stty binary in /usr/local/bin on the host (default install of coreutils), that gets picked up by expect's configure script:

if test -r /usr/local/bin/stty ; then
  STTY_BIN=/usr/local/bin/stty
else
  STTY_BIN=/bin/stty
fi

This gets compiled into libexpect and utimately breaks dejagnu in ch6 because we have created a symlink to /tools/bin/stty in /bin but not in /usr/local/bin.

I see two possible fixes:

  1. ln -s /bin/stty /usr/local/bin in the Essential Symlinks

Don't like that as it pollutes the final LFS environment.

  1. Fix Expect's configure.status and/or Makefile with a sed between the ./configure and the make.

(Probably should check first that /bin/stty actually exists on the host.)

Change History (4)

comment:1 by Jeremy Huntwork, 17 years ago

Adding these two lines to the book commands would 'fix' this behavior:

cp configure{,.bak}
sed 's:/usr/local/bin:/bin:' configure.bak > configure

That would produce the following in the 'configure' script:

echo "configure:2028: checking stty to use" >&5
if test -r /bin/stty ; then
  STTY_BIN=/bin/stty
else
  STTY_BIN=/bin/stty
fi

If you like this fix, I made a patch: http://linuxfromscratch.org/~jhuntwork/chapter05-expect.patch

comment:2 by brandon_peirce@…, 17 years ago

I like the approach. It ought to work (though a test run on the originally affected host may have to wait a while). The explanatory text in patch is great.

comment:3 by Jeremy Huntwork, 17 years ago

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

Confirmed; and here's how:

  • Start up the LiveCD.
  • Copy /bin/stty to /usr/local/bin
  • Compile tcl/expect/dejagnu like you would in chapter 5.
  • Remove /usr/local/bin/stty
  • Compile the calc example that comes with the dejagnu source (make sure your PATH is set to use the new testsuite tools):
    cd example/calc
    make
    make check
    
  • The check will fail and calc.log will contain something like the following:
    sh: /usr/local/bin/stty: No such file or directory
    calc: ERROR: Can't start /path/to/dejagnu-1.4.4/example/calc/calc
    

comment:4 by Jeremy Huntwork, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed as of r7870.

Note: See TracTickets for help on using tickets.