Skip to content

Fix #1437: handle build failure in bin/dotc. #1438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,26 @@ function find_jar {
echo "$artifact"
}

# Log used to communicate errors from a command substitution, for example:
# $(sbt package || (echo msg >> $ERROR_LOG; kill -SIGTERM $$))
ERROR_LOG=error.log
trap onTerminate SIGTERM

onTerminate() {
if [ -f $ERROR_LOG ]; then
cat $ERROR_LOG
rm -f $ERROR_LOG
fi
exit 1 # $? is lost from subprocess in command substitution.
}

function build_jar {
# Usage:
# build_jar package path/to/jar/dir ['/some/sed/command']
#
# Last arg is optional
cd $DOTTY_ROOT >& /dev/null
local build_output=$(sbt "$1")
local build_output=$(sbt "$1" || (echo "failed to run: sbt $1" >> $ERROR_LOG; kill -SIGTERM $$))
local jar=$(echo $build_output | sed -n 's/.*Packaging //g; s/ \.\.\..*//g; /^\/.*/p')

local sedjar="$3"
Expand Down