From 67b31ac6400833bc7ef33b48e2126d8aca1c5f18 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 11 Oct 2019 09:31:25 +0900 Subject: .travis.yml: factor out common parts --- .travis.yml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 68118423..5cd45ac7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,37 +36,33 @@ matrix: before_install: - eval "${ENV_EVAL}" -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then USE_NINJA="-GNinja"; fi +- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=../install -DCMAKE_INSTALL_PREFIX=../install" +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; fi install: - git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm -- cmake . -Bbuild -DBUILD_SHARED_LIBS=NO -DCMAKE_INSTALL_PREFIX=install -- cmake --build build +- cmake . -Bbuild -DBUILD_SHARED_LIBS=NO $CMAKE_ARGS - cmake --build build --target install - popd - git clone https://github.com/quotient-im/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/gtad.git - pushd gtad -- cmake $USE_NINJA -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} . +- cmake $CMAKE_ARGS . - cmake --build . - popd before_script: -- mkdir build && pushd build -- cmake $USE_NINJA -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_INSTALL_PREFIX=../install -DOlm_DIR=../olm/install/lib/cmake/Olm .. -- cmake --build . --target update-api -- popd +- cmake . -Bbuild -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" $CMAKE_ARGS +- cmake --build build --target update-api script: - cmake --build build --target all - cmake --build build --target install # Build qmc-example with the installed library -- mkdir build-example && pushd build-example -- cmake -DCMAKE_PREFIX_PATH=../install -DOlm_DIR=../olm/install/lib/cmake/Olm ../examples -- cmake --build . --target all -- popd +- cmake examples -Bbuild-example $CMAKE_ARGS +- cmake --build build-example --target all # Build with qmake - qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/install/lib" - make all -- cgit v1.2.3 From a4538e65359ea71f285d352d9cb44bdcdcab7139 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 12 Oct 2019 14:56:12 +0900 Subject: CI: use env variables to group common CMake (and other) values For AppVeyor, skip olm installation as we don't intend to check dynamic linkage. --- .appveyor.yml | 13 +++++-------- .travis.yml | 35 ++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 725adc8c..701028af 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2017 environment: - #DEPLOY_DIR: quotient-%APPVEYOR_BUILD_VERSION% + CMAKE_ARGS: '-G "NMake Makefiles JOM" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo' matrix: - QTDIR: C:\Qt\5.13\msvc2017_64 VCVARS: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" @@ -19,17 +19,14 @@ init: before_build: - git submodule update --init --recursive - git clone https://gitlab.matrix.org/matrix-org/olm.git -- cd olm -- cmake -G "NMake Makefiles JOM" -H. -Bbuild -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install -- cmake --build build -- cmake --build build --target install -- cd .. -- cmake -G "NMake Makefiles JOM" -H. -Bbuild -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX="%DEPLOY_DIR%" -DOlm_DIR="olm/install/lib/cmake/Olm" +- cmake %CMAKE_ARGS% -Holm -Bbuild/olm +- cmake --build build/olm build_script: +- cmake %CMAKE_ARGS% -H. -Bbuild "-DOlm_DIR=build/olm" - cmake --build build # qmake uses olm just built by CMake - it can't build olm on its own. -- qmake "INCLUDEPATH += olm/install/include" "LIBS += -Lbuild" "LIBS += -Lolm/install/lib" && jom +- qmake "INCLUDEPATH += olm/include" "LIBS += -Lbuild" "LIBS += -Lbuild/olm" && jom #after_build: #- cmake --build build --target install diff --git a/.travis.yml b/.travis.yml index 5cd45ac7..db92dc59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,17 @@ addons: - qtmultimedia5-dev - valgrind +env: + global: + - DESTDIR="$TRAVIS_BUILD_DIR/install" + - CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_PREFIX_PATH=$DESTDIR/usr" + - VALGRIND_OPTIONS="--tool=memcheck --leak-check=yes --gen-suppressions=all --suppressions=.valgrind.qmc-example.supp" + # RPM spec-style: swallow a command with default parameters into a variable + # and add/override parameters further in the code if/as necessary + - _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild" + - _CMAKE_BUILD="cmake --build build" + - _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install" + matrix: include: - os: linux @@ -36,15 +47,22 @@ matrix: before_install: - eval "${ENV_EVAL}" -- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=../install -DCMAKE_INSTALL_PREFIX=../install" +#- export DESTDIR=$TRAVIS_BUILD_DIR/install +#- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=${DESTDIR}/install" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; fi +# RPM spec-style: swallow a command with default parameters into a variable +# and add/override parameters further in the code if/as necessary +#- export _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild" +#- export _CMAKE_BUILD="cmake --build build" +#- export _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install" + install: - git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm -- cmake . -Bbuild -DBUILD_SHARED_LIBS=NO $CMAKE_ARGS -- cmake --build build --target install +- $_CMAKE_CONFIG -DBUILD_SHARED_LIBS=NO +- $_CMAKE_BUILD_INSTALL - popd - git clone https://github.com/quotient-im/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/gtad.git @@ -54,17 +72,16 @@ install: - popd before_script: -- cmake . -Bbuild -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" $CMAKE_ARGS -- cmake --build build --target update-api +- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" +- $_CMAKE_BUILD --target update-api script: -- cmake --build build --target all -- cmake --build build --target install +- $_CMAKE_BUILD_INSTALL # Build qmc-example with the installed library -- cmake examples -Bbuild-example $CMAKE_ARGS +- cmake $CMAKE_ARGS examples -Bbuild-example - cmake --build build-example --target all # Build with qmake -- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/install/lib" +- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += $DESTDIR/include" "LIBS += -Lbuild/lib" "LIBS += -L$DESTDIR/lib" - make all # Run the qmake-compiled qmc-example under valgrind - if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="build/lib" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi -- cgit v1.2.3 From 143b7f98664854a3204f7a4395f903d4149b1ca1 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 12 Oct 2019 18:04:09 +0900 Subject: Travis CI: Use built rather than installed olm ...until the patch to fix olm CMake installation is accepted upstream. --- .travis.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index db92dc59..84f83e24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,17 +47,9 @@ matrix: before_install: - eval "${ENV_EVAL}" -#- export DESTDIR=$TRAVIS_BUILD_DIR/install -#- export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_PREFIX_PATH=${DESTDIR}/install" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CMAKE_ARGS="$CMAKE_ARGS -GNinja"; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; fi -# RPM spec-style: swallow a command with default parameters into a variable -# and add/override parameters further in the code if/as necessary -#- export _CMAKE_CONFIG="cmake $CMAKE_ARGS . -Bbuild" -#- export _CMAKE_BUILD="cmake --build build" -#- export _CMAKE_BUILD_INSTALL="$_CMAKE_BUILD --target install" - install: - git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm @@ -72,16 +64,16 @@ install: - popd before_script: -- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" +- $_CMAKE_CONFIG -DMATRIX_DOC_PATH="matrix-doc" -DGTAD_PATH="gtad/gtad" -DOlm_DIR=olm/build - $_CMAKE_BUILD --target update-api script: - $_CMAKE_BUILD_INSTALL # Build qmc-example with the installed library -- cmake $CMAKE_ARGS examples -Bbuild-example +- cmake $CMAKE_ARGS examples -Bbuild-example -DOlm_DIR=olm/build - cmake --build build-example --target all # Build with qmake -- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += $DESTDIR/include" "LIBS += -Lbuild/lib" "LIBS += -L$DESTDIR/lib" +- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/build" - make all # Run the qmake-compiled qmc-example under valgrind - if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="build/lib" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi -- cgit v1.2.3 From a3aa9b5addcc87cfe18c831207f0e97481b0e428 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 13 Oct 2019 16:02:10 +0900 Subject: Travis CI: Build olm as a dynamic object --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84f83e24..3f6aa27d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -53,8 +53,9 @@ before_install: install: - git clone https://gitlab.matrix.org/matrix-org/olm.git - pushd olm -- $_CMAKE_CONFIG -DBUILD_SHARED_LIBS=NO -- $_CMAKE_BUILD_INSTALL +- $_CMAKE_CONFIG +- $_CMAKE_BUILD +#- $_CMAKE_BUILD_INSTALL - popd - git clone https://github.com/quotient-im/matrix-doc.git - git clone --recursive https://github.com/KitsuneRal/gtad.git @@ -76,7 +77,7 @@ script: - qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" "INCLUDEPATH += olm/include" "LIBS += -Lbuild/lib" "LIBS += -Lolm/build" - make all # Run the qmake-compiled qmc-example under valgrind -- if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="build/lib" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi +- if [ "$QMC_TEST_USER" != "" ]; then LD_LIBRARY_PATH="olm/build" $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" qmc-example-travis '#qmc-test:matrix.org' "Travis CI job $TRAVIS_JOB_NUMBER"; fi notifications: webhooks: -- cgit v1.2.3 From e9b4f1223d90428ae79a4a5662dd03bc8cafe01e Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sun, 13 Oct 2019 19:47:04 +0900 Subject: Update Valgrind suppressions --- .valgrind.qmc-example.supp | 110 ++++++--------------------------------------- 1 file changed, 13 insertions(+), 97 deletions(-) diff --git a/.valgrind.qmc-example.supp b/.valgrind.qmc-example.supp index 6f0bf60a..d65fb52e 100644 --- a/.valgrind.qmc-example.supp +++ b/.valgrind.qmc-example.supp @@ -8,27 +8,6 @@ fun:exit } -{ - sendPostedEvents1 - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - fun:_ZN15QtSharedPointer20ExternalRefCountData9getAndRefEPK7QObject - obj:/opt/qt56/lib/libQt5Network.so.* -} - -{ - sendPostedEvents3 - Memcheck:Leak - ... - obj:/opt/qt56/lib/libQt5Network.so.* - fun:_ZN7QObject5eventEP6QEvent - fun:_ZN16QCoreApplication6notifyEP7QObjectP6QEvent - fun:_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent - fun:_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData - obj:/opt/qt56/lib/libQt5Core.so.* -} - { QAuthenticator Memcheck:Leak @@ -37,24 +16,6 @@ fun:_ZN14QAuthenticator6detachEv } -{ - QObject_connect - Memcheck:Leak - match-leak-kinds: possible - ... - obj:/opt/qt56/lib/libQt5Core.so.* - fun:_ZN7QObject7connectEPKS_PKcS1_S3_N2Qt14ConnectionTypeE -} - -{ - QNetworkProxy - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - fun:_ZN13QNetworkProxyC1ENS_9ProxyTypeERK7QStringtS3_S3_ - obj:/opt/qt56/lib/libQt5Network.so.* -} - { QTimer Memcheck:Leak @@ -73,46 +34,6 @@ fun:_ZN17QSslConfigurationC1Ev } -{ - sendPostedEvents6 - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - ... - obj:/opt/qt56/lib/libQt5Network.so.* - fun:_ZN7QObject5eventEP6QEvent - fun:_ZN16QCoreApplication6notifyEP7QObjectP6QEvent - fun:_ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent - fun:_ZN23QCoreApplicationPrivate16sendPostedEventsEP7QObjectiP11QThreadData -} - -{ - QMetaObject_activate_in_QtNetwork - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - ... - obj:/opt/qt56/lib/libQt5Network.so.* - fun:_ZN11QMetaObject8activateEP7QObjectiiPPv -} - -{ - QMapDatabase_from_QtNetwork - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - fun:_ZN12QMapDataBase10createDataEv - obj:/opt/qt56/lib/libQt5Network.so.* -} - -{ - QThread - Memcheck:Leak - match-leak-kinds: possible - ... - fun:_ZN7QThread5startENS_8PriorityE -} - { libcrypto_ASN1 Memcheck:Leak @@ -123,30 +44,25 @@ } { - QObject_from_QtNetwork - Memcheck:Leak - match-leak-kinds: possible - fun:_Znwm - fun:_ZN7QObjectC1EPS_ - obj:/opt/qt56/lib/libQt5Network.so.* -} - -{ - array_new_from_QtNetwork + malloc_from_libcrypto Memcheck:Leak match-leak-kinds: possible - fun:_Znam - obj:/opt/qt56/lib/libQt5Network.so.* + fun:malloc + fun:CRYPTO_malloc + ... + obj:/lib/x86_64-linux-gnu/libcrypto.so.* } { - malloc_from_libcrypto + Slot_activation_from_QtNetwork Memcheck:Leak - match-leak-kinds: possible + match-leak-kinds: definite fun:malloc - fun:CRYPTO_malloc + fun:inflateInit2_ + obj:/*/*/*/libQt5Network.so.* ... - obj:/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 + fun:_ZN11QMetaObject8activateEP7QObjectiiPPv ... - obj:/opt/qt56/lib/libQt5Network.so.* -} + fun:_ZN11QMetaObject8activateEP7QObjectiiPPv + obj:/*/*/*/libQt5Network.so.* +} \ No newline at end of file -- cgit v1.2.3