planck-repl / planck

Stand-alone ClojureScript REPL
https://planck-repl.org
Eclipse Public License 1.0
1.03k stars 68 forks source link

Bash scripts do not exit on first error. Would you be open to PR's? #1026

Closed cellularmitosis closed 1 year ago

cellularmitosis commented 4 years ago

Thanks so much for making planck!

I tried building planck in a Debian 10 (Buster) chroot and ran into a build error, which ultimately led to the discovery that the bash scripts in scripts/ do not use set -e style (they do not exit on first error).

Tweaking these scripts to use set -e style is something I'd be happy to do, but before I start submitting PR's, I thought I'd ask if this is something you'd be interested in, or if you'd prefer to keep them non-set-e style?

(The error was ultimately due to not having unzip installed, but that was obscured because the script continued to run after the missing-unzip failure)

Error specifics:

Syntax error (ExceptionInfo) compiling at (script/build.clj:30:1).
/root/tmp/planck-2.24.0/planck-cljs/src/planck/bundle/gcl.cljs [line 4, col 1] Unexpected EOF while reading item 1 of list, starting at line 3 and column 3.

indeed, gcl.cljs appears to be incomplete:

# cat planck/root/tmp/planck-2.24.0/planck-cljs/src/planck/bundle/gcl.cljs 
(ns planck.bundle.gcl
  "Require the namespaces that make up the Google Closure Library."
  (:require

scrolling up further in the build process revealed a few other errors:

Fetching Google Closure Compiler...
script/get-closure-compiler: line 12: unzip: command not found
Cleaning up Google Closure Compiler archive...
Fetching Google Closure Library...
script/get-closure-library: line 17: unzip: command not found
mv: cannot stat 'closure-library-20190301/closure': No such file or directory
mv: cannot stat 'closure-library-20190301/third_party': No such file or directory
Cleaning up Google Closure Library archive...
script/get-closure-library: line 34: cd: planck-cljs/lib/closure/goog: No such file or directory
script/get-closure-library: line 59: cd: planck-cljs/lib/third_party/closure/goog: No such file or directory
script/get-closure-library: line 72: planck-cljs/src/planck/bundle/gcl.cljs: No such file or directory
Fetching Build Cache...

so ultimately, this was all because I forgot to install unzip.

mfikes commented 4 years ago

@cellularmitosis Sure set -e would be much better!

cellularmitosis commented 4 years ago

Thanks! PR: https://github.com/planck-repl/planck/pull/1027

pyrmont commented 4 years ago

Will leave this open and set the PR to close it when merged.