Opened 3 years ago

Closed 16 months ago

Last modified 15 months ago

#5099 closed defect (fixed)

Running make twice compiles again under postgis

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.4.0
Component: build Version: master
Keywords: Cc:

Description

Running make a second time after the first make, in top-level dir, results in some files being built again. This should NOT happen, in a sane system. Files that are built again are under the postgis/ directory.

I was under the impression that I already filed this ticket but upon looking I could not find a precedent one.

Change History (8)

comment:1 by strk, 3 years ago

This is what's being re-built:

---- Making all in postgis
make[1]: Entering directory '/home/src/postgis/postgis/build/postgis'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I../../liblwgeom -I../liblwgeom -std=gnu99 -O2 -g -Wall -fno-math-errno -fno-signed-zeros -Wall -I../../libpgcommon -I../../deps/flatgeobuf -I../../deps/wagyu -I../../deps/uthash/include  -I/usr/local/include   -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG   -fPIC -DPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o vector_tile.pb-c.o vector_tile.pb-c.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I../../liblwgeom -I../liblwgeom -std=gnu99 -O2 -g -Wall -fno-math-errno -fno-signed-zeros -Wall -I../../libpgcommon -I../../deps/flatgeobuf -I../../deps/wagyu -I../../deps/uthash/include  -I/usr/local/include   -I/usr/include/libxml2 -I/usr/include -I/usr/include/json-c  -DNDEBUG   -fPIC -DPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o geobuf.pb-c.o geobuf.pb-c.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -shared -o postgis-3.3.so 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 vector_tile.pb-c.o geobuf.pb-c.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/wagyu/libwagyu.la -lstdc++ ../deps/flatgeobuf/libflatgeobuf.la -lstdc++ ../libpgcommon/libpgcommon.a ../liblwgeom/.libs/liblwgeom.a  -L/usr/local/lib -lgeos_c -lproj -ljson-c -lprotobuf-c -lxml2 -L/usr/lib/x86_64-linux-gnu -lSFCGAL -lgmpxx -Wl,--exclude-libs,ALL  -lm 

So it's basically:

  • vector_tile.pb-c.o
  • geobuf.pb-c.o

The two object files above, when rebuilt, trigger also rebuilding postgis-3.3.so

comment:2 by strk, 3 years ago

The *first* run of make already builds both vector_tile.pb-c.o and geobuf.pb-c.o. The second run reports (make --dry-run --trace geobuf-pb-c.o) that geobuf-pb.c.o is being rebuilt due to geobuf-pb-c.c being newer.

For some reason, the first make invocation is running protoc-c for producing those two .c files twice:

$ grep -n protoc-c make.log 
325:/usr/bin/protoc-c -I../../postgis --c_out=. ../../postgis/vector_tile.proto
327:/usr/bin/protoc-c -I../../postgis --c_out=. ../../postgis/geobuf.proto
329:/usr/bin/protoc-c -I../../postgis --c_out=. ../../postgis/vector_tile.proto
332:/usr/bin/protoc-c -I../../postgis --c_out=. ../../postgis/geobuf.proto

comment:3 by Sandro Santilli <strk@…>, 3 years ago

Resolution: fixed
Status: newclosed

In 2e487f25/git:

Fix double invocation of protobuf compiler and repeated builds

Closes #5099

comment:4 by strk, 2 years ago

Resolution: fixed
Status: closedreopened

This is happening again on my system as of [adfa7138aba1c486e6bda495e112738892fec94b/git]

comment:5 by robe, 2 years ago

Milestone: PostGIS 3.3.0PostGIS 3.4.0

comment:6 by strk, 16 months ago

This might have been fixed again with [a05989263dcb62b77ac5740f1b8ea2a025b9c9df/git] I'll see how to have a bot guard after this (marking build dir read-only after initial build sounds like a possible way to do it)

comment:7 by robe, 16 months ago

Resolution: fixed
Status: reopenedclosed

I'm going to close. We can reopen if it is still an issue.

comment:8 by Sandro Santilli <strk@…>, 15 months ago

In ed3d35f/git:

[gitlab-ci] Run make again as unprivileged user

Serves as an idempotence test.
References #5099

Note: See TracTickets for help on using tickets.