Make debug builds instead of -O0 builds.

Rename OPT -> CFG.
Rename LTS -> IMAGE.
Reorder travis jobs.
This commit is contained in:
Pentarctagon 2020-02-26 22:02:42 -06:00 committed by Pentarctagon
parent 8af1d6173e
commit 2f22de2636
4 changed files with 77 additions and 61 deletions

View file

@ -22,42 +22,42 @@ env:
matrix:
include:
- os: windows
env: TOOL=msbuild OPT=Debug BRANCH=master UPLOAD_ID=vs-debug
env: TOOL=msbuild NLS=false BRANCH=master CFG=Debug UPLOAD=true
- os: windows
env: TOOL=msbuild OPT=Release BRANCH=master
env: TOOL=msbuild NLS=false BRANCH=master CFG=Release
- os: osx
compiler: clang
env: TOOL=xcodebuild OPT=Debug NLS=true BRANCH=master UPLOAD_ID=xcode-debug
env: TOOL=xcodebuild NLS=true BRANCH=master CFG=Debug UPLOAD=true
- os: osx
compiler: clang
env: TOOL=xcodebuild OPT=Release NLS=true BRANCH=master
env: TOOL=xcodebuild NLS=true CFG=Release BRANCH=master
- compiler: gcc
env: CXXSTD=14 NLS=only LTS=1604 BRANCH=master
env: TOOL=scons CXXSTD=14 NLS=only IMAGE=1804 BRANCH=master CFG=release
- compiler: gcc
env: TOOL=scons CXXSTD=17 NLS=false LTS=1804 BRANCH=master VALIDATE=true UPLOAD_ID=ubuntu-1804
- compiler: gcc
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: gcc
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1604 BRANCH=master UPLOAD_ID=ubuntu-1604
- compiler: clang
env: TOOL=scons CXXSTD=14 NLS=false LTS=1604 BRANCH=master OPT=-O0
- compiler: clang
env: TOOL=cmake CXXSTD=14 NLS=false LTS=1804 BRANCH=master
- env: CXXSTD=14 NLS=true LTS=mingw BRANCH=master STRICT=false UPLOAD_ID=mingw
- env: TOOL=scons CXXSTD=14 NLS=true IMAGE=mingw BRANCH=master CFG=release STRICT=false UPLOAD=true
- env: CXXSTD=14 NLS=false LTS=steamrt BRANCH=master CC=gcc-5 CXX=g++-5
- env: TOOL=scons CXXSTD=14 NLS=false IMAGE=steamrt BRANCH=master CFG=release CC=gcc-5 CXX=g++-5
- env: NLS=true LTS=flatpak BRANCH=master
- env: TOOL=scons NLS=true IMAGE=flatpak BRANCH=master
- compiler: gcc
env: TOOL=scons CXXSTD=17 NLS=false IMAGE=1804 BRANCH=master CFG=release VALIDATE=true
- compiler: gcc
env: TOOL=scons CXXSTD=14 NLS=false IMAGE=1804 BRANCH=master CFG=debug UPLOAD=true
- compiler: gcc
env: TOOL=cmake CXXSTD=14 NLS=false IMAGE=1804 BRANCH=master CFG=Release
- compiler: clang
env: TOOL=cmake CXXSTD=14 NLS=false IMAGE=1804 BRANCH=master CFG=Debug
- compiler: gcc
env: TOOL=scons CXXSTD=14 NLS=false IMAGE=1604 BRANCH=master CFG=debug UPLOAD=true
install:
- . ./utils/travis/steps/install.sh

View file

@ -11,7 +11,7 @@ die() { error "$*"; exit 1; }
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1024x768x24
if [ "$OPT" == "-O0" ]; then
if [ "$CFG" = "debug" ] || [ "$CFG" = "Debug" ]; then
STRICT="true"
build_timeout=35
else
@ -29,7 +29,7 @@ echo "TOOL: $TOOL"
echo "CC: $CC"
echo "CXX: $CXX"
echo "CXXSTD: $CXXSTD"
echo "OPT: $OPT"
echo "CFG: $CFG"
echo "WML_TESTS: $WML_TESTS"
echo "WML_TEST_TIME: $WML_TEST_TIME"
echo "PLAY_TEST: $PLAY_TEST"
@ -38,7 +38,7 @@ echo "BOOST_TEST: $BOOST_TEST"
echo "LTO: $LTO"
echo "SAN: $SAN"
echo "VALIDATE: $VALIDATE"
echo "LTS: $LTS"
echo "IMAGE: $IMAGE"
echo "TRAVIS_COMMIT: $TRAVIS_COMMIT"
echo "BRANCH: $BRANCH"
echo "UPLOAD_ID: $UPLOAD_ID"
@ -65,7 +65,7 @@ if [ "$NLS" == "only" ]; then
scons translations build=release --debug=time nls=true jobs=2 || exit 1
scons pot-update update-po4a manual
elif [ "$LTS" == "flatpak" ]; then
elif [ "$IMAGE" == "flatpak" ]; then
# docker's --volume means the directory is on a separate filesystem
# flatpak-builder doesn't support this
# therefore manually move stuff between where flatpak needs it and where travis' caching can see it
@ -79,9 +79,9 @@ elif [ "$LTS" == "flatpak" ]; then
cp -R .flatpak-builder/. flatpak-cache/
chmod -R 777 flatpak-cache/
exit $BUILD_RET
elif [ "$LTS" == "mingw" ]; then
scons wesnoth wesnothd build=release \
cxx_std=$CXXSTD opt="$OPT" strict="$STRICT" \
elif [ "$IMAGE" == "mingw" ]; then
scons wesnoth wesnothd build="$CFG" \
cxx_std=$CXXSTD strict="$STRICT" \
nls=false enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
arch=x86-64 prefix=/windows/mingw64 gtkdir=/windows/mingw64 host=x86_64-w64-mingw32 || exit 1
@ -100,19 +100,19 @@ elif [ "$LTS" == "mingw" ]; then
bzip2 wesnoth-$TRAVIS_TAG.tar || exit 1
./utils/travis/sftp wesnoth-$TRAVIS_TAG.tar.bz2 || exit 1
fi
elif [ "$LTS" == "steamrt" ]; then
elif [ "$IMAGE" == "steamrt" ]; then
scons ctool=$CC cxxtool=$CXX boostdir=/usr/local/include boostlibdir=/usr/local/lib extra_flags_config=-lrt \
cxx_std=$CXXSTD opt="$OPT" strict="$STRICT" nls="$NLS" enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
build=release
cxx_std=$CXXSTD strict="$STRICT" nls="$NLS" enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time \
build="$CFG"
else
SECONDS=0
if [ "$TOOL" == "cmake" ]; then
echo "max_size = 200M" > $HOME/.ccache/ccache.conf
echo "compiler_check = content" >> $HOME/.ccache/ccache.conf
export CCACHE_MAXSIZE=3000M
export CCACHE_COMPILERCHECK=content
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS="$NLS" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DOPT="$OPT" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO="$LTO" -DLTO_JOBS=2 -DENABLE_MYSQL=true -DSANITIZE="$SAN" \
cmake -DCMAKE_BUILD_TYPE="$CFG" -DENABLE_GAME=true -DENABLE_SERVER=true -DENABLE_CAMPAIGN_SERVER=true -DENABLE_TESTS=true -DENABLE_NLS="$NLS" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_STRICT_COMPILATION="$STRICT" -DENABLE_LTO="$LTO" -DLTO_JOBS=2 -DENABLE_MYSQL=true -DSANITIZE="$SAN" \
-DCXX_STD="$CXXSTD" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache && \
make VERBOSE=1 -j2
BUILD_RET=$?
@ -120,11 +120,19 @@ else
ccache -s
ccache -z
else
scons wesnoth wesnothd campaignd boost_unit_tests build=release \
scons wesnoth wesnothd campaignd boost_unit_tests build="$CFG" \
ctool=$CC cxxtool=$CXX cxx_std=$CXXSTD \
extra_flags_config="-pipe" opt="$OPT" strict="$STRICT" forum_user_handler=true \
extra_flags_config="-pipe" strict="$STRICT" forum_user_handler=true \
nls="$NLS" enable_lto="$LTO" sanitize="$SAN" jobs=2 --debug=time
BUILD_RET=$?
# rename debug executables to what the tests expect
if [ "$CFG" == "debug" ]; then
mv wesnoth-debug wesnoth
mv wesnothd-debug wesnothd
mv campaignd-debug campaignd
mv boost_unit_tests-debug boost_unit_tests
fi
fi
if [ $BUILD_RET != 0 ]; then
@ -142,7 +150,7 @@ else
# needed since bash returns the exit code of the final command executed, so a failure needs to be returned if any unit tests fail
EXIT_VAL=0
# print given message ($1) and execute given command; sets EXIT_VAL on failure
# print given message ($1) and execute given command; sets EXIT_VAL on failure
execute() {
local message=$1; shift
printf 'Executing %s\n' "$message"

View file

@ -8,7 +8,7 @@ export MP_TEST=true
export WML_TEST_TIME=15
export BOOST_TEST=true
if [ "$OPT" = "-O0" ]; then
if [ "$CFG" = "debug" ] || [ "$CFG" = "Debug" ]; then
export PLAY_TEST=false
export MP_TEST=false
export WML_TEST_TIME=20
@ -18,6 +18,14 @@ if [ "$LTO" == "" ]; then
export LTO=false
fi
if [ "$UPLOAD" == "true" ]; then
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export UPLOAD_ID="${TRAVIS_OS_NAME}-${IMAGE}-${TOOL}-${CFG}"
else
export UPLOAD_ID="${TRAVIS_OS_NAME}-${TOOL}-${CFG}"
fi
fi
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache scons
yes | pip3 install paramiko
@ -48,19 +56,19 @@ elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
echo "Dependencies retrieved and installed!"
fi
./utils/travis/windows-file-hasher.sh "projectfiles/VC14/$OPT/filehashes.sqlite"
./utils/travis/windows-file-hasher.sh "projectfiles/VC14/$CFG/filehashes.sqlite"
else
# if not doing translations, save a bit of time by not copying them into the docker image
# otherwise, if this is the mingw job, the .git directory is needed for running the git archive command
if [ "$NLS" == "false" ]; then
echo "po/" >> .dockerignore
elif [ "$LTS" == "mingw" ]; then
elif [ "$IMAGE" == "mingw" ]; then
rm .dockerignore
fi
echo "FROM wesnoth/wesnoth:$LTS-$BRANCH" > utils/dockerbuilds/travis/Dockerfile-travis-"$LTS"-"$BRANCH"
echo "COPY ./ /home/wesnoth-travis/" >> utils/dockerbuilds/travis/Dockerfile-travis-"$LTS"-"$BRANCH"
echo "WORKDIR /home/wesnoth-travis" >> utils/dockerbuilds/travis/Dockerfile-travis-"$LTS"-"$BRANCH"
echo "FROM wesnoth/wesnoth:$IMAGE-$BRANCH" > utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
echo "COPY ./ /home/wesnoth-travis/" >> utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
echo "WORKDIR /home/wesnoth-travis" >> utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH"
docker build -t wesnoth-repo:"$LTS"-"$BRANCH" -f utils/dockerbuilds/travis/Dockerfile-travis-"$LTS"-"$BRANCH" .
docker build -t wesnoth-repo:"$IMAGE"-"$BRANCH" -f utils/dockerbuilds/travis/Dockerfile-travis-"$IMAGE"-"$BRANCH" .
fi

View file

@ -5,14 +5,14 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
cd ./projectfiles/Xcode
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -project "The Battle for Wesnoth.xcodeproj" -target "The Battle for Wesnoth" -configuration "$OPT"
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -project "The Battle for Wesnoth.xcodeproj" -target "The Battle for Wesnoth" -configuration "$CFG"
BUILD_RET=$?
if [ "$UPLOAD_ID" != "" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# workaround for a bug in hdiutil where it freezes if multiple srcfolder-s are specified
cp -R "build/$OPT/The Battle for Wesnoth.app" "../../packaging/macos/The Battle for Wesnoth.app"
hdiutil create -volname "Wesnoth_${OPT}" -fs 'HFS+' -srcfolder ../../packaging/macos -ov -format UDBZ "Wesnoth_${OPT}.dmg"
./../../utils/travis/sftp "Wesnoth_${OPT}.dmg"
cp -R "build/$CFG/The Battle for Wesnoth.app" "../../packaging/macos/The Battle for Wesnoth.app"
hdiutil create -volname "Wesnoth_${CFG}" -fs 'HFS+' -srcfolder ../../packaging/macos -ov -format UDBZ "Wesnoth_${CFG}.dmg"
./../../utils/travis/sftp "Wesnoth_${CFG}.dmg"
fi
ccache -s
@ -20,7 +20,7 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
exit $BUILD_RET
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
powershell "MSBuild.exe projectfiles/VC14/wesnoth.sln -p:PlatformToolset=v141 -p:Configuration=$OPT"
powershell "MSBuild.exe projectfiles/VC14/wesnoth.sln -p:PlatformToolset=v141 -p:Configuration=$CFG"
BUILD_RET=$?
if [ "$UPLOAD_ID" != "" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
@ -28,12 +28,12 @@ elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
fi
if [ "$BUILD_RET" != "0" ]; then
sqlite3 "projectfiles/VC14/$OPT/filehashes.sqlite" "update FILES set MD5 = OLD_MD5, OLD_MD5 = '-' where OLD_MD5 != '-'"
sqlite3 "projectfiles/VC14/$CFG/filehashes.sqlite" "update FILES set MD5 = OLD_MD5, OLD_MD5 = '-' where OLD_MD5 != '-'"
else
sqlite3 "projectfiles/VC14/$OPT/filehashes.sqlite" "update FILES set OLD_MD5 = '-' where OLD_MD5 != '-'"
sqlite3 "projectfiles/VC14/$CFG/filehashes.sqlite" "update FILES set OLD_MD5 = '-' where OLD_MD5 != '-'"
fi
if [ "$OPT" == "Release" ] && [ "$BUILD_RET" == "0" ]; then
if [ "$CFG" == "Release" ] && [ "$BUILD_RET" == "0" ]; then
./run_wml_tests -g -v -c -t "$WML_TEST_TIME"
BUILD_RET=$?
fi
@ -44,23 +44,23 @@ else
# enabling tty/using unbuffer causes po4a-translate to hang during the translation job
if [ "$NLS" != "only" ]; then
docker run --cap-add=ALL --privileged \
--env SFTP_PASSWORD --env LTS --env TRAVIS_COMMIT --env BRANCH --env UPLOAD_ID --env TRAVIS_PULL_REQUEST --env NLS --env CC --env CXX --env TOOL \
--env CXXSTD --env OPT --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env SFTP_PASSWORD --env IMAGE --env TRAVIS_COMMIT --env BRANCH --env UPLOAD_ID --env TRAVIS_PULL_REQUEST --env NLS --env CC --env CXX --env TOOL \
--env CXXSTD --env CFG --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env TRAVIS_TAG \
--volume "$HOME"/build-cache:/home/wesnoth-travis/build \
--volume "$HOME"/flatpak-cache:/home/wesnoth-travis/flatpak-cache \
--volume "$HOME"/.ccache:/root/.ccache \
--tty wesnoth-repo:"$LTS"-"$BRANCH" \
--tty wesnoth-repo:"$IMAGE"-"$BRANCH" \
unbuffer ./utils/travis/docker_run.sh
else
docker run --cap-add=ALL --privileged \
--env SFTP_PASSWORD --env LTS --env TRAVIS_COMMIT --env BRANCH --env UPLOAD_ID --env TRAVIS_PULL_REQUEST --env NLS --env CC --env CXX --env TOOL \
--env CXXSTD --env OPT --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env SFTP_PASSWORD --env IMAGE --env TRAVIS_COMMIT --env BRANCH --env UPLOAD_ID --env TRAVIS_PULL_REQUEST --env NLS --env CC --env CXX --env TOOL \
--env CXXSTD --env CFG --env WML_TESTS --env WML_TEST_TIME --env PLAY_TEST --env MP_TEST --env BOOST_TEST --env LTO --env SAN --env VALIDATE \
--env TRAVIS_TAG \
--volume "$HOME"/build-cache:/home/wesnoth-travis/build \
--volume "$HOME"/flatpak-cache:/home/wesnoth-travis/flatpak-cache \
--volume "$HOME"/.ccache:/root/.ccache \
wesnoth-repo:"$LTS"-"$BRANCH" \
wesnoth-repo:"$IMAGE"-"$BRANCH" \
./utils/travis/docker_run.sh
fi
fi