Skip to content

Commit 026558d

Browse files
committed
Disable UndefinedBehaviorSanitizer in debug build packages.
Debug builds from CI have been crashing because they can't find the UBSan dylib (even though it was in the bundles).
1 parent ae724fe commit 026558d

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ script:
8787
./package.sh || (cat build_and_install.log && travis_terminate 1);
8888
fi
8989
# Install the .pkg.
90-
# TODO: Debug packages are failing to install on Travis, but I can't reproduce the problem locally,
91-
# so temporarily allow debug builds to pass even if the install fails.
92-
- sudo installer -pkg Background-Music-*/BackgroundMusic-*.pkg -target / -verbose -dumplog || [[ "$TRAVIS_TAG" =~ .*DEBUG.* ]]
90+
- sudo installer -pkg Background-Music-*/BackgroundMusic-*.pkg -target / -verbose -dumplog
9391
# Print the installer logs. This only prints the current day's logs.
9492
- echo -en '/var/log/install.log\ntravis_fold:start:install.log\\r'
9593
- grep -A 9999 $(date +%Y-%m-%d) /var/log/install.log

build_and_install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,13 @@ else
662662
ENABLE_ASAN="${ENABLE_ASAN:-NO}"
663663
fi
664664
665+
enableUBSanArg() {
666+
if [[ -n "$ENABLE_UBSAN" ]]; then
667+
echo "-enableUndefinedBehaviorSanitizer"
668+
echo "$ENABLE_UBSAN"
669+
fi
670+
}
671+
665672
# Clean all projects. Done separately to workaround what I think is a bug in Xcode 10.0. If you just
666673
# add "clean" to the other xcodebuild commands, they seem to fail because of the DSTROOT="/" arg.
667674
if [[ "${CLEAN}" != "" ]]; then
@@ -714,6 +721,7 @@ echo "[1/3] ${ACTIONING} the virtual audio device $(bold_face ${DRIVER_DIR}) to"
714721
${SUDO} "${XCODEBUILD}" -scheme "Background Music Device" \
715722
-configuration ${CONFIGURATION} \
716723
-enableAddressSanitizer ${ENABLE_ASAN} \
724+
$(enableUBSanArg) \
717725
$(archivePath BGMDriver) \
718726
BUILD_DIR=./build \
719727
RUN_CLANG_STATIC_ANALYZER=0 \
@@ -743,6 +751,7 @@ xpcHelperInstallPathArg() {
743751
${SUDO} "${XCODEBUILD}" -scheme BGMXPCHelper \
744752
-configuration ${CONFIGURATION} \
745753
-enableAddressSanitizer ${ENABLE_ASAN} \
754+
$(enableUBSanArg) \
746755
$(archivePath BGMXPCHelper) \
747756
BUILD_DIR=./build \
748757
RUN_CLANG_STATIC_ANALYZER=0 \
@@ -764,6 +773,7 @@ echo "[3/3] ${ACTIONING} $(bold_face ${APP_DIR}) to $(bold_face ${APP_PATH})" \
764773
${SUDO} "${XCODEBUILD}" -scheme "Background Music" \
765774
-configuration ${CONFIGURATION} \
766775
-enableAddressSanitizer ${ENABLE_ASAN} \
776+
$(enableUBSanArg) \
767777
$(archivePath BGMApp) \
768778
BUILD_DIR=./build \
769779
RUN_CLANG_STATIC_ANALYZER=0 \

package.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,14 @@ if [[ $packaging_operation == "repackage" ]]; then
8989
elif [[ $packaging_operation == "make_debug_package" ]]; then
9090
# Build using the debug configuration.
9191
#
92-
# Disable AddressSanitizer so we can distribute debug packages to users reporting bugs without
93-
# worrying about loading the AddressSanitizer dylib in coreaudiod.
92+
# Disable AddressSanitizer and UndefinedBehaviorSanitizer so we can distribute debug packages to
93+
# users without worrying about loading the AddressSanitizer and UndefinedBehaviorSanitizer
94+
# dylibs in coreaudiod. We've also had issues loading those dylibs in the other binaries when
95+
# the binaries were built on other systems.
9496
#
9597
# TODO: Would debug packages be more useful if they were built with optimization (i.e. using the
9698
# DebugOpt configuration instead of Debug)?
97-
ENABLE_ASAN=NO bash build_and_install.sh -b -d
99+
ENABLE_ASAN=NO ENABLE_UBSAN=NO bash build_and_install.sh -b -d
98100
build_status=$?
99101

100102
# Set the paths to the build products (i.e. the bundles).

0 commit comments

Comments
 (0)