Problem with build-from-lisp.bash

Pascal Bourguignon <[email protected]>
Newsgroups gmane.editors.j.devel
Message-ID <C075BE2A-E870-4783-BB16-CD0A44189E72__23659.018558874$1544392147$gmane$org@informatimago.com>
Hi!

The lisp commands to build abcl in the build-from-lisp.bash script have a problem: they’re mere progn forms.
When an error occurs, the lisp implementations will enter into the debugger and expect an interactive debugging.
This prevents building abcl in automatic scripts, such as:

function install_abcl_from_sources(){
    # Assume ccl is available.
    cd "${PREFIX}"/src/
    local url='http://abcl.org/releases/1.4.0/abcl-src-1.4.0.tar.gz'
    local tarball;tarball="$(basename "${url}")"
    local dir;dir="$(basename "${tarball}" .tar.gz)"
    local jdkhome;jdkhome="$(java_home)"
    local logbase;logbase="$(pwd)/${dir}"
    export JAVA_HOME="${jdkhome}"
    if [[ ! -e  "${tarball}" ]] ; then
        download "${url}"
    fi
    unarchive "${tarball}" "${dir}"
    cd "${dir}"
    case "$(uname)" in
    (Darwin)
        sed -e 's^"/usr/"^"'"${jdkhome}/"'"^' \
            <customizations.lisp.in >customizations.lisp
        ;;
    (*)
        sed -e 's^"/home/peter/sun/jdk1.5.0_16/"^"'"${jdkhome}/"'"^' \
            -e 's/fastjar/jar/' \
            <customizations.lisp.in >customizations.lisp
        ;;
    esac
    chmod 755 ./build-from-lisp.bash
    printi 'Building abcl from lisp with ccl'
    ./build-from-lisp.bash ccl  > "${logbase}".build-from-lisp.log      2>&1 \
        && ( printi 'Installing abcl' ; install -m 755 abcl "${PREFIX}"/bin/  > "${logbase}".make-install.log   2>&1 ) \
        ||   printe 'Compiling abcl failed; check the logs.'
}


since errors aren’t detected, but just suspend the execution indefinitely.


Therefore, I would suggest to wrap those progn forms into a handler-case; for example, in the case of ccl:

(handler-case (progn $3 (ccl:quit)) (error (err) (princ err *error-output*) (terpri *error-output*) (finish-output *error-output*) (ccl:quit 1)))




-- 
__Pascal J. Bourguignon__
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.