From 829cf1821b0b0985a10b57b5a830ade8e4fa7a7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 17 Oct 2020 14:00:17 +0200 Subject: [PATCH 1/4] Adding Ubuntu 18.04 & 20.04 to travis builds --- .travis.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.travis.yml b/.travis.yml index 02d8bfb5..bf59f3f6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,38 @@ matrix: env: - BUILD_TYPE="Debug" + - name: "Ubuntu 18.04 - gcc (Release)" + os: linux + dist: bionic + sudo: required + compiler: gcc + env: + - BUILD_TYPE="Release" + + - name: "Ubuntu 18.04 - gcc (Debug)" + os: linux + dist: bionic + sudo: required + compiler: gcc + env: + - BUILD_TYPE="Debug" + + - name: "Ubuntu 20.04 - gcc (Release)" + os: linux + dist: focal + sudo: required + compiler: gcc + env: + - BUILD_TYPE="Release" + + - name: "Ubuntu 20.04 - gcc (Debug)" + os: linux + dist: focal + sudo: required + compiler: gcc + env: + - BUILD_TYPE="Debug" + - name: "Ubuntu 16.04 - gcc-5.4 with coverage" os: linux dist: xenial From a322e5d00803ffd42a9d1c57cdc502fa407d19a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 17 Oct 2020 16:40:59 +0200 Subject: [PATCH 2/4] CI: Special packages for Ubuntu 20.04 --- ci/install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/install.sh b/ci/install.sh index 91fd7637..599dbce1 100755 --- a/ci/install.sh +++ b/ci/install.sh @@ -2,12 +2,21 @@ set -e # Enables cheking of return values from each command set -x # Prints every command +# This file is only used from Travis CI, where the only Linux distro used is Ubuntu + python --version python3 --version if [[ "$(uname -s)" == 'Linux' ]]; then sudo apt-get update - sudo apt-get install cmake zlib1g-dev libssh-dev python-pip libxml2-utils + + if [[ "$(lsb_release -cs)" == 'focal' ]]; then + # In Ubuntu 20.04 python-pip does not exist. Furthermore we need to have the alias python for python3 + sudo apt-get install cmake zlib1g-dev libssh-dev python3-pip python-is-python3 libxml2-utils + else + sudo apt-get install cmake zlib1g-dev libssh-dev python-pip libxml2-utils + fi + if [ -n "$WITH_VALGRIND" ]; then sudo apt-get install valgrind fi From f1fe122585970c5be5ef01882d3e8e7e25d33d2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 17 Oct 2020 16:56:51 +0200 Subject: [PATCH 3/4] CI: Fix how we pass CMake options in travis --- ci/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/run.sh b/ci/run.sh index 9ebb65a3..b6da9ffe 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -8,21 +8,21 @@ source conan/bin/activate if [[ "$(uname -s)" == 'Linux' ]]; then if [ "$CC" == "clang" ]; then # clang + Ubuntu don't like to run with UBSAN, but ASAN works - export CMAKE_OPTIONS="$CMAKE_OPTIONS" + export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS" elif [ -n "$WITH_VALGRIND" ]; then export EXIV2_VALGRIND="valgrind --quiet" else - export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF" + export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF" fi else - export CMAKE_OPTIONS="$CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF" + export CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DEXIV2_TEAM_USE_SANITIZERS=OFF" fi -CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_CXX_FLAGS=-Wno-deprecated" +CMAKE_OPTIONS="$COMMON_CMAKE_OPTIONS -DCMAKE_CXX_FLAGS=-Wno-deprecated -DCMAKE_CXX_STANDARD=98 -DCMAKE_BUILD_TYPE=$BUILD_TYPE" mkdir build cd build conan install .. -o webready=True --build missing -cmake ${CMAKE_OPTIONS} -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DCMAKE_INSTALL_PREFIX=install .. +cmake ${CMAKE_OPTIONS} .. make -j make tests make install From 9eb058bd43e3db834b0fdb5a4b682bafb8907d3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20D=C3=ADaz=20M=C3=A1s?= Date: Sat, 17 Oct 2020 17:21:23 +0200 Subject: [PATCH 4/4] Modify strncpy0 to avoid warning --- src/ini.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ini.cpp b/src/ini.cpp index f35f18d0..6e4932fa 100755 --- a/src/ini.cpp +++ b/src/ini.cpp @@ -79,7 +79,7 @@ static char* find_chars_or_comment(const char* s, const char* chars) /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ static char* strncpy0(char* dest, const char* src, size_t size) { - strncpy(dest, src, size); + memcpy(dest, src, size); dest[size - 1] = '\0'; return dest; }