Skip to content

Commit

Permalink
chore(ci): Windows docker build fixes
Browse files Browse the repository at this point in the history
* Fix unit tests not running in windows build
* Fix missing comment ports from old build script
  • Loading branch information
sphaerophoria authored and anthonybilinski committed Feb 17, 2022
1 parent 1bc72ab commit 1288a0a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ jobs:
with:
docker_image_name: windows_builder
- name: Run build
run: docker-compose run --rm windows_builder ./windows/cross-compile/build.sh --arch x86_64 --build-type ${{ matrix.build_type }} --src-dir /qtox
run: docker-compose run --rm windows_builder ./windows/cross-compile/build.sh --arch x86_64 --build-type ${{ matrix.build_type }} --run-tests --src-dir /qtox
- name: Upload installer
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -398,7 +398,7 @@ jobs:
with:
docker_image_name: windows_builder.i686
- name: Run build
run: docker-compose run --rm windows_builder.i686 ./windows/cross-compile/build.sh --arch i686 --build-type ${{ matrix.build_type }} --src-dir /qtox
run: docker-compose run --rm windows_builder.i686 ./windows/cross-compile/build.sh --arch i686 --build-type ${{ matrix.build_type }} --run-tests --src-dir /qtox
- name: Upload installer
uses: actions/upload-artifact@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/build_openssl_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fi
--openssldir=/windows/ssl \
shared \
$OPENSSL_ARCH \
--cross-compile-prefix=${ARCH}-w64-mingw32- && \
--cross-compile-prefix=${ARCH}-w64-mingw32-

make -j $(nproc)
make install
3 changes: 3 additions & 0 deletions buildscripts/build_vpx_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ fi

"$(dirname "$0")"/download/download_vpx.sh

# There is a bug in gcc that breaks avx512 on 64-bit Windows https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
# VPX fails to build due to it.
# This is a workaround as suggested in https://stackoverflow.com/questions/43152633
if [ "${ARCH}" == "x86_64" ]; then
ARCH_FLAGS="-fno-asynchronous-unwind-tables"
VPX_ARCH="x86_64-win64-gcc"
Expand Down
1 change: 1 addition & 0 deletions buildscripts/download/download_nsisshellexecasuser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ NSISSHELLEXECASUSER_HASH=8fc19829e144716a422b15a85e718e1816fe561de379b2b5ae87ef9

source "$(dirname "$0")/common.sh"

# Backup: https://web.archive.org/web/20171008011417/http://nsis.sourceforge.net/mediawiki/images/c/c7/ShellExecAsUser.zip
download_file http://nsis.sourceforge.net/mediawiki/images/c/c7/ShellExecAsUser.zip

if ! check_sha256 "$NSISSHELLEXECASUSER_HASH" ShellExecAsUser.zip; then
Expand Down
1 change: 1 addition & 0 deletions buildscripts/download/download_opus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
set -euo pipefail

OPUS_VERSION=1.3.1
# https://archive.mozilla.org/pub/opus/SHA256SUMS.txt
OPUS_HASH=65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d

source "$(dirname "$0")"/common.sh
Expand Down
3 changes: 3 additions & 0 deletions buildscripts/patches/vpx.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Fix VPX not supporting creation of dll
Modified version of https://aur.archlinux.org/cgit/aur.git/tree/configure.patch?h=mingw-w64-libvpx&id=6d658aa0f4d8409fcbd0f20be2c0adcf1e81a297

diff -ruN libvpx/build/make/configure.sh patched/build/make/configure.sh
--- libvpx/build/make/configure.sh 2019-02-13 16:56:48.972857636 +0100
+++ patched/build/make/configure.sh 2019-02-13 16:50:37.995967583 +0100
Expand Down
8 changes: 6 additions & 2 deletions windows/cross-compile/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@

set -euo pipefail

RUN_TESTS=0

while (( $# > 0 )); do
case $1 in
--src-dir) QTOX_SRC_DIR=$2; shift 2 ;;
--arch) ARCH=$2; shift 2 ;;
--run-tests) RUN_TESTS=1; shift ;;
--build-type) BUILD_TYPE=$2; shift 2;;
*) "Unexpected argument $1"; exit 1 ;;
esac
Expand Down Expand Up @@ -86,6 +88,7 @@ then
-DDESKTOP_NOTIFICATIONS=ON \
-DUPDATE_CHECK=ON \
-DSTRICT_OPTIONS=ON \
-DTEST_CROSSCOMPILING_EMULATOR=wine \
"$QTOX_SRC_DIR"
elif [[ "$BUILD_TYPE" == "debug" ]]
then
Expand All @@ -96,6 +99,7 @@ then
-DDESKTOP_NOTIFICATIONS=ON \
-DUPDATE_CHECK=ON \
-DSTRICT_OPTIONS=ON \
-DTEST_CROSSCOMPILING_EMULATOR=wine \
"$QTOX_SRC_DIR"
fi

Expand All @@ -105,9 +109,9 @@ mkdir -p "${QTOX_PREFIX_DIR}"
cp qtox.exe $QTOX_PREFIX_DIR
cp -r /export/* $QTOX_PREFIX_DIR

# Run tests (only on Travis)
# Run tests
set +u
if [[ -n "$TRAVIS_CI_STAGE" ]]
if [[ $RUN_TESTS -ne 0 ]]
then
export WINEPATH='/export;/windows/bin'
export CTEST_OUTPUT_ON_FAILURE=1
Expand Down

0 comments on commit 1288a0a

Please sign in to comment.