Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-mapnik 3.7.2 fails to build with geometry.hpp 1.0.0 & mapnik-vector-tile 1.6.1 #901

Open
sebastic opened this issue Nov 14, 2018 · 5 comments

Comments

@sebastic
Copy link
Contributor

As reported by Matthias Klose in Debian Bug #913708:

node-mapnik ftbfs in unstable, with

/usr/include/vector_tile_geometry_encoder_pbf.ipp:305:48:   required from here
/usr/include/vector_tile_geometry_encoder_pbf.ipp:70:35: error: call of
overloaded 'encode_geometry_pbf(const mapbox::geometry::empty&,
protozero::pbf_writer&, int32_t&, int32_t&)' is ambiguous
         return encode_geometry_pbf(geom, feature_, x_, y_);
                ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:204:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::multi_point<long int>&, protozero::pbf_writer&, int32_t&,
int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::multi_point<std::int64_t> const& geom,
                           ^~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:232:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::line_string<long int>&, protozero::pbf_writer&, int32_t&,
int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::line_string<std::int64_t> const& line,
                           ^~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:246:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::multi_line_string<long int>&, protozero::pbf_writer&,
int32_t&, int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::multi_line_string<std::int64_t> const& geom,
                           ^~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:265:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::polygon<long int>&, protozero::pbf_writer&, int32_t&, int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::polygon<std::int64_t> const& poly,
                           ^~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:279:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::multi_polygon<long int>&, protozero::pbf_writer&, int32_t&,
int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::multi_polygon<std::int64_t> const& geom,
                           ^~~~~~~~~~~~~~~~~~~
/usr/include/vector_tile_geometry_encoder_pbf.ipp:299:27: note: candidate: 'bool
mapnik::vector_tile_impl::encode_geometry_pbf(const
mapbox::geometry::geometry<long int, std::vector>&, protozero::pbf_writer&,
int32_t&, int32_t&)'
 MAPNIK_VECTOR_INLINE bool
encode_geometry_pbf(mapbox::geometry::geometry<std::int64_t> const& geom,
                           ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/vector_tile_processor.ipp:3,
                 from /usr/include/vector_tile_processor.hpp:210,
                 from ../src/mapnik_map.cpp:15:
/usr/include/vector_tile_geometry_feature.hpp: In instantiation of 'void
mapnik::vector_tile_impl::geometry_to_feature_pbf_visitor::operator()(const T&)
[with T = mapbox::geometry::empty]':

It looks like geometry.hpp 1.0.0 caused this issue.

@plugwash
Copy link

plugwash commented Nov 19, 2018

I am far from an expert (just a maintainer of a Debian derivative who ran into this build failure) but here is my interpretation of what is going on.

mapbox::geometry::geometry is a "variant" type which can be one of a variety of subtypes.

There is an implementation of encode_geometry_pbf that takes said variant and uses some template magic to look up the type stored in the variant and dispatch it to the correct implementation.

It looks like a new type "empty" was added to the list of types supported by the variant. When the template magic trys to generate the dispatch for the variant the compiler fails to find the routine to dispatch to, for reasons I don't fully understand it considers this as "ambiguous" rather than "no match".

The fix would seem to be to add an implementation of encode_geometry_pbf for mapbox::geometry::empty . From reading the existing "multi point" implementation I belive this implementation should simply return false, but I am far from an expert.

@akx
Copy link

akx commented Jul 23, 2019

Hmm, since Travis passes mostly fine (and it builds using clang), I think this might be a gcc-only problem?

@plugwash
Copy link

what version of mapnik-vector-tile are you testing with? It looks like this has been fixed (with a more aggressive patch than the one I used) in the master branch of mapnik-vector-tile ( mapbox/mapnik-vector-tile@29fae7a ) , though there don't seem to have been any releases since.

@akx
Copy link

akx commented Jul 23, 2019

Actually, no, clang++ fails the same way. :(

I'm building 3fecdfa from source in a Docker container.

I just wonder how Travis seems to pass alright with the current master...

@akx
Copy link

akx commented Jul 23, 2019

Ah, this might be the thing:

If building against an external Mapnik please know that Mapnik Vector Tile does not currently support Mapnik 3.1.x.

I'm currently on Mapnik master too, which identifies itself as 4.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants