diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 000000000..6a289f6ea --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,131 @@ +# .appveyor.yml for use with EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) + +# Version format +version: base-{branch}-{build} + +#---------------------------------# +# build cache # +#---------------------------------# +# The AppVeyor cache allowance is way too small (1GB per account across all projects, branches and jobs) +# to be used for the dependency builds. + +cache: + - C:\Users\appveyor\.tools + +#---------------------------------# +# repository cloning # +#---------------------------------# + +# Called at very beginning, before repo cloning +init: + # Set autocrlf to make batch files work + - git config --global core.autocrlf true + +# Set clone depth (do not fetch complete history) +clone_depth: 5 + +# Skipping commits affecting only specific files +skip_commits: + files: + - 'documentation/*' + - 'templates/*' + - '**/*.html' + - '**/*.md' + +#---------------------------------# +# build matrix configuration # +#---------------------------------# + +# Build Configurations: dll/static, regular/debug +configuration: + - dynamic + - static + - dynamic-debug + - static-debug + +# Environment variables: compiler toolchain, base version, setup file, ... +environment: + # common / default variables for all jobs + SETUP_PATH: .ci-local:.ci + BASE: SELF + + matrix: + - CMP: vs2019 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - CMP: vs2017 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + - CMP: vs2015 + - CMP: vs2013 + - CMP: vs2012 + - CMP: vs2010 + - CMP: mingw + +# Platform: processor architecture +platform: + - x86 + - x64 + +# Matrix configuration: exclude sets of jobs +matrix: + exclude: + # VS2012 and older installs don't have the 64 bit compiler + - platform: x64 + CMP: vs2012 + - platform: x64 + CMP: vs2010 + - platform: x64 + CMP: vs2008 + # Exclude more jobs to reduce build time + # Skip 32-bit for "middle-aged" compilers + - platform: x86 + CMP: vs2017 + - platform: x86 + CMP: vs2015 + +#---------------------------------# +# building & testing # +#---------------------------------# + +install: + - cmd: git submodule update --init --recursive + - cmd: python .ci/appveyor/do.py prepare + +build_script: + - cmd: python .ci/appveyor/do.py build + +test_script: + - cmd: python .ci/appveyor/do.py test + +on_finish: + - ps: Get-ChildItem *.tap -Recurse -Force | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } + - cmd: python .ci/appveyor/do.py build test-results -s + +#---------------------------------# +# debugging # +#---------------------------------# + +## if you want to connect by remote desktop to a failed build, uncomment these lines +## note that you will need to connect within the usual build timeout limit (60 minutes) +## so you may want to adjust the build matrix above to just build the one of interest + +# print the connection info +#init: +# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +# block a failed build (until the watchdog barks) +#on_failure: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) + +#---------------------------------# +# notifications # +#---------------------------------# + +notifications: + + - provider: Email + to: + - core-talk@aps.anl.gov + on_build_success: false + + - provider: GitHubPullRequest diff --git a/.ci b/.ci new file mode 160000 index 000000000..e91a58837 --- /dev/null +++ b/.ci @@ -0,0 +1 @@ +Subproject commit e91a5883704e9fa57792953436eb7020baf37063 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..271d6c8f0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule ".ci"] + path = .ci + url = https://github.com/epics-base/ci-scripts + branch = master diff --git a/.travis.yml b/.travis.yml index 0ae572504..5edb00dcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,62 +1,93 @@ -language: c +# .travis.yml for use with EPICS Base ci-scripts +# (see: https://github.com/epics-base/ci-scripts) -matrix: - include: - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=gcc - - sudo: false - dist: xenial - compiler: gcc - env: CMPLR=gcc - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=gcc CMD_CXXFLAGS=-std=c++11 - - sudo: false - dist: trusty - compiler: gcc - env: CMPLR=gcc STATIC=YES CMD_CXXFLAGS=-std=c++11 - - sudo: false - dist: bionic - compiler: gcc - env: CMPLR=clang - - sudo: false - dist: xenial - compiler: gcc - env: CMPLR=clang - - sudo: false - dist: trusty - compiler: gcc - env: CMPLR=clang STATIC=YES - - sudo: false - dist: trusty - compiler: gcc - env: WINE=32 TEST=NO STATIC=YES - - sudo: false - dist: trusty - compiler: gcc - env: WINE=32 TEST=NO STATIC=NO - - sudo: false - dist: trusty - compiler: gcc - env: RTEMS=4.10 TEST=NO - - sudo: false - dist: trusty - compiler: gcc - env: RTEMS=4.9 TEST=NO - - os: osx - env: CMD_CFLAGS="-mmacosx-version-min=10.7" CMD_CXXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" CMD_LDXFLAGS="-mmacosx-version-min=10.7 -std=c++11 -stdlib=libc++" +language: cpp +compiler: gcc +dist: xenial + +cache: + directories: + - $HOME/.cache + +env: + global: + - SETUP_PATH=.ci-local:.ci + - BASE=SELF addons: apt: packages: + # for all EPICS builds - libreadline6-dev - libncurses5-dev - perl + # for clang compiler - clang + # for mingw builds (32bit and 64bit) - g++-mingw-w64-i686 + - g++-mingw-w64-x86-64 + # for RTEMS cross builds + - qemu-system-x86 + homebrew: + packages: + # for all EPICS builds + - bash + update: true -install: sh ci/travis-prepare.sh -# Copyright (c) 2016-2017 ITER Organization - -# Version format -version: base-{branch}-{build} - -#---------------------------------# -# repository cloning # -#---------------------------------# - -# Called at very beginning, before repo cloning -init: - # Set autocrlf to make batch files work - - git config --global core.autocrlf true - -# Set clone depth (do not fetch complete history) -clone_depth: 2 - -# Skipping commits affecting only specific files -skip_commits: - files: - - 'documentation/*' - - 'templates/*' - - '**/*.html' - - '**/*.md' - -#---------------------------------# -# build matrix configuration # -#---------------------------------# - -# Build Configurations: dll/static, regular/debug -configuration: - - dynamic - - static - - dynamic-debug - - static-debug - -# Environment variables: compiler toolchain -environment: - matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 10.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 11.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 12.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: 14.0 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLCHAIN: 2017 - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLCHAIN: mingw - -# Platform: architecture -platform: - - x86 - - x64 - -# Matrix configuration: allow specific failing jobs -matrix: - exclude: - # VS Express installs don't have the 64 bit compiler - - platform: x64 - TOOLCHAIN: 10.0 - - -#---------------------------------# -# building & testing # -#---------------------------------# - -install: - - cmd: ci/appveyor-prepare.bat - -build_script: - - cmd: ci/appveyor-make.bat - -test_script: - - cmd: ci/appveyor-make.bat tapfiles - -on_finish: - - cmd: ci/appveyor-make.bat -s test-results - -#---------------------------------# -# notifications # -#---------------------------------# - -notifications: - - - provider: Email - to: - - core-talk@aps.anl.gov - on_build_success: false - - - provider: GitHubPullRequest diff --git a/ci/appveyor-make.bat b/ci/appveyor-make.bat deleted file mode 100644 index 8d976d93d..000000000 --- a/ci/appveyor-make.bat +++ /dev/null @@ -1,119 +0,0 @@ -:: Universal build script for AppVeyor (https://ci.appveyor.com/) -:: Environment: -:: TOOLCHAIN - toolchain version [10.0/11.0/12.0/14.0/2017/mingw] -:: CONFIGURATION - determines EPICS build [dynamic/static] -:: PLATFORM - architecture [x86/x64] -:: -:: All command line args are passed to make - -Setlocal EnableDelayedExpansion - -set "ST=" -if /i "%CONFIGURATION%"=="static" set ST=-static - -set OS=64BIT -if "%PLATFORM%"=="x86" set OS=32BIT - -echo [INFO] Platform: %OS% - -:: Use parallel make, except for 3.14 -set "MAKEARGS=-j2 -Otarget" -if "%APPVEYOR_REPO_BRANCH%"=="3.14" set MAKEARGS= - -if "%TOOLCHAIN%"=="mingw" ( - set "MAKE=mingw32-make" - if "%OS%"=="64BIT" ( - set "EPICS_HOST_ARCH=windows-x64-mingw" - set "INCLUDE=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\include;%INCLUDE%" - set "PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%" - echo [INFO] MinGW Toolchain 64bit - ) else ( - set "EPICS_HOST_ARCH=win32-x86-mingw" - set "INCLUDE=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\include;%INCLUDE%" - set "PATH=C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin;%PATH%" - echo [INFO] MinGW Toolchain 32bit - ) - echo [INFO] Compiler Version - gcc -v - goto Finish -) - -set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN%" -if not exist "%VSINSTALL%\" set "VSINSTALL=C:\Program Files (x86)\Microsoft Visual Studio\%TOOLCHAIN%\Community" -if not exist "%VSINSTALL%\" goto MSMissing - -set "MAKE=C:\tools\make" - -echo [INFO] APPVEYOR_BUILD_WORKER_IMAGE=%APPVEYOR_BUILD_WORKER_IMAGE% - -if "%OS%"=="64BIT" ( - set EPICS_HOST_ARCH=windows-x64%ST% - :: VS 2017 - if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" ( - call "%VSINSTALL%\VC\Auxiliary\Build\vcvars64.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\vcvarsall.bat" ( - call "%VSINSTALL%\VC\vcvarsall.bat" amd64 - where cl - if !ERRORLEVEL! NEQ 0 ( - call "%VSINSTALL%\VC\vcvarsall.bat" x86_amd64 - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - ) - goto MSFound - ) - if exist "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" ( - call "%VSINSTALL%\VC\bin\amd64\vcvars64.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) -) else ( - set EPICS_HOST_ARCH=win32-x86%ST% - :: VS 2017 - if exist "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" ( - call "%VSINSTALL%\VC\Auxiliary\Build\vcvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\vcvarsall.bat" ( - call "%VSINSTALL%\VC\vcvarsall.bat" x86 - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\VC\bin\vcvars32.bat" ( - call "%VSINSTALL%\VC\bin\vcvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) - if exist "%VSINSTALL%\Common7\Tools\vsvars32.bat" ( - call "%VSINSTALL%\Common7\Tools\vsvars32.bat" - where cl - if !ERRORLEVEL! NEQ 0 goto MSMissing - goto MSFound - ) -) - -:MSMissing -echo [INFO] Installation for MSVC Toolchain %TOOLCHAIN% / %OS% seems to be missing -exit 1 - -:MSFound -echo [INFO] Microsoft Visual Studio Toolchain %TOOLCHAIN% -echo [INFO] Compiler Version -cl - -:Finish -echo [INFO] EPICS_HOST_ARCH: %EPICS_HOST_ARCH% -echo [INFO] Make version -%MAKE% --version -echo [INFO] Perl version -perl --version - -%MAKE% %MAKEARGS% %* diff --git a/ci/appveyor-prepare.bat b/ci/appveyor-prepare.bat deleted file mode 100644 index a685dbfb3..000000000 --- a/ci/appveyor-prepare.bat +++ /dev/null @@ -1,38 +0,0 @@ -:: Build script for AppVeyor (https://ci.appveyor.com/) -:: Environment: -:: TOOLCHAIN - Toolchain Version [9.0/10.0/11.0/12.0/14.0/mingw] -:: CONFIGURATION - determines EPICS build [dynamic/static, -debug] -:: PLATFORM - "x86" -> use 32bit architecture -:: -:: Prepares an Appveyor build by excuting the following steps -:: - Set up configure\CONFIG_SITE for static vs. dynamic build -:: - Install Mingw (TOOLCHAIN setting) in the in the appropriate flavor -:: - Download and install Make-4.1 from EPICS download page - -Setlocal EnableDelayedExpansion - -set OS=64BIT -if "%PLATFORM%"=="x86" set OS=32BIT - -echo [INFO] Platform: %OS% - -if "%TOOLCHAIN%"=="mingw" ( - echo.%CONFIGURATION% | findstr /C:"static">nul && ( - echo SHARED_LIBRARIES=NO>> configure\CONFIG_SITE - echo STATIC_BUILD=YES>> configure\CONFIG_SITE - echo [INFO] EPICS set up for static build - ) || ( - echo [INFO] EPICS set up for dynamic build - ) - echo.%CONFIGURATION% | findstr /C:"debug">nul && ( - echo HOST_OPT=NO>> configure\CONFIG_SITE - echo [INFO] EPICS set up for debug build - ) || ( - echo [INFO] EPICS set up for optimized build - ) -) - -echo [INFO] Installing Make 4.2.1 from ANL web site -curl -fsS --retry 3 -o C:\tools\make-4.2.1.zip https://epics.anl.gov/download/tools/make-4.2.1-win64.zip -cd \tools -"C:\Program Files\7-Zip\7z" e make-4.2.1.zip diff --git a/ci/travis-build.sh b/ci/travis-build.sh deleted file mode 100644 index e69616aa3..000000000 --- a/ci/travis-build.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -set -e -x - -die() { - echo "$1" >&2 - exit 1 -} - -ticker() { - while true - do - sleep 60 - date -R - [ -r "$1" ] && tail -n10 "$1" - done -} - -CACHEKEY=1 - -EPICS_HOST_ARCH=`perl src/tools/EpicsHostArch.pl` - -[ -e configure/os/CONFIG_SITE.Common.linux-x86 ] || die "Wrong location: $PWD" - -case "$CMPLR" in -clang) - echo "Host compiler is clang" - cat << EOF >> configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH -GNU = NO -CMPLR_CLASS = clang -CC = clang -CCC = clang++ -EOF - ;; -*) echo "Host compiler is default";; -esac - -if [ "$STATIC" = "YES" ] -then - echo "Build static libraries/executables" - cat << EOF >> configure/CONFIG_SITE -SHARED_LIBRARIES=NO -STATIC_BUILD=YES -EOF -fi - -# requires wine and g++-mingw-w64-i686 -if [ "$WINE" = "32" ] -then - echo "Cross mingw32" - sed -i -e '/CMPLR_PREFIX/d' configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw - cat << EOF >> configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw -CMPLR_PREFIX=i686-w64-mingw32- -EOF - cat << EOF >> configure/CONFIG_SITE -CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw -EOF -fi - -# set RTEMS to eg. "4.9" or "4.10" -# requires qemu, bison, flex, texinfo, install-info -if [ -n "$RTEMS" ] -then - echo "Cross RTEMS${RTEMS} for pc386" - install -d /home/travis/.cache - curl -L "https://github.com/mdavidsaver/rsb/releases/download/travis-20160306-2/rtems${RTEMS}-i386-trusty-20190306-2.tar.gz" \ - | tar -C /home/travis/.cache -xj - - sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' configure/os/CONFIG_SITE.Common.RTEMS - cat << EOF >> configure/os/CONFIG_SITE.Common.RTEMS -RTEMS_VERSION=$RTEMS -RTEMS_BASE=/home/travis/.cache/rtems${RTEMS}-i386 -EOF - cat << EOF >> configure/CONFIG_SITE -CROSS_COMPILER_TARGET_ARCHS+=RTEMS-pc386 -EOF - - # find local qemu-system-i386 - echo -n "Using QEMU: " - type qemu-system-i386 || echo "Missing qemu" -fi - -make -j2 RTEMS_QEMU_FIXUPS=YES CMD_CFLAGS="${CMD_CFLAGS}" CMD_CXXFLAGS="${CMD_CXXFLAGS}" CMD_LDFLAGS="${CMD_LDFLAGS}" - -if [ "$TEST" != "NO" ] -then - make tapfiles - make -s test-results -fi diff --git a/ci/travis-prepare.sh b/ci/travis-prepare.sh deleted file mode 100644 index 393bd80b6..000000000 --- a/ci/travis-prepare.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -set -e -x - -die() { - echo "$1" >&2 - exit 1 -} - -if [ -f /etc/hosts ] -then - # The travis-ci "bionic" image throws us a curveball in /etc/hosts - # by including two entries for localhost. The first for 127.0.1.1 - # which causes epicsSockResolveTest to fail. - # cat /etc/hosts - # ... - # 127.0.1.1 localhost localhost ip4-loopback - # 127.0.0.1 localhost nettuno travis vagrant travis-job-.... - - sudo sed -i -e '/^127\.0\.1\.1/ s|localhost\s*||g' /etc/hosts - - echo "==== /etc/hosts" - cat /etc/hosts - echo "====" -fi