Skip to content

Commit

Permalink
Travis CI: port gcc52_stdcpp14_sanitize job to Xenial since Precise i…
Browse files Browse the repository at this point in the history
…s discontinued
  • Loading branch information
rouault committed Aug 1, 2019
1 parent dc9a020 commit 6e1ba1f
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 119 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ matrix:
compiler: gcc
language: cpp
sudo: required
dist: precise
dist: xenial
cache:
apt: true
directories:
- $HOME/.ccache
env:
- BUILD_NAME=gcc52_stdcpp14_sanitize
- BUILD_NAME=sanitize
- DETAILS=""
- os: linux
compiler: gcc
Expand Down
4 changes: 4 additions & 0 deletions autotest/asan_suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ leak:SwigPyClientData_New
leak:spatialite_alloc_connection
leak:/usr/bin/zip
leak:/usr/lib/x86_64-linux-gnu/libfontconfig.so.1
leak:/usr/bin/python2.7
leak:/usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so
leak:PyDataMem_NEW
leak:PyArray_NewFromDescr_int
4 changes: 4 additions & 0 deletions autotest/gcore/tiff_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,10 @@ def test_tiff_read_online_2():
if gdal.GetDriverByName('HTTP') is None:
pytest.skip()

# For some reason this fails on this configuration
if gdaltest.is_travis_branch('sanitize'):
pytest.skip()

if gdaltest.gdalurlopen('http://download.osgeo.org/gdal/data/gtiff/utm.tif') is None:
pytest.skip('cannot open URL')

Expand Down
6 changes: 0 additions & 6 deletions autotest/gdrivers/eedai.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ def test_eedai_3():
if gdaltest.eedai_drv is None:
pytest.skip()

if gdaltest.is_travis_branch('gcc52_stdcpp14_sanitize'):
pytest.skip()

gdal.SetConfigOption('EEDA_URL', '/vsimem/ee/')
# Generated with 'openssl genrsa -out rsa-openssl.pem 1024' and
# 'openssl pkcs8 -nocrypt -in rsa-openssl.pem -inform PEM -topk8 -outform PEM -out rsa-openssl.pkcs8.pem'
Expand Down Expand Up @@ -394,9 +391,6 @@ def test_eedai_GOOGLE_APPLICATION_CREDENTIALS():
if gdaltest.eedai_drv is None:
pytest.skip()

if gdaltest.is_travis_branch('gcc52_stdcpp14_sanitize'):
pytest.skip()

gdal.FileFromMemBuffer('/vsimem/my.json', """{
"private_key":"-----BEGIN PRIVATE KEY-----
MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAOlwJQLLDG1HeLrk\n
Expand Down
2 changes: 2 additions & 0 deletions autotest/ogr/ogr_mvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ def test_ogr_mvt_point_polygon_clip():
pytest.skip()
if sys.platform == 'darwin' and gdal.GetConfigOption('TRAVIS', None) is not None:
pytest.skip()
if gdaltest.is_travis_branch('sanitize'):
pytest.skip()

ds = ogr.Open('data/mvt/point_polygon/1')
lyr = ds.GetLayer(1)
Expand Down
65 changes: 0 additions & 65 deletions gdal/ci/travis/gcc52_stdcpp14_sanitize/before_install.sh

This file was deleted.

23 changes: 23 additions & 0 deletions gdal/ci/travis/sanitize/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

set -e

sudo mv /etc/apt/sources.list.d/pgdg* /tmp
sudo apt-get update
sudo apt-get install -y software-properties-common python-software-properties
sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
# Disable postgresql since it draws ssl-cert that doesn't install cleanly
# postgis postgresql-9.1 postgresql-client-9.1 postgresql-9.1-postgis-2.1 postgresql-9.1-postgis-2.1-scripts libpq-dev
sudo apt-get install -y --allow-unauthenticated python-numpy libpng12-dev libjpeg-dev libgif-dev liblzma-dev libgeos-dev libcurl4-gnutls-dev libproj-dev libxml2-dev libexpat-dev libxerces-c-dev libnetcdf-dev netcdf-bin libpoppler-dev libpoppler-private-dev libsqlite3-dev gpsbabel swig libhdf4-alt-dev libhdf5-serial-dev libpodofo-dev poppler-utils libfreexl-dev unixodbc-dev libwebp-dev libepsilon-dev liblcms2-2 libpcre3-dev libcrypto++-dev libdap-dev libfyba-dev libmysqlclient-dev libogdi3.2-dev libcfitsio-dev openjdk-8-jdk couchdb libzstd1-dev ccache curl autoconf automake sqlite3 libspatialite-dev
sudo apt-get install -y doxygen texlive-latex-base
sudo apt-get install -y make
sudo apt-get install -y python-dev
sudo apt-get install -y g++
sudo apt-get install -y --allow-unauthenticated libsfcgal-dev
sudo apt-get install -y --allow-unauthenticated fossil libgeotiff-dev libcharls-dev libopenjp2-7-dev libcairo2-dev

wget https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5/FileGDB_API_1_5_64gcc51.tar.gz
tar xzf FileGDB_API_1_5_64gcc51.tar.gz
sudo cp FileGDB_API-64gcc51/lib/* /usr/lib
sudo ldconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ case $SCRIPT_DIR in
esac
$SCRIPT_DIR/../common_install.sh

export PATH=$PWD/install-gcc-5.2.0/bin:$PATH
export LD_LIBRARY_PATH=$PWD/install-gcc-5.2.0/lib64
export PRELOAD=$PWD/install-gcc-5.2.0/lib64/libasan.so.2.0.0:$PWD/install-gcc-5.2.0/lib64/libubsan.so.0.0.0
#export PRELOAD=$PWD/install-gcc-5.2.0/lib64/libubsan.so.0.0.0
export ASAN_OPTIONS=allocator_may_return_null=1

export CCACHE_CPP2=yes
Expand All @@ -30,14 +26,11 @@ ccache -s

# Build proj
(cd proj; ./autogen.sh && CFLAGS='-DPROJ_RENAME_SYMBOLS' CXXFLAGS='-DPROJ_RENAME_SYMBOLS' ./configure --disable-static --prefix=/usr/local && make -j3)
(cd proj; sudo make -j3 install && sudo ldconfig)
(cd proj; sudo make -j3 install && sudo mv /usr/local/lib/libproj.so.15.0.0 /usr/local/lib/libinternalproj.so.15.0.0 && sudo rm /usr/local/lib/libproj.so* && sudo rm /usr/local/lib/libproj.la && sudo ln -s libinternalproj.so.15.0.0 /usr/local/lib/libinternalproj.so.15 && sudo ln -s libinternalproj.so.15.0.0 /usr/local/lib/libinternalproj.so)

cd gdal

# Disable --with-fgdb=/usr/local since it causes /usr/local/include/GeodatabaseManagement.h:56:1: error: expected constructor, destructor, or type conversion before ‘(’ token EXT_FILEGDB_API fgdbError CreateGeodatabase(const std::wstring& path, Geodatabase& geodatabase);
# Disable --with-mongocxx=/usr/local since it should also likely be compiled with C+11, but this fails because boost itself should probably be
CPPFLAGS="-DMAKE_SANITIZE_HAPPY -fsanitize=undefined -fsanitize=address" LDFLAGS="-fsanitize=undefined -fsanitize=address" ./configure --with-cpp14 --prefix=/usr --without-libtool --enable-debug --with-jpeg12 --with-poppler --without-podofo --with-spatialite --with-mysql --with-liblzma --with-webp --with-epsilon --with-ecw=/usr/local --with-libtiff=internal --with-rename-internal-libtiff-symbols --with-hide-internal-symbols --with-gnm --with-proj=/usr/local
# --with-gta
CPPFLAGS="-DMAKE_SANITIZE_HAPPY -fsanitize=undefined -fsanitize=address" LDFLAGS="-fsanitize=undefined -fsanitize=address" ./configure --prefix=/usr --without-libtool --enable-debug --with-jpeg12 --with-poppler --without-podofo --with-spatialite --with-mysql --with-liblzma --with-webp --with-epsilon --with-libtiff=internal --with-rename-internal-libtiff-symbols --with-hide-internal-symbols --with-gnm --with-proj=/usr/local --with-fgdb=$PWD/../FileGDB_API-64gcc51
make USER_DEFS="-Werror" -j3
cd apps
make USER_DEFS="-Werror" test_ogrsf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,25 @@

set -e

export PATH=$PWD/install-gcc-5.2.0/bin:$PATH
export LD_LIBRARY_PATH=$PWD/install-gcc-5.2.0/lib64
export PRELOAD=$PWD/install-gcc-5.2.0/lib64/libasan.so.2.0.0:$PWD/install-gcc-5.2.0/lib64/libubsan.so.0.0.0
#export PRELOAD=$PWD/install-gcc-5.2.0/lib64/libubsan.so.0.0.0
export PYTEST="pytest -vv -p no:sugar --color=no"
export PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/5/libasan.so:/usr/lib/gcc/x86_64-linux-gnu/5/libubsan.so

cd gdal

# Perl unit tests
#cd swig/perl
#make test
#cd ../..
# Java unit tests
#cd swig/java
#make test
#cd ../..
# CPP unit tests
cd ../autotest
#cd cpp
#GDAL_SKIP=JP2ECW make quick_test
# Compile and test vsipreload
#make vsipreload.so
#LD_PRELOAD=./vsipreload.so gdalinfo /vsicurl/http://download.osgeo.org/gdal/data/ecw/spif83.ecw
#LD_PRELOAD=./vsipreload.so sqlite3 /vsicurl/http://download.osgeo.org/gdal/data/sqlite3/polygon.db "select * from polygon limit 10"
#cd ..
# Download a sample file
#mkdir -p ogr/tmp/cache/
#cd ogr/tmp/cache/
#wget http://download.osgeo.org/gdal/data/pgeo/PGeoTest.zip
#unzip PGeoTest.zip
#cd ../../..

# Don't run these
rm ogr/ogr_fgdb.py ogr/ogr_pgeo.py

# Too old spatialite version
rm ogr/ogr_sqlite.py gdrivers/rasterlite.py

# install test dependencies
# note: pip 9 is installed on the box, but it hits a strange error after upgrading setuptools.
# so we install a newer pip first.
sudo -H pip install -U pip
sudo -H pip install -U -r ./requirements.txt
sudo apt-get remove python-numpy
sudo -H pip install -U numpy


# Run each module in its own pytest process.
# This makes sure the output from the address sanitizer is relevant
# and it doesn't blow out RAM too much.
Expand Down Expand Up @@ -75,11 +48,3 @@ if grep -P '===.*\d+ failed' ./test-output.txt > /dev/null ; then
else
echo 'Tests passed'
fi

# A bit messy, but force testing with libspatialite 4.0dev (that has been patched a bit to remove any hard-coded SRS definition so it is very small)
#cd ogr
#wget http://s3.amazonaws.com/etc-data.koordinates.com/gdal-travisci/libspatialite4.0dev_ubuntu12.04-64bit_srs_stripped.tar.gz
#tar xzf libspatialite4.0dev_ubuntu12.04-64bit_srs_stripped.tar.gz
#ln -s install-libspatialite-4.0dev/lib/libspatialite.so.5.0.1 libspatialite.so.3
#LD_PRELOAD=$PRELOAD LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD $PYTEST ogr_sqlite.py
#cd ..

0 comments on commit 6e1ba1f

Please sign in to comment.