Remove error emailing, just print all errors to console and exit

This commit is contained in:
baldurk
2018-11-28 11:21:19 +00:00
parent b89a8295cf
commit b147041581
4 changed files with 33 additions and 108 deletions
-10
View File
@@ -3,7 +3,6 @@
TYPE=""
SNAPNAME=""
SYMSTORE=""
ERRORMAIL=""
SKIPCOMPILE=""
LLVM_ARM32=$(readlink -f $(dirname $0)/support/llvm_arm32)
LLVM_ARM64=$(readlink -f $(dirname $0)/support/llvm_arm64)
@@ -14,7 +13,6 @@ usage() {
echo " --symstore <symbol store> [Windows only] Specify a path to a symbol store.";
echo " --llvm_arm32 <path> Give the path to an ARM32 build of LLVM, for android.";
echo " --llvm_arm64 <path> Give the path to an ARM64 build of LLVM, for android.";
echo " --errormail <email> Send emails on error";
echo " --skipcompile Skip compile steps, package already compiled binaries.";
}
@@ -50,12 +48,6 @@ while [[ $# -gt 0 ]]; do
shift
;;
--errormail)
ERRORMAIL="$2"
shift
shift
;;
--skipcompile)
SKIPCOMPILE="yes"
shift
@@ -96,8 +88,6 @@ if [[ "$SYMSTORE" != "" ]]; then
export SYMSTORE;
fi
export ERRORMAIL;
echo "Using ARM32 LLVM from '$LLVM_ARM32' and ARM64 from '$LLVM_ARM64'"
export LLVM_ARM32;
+14 -30
View File
@@ -1,26 +1,23 @@
#!/bin/bash
rm -f /tmp/compile_errors /tmp/error_email
# Store the path to the error-mail script
ERROR_SCRIPT=$(readlink -f "${BUILD_ROOT}"/scripts/errormail.sh)
echo "Building renderdoc-build docker image"
# Ensure the docker image is prepared
pushd "${BUILD_ROOT}"/scripts/docker
docker build -t renderdoc-build .
popd
echo "Docker image built. Running build"
# Run the docker compilation script inside the container above to build the main renderdoc project
mkdir -p /tmp/rdoc_docker
cp "${BUILD_ROOT}"/scripts/compile_docker.sh /tmp/rdoc_docker
docker run --rm -v /tmp/rdoc_docker:/io -v $(readlink -f "${REPO_ROOT}"):/renderdoc:ro renderdoc-build bash /io/compile_docker.sh 2>&1 | tee /tmp/compile_errors
docker run --rm -v /tmp/rdoc_docker:/io -v $(readlink -f "${REPO_ROOT}"):/renderdoc:ro renderdoc-build bash /io/compile_docker.sh
if [ -d /tmp/rdoc_docker/dist ]; then
echo "No error.";
echo "Build successful.";
else
echo "Error encountered.";
iconv -f UTF-8 -t ASCII//translit /tmp/compile_errors > /tmp/error_email
$ERROR_SCRIPT /tmp/error_email
echo "Error encountered during docker build.";
exit 1;
fi
@@ -43,20 +40,13 @@ cp -R /tmp/rdoc_docker/pymodules build/bin
# Step into the docs folder and build
pushd docs
make clean
make html > /tmp/sphinx.log
if [ $? -ne 0 ]; then
$ERROR_SCRIPT /tmp/sphinx.log
exit 1;
fi
make html
popd; # docs
# if we didn't produce an html file, bail out even if sphinx didn't return an error code above
if [ ! -f ./Documentation/html/index.html ]; then
echo >> /tmp/sphinx.log
echo "Didn't auto-build html docs." >> /tmp/sphinx.log
$ERROR_SCRIPT /tmp/sphinx.log
echo "Didn't get successful build of html docs."
exit 1;
fi
@@ -65,16 +55,12 @@ export PATH=$PATH:$ANDROID_SDK/tools/
# Check that we're set up to build for android
if [ ! -d $ANDROID_SDK/tools ] ; then
echo "\$ANDROID_SDK is not correctly configured: '$ANDROID_SDK'" >> /tmp/android.log
$ERROR_SCRIPT /tmp/android.log
# Don't return an error code, consider android errors non-fatal other than emailing
echo "\$ANDROID_SDK is not correctly configured: '$ANDROID_SDK'"
exit 0;
fi
if [ ! -d $LLVM_ARM32 ] || [ ! -d $LLVM_ARM64 ] ; then
echo "llvm is not available, expected $LLVM_ARM32 and $LLVM_ARM64 respectively." >> /tmp/android.log
$ERROR_SCRIPT /tmp/android.log
# Don't return an error code, consider android errors non-fatal other than emailing
echo "llvm is not available, expected $LLVM_ARM32 and $LLVM_ARM64 respectively."
exit 0;
fi
@@ -86,9 +72,8 @@ cmake -DBUILD_ANDROID=1 -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=23
make -j8
if ! ls bin/*.apk; then
echo >> /tmp/cmake.log
echo "Failed to build android?" >> /tmp/cmake.log
$ERROR_SCRIPT /tmp/cmake.log
echo "Android build failed"
exit 0;
fi
popd # build-android-arm32
@@ -100,9 +85,8 @@ cmake -DBUILD_ANDROID=1 -DANDROID_ABI=arm64-v8a -DANDROID_NATIVE_API_LEVEL=23 -D
make -j8
if ! ls bin/*.apk; then
echo >> /tmp/cmake.log
echo "Failed to build android?" >> /tmp/cmake.log
$ERROR_SCRIPT /tmp/cmake.log
echo "Android build failed"
exit 0;
fi
popd # build-android-arm64
+19 -50
View File
@@ -2,43 +2,28 @@
mkdir -p "${REPO_ROOT}/dist"
# Get the logfile as a windows path
LOGFILE=$(cd ${REPO_ROOT}/dist && cmd.exe /C cd | tr -d '[:space:]')/MSBuild.log
echo "Building, log in ${LOGFILE}"
# Store the path to the error-mail script
ERROR_SCRIPT=$(readlink -f "${BUILD_ROOT}"/scripts/errormail.sh)
# pushd into the git checkout
pushd "${REPO_ROOT}"
# Build 32-bit Release
MSYS2_ARG_CONV_EXCL="*" msbuild.exe /nologo /fl4 /flp4':Verbosity=minimal;Encoding=ASCII;logfile='"${LOGFILE}" renderdoc.sln /t:Rebuild /p:'Configuration=Release;Platform=x86'
if [ $? -ne 0 ]; then
$ERROR_SCRIPT /tmp/MSbuild.log
exit 1;
fi
MSYS2_ARG_CONV_EXCL="*" msbuild.exe /nologo /fl4 /flp4':Verbosity=minimal;Encoding=ASCII' renderdoc.sln /t:Rebuild /p:'Configuration=Release;Platform=x86'
# Build 64-bit Release
MSYS2_ARG_CONV_EXCL="*" msbuild.exe /nologo /fl4 /flp4':Verbosity=minimal;Encoding=ASCII;logfile='"${LOGFILE}" renderdoc.sln /t:Rebuild /p:'Configuration=Release;Platform=x64'
if [ $? -ne 0 ]; then
$ERROR_SCRIPT /tmp/MSbuild.log
exit 1;
fi
MSYS2_ARG_CONV_EXCL="*" msbuild.exe /nologo /fl4 /flp4':Verbosity=minimal;Encoding=ASCII' renderdoc.sln /t:Rebuild /p:'Configuration=Release;Platform=x64'
# Step into the docs folder and build
pushd docs
./make.sh clean
./make.sh htmlhelp > /tmp/sphinx.log
if [ $? -ne 0 ]; then
$ERROR_SCRIPT /tmp/sphinx.log
exit 1;
fi
./make.sh htmlhelp
popd; # docs
# if we didn't produce a chm file, bail out even if sphinx didn't return an error code above
if [ ! -f ./Documentation/htmlhelp/renderdoc.chm ]; then
echo "Didn't auto-build chm file. Missing HTML Help Workshop?"
exit 1;
fi
# Transform ANDROID_SDK / ANDROID_NDK to native paths if needed
if echo "${ANDROID_SDK}" | grep -q :; then
NATIVE_ANDROID_SDK_PATH=$(echo "${ANDROID_SDK}" | sed -e '{s#^\(.\):[/\]#\1/#g}' | tr '\\' '/')
@@ -56,22 +41,12 @@ if echo "${ANDROID_NDK}" | grep -q :; then
export ANDROID_NDK
fi
# if we didn't produce a chm file, bail out even if sphinx didn't return an error code above
if [ ! -f ./Documentation/htmlhelp/renderdoc.chm ]; then
echo >> /tmp/sphinx.log
echo "Didn't auto-build chm file. Missing HTML Help Workshop?" >> /tmp/sphinx.log
$ERROR_SCRIPT /tmp/sphinx.log
exit 1;
fi
export PATH=$PATH:"${ANDROID_SDK}/tools"
# Check that we're set up to build for android
if [ ! -d "${ANDROID_SDK}"/tools ] ; then
echo "\$ANDROID_SDK is not correctly configured: '$ANDROID_SDK'" > /tmp/android.log
cat /tmp/android.log
$ERROR_SCRIPT /tmp/android.log
# Don't return an error code, consider android errors non-fatal other than emailing
echo "\$ANDROID_SDK is not correctly configured: '$ANDROID_SDK'"
# Don't return an error code, consider android errors non-fatal
exit 0;
fi
@@ -86,10 +61,8 @@ if ! which make > /dev/null 2>&1; then
fi
if [ ! -d $LLVM_ARM32 ] || [ ! -d $LLVM_ARM64 ] ; then
echo "llvm is not available, expected $LLVM_ARM32 and $LLVM_ARM64 respectively." > /tmp/android.log
cat /tmp/android.log
$ERROR_SCRIPT /tmp/android.log
# Don't return an error code, consider android errors non-fatal other than emailing
echo "llvm is not available, expected $LLVM_ARM32 and $LLVM_ARM64 respectively."
# Don't return an error code, consider android errors non-fatal
exit 0;
fi
@@ -115,13 +88,11 @@ else
mkdir -p build-android-arm32
pushd build-android-arm32
cmake -G "${GENERATOR}" -DBUILD_ANDROID=1 -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DSTRIP_ANDROID_LIBRARY=On -DLLVM_DIR=$LLVM_ARM32/lib/cmake/llvm -DUSE_INTERCEPTOR_LIB=On .. 2>&1 | tee /tmp/cmake.log
make -j$(nproc) 2>&1 | tee -a /tmp/cmake.log
cmake -G "${GENERATOR}" -DBUILD_ANDROID=1 -DANDROID_ABI=armeabi-v7a -DCMAKE_BUILD_TYPE=Release -DSTRIP_ANDROID_LIBRARY=On -DLLVM_DIR=$LLVM_ARM32/lib/cmake/llvm -DUSE_INTERCEPTOR_LIB=On ..
make -j$(nproc)
if ! ls bin/*.apk; then
echo >> /tmp/cmake.log
echo "Failed to build android?" >> /tmp/cmake.log
$ERROR_SCRIPT /tmp/cmake.log
echo "Android build failed"
fi
popd # build-android-arm32
@@ -137,13 +108,11 @@ else
mkdir -p build-android-arm64
pushd build-android-arm64
cmake -G "${GENERATOR}" -DBUILD_ANDROID=1 -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DSTRIP_ANDROID_LIBRARY=On -DLLVM_DIR=$LLVM_ARM64/lib/cmake/llvm -DUSE_INTERCEPTOR_LIB=On .. | tee /tmp/cmake.log
make -j$(nproc) 2>&1 | tee -a /tmp/cmake.log
cmake -G "${GENERATOR}" -DBUILD_ANDROID=1 -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DSTRIP_ANDROID_LIBRARY=On -DLLVM_DIR=$LLVM_ARM64/lib/cmake/llvm -DUSE_INTERCEPTOR_LIB=On ..
make -j$(nproc)
if ! ls bin/*.apk; then
echo >> /tmp/cmake.log
echo "Failed to build android?" >> /tmp/cmake.log
$ERROR_SCRIPT /tmp/cmake.log
echo "Android build failed"
fi
popd # build-android-arm64
-18
View File
@@ -1,18 +0,0 @@
#!/bin/bash
EMAIL_BODY_FILE=$1
if [[ "$ERRORMAIL" == "" ]]; then
exit 0;
fi
SUBJECT="[renderdoc] Compile error on $PLATFORM"
EMAILHOST="${BUILD_ROOT}"/support/emailhost
if [ -f "${EMAILHOST}" ]; then
ssh $(cat "${EMAILHOST}") "mail -s \"$SUBJECT\" $ERRORMAIL" < $EMAIL_BODY_FILE
exit;
else
mail -s "$SUBJECT" $ERRORMAIL < $EMAIL_BODY_FILE
fi