Re: pipefail

Bruno Haible <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <2275412.kRk9oFmspM@omega>
Hi Sam,

> We use pipes in configure:
> ${MAKE} 2>&1 | tee cbcstep2.log
> and this breaks "set -e" without "set -o pipefail" which is not
> supported by dash (/bin/sh on linux).

Yes, /bin/sh happens to be 'dash' on Ubuntu Linux.

> How should we handle this?
> 
> 1. "All platforms we care about have bash or ksh or zsh which support
>    pipefail" (is it really true?)
>    Detect which one is available and use it.
>    The problem is that this is in the top-level configure.

It is too much annoyance to ask the user to run "bash configure", or
to use respawn logic similar to the one in autoconf-generated configure
files. So, better avoid the unportable 'pipefail' feature.

> 2. Use http://cfajohnson.com/shell/cus-faq-2.html#Q11 .

Interesting to see that there is a portable solution to this. But it
unreadable as hell, this game with file descriptors 3 and 4.

>    I would much prefer if it were in gnulib and we merely sourced it --
>    could you please add it there?

gnulib is, so far, not a library of shell functions (except for the
tests/init.sh meant for use in test suites).

And fortunately we don't need the general solution here. Since each of
the interesting commands is sending its output to a log file, we can send
the exit status to the log file as well.

This is what I did and pushed.

Also, when doing "make -f Makefile.devel multibuild-...", it is useful
when the cbcstep3.log and cbcstep4.log files are present even when cbcstep2.log
failed. This allows me to get a quick overview of all build variants through
"ls -l build-*/cbcstep3.log". I restored this behaviour as well.

Bruno


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.