mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
160 stars 91 forks source link

Fails to build with Mapnik 3.0.23 (error: use of deleted function 'mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >::vertex_adapter(const mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >&)') #223

Open sebastic opened 4 years ago

sebastic commented 4 years ago

The v3.0.x branch fails to build with 3.0.23:

/usr/include/boost/spirit/home/karma/nonterminal/rule.hpp:230:32:   required from 'boost::spirit::karma::rule<OutputIterator, T1, T2, T3, T4>& boost::spirit::karma::rule<OutputIterator, T1, T2, T3, T4>::operator=(const Expr&) [with Expr = boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<const boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<const boost::proto::exprns_::expr<boost::proto::tagns_::tag::shift_left, boost::proto::argsns_::list2<const boost::proto::exprns_::expr<boost::proto::tagns_::tag::address_of, boost::proto::argsns_::list1<const boost::proto::exprns_::expr<boost::proto::tagns_::tag::subscript, boost::proto::argsns_::list2<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::spirit::terminal_ex<boost::spirit::tag::uint_, boost::fusion::vector<mapnik::geometry::geometry_types> > >, 0>&, const boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::assign, boost::proto::argsns_::list2<boost::phoenix::actor<boost::spirit::argument<0> >, boost::phoenix::actor<boost::proto::exprns_::basic_expr<boost::phoenix::detail::tag::function_eval, boost::proto::argsns_::list2<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<mapnik::svg::svg_detail::get_type<mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> > > >, 0>, boost::phoenix::actor<boost::spirit::attribute<0> > >, 2> > >, 2> >&>, 2>&>, 1>&, const boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::spirit::terminal_ex<boost::spirit::tag::lit, boost::fusion::vector<const char (&)[4]> > >, 0>&>, 2>&, boost::spirit::karma::rule<std::back_insert_iterator<std::__cxx11::basic_string<char> >, mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >(), boost::spirit::unused_type, boost::spirit::unused_type, boost::spirit::unused_type>&>, 2>&, const boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<boost::spirit::terminal_ex<boost::spirit::tag::lit, boost::fusion::vector<const char (&)[2]> > >, 0>&>, 2>; OutputIterator = std::back_insert_iterator<std::__cxx11::basic_string<char> >; T1 = mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >(); T2 = boost::spirit::unused_type; T3 = boost::spirit::unused_type; T4 = boost::spirit::unused_type]'
/usr/include/mapnik/svg/geometry_svg_generator_impl.hpp:54:20:   required from 'mapnik::svg::svg_path_generator<OutputIterator, Path>::svg_path_generator() [with OutputIterator = std::back_insert_iterator<std::__cxx11::basic_string<char> >; Path = mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >]'
src/mapnik_svg_generator_grammar.cpp:27:30:   required from here
/usr/include/boost/spirit/home/karma/detail/attributes.hpp:23:20: error: use of deleted function 'mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >::vertex_adapter(const mapnik::detail::vertex_adapter<mapnik::detail::path<double, mapnik::vertex_vector> >&)'
   23 |             return Transformed(traits::extract_from<Transformed>(val, unused));
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/mapnik/util/path_iterator.hpp:28,
                 from /usr/include/mapnik/svg/geometry_svg_generator.hpp:33,
                 from /usr/include/mapnik/svg/geometry_svg_generator_impl.hpp:25,
                 from src/mapnik_svg_generator_grammar.cpp:23:
edge0701 commented 4 years ago

I've just encountered the same issue myself.

artemp commented 4 years ago

@sebastic @edge0701 - could you try latest v3.0.x branch to see if 7da019c fixed this issue, thanks

sebastic commented 4 years ago

It builds successfully with the changes from 7da019cf9eb12af8f8aa88b7d75789dfcd1e901b.

There are some (unrelated) test failures:

======================================================================
ERROR: Failure: TabError (inconsistent use of tabs and spaces in indentation (pdf_printing_test.py, line 41))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3/dist-packages/nose/loader.py", line 416, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3/dist-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.8/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 916, in get_code
  File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/build/python-mapnik-0.0~20200224-7da019cf9/.pybuild/cpython3_3.8_mapnik/build/test/python_tests/pdf_printing_test.py", line 41
    source_xml = '../data/good_maps/marker-text-line.xml'.encode('utf-8')
                                                                        ^
TabError: inconsistent use of tabs and spaces in indentation

======================================================================
FAIL: python_tests.multi_tile_raster_test.test_multi_tile_policy
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/python-mapnik-0.0~20200224-7da019cf9/.pybuild/cpython3_3.8_mapnik/build/test/python_tests/multi_tile_raster_test.py", line 49, in test_multi_tile_policy
    eq_(im.view(0, 64, 1, 1).tostring(), b'\x00\xff\x00\xff')
AssertionError: b'\x00\x00\x00\x00' != b'\x00\xff\x00\xff'

======================================================================
FAIL: python_tests.projection_test.test_proj_antimeridian_bbox
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/python-mapnik-0.0~20200224-7da019cf9/.pybuild/cpython3_3.8_mapnik/build/test/python_tests/projection_test.py", line 147, in test_proj_antimeridian_bbox
    assert_box2d_almost_equal(fwd_ext, better)
  File "/build/python-mapnik-0.0~20200224-7da019cf9/.pybuild/cpython3_3.8_mapnik/build/test/python_tests/utilities.py", line 141, in assert_box2d_almost_equal
    assert_almost_equal(a.maxy, b.maxy, msg=msg)
AssertionError: -24.584595927676872 != -24.584597490955804 within 7 places (1.5632789320818574e-06 difference) : Box2d(-180.0,-62.33374815277128,180.0,-24.584595927676872) != Box2d(-180.0,-62.33374815225163,180.0,-24.584597490955804)

======================================================================
FAIL: python_tests.render_grid_test.test_point_symbolizer_grid
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/build/python-mapnik-0.0~20200224-7da019cf9/.pybuild/cpython3_3.8_mapnik/build/test/python_tests/render_grid_test.py", line 950, in test_point_symbolizer_grid
    eq_(utf1, point_expected, show_grids('point-sym', utf1, point_expected))
AssertionError: JSON does not match  ->
 X grid does not match
 X data does not match
 X keys do not

        /tmp/mapnik-point-sym-actual.json
        /tmp/mapnik-point-sym-expected.json

----------------------------------------------------------------------
Ran 346 tests in 13.087s

FAILED (SKIP=155, errors=1, failures=3)