Summary

chicken-install does not stop on error

Metadata

Attachments

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.

Changes and comments

[2009-08-14 08:59:46 UTC] zbigniew wrote:

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.

[2009-08-14 09:09:13 UTC] zbigniew attached csc-exit.diff.txt (description=shell command non-zero exit status will cause csc to (exit 1))

[2009-08-14 09:11:14 UTC] zbigniew wrote:

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.

[2009-08-14 19:01:57 UTC] felix changed status from new to closed

[2009-08-14 19:01:57 UTC] felix set resolution to fixed

[2009-08-14 19:01:57 UTC] felix wrote:

Thanks, patch applied in r15483.