aboutsummaryrefslogtreecommitdiffstats
path: root/build/ci
diff options
context:
space:
mode:
Diffstat (limited to 'build/ci')
-rwxr-xr-xbuild/ci/build.sh34
-rw-r--r--build/ci/cirrus_ci/Dockerfile.cygwin4
-rw-r--r--build/ci/cirrus_ci/Dockerfile.fc293
-rw-r--r--build/ci/cirrus_ci/Dockerfile.fc29.distcheck3
-rw-r--r--build/ci/cirrus_ci/Dockerfile.mingw8
-rw-r--r--build/ci/cirrus_ci/Dockerfile.msvc9
-rw-r--r--build/ci/cirrus_ci/Dockerfile.windows12
-rwxr-xr-xbuild/ci/cirrus_ci/ci.cmd122
-rwxr-xr-xbuild/ci/cirrus_ci/ci.sh (renamed from build/ci/cirrus_ci.sh)11
-rwxr-xr-xbuild/ci/travis_ci.sh3
10 files changed, 202 insertions, 7 deletions
diff --git a/build/ci/build.sh b/build/ci/build.sh
index d61336eafb0e..64eb07fb23aa 100755
--- a/build/ci/build.sh
+++ b/build/ci/build.sh
@@ -8,11 +8,13 @@
# SRCDIR= # source directory
# CONFIGURE_ARGS= # configure arguments
# MAKE_ARGS= # make arguments
+# DEBUG= # set -g -fsanitize=address flags
ACTIONS=
if [ -n "${BUILD_SYSTEM}" ]; then
BS="${BUILD_SYSTEM}"
fi
+
BS="${BS:-autotools}"
MAKE="${MAKE:-make}"
CMAKE="${CMAKE:-cmake}"
@@ -21,7 +23,7 @@ SRCDIR="${SRCDIR:-`pwd`}"
RET=0
usage () {
- echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test ] [ -a ... ] [ -d builddir ] [-s srcdir ]"
+ echo "Usage: $0 [-b autotools|cmake] [-a autogen|configure|build|test|install|distcheck ] [ -a ... ] [ -d builddir ] [-s srcdir ]"
}
inputerror () {
echo $1
@@ -36,6 +38,8 @@ while getopts a:b:d:s: opt; do
configure) ;;
build) ;;
test) ;;
+ install) ;;
+ distcheck) ;;
*) inputerror "Invalid action (-a)" ;;
esac
ACTIONS="${ACTIONS} ${OPTARG}"
@@ -58,8 +62,25 @@ while getopts a:b:d:s: opt; do
;;
esac
done
+if [ -z "${MAKE_ARGS}" ]; then
+ if [ "${BS}" = "autotools" ]; then
+ MAKE_ARGS="V=1"
+ elif [ "${BS}" = "cmake" ]; then
+ MAKE_ARGS="VERBOSE=1"
+ fi
+fi
+if [ -n "${DEBUG}" ]; then
+ if [ -n "${CFLAGS}" ]; then
+ export CFLAGS="${CFLAGS} -g -fsanitize=address"
+ else
+ export CFLAGS="-g -fsanitize=address"
+ fi
+ if ["${BS}" = "cmake" ]; then
+ CONFIGURE_ARGS="${CONFIGURE_ARGS} -DCMAKE_C_CFLAGS=-g -fsanitize=address"
+ fi
+fi
if [ -z "${ACTIONS}" ]; then
- ACTIONS="autogen configure build test"
+ ACTIONS="autogen configure build test install"
fi
if [ -z "${BS}" ]; then
inputerror "Missing build system (-b) parameter"
@@ -103,6 +124,15 @@ for action in ${ACTIONS}; do
RET="$?"
find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \;
;;
+ install)
+ ${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir"
+ RET="$?"
+ cd ${BUILDDIR}/destdir && ls -lR .
+ ;;
+ distcheck)
+ ${MAKE} ${MAKE_ARGS} distcheck
+ RET="$?"
+ ;;
esac
if [ "${RET}" != "0" ]; then
exit "${RET}"
diff --git a/build/ci/cirrus_ci/Dockerfile.cygwin b/build/ci/cirrus_ci/Dockerfile.cygwin
new file mode 100644
index 000000000000..453503e0301c
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.cygwin
@@ -0,0 +1,4 @@
+FROM cirrusci/windowsservercore:2019
+
+RUN choco install -y --no-progress cygwin
+RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
diff --git a/build/ci/cirrus_ci/Dockerfile.fc29 b/build/ci/cirrus_ci/Dockerfile.fc29
new file mode 100644
index 000000000000..d88176b174d8
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.fc29
@@ -0,0 +1,3 @@
+FROM fedora:29
+
+RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel
diff --git a/build/ci/cirrus_ci/Dockerfile.fc29.distcheck b/build/ci/cirrus_ci/Dockerfile.fc29.distcheck
new file mode 100644
index 000000000000..4470b5c39168
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.fc29.distcheck
@@ -0,0 +1,3 @@
+FROM fedora:29
+
+RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel libzip-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel groff ghostscript
diff --git a/build/ci/cirrus_ci/Dockerfile.mingw b/build/ci/cirrus_ci/Dockerfile.mingw
new file mode 100644
index 000000000000..f14bb0bc73bd
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.mingw
@@ -0,0 +1,8 @@
+FROM cirrusci/windowsservercore:2019
+
+RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake
+RUN choco install -y --no-progress mingw
+RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz
+RUN tar -x -f zlib-1.2.11.tar.gz
+RUN cd zlib-1.2.11 && cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . && mingw32-make && mingw32-make install
+RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz
diff --git a/build/ci/cirrus_ci/Dockerfile.msvc b/build/ci/cirrus_ci/Dockerfile.msvc
new file mode 100644
index 000000000000..c98318289217
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.msvc
@@ -0,0 +1,9 @@
+FROM cirrusci/windowsservercore:2019
+
+RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake
+RUN choco install -y --no-progress visualstudio2017community
+RUN choco install -y --no-progress visualstudio2017-workload-vctools
+RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz
+RUN tar -x -f zlib-1.2.11.tar.gz
+RUN cd zlib-1.2.11 && cmake -G "Visual Studio 15 2017" . && cmake --build . --target ALL_BUILD --config Release && cmake --build . --target INSTALL --config Release
+RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz
diff --git a/build/ci/cirrus_ci/Dockerfile.windows b/build/ci/cirrus_ci/Dockerfile.windows
new file mode 100644
index 000000000000..34d6d32a7af6
--- /dev/null
+++ b/build/ci/cirrus_ci/Dockerfile.windows
@@ -0,0 +1,12 @@
+FROM cirrusci/windowsservercore:2019
+
+RUN choco install -y --no-progress mingw
+RUN choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=User' cmake
+RUN choco install -y --no-progress visualstudio2017community
+RUN choco install -y --no-progress visualstudio2017-workload-vctools
+RUN curl -o zlib-1.2.11.tar.gz https://www.zlib.net/zlib-1.2.11.tar.gz
+RUN tar -x -f zlib-1.2.11.tar.gz
+RUN cd zlib-1.2.11 && cmake -G "Visual Studio 15 2017" . && cmake --build . --target ALL_BUILD --config Release && cmake --build . --target INSTALL --config Release
+RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz
+RUN choco install -y --no-progress cygwin
+RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
diff --git a/build/ci/cirrus_ci/ci.cmd b/build/ci/cirrus_ci/ci.cmd
new file mode 100755
index 000000000000..654d704860ff
--- /dev/null
+++ b/build/ci/cirrus_ci/ci.cmd
@@ -0,0 +1,122 @@
+@ECHO OFF
+SET ZLIB_VERSION=1.2.11
+IF NOT "%BE%"=="cygwin-gcc" (
+ IF NOT "%BE%"=="mingw-gcc" (
+ IF NOT "%BE%"=="msvc" (
+ ECHO Environment variable BE must be cygwin-gcc, mingw-gcc or msvc
+ EXIT /b 1
+ )
+ )
+)
+
+IF "%1%"=="prepare" (
+ IF "%BE%"=="cygwin-gcc" (
+ @ECHO ON
+ choco install -y --no-progress cygwin || EXIT /b 1
+ C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel || EXIT /b 1
+ @EXIT /b 0
+ ) ELSE IF "%BE%"=="mingw-gcc" (
+ @ECHO ON
+ choco install -y --no-progress mingw || EXIT /b 1
+ choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=System' cmake || EXIT /b 1
+ @EXIT /b 0
+ ) ELSE IF "%BE%"=="msvc" (
+ @ECHO ON
+ choco install -y --no-progress visualstudio2017community || EXIT /b 1
+ choco install -y --no-progress visualstudio2017-workload-vctools || EXIT /b 1
+ choco install -y --no-progress --installargs 'ADD_CMAKE_TO_PATH=System' cmake || EXIT /b 1
+ )
+) ELSE IF "%1"=="deplibs" (
+ IF "%BE%"=="cygwin-gcc" (
+ ECHO Skipping on this platform
+ EXIT /b 0
+ )
+ IF NOT EXIST build_ci\libs (
+ MKDIR build_ci\libs
+ )
+ CD build_ci\libs
+ IF NOT EXIST zlib-%ZLIB_VERSION%.tar.gz (
+ curl -o zlib-%ZLIB_VERSION%.tar.gz https://www.zlib.net/zlib-%ZLIB_VERSION%.tar.gz
+ )
+ IF NOT EXIST zlib-%ZLIB_VERSION% (
+ tar -x -z -f zlib-%ZLIB_VERSION%.tar.gz
+ )
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ CD zlib-%ZLIB_VERSION%
+ IF "%BE%"=="mingw-gcc" (
+ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
+ mingw32-make || EXIT /b 1
+ mingw32-make test || EXIT /b 1
+ mingw32-make install || EXIT /b 1
+ ) ELSE IF "%BE%"=="msvc" (
+ cmake -G "Visual Studio 15 2017" . || EXIT /b 1
+ cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
+ cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
+ cmake --build . --target INSTALL --config Release || EXIT /b 1
+ )
+) ELSE IF "%1%"=="configure" (
+ IF "%BE%"=="cygwin-gcc" (
+ SET BS=cmake
+ SET CONFIGURE_ARGS=-DENABLE_ACL=OFF
+ C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a configure" || EXIT /b 1
+ ) ELSE IF "%BE%"=="mingw-gcc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ MKDIR build_ci\cmake
+ CD build_ci\cmake
+ cmake -G "MinGW Makefiles" ..\.. || EXIT /b 1
+ ) ELSE IF "%BE%"=="msvc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ MKDIR build_ci\cmake
+ CD build_ci\cmake
+ cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" ..\.. || EXIT /b 1
+ )
+) ELSE IF "%1%"=="build" (
+ IF "%BE%"=="cygwin-gcc" (
+ SET BS=cmake
+ C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a build"
+ ) ELSE IF "%BE%"=="mingw-gcc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ CD build_ci\cmake
+ mingw32-make || EXIT /b 1
+ ) ELSE IF "%BE%"=="msvc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ CD build_ci\cmake
+ cmake --build . --target ALL_BUILD --config Release
+ )
+) ELSE IF "%1%"=="test" (
+ IF "%BE%"=="cygwin-gcc" (
+ ECHO "Skipping tests on this platform"
+ EXIT /b 0
+ REM SET BS=cmake
+ REM SET SKIP_TEST_SPARSE=1
+ REM C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a test"
+ ) ELSE IF "%BE%"=="mingw-gcc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ COPY "C:\Program Files (x86)\zlib\bin\libzlib.dll" build_ci\cmake\bin\
+ CD build_ci\cmake
+ SET SKIP_TEST_SPARSE=1
+ mingw32-make test
+ ) ELSE IF "%BE%"=="msvc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ ECHO "Skipping tests on this platform"
+ EXIT /b 0
+ REM CD build_ci\cmake
+ REM cmake --build . --target RUN_TESTS --config Release
+ )
+) ELSE IF "%1%"=="install" (
+ IF "%BE%"=="cygwin-gcc" (
+ SET BS=cmake
+ C:\tools\cygwin\bin\bash.exe --login -c "cd '%cd%'; ./build/ci/build.sh -a install"
+ ) ELSE IF "%BE%"=="mingw-gcc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ CD build_ci\cmake
+ mingw32-make install DESTDIR=%cd%\destdir
+ ) ELSE IF "%BE%"=="msvc" (
+ SET PATH=%PATH%;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ cmake --build . --target INSTALL --config Release
+ )
+) ELSE (
+ ECHO "Usage: %0% prepare|deplibs|configure|build|test|install"
+ @EXIT /b 0
+)
+@EXIT /b 0
diff --git a/build/ci/cirrus_ci.sh b/build/ci/cirrus_ci/ci.sh
index 9db762f97cca..c07ebfe97bea 100755
--- a/build/ci/cirrus_ci.sh
+++ b/build/ci/cirrus_ci/ci.sh
@@ -1,6 +1,6 @@
#!/bin/sh
UNAME=`uname`
-if [ "$1" = "install" ]
+if [ "$1" = "prepare" ]
then
if [ "${UNAME}" = "FreeBSD" ]
then
@@ -17,8 +17,11 @@ then
elif [ "${UNAME}" = "Darwin" ]
then
set -x -e
- brew update
- brew install autoconf automake libtool pkg-config cmake xz lz4 zstd
+ brew update > /dev/null
+ for pkg in autoconf automake libtool pkg-config cmake xz lz4 zstd
+ do
+ brew list $pkg > /dev/null && brew upgrade $pkg || brew install $pkg
+ done
elif [ "${UNAME}" = "Linux" ]
then
if [ -f "/etc/debian_version" ]
@@ -48,6 +51,6 @@ then
TMPDIR=/tmp_acl_nfsv4 ${BIN_SUBDIR}/libarchive_test -r "${CURDIR}/libarchive/test" -v test_acl_platform_nfs4
fi
else
- echo "Usage $0 install | test_nfsv4_acls"
+ echo "Usage $0 prepare | test_nfsv4_acls"
exit 1
fi
diff --git a/build/ci/travis_ci.sh b/build/ci/travis_ci.sh
index e51a67931b9f..8ed0543dfdf9 100755
--- a/build/ci/travis_ci.sh
+++ b/build/ci/travis_ci.sh
@@ -15,13 +15,14 @@ case "$UNAME" in
cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}"
cmake --build . --target ALL_BUILD
# Until fixed, we don't run tests on Windows (lots of fails + timeout)
+ #export SKIP_TEST_FUZZ=1
#cmake --build . --target RUN_TESTS
set +x
elif [ "${BS}" = "mingw" ]; then
set -x
cmake -G "MSYS Makefiles" -D CMAKE_C_COMPILER="${CC}" -D CMAKE_MAKE_PROGRAM="mingw32-make" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}"
mingw32-make
- # The MinGW tests time out on Travis CI, disable for now
+ #export SKIP_TEST_FUZZ=1
#mingw32-make test
set +x
else