From c6b1abcdb61111873db96b0208f9897eb7a22141 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 12 Aug 2016 18:16:24 -0700 Subject: [PATCH 01/12] update mason deps and test data - refs mapnik/test-data#8 mapnik/test-data-visual#36 --- bootstrap.sh | 30 +++++++++++++++--------------- test/data | 2 +- test/data-visual | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 113d60f8c..c805774a9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -11,7 +11,7 @@ todo - shrink icu data ' -MASON_VERSION="7ed8931" +MASON_VERSION="new-pkgs" function setup_mason() { if [[ ! -d ./.mason ]]; then @@ -19,7 +19,7 @@ function setup_mason() { (cd ./.mason && git checkout ${MASON_VERSION}) else echo "Updating to latest mason" - (cd ./.mason && git fetch && git checkout ${MASON_VERSION}) + (cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull) fi export PATH=$(pwd)/.mason:$PATH export CXX=${CXX:-clang++} @@ -47,21 +47,21 @@ ICU_VERSION="55.1" function install_mason_deps() { FAIL=0 install ccache 3.2.4 & - install jpeg_turbo 1.4.0 libjpeg & - install libpng 1.6.20 libpng & - install libtiff 4.0.4beta libtiff & - install libpq 9.4.1 & - install sqlite 3.8.8.3 libsqlite3 & - install expat 2.1.0 libexpat & + install jpeg_turbo 1.5.0 libjpeg & + install libpng 1.6.24 libpng & + install libtiff 4.0.6 libtiff & + install libpq 9.5.2 & + install sqlite 3.14.1 libsqlite3 & + install expat 2.2.0 libexpat & install icu ${ICU_VERSION} & - install proj 4.8.0 libproj & - install pixman 0.32.6 libpixman-1 & - install cairo 1.14.2 libcairo & + install proj 4.9.2 libproj & + install pixman 0.34.0 libpixman-1 & + install cairo 1.14.6 libcairo & install protobuf 2.6.1 & # technically protobuf is not a mapnik core dep, but installing # here by default helps make mapnik-vector-tile builds easier - install webp 0.5.0 libwebp & - install gdal 1.11.2 libgdal & + install webp 0.5.1 libwebp & + install gdal 2.1.1 libgdal & install boost 1.61.0 & install boost_libsystem 1.61.0 & install boost_libfilesystem 1.61.0 & @@ -71,8 +71,8 @@ function install_mason_deps() { # here by default helps make python-mapnik builds easier install boost_libthread 1.61.0 & install boost_libpython 1.61.0 & - install freetype 2.6 libfreetype & - install harfbuzz 0.9.41 libharfbuzz & + install freetype 2.6.5 libfreetype & + install harfbuzz 1.3.0 libharfbuzz & for job in $(jobs -p) do wait $job || let "FAIL+=1" diff --git a/test/data b/test/data index fb1529e22..cb7f1aff2 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit fb1529e225b36f8a3077ad23f7005951a07c8a7e +Subproject commit cb7f1aff2ee5a43178111801356eb529b9ef098f diff --git a/test/data-visual b/test/data-visual index bb0a8927f..fb51e008e 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit bb0a8927f4305df861d1b5c6366216bb4e530975 +Subproject commit fb51e008e009e37b5d067714a4b1273eb8426d65 From d747f326f21993277fbc748aacdd22259c9b8b83 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 26 Aug 2016 14:39:56 +0100 Subject: [PATCH 02/12] CHANGELOG - fix typo and update --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9840af1ff..9b47daba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,7 +36,11 @@ Released: xx-xx-xx - Added support for quantising small (less than 3 pixel) images (ref #3466) - Added support for natural logarithm function in expressions (ref #3475) - Improved logic determining if certain compiler features are available e.g `inheriting constructors` (MSVC) -- GeoJSON - corrected quoting in `stringgifird` objects (ref #3491) +- GeoJSON - corrected quoting in `stringify` objects (ref #3491) +- GeoJSON - ensured consistent ordering of attribute descriptors (ref #3494) +- GeoJSON - exposed `num_features_to_query` as datasource paramer (ref #3495) +- Replaced `boost::mpl::vector` with `std::tuple` (ref #3503) +- BuildingSymbolizer - fixed closing segment of polygon in building symbolizer (ref #3505) ## 3.0.11 From 95331eda407c1ee32c381795335452ebcfd7de82 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 26 Aug 2016 13:40:28 -0700 Subject: [PATCH 03/12] temporary workaround for https://github.com/mapbox/mason/issues/230 --- bootstrap.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index c805774a9..2234ef08f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -39,6 +39,8 @@ function install() { fi fi fi + # the rm here is to workaround https://github.com/mapbox/mason/issues/230 + rm -f ./mason_packages/.link/mason.ini mason link $1 $2 } From 8b954a6fc3c842e1821ec57d4f2220329f768c48 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 26 Aug 2016 14:30:47 -0700 Subject: [PATCH 04/12] Get correct package of lndir --- .travis.yml | 4 ++-- circle.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c16bfa3a8..331979c2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ matrix: addons: apt: sources: [ 'ubuntu-toolchain-r-test'] - packages: [ 'libstdc++-5-dev', 'xutils'] + packages: [ 'libstdc++-5-dev', 'xutils-dev'] - os: linux sudo: false compiler: ": clang-coverage" @@ -37,7 +37,7 @@ matrix: addons: apt: sources: [ 'ubuntu-toolchain-r-test'] - packages: ['libstdc++-5-dev', 'xutils' ] + packages: ['libstdc++-5-dev', 'xutils-dev' ] - os: osx compiler: ": clang-osx" # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions diff --git a/circle.yml b/circle.yml index 435cd077b..d9d4bad81 100644 --- a/circle.yml +++ b/circle.yml @@ -27,7 +27,7 @@ dependencies: - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test override: - sudo apt-get update -y - - sudo apt-get install -y libstdc++-5-dev xutils + - sudo apt-get install -y libstdc++-5-dev xutils-dev database: pre: From 3f26a1f23fbaec0876c960b2feb3d07906848efb Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 30 Aug 2016 12:37:33 -0700 Subject: [PATCH 05/12] use latest visual test data --- test/data-visual | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/data-visual b/test/data-visual index db7989be3..61f0d314b 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit db7989be3a8b636c60c79356b9ba9ca579faa01d +Subproject commit 61f0d314b989a345df9515d5bc1472c8d5362990 From f360f50eed1679f62a83b0f55cfc50f0e01c5fd0 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 31 Aug 2016 14:36:35 +0100 Subject: [PATCH 06/12] JSON - make `generic_json` a proper spirit grammar and reduce code bloat --- .../extract_bounding_box_grammar_impl.hpp | 22 ------- include/mapnik/json/feature_grammar_impl.hpp | 25 -------- include/mapnik/json/generic_json.hpp | 5 +- include/mapnik/json/geometry_grammar_impl.hpp | 25 -------- include/mapnik/json/positions_grammar.hpp | 3 +- include/mapnik/json/topojson_grammar_impl.hpp | 24 ------- src/json/generic_json.cpp | 64 +++++++++++++++++++ 7 files changed, 69 insertions(+), 99 deletions(-) create mode 100644 src/json/generic_json.cpp diff --git a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp index 25ddbcd92..bdc1b98b2 100644 --- a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp @@ -144,28 +144,6 @@ extract_bounding_box_grammar::extract_bounding_bo rings_array = lit('[') >> rings(_r1) % lit(',') > lit(']') ; - // generic json types - json.value = json.object | json.array | json.string_ | json.number - ; - - json.key_value = json.string_ >> lit(':') >> json.value - ; - - json.object = lit('{') >> json.key_value % lit(',') >> lit('}') - ; - - json.array = lit('[') - >> json.value >> *(lit(',') >> json.value) - >> lit(']') - ; - - json.number = json.strict_double - | json.int__ - | lit("true") - | lit("false") - | lit("null") - ; - coords.name("Coordinates"); pos.name("Position"); ring.name("Ring"); diff --git a/include/mapnik/json/feature_grammar_impl.hpp b/include/mapnik/json/feature_grammar_impl.hpp index 0fc4205ad..88f72ff0d 100644 --- a/include/mapnik/json/feature_grammar_impl.hpp +++ b/include/mapnik/json/feature_grammar_impl.hpp @@ -35,7 +35,6 @@ feature_grammar::feature_grammar(mapnik::tran qi::lit_type lit; qi::long_long_type long_long; qi::double_type double_; - qi::_val_type _val; qi::_1_type _1; qi::_2_type _2; qi::_3_type _3; @@ -49,30 +48,6 @@ feature_grammar::feature_grammar(mapnik::tran using phoenix::new_; using phoenix::construct; - // generic json types - json_.value = json_.object | json_.array | json_.string_ | json_.number - ; - - json_.key_value = json_.string_ > lit(':') > json_.value - ; - - json_.object = lit('{') - > -(json_.key_value % lit(',')) - > lit('}') - ; - - json_.array = lit('[') - > -(json_.value % lit(',')) - > lit(']') - ; - - json_.number = json_.strict_double[_val = json_.double_converter(_1)] - | json_.int__[_val = json_.integer_converter(_1)] - | lit("true") [_val = true] - | lit ("false") [_val = false] - | lit("null")[_val = construct()] - ; - // geojson types feature_type = lit("\"type\"") > lit(':') > lit("\"Feature\"") ; diff --git a/include/mapnik/json/generic_json.hpp b/include/mapnik/json/generic_json.hpp index 7ea1bc05f..65c04c47d 100644 --- a/include/mapnik/json/generic_json.hpp +++ b/include/mapnik/json/generic_json.hpp @@ -129,7 +129,7 @@ struct push_esc } }; -template< typename Iterator > +template< typename Iterator> unicode_string::unicode_string() : unicode_string::base_type(double_quoted) { @@ -175,8 +175,9 @@ unicode_string::unicode_string() } template -struct generic_json +struct generic_json : qi::grammar { + generic_json(); qi::rule value; qi::int_parser int__; unicode_string string_; diff --git a/include/mapnik/json/geometry_grammar_impl.hpp b/include/mapnik/json/geometry_grammar_impl.hpp index 285be2744..29ea8461c 100644 --- a/include/mapnik/json/geometry_grammar_impl.hpp +++ b/include/mapnik/json/geometry_grammar_impl.hpp @@ -52,31 +52,6 @@ geometry_grammar::geometry_grammar() using phoenix::push_back; start = geometry.alias() | lit("null"); - - // generic json types - json_.value = json_.object | json_.array | json_.string_ | json_.number - ; - - json_.key_value = json_.string_ > lit(':') > json_.value - ; - - json_.object = lit('{') - > -(json_.key_value % lit(',')) - > lit('}') - ; - - json_.array = lit('[') - > -(json_.value % lit(',')) - > lit(']') - ; - - json_.number = json_.strict_double - | json_.int__ - | lit("true") - | lit ("false") - | lit("null") - ; - geometry = lit('{')[_a = 0] > (((lit("\"type\"") > lit(':') > geometry_type_dispatch[_a = _1]) | diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp index 75a6b21b6..016ecb222 100644 --- a/include/mapnik/json/positions_grammar.hpp +++ b/include/mapnik/json/positions_grammar.hpp @@ -26,7 +26,6 @@ // mapnik #include #include -#include #include #include #pragma GCC diagnostic push @@ -38,6 +37,8 @@ namespace mapnik { namespace json { namespace qi = boost::spirit::qi; +namespace standard = boost::spirit::standard; +using space_type = standard::space_type; template > struct positions_grammar : diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp index f868cefc4..07b3a9756 100644 --- a/include/mapnik/json/topojson_grammar_impl.hpp +++ b/include/mapnik/json/topojson_grammar_impl.hpp @@ -94,7 +94,6 @@ topojson_grammar::topojson_grammar() using qi::fail; using qi::on_error; using phoenix::push_back; - using phoenix::construct; geometry_type_dispatch.add ("\"Point\"",1) @@ -109,29 +108,6 @@ topojson_grammar::topojson_grammar() // error handler boost::phoenix::function const error_handler; boost::phoenix::function const create_geometry; - // generic JSON types - json.value = json.object | json.array | json.string_ | json.number - ; - - json.key_value = json.string_ > lit(':') > json.value - ; - - json.object = lit('{') - > -(json.key_value % lit(',')) - > lit('}') - ; - - json.array = lit('[') - > -(json.value % lit(',')) - > lit(']') - ; - - json.number = json.strict_double[_val = json.double_converter(_1)] - | json.int__[_val = json.integer_converter(_1)] - | lit("true")[_val = true] - | lit("false")[_val = false] - | lit("null")[_val = construct()] - ; // topo json topology = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Topology\"") diff --git a/src/json/generic_json.cpp b/src/json/generic_json.cpp new file mode 100644 index 000000000..92cd908b5 --- /dev/null +++ b/src/json/generic_json.cpp @@ -0,0 +1,64 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#include + +namespace mapnik { namespace json { + +template +generic_json::generic_json() + : generic_json::base_type(value) +{ + qi::lit_type lit; + qi::_val_type _val; + qi::_1_type _1; + using phoenix::construct; + // generic json types + value = object | array | string_ | number + ; + + key_value = string_ > lit(':') > value + ; + + object = lit('{') + > -(key_value % lit(',')) + > lit('}') + ; + + array = lit('[') + > -(value % lit(',')) + > lit(']') + ; + + number = strict_double[_val = double_converter(_1)] + | int__[_val = integer_converter(_1)] + | lit("true") [_val = true] + | lit ("false") [_val = false] + | lit("null")[_val = construct()] + ; +} + +}} + +using iterator_type = char const*; +template struct mapnik::json::generic_json; +template struct mapnik::json::generic_json; From af099a57efffbf49bf0829f2befaa740f28f810d Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 31 Aug 2016 17:42:18 +0100 Subject: [PATCH 07/12] topojson grammar - change interface + instantiate with `Iterator = char const*` to reduce binary size --- plugins/input/topojson/topojson_datasource.cpp | 12 +++++++----- src/json/generic_json.cpp | 1 - src/json/mapnik_topojson_grammar.cpp | 2 +- test/unit/datasource/topojson.cpp | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index 2cfad1fb8..67bae443b 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -160,7 +160,7 @@ topojson_datasource::topojson_datasource(parameters const& params) } if (!inline_string_.empty()) { - parse_topojson(inline_string_); + parse_topojson(inline_string_.c_str()); } else { @@ -172,20 +172,22 @@ topojson_datasource::topojson_datasource(parameters const& params) std::string file_buffer; file_buffer.resize(file.size()); std::fread(&file_buffer[0], file.size(), 1, file.get()); - parse_topojson(file_buffer); + parse_topojson(file_buffer.c_str()); } } namespace { -using base_iterator_type = std::string::const_iterator; -const mapnik::topojson::topojson_grammar g; +using iterator_type = const char*; +const mapnik::topojson::topojson_grammar g; } template void topojson_datasource::parse_topojson(T const& buffer) { boost::spirit::standard::space_type space; - bool result = boost::spirit::qi::phrase_parse(buffer.begin(), buffer.end(), g, space, topo_); + auto itr = buffer; + auto end = buffer + std::strlen(buffer); + bool result = boost::spirit::qi::phrase_parse(itr, end, g, space, topo_); if (!result) { throw mapnik::datasource_exception("topojson_datasource: Failed parse TopoJSON file '" + filename_ + "'"); diff --git a/src/json/generic_json.cpp b/src/json/generic_json.cpp index 92cd908b5..7fb2e9fd3 100644 --- a/src/json/generic_json.cpp +++ b/src/json/generic_json.cpp @@ -61,4 +61,3 @@ generic_json::generic_json() using iterator_type = char const*; template struct mapnik::json::generic_json; -template struct mapnik::json::generic_json; diff --git a/src/json/mapnik_topojson_grammar.cpp b/src/json/mapnik_topojson_grammar.cpp index e70f7c590..e4b9dca32 100644 --- a/src/json/mapnik_topojson_grammar.cpp +++ b/src/json/mapnik_topojson_grammar.cpp @@ -24,5 +24,5 @@ #include #include -using iterator_type = std::string::const_iterator; +using iterator_type = char const*; template struct mapnik::topojson::topojson_grammar ; diff --git a/test/unit/datasource/topojson.cpp b/test/unit/datasource/topojson.cpp index 41d9b1908..7bf155e33 100644 --- a/test/unit/datasource/topojson.cpp +++ b/test/unit/datasource/topojson.cpp @@ -31,7 +31,7 @@ namespace { -using iterator_type = std::string::const_iterator; +using iterator_type = char const*; const mapnik::topojson::topojson_grammar grammar; bool parse_topology(std::string const& filename, mapnik::topojson::topology & topo) @@ -42,8 +42,8 @@ bool parse_topology(std::string const& filename, mapnik::topojson::topology & to std::fread(&buffer[0], buffer.size(), 1, file.get()); if (!file) return false; boost::spirit::standard::space_type space; - iterator_type itr = buffer.begin(); - iterator_type end = buffer.end(); + iterator_type itr = buffer.c_str(); + iterator_type end = itr + buffer.length(); bool result = boost::spirit::qi::phrase_parse(itr, end, grammar, space, topo); return (result && (itr == end)); } From 02c2338c431c2cf1aa0ff1da90ce44b36cd4eab7 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 31 Aug 2016 11:09:11 -0700 Subject: [PATCH 08/12] mapnik-config: strip clang specific warning flags --- utils/mapnik-config/build.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils/mapnik-config/build.py b/utils/mapnik-config/build.py index e4178ba41..35a730bf0 100644 --- a/utils/mapnik-config/build.py +++ b/utils/mapnik-config/build.py @@ -80,7 +80,15 @@ def write_config(configuration,template,config_file): os.chmod(config_file,0755) except: pass -cxxflags = ' '.join(config_env['LIBMAPNIK_CXXFLAGS']) + +cxxflags_raw = config_env['LIBMAPNIK_CXXFLAGS']; +# strip clang specific flags to avoid breaking gcc +# while it is not recommended to mix compilers, this nevertheless +# makes it easier to compile apps with gcc and mapnik-config against mapnik built with clang +to_remove = ['-Wno-unsequenced','-Wno-unknown-warning-option','-Wtautological-compare','-Wheader-hygiene'] +cxxflags_cleaned = [item for item in config_env['LIBMAPNIK_CXXFLAGS'] if item not in to_remove]; + +cxxflags = ' '.join(cxxflags_cleaned) defines = ' '.join(config_env['LIBMAPNIK_DEFINES']) From 4b06dfe9b4636baf6358e3413b8d9e2e6506fe40 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 31 Aug 2016 11:09:27 -0700 Subject: [PATCH 09/12] Avoid warnings when building the g++5 --- include/mapnik/raster_colorizer.hpp | 4 ++-- include/mapnik/value.hpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index 86a85def2..690549746 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -93,7 +93,7 @@ public: //! \brief Set the stop value //! \param[in] value The stop value - inline void set_value(float value) { value_ = value; } + inline void set_value(float v) { value_ = v; } //! \brief Get the stop value //! \return The stop value @@ -205,7 +205,7 @@ public: //! //! \param[in] value Input value //! \return color associated with the value - unsigned get_color(float value) const; + unsigned get_color(float v) const; //! \brief Set the epsilon value for exact mode diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 3bd59b4b7..9ee732385 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -149,6 +149,7 @@ namespace std { #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpragmas" #pragma GCC diagnostic ignored "-Wmismatched-tags" template <> From d19c38de176da7a3e14a60ca9235f9719284144c Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 1 Sep 2016 16:59:18 -0700 Subject: [PATCH 10/12] upgrade ccache / convert to generic travis language --- .travis.yml | 10 ++++------ bootstrap.sh | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 331979c2a..0a266f878 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: cpp +language: generic git: depth: 10 @@ -25,7 +25,7 @@ matrix: - os: linux sudo: false compiler: ": clang" - env: JOBS=8 MASON_PUBLISH=true _CXX="ccache clang++-3.8 -Qunused-arguments" _CC="clang-3.8" TRIGGER=true + env: JOBS=8 MASON_PUBLISH=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8" TRIGGER=true addons: apt: sources: [ 'ubuntu-toolchain-r-test'] @@ -33,7 +33,7 @@ matrix: - os: linux sudo: false compiler: ": clang-coverage" - env: JOBS=8 COVERAGE=true _CXX="ccache clang++-3.8 -Qunused-arguments" _CC="clang-3.8" + env: JOBS=8 COVERAGE=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8" addons: apt: sources: [ 'ubuntu-toolchain-r-test'] @@ -42,7 +42,7 @@ matrix: compiler: ": clang-osx" # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions osx_image: xcode7.3 # upgrades clang from 6 -> 7 - env: JOBS=4 MASON_PUBLISH=true _CXX="ccache clang++ -Qunused-arguments" + env: JOBS=4 MASON_PUBLISH=true CXX="ccache clang++ -Qunused-arguments" before_install: # workaround travis rvm bug @@ -51,8 +51,6 @@ before_install: if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then rvm get head || true fi - - if [[ ${_CXX:-false} != false ]]; then export CXX=${_CXX}; fi - - if [[ ${_CC:-false} != false ]]; then export CC=${_CC}; fi - source scripts/travis-common.sh - export PYTHONUSERBASE=$(pwd)/mason_packages/.link - export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PYTHONUSERBASE}/bin:${PATH} diff --git a/bootstrap.sh b/bootstrap.sh index 2234ef08f..7946805c9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -48,7 +48,7 @@ ICU_VERSION="55.1" function install_mason_deps() { FAIL=0 - install ccache 3.2.4 & + install ccache 3.3.0 & install jpeg_turbo 1.5.0 libjpeg & install libpng 1.6.24 libpng & install libtiff 4.0.6 libtiff & From 7075a361cc743e956523787b8a0060291a72209e Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 1 Sep 2016 18:13:06 -0700 Subject: [PATCH 11/12] try travis-command-wrapper.py to help cache get created even on job that timed out - refs travis-ci/travis-ci#4472 --- .travis.yml | 2 +- scripts/travis-command-wrapper.py | 104 ++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) create mode 100755 scripts/travis-command-wrapper.py diff --git a/.travis.yml b/.travis.yml index 0a266f878..3a603a784 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,7 +92,7 @@ script: - export SCONSFLAGS='--debug=time' - configure BENCHMARK=${BENCH} - cat config.log - - make + - scripts/travis-command-wrapper.py make - make test - enabled ${COVERAGE} coverage - enabled ${BENCH} make bench diff --git a/scripts/travis-command-wrapper.py b/scripts/travis-command-wrapper.py new file mode 100755 index 000000000..eb7a794ab --- /dev/null +++ b/scripts/travis-command-wrapper.py @@ -0,0 +1,104 @@ +#!/usr/bin/python +# +# Author: Patrick Ohly +# Copyright: Copyright (C) 2015 Intel Corporation +# +# This file is licensed under the MIT license, see COPYING.MIT in +# this source distribution for the terms. + +# Runs a command, pipes its output to stdout, and injects status +# reports at regular time interval. +# +# This ensures that TravisCI does not abort the command just because +# it is silent for more than 10 minutes, as it can happen with bitbake +# when working on a single complex task, like "bitbake linux-yocto". +# +# Piping bitbake stdout has the advantage that bitbake enters +# non-interactive output mode, which it would do when run by TravisCI +# directly. +# +# Finally, the default status messages give some sense of memory +# and disk usage, which is critical in the rather constrained +# TravisCI environments. + +import errno +import optparse +import signal +import subprocess +import sys +import time + +parser = optparse.OptionParser() +parser.add_option("-s", "--status", + help="invoked in a shell when it is time for a status report", + # 200 columns is readable in the TravisCI Web UI without wrapping. + # Depends of course on screen and font size. Resizing top output + # only works (and is needed) on the more recent Trusty TravisCI + # environment. + default="date; free; df -h .; COLUMNS=200 LINES=30 top -w -b -n 1 2>/dev/null || top -n 1; ps x --cols 200 --forest", + metavar="SHELL-CMD") +parser.add_option("-i", "--interval", + help="repeat status at intervals of this amount of seconds, 0 to disable", + default=300, + metavar="SECONDS", type="int") +parser.add_option("-d", "--deadline", + help="stop execution when reaching the given time", + default=time.time, + metavar="SECONDS-SINCE-EPOCH", type="int") + +(options, args) = parser.parse_args() + +def check_deadline(now): + if options.deadline > 0 and options.deadline < now: + print "\n\n*** travis-cmd-wrapper: deadline reached, shutting down ***\n\n" + sys.exit(1) + +# Set up status alarm. When we have a deadline, we need to check more often +# and/or sooner. Sending a SIGALRM manually will also trigger a status report +# (not really possible in TravisCI, but may be useful elsewhere). +now = time.time() +next_status = now + options.interval +alarm_interval = max(options.interval, 0) +if options.deadline: + check_deadline(now) + if options.deadline < now + 60: + # Wake up a little too late, to be sure that we trigger the if check. + deadline_alarm_interval = max(int(options.deadline + 2 - now), 1) + elif next_status > 60: + deadline_alarm_interval = 60 + if deadline_alarm_interval < alarm_interval: + alarm_interval = deadline_alarm_interval + +def status(signum, frame): + global next_status + now = time.time() + if options.interval < 0 or now >= next_status: + subprocess.call(options.status, shell=True) + next_status = now + options.interval + check_deadline(now) + if alarm_interval > 0: + signal.alarm(alarm_interval) + +# Run command. +try: + cmd = subprocess.Popen(args, stdout=subprocess.PIPE) + + # Arm timer and handler. + signal.signal(signal.SIGALRM, status) + if alarm_interval > 0: + signal.alarm(alarm_interval) + + while cmd.poll() is None: + try: + line = cmd.stdout.readline() + sys.stdout.write(line) + sys.stdout.flush() + except IOError, ex: + if ex.errno != errno.EINTR: + raise +finally: + # If we go down, so must our child... + if cmd.poll() is None: + cmd.kill() + +exit(1 if cmd.returncode else 0) \ No newline at end of file From 5a21b1fc05703d8187043f170e709d8a1989dd10 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 1 Sep 2016 18:53:55 -0700 Subject: [PATCH 12/12] better wrapper args --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3a603a784..68505741b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,7 +92,7 @@ script: - export SCONSFLAGS='--debug=time' - configure BENCHMARK=${BENCH} - cat config.log - - scripts/travis-command-wrapper.py make + - scripts/travis-command-wrapper.py -s "date;ps aux | grep ${CXX}" -i 60 make - make test - enabled ${COVERAGE} coverage - enabled ${BENCH} make bench