Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#5091 closed defect (fixed)

configure --without-protobuf broken

Reported by: tbussmann Owned by: strk
Priority: medium Milestone: PostGIS 3.2.2
Component: build/upgrade/install Version: 3.2.x
Keywords: Cc:


When I examined #5090 I found that the --without-protobuf configure option seem to be broken in PostGIS 3.2.0. The build fails with

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument  -Os -mmacosx-version-min=10.12 -arch arm64 -arch x86_64  -bundle -multiply_defined suppress -o postgis_module.o lwgeom_accum.o lwgeom_spheroid.o lwgeom_ogc.o lwgeom_functions_analytic.o lwgeom_inout.o lwgeom_functions_basic.o lwgeom_btree.o lwgeom_box.o lwgeom_box3d.o lwgeom_geos.o lwgeom_geos_prepared.o lwgeom_geos_clean.o lwgeom_geos_relatematch.o lwgeom_generate_grid.o lwgeom_export.o lwgeom_in_gml.o lwgeom_in_kml.o lwgeom_in_geohash.o lwgeom_in_geojson.o lwgeom_in_encoded_polyline.o lwgeom_triggers.o lwgeom_dump.o lwgeom_dumppoints.o lwgeom_functions_lrs.o lwgeom_functions_temporal.o lwgeom_rectree.o long_xact.o lwgeom_sqlmm.o lwgeom_rtree.o lwgeom_transform.o lwgeom_window.o gserialized_typmod.o gserialized_gist_2d.o gserialized_gist_nd.o gserialized_supportfn.o gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_nd.o brin_2d.o brin_nd.o brin_common.o gserialized_estimate.o geography_inout.o geography_btree.o geography_centroid.o geography_measurement.o geography_measurement_trees.o geometry_inout.o postgis_libprotobuf.o  mvt.o lwgeom_out_mvt.o geobuf.o lwgeom_out_geobuf.o lwgeom_out_geojson.o flatgeobuf.o lwgeom_in_flatgeobuf.o lwgeom_out_flatgeobuf.o postgis_legacy.o -lm   ../deps/flatgeobuf/  ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a  -L/Applications/ -lgeos_c -L/Applications/ -lproj -L/Applications/ -ljson-c  -L/Applications/ -lxml2 -lz -lpthread -liconv -lm    -lm -bundle_loader /Applications/
Undefined symbols for architecture arm64:
  "std::__1::__shared_weak_count::__get_deleter(std::type_info const&) const", referenced from:
      vtable for std::__1::__shared_ptr_emplace<FeatureItem, std::__1::allocator<FeatureItem> > in
  "std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
      _flatgeobuf_encode_header in
      _flatgeobuf_create_index in
      FlatGeobuf::PackedRTree::generateLevelBounds(unsigned long long, unsigned short) in
      FlatGeobuf::PackedRTree::search(double, double, double, double) const in
      FlatGeobuf::PackedRTree::streamSearch(unsigned long long, unsigned short, FlatGeobuf::NodeItem const&, std::__1::function<void (unsigned char*, unsigned long, unsigned long)> const&) in
      std::__1::vector<FlatGeobuf::NodeItem, std::__1::allocator<FlatGeobuf::NodeItem> >::__vallocate(unsigned long) in
      FlatGeobuf::GeometryWriter::writePA(POINTARRAY*) in

as this is not the case in PostGIS 3.1.5 I assume the new FlatGeobuf format support is depending on protobuf and would need to be disabled if HAVE_PROTOBUF=no but I haven't investigated further.

Change History (11)

comment:1 by Regina Obe <lr@…>, 5 months ago

Resolution: fixed
Status: newclosed

In ecad675/git:

Closes #5090 for PostGIS 3.2.1
Closes #5091 for PostGIS 3.2.1
Fix —with-protobuf-lib / —with-protobufdir broken

comment:2 by tbussmann, 5 months ago

Milestone: PostGIS 3.2.1PostGIS 3.2.2
Resolution: fixed
Status: closedreopened

the referenced commit does not deal with this issue, it seems to be closed in error. Verified to be still an issue against 3.2.1

comment:3 by strk, 4 months ago

Is the master branch not affected ? Because I can build fine after configuring —without-protobuf

comment:4 by strk, 4 months ago

I've actually found that make clean is broken, with —without-protobuf, maybe the build succeeds ONLY because I actually DO have protobuf. Will attempt a fix and report here, before backporting.

comment:5 by Sandro Santilli <strk@…>, 4 months ago

In 1535e01/git:

Only descend in deps if protoc is found

References #5091 in master branch (3.3.0dev)

comment:6 by strk, 4 months ago

tbussmann can you please try now, against master branch and let us know if it fixes the problem for you ?

comment:7 by tbussmann, 4 months ago

I rechecked with master but no - that changes did not fix it for me.

I got it to build when completely disabling the flatgeobuf support if protobuf-c is not available. But reading on the backgrounds of it, there should be no dependency as flatgeobuf is based on flatbuffers and not like geobuf on protbuf. So this was a red herring.

Experimenting further, I found that the build succeeds if I remove the suppression of wagyu despite we don't need it w/o protobuf. As both require a C++ compiler I then carefully checked the generated LDFLAGS and found the culprit: a single 'W' character git/ slipped in from copy&pasting the configure code in the original flatgeobuf changeset [3ae2c584/git]


comment:8 by strk, 4 months ago

Thanks, pushed to master branch

comment:9 by Sandro Santilli <strk@…>, 4 months ago

Resolution: fixed
Status: reopenedclosed

In 4323c22/git:

fix generation of FLATGEOBUF_LDFLAGS

because of WAGYU_LDFLAGS, this only had an impact when building
—without-protobuf. fixes #5091

comment:10 by Sandro Santilli <strk@…>, 4 months ago

In f7a8918/git:

fix generation of FLATGEOBUF_LDFLAGS

because of WAGYU_LDFLAGS, this only had an impact when building

References #5091 in stable-3.2 branch (3.2.2dev)

comment:11 by strk, 4 months ago

Can you test now ? Ideally both master and stable-3.2 branches

Note: See TracTickets for help on using tickets.