Opened 10 years ago

Closed 10 years ago

#69 closed defect (fixed)

chicken-install does not stop on error

Reported by: Jim Ursetto Owned by:
Priority: major Milestone:
Component: build system Version: 4.1.x
Keywords: Cc:
Estimated difficulty:

Description

After a compilation error chicken-install will continue to execute and attempt to install the extension anyway.

For example, install the readline egg without any readline library installed at all:

  /home/jim/local/chicken-4/bin/csc -feature compiling-extension   -s -O2 readline.scm -lreadline -lhistory -ltermcap
Error: shell command terminated with non-zero exit status 256:
 gcc readline.c -o readline.o -c -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H -Os \
  -fomit-frame-pointer -fPIC -DPIC -DC_SHARED -I/home/jim/local/chicken-4/include

  /home/jim/local/chicken-4/bin/csc -feature compiling-extension   -c -O2 -d0 -j readline \
   readline.scm -o readline-static.o -unit readline -lreadline -lhistory -ltermcap
Error: shell command terminated with non-zero exit status 256:
 gcc readline-static.c -o readline-static.o -c -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H \
  -Os -fomit-frame-pointer -I/home/jim/local/chicken-4/include

  /home/jim/local/chicken-4/bin/csc -feature compiling-extension   -s -O2 -d0 readline.import.scm

  rm -fr /home/jim/local/chicken-4/lib/chicken/4/readline.so
Error: file does not exist: "readline.so"
Error: shell command terminated with nonzero exit code 17920

It probably also prevents the correct analysis of which libraries are on the system, which was reported by Sam Varner, because a failing compile will "succeed" from the caller's perspective.

Wild guess, this could have to do with improper parsing of exit status 256 (which happens to be 0 mod 256). Actual investigation is needed.

Attachments (1)

csc-exit.diff.txt (804 bytes) - added by Jim Ursetto 10 years ago.
shell command non-zero exit status will cause csc to (exit 1)

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by Jim Ursetto

Yep, that's exactly the problem. Return value of (system) is raw return value of waitpid(2) which is not appropriate to pass to (exit) -- as the return value is in bits 8-15, whereas exit masks these off.

There is a recipe for obtaining the exact exit status on UNIX at:
http://chicken.wiki.br/man/4/Unit%20library#system

Probably easier is to have csc return a fixed exit status of 1 (or whatever) if a subcommand fails, since we do not have official methods to get this.

Changed 10 years ago by Jim Ursetto

Attachment: csc-exit.diff.txt added

shell command non-zero exit status will cause csc to (exit 1)

comment:2 Changed 10 years ago by Jim Ursetto

So, that's a quick hack, but it fixes chicken-install's failure to stop on error and also Sam's issue with the compilation tests not working correctly.

comment:3 Changed 10 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

Thanks, patch applied in r15483.

Note: See TracTickets for help on using tickets.