Closed JamesChevalier closed 2 years ago
@JamesChevalier yes, I think the best way is to replace the flatbuffers/
directory with updated versions. Do you want to open a PR?
At some point there seemed to be CI for building on different OS: https://github.com/felt/tippecanoe/blob/main/.travis.yml but I think travis is dead - would be nice to bring this back to catch these
Updating the files in flatbuffers
went smoothly enough ( https://github.com/JamesChevalier/tippecanoe/commit/8e352d66c1083932820406cf77287e715de8e297 ), but I'm unsure how to generate the feature_generated.h
and header_generated.h
files where were included in the initial commit ( https://github.com/felt/tippecanoe/commit/a3dec5116dce33340dfb23a7669581625d0af8ee ).
https://github.com/google/flatbuffers/blob/master/docs/source/FlatBuffers.md includes:
Use flatc (the FlatBuffer compiler) to generate a C++ header (or Java/Kotlin/C#/Go/Python.. classes) with helper classes to access and construct serialized data. This header (say mydata_generated.h) only depends on flatbuffers.h, which defines the core functionality.
and https://github.com/google/flatbuffers/blob/master/docs/source/Compiler.md includes some usage notes that suggest a command along the lines of flatc --cpp -o flatgeobuf -I flatbuffers
but I'm completely stumped on which file(s) I'd be pointing to for it to generate feature_generated.h
and header_generated.h
.
If it's easy enough to explain next steps, I'm happy to continue. If it's easier for you/someone else to take over entirely, that's ok too.
You would need to use the schema definitions here: https://github.com/flatgeobuf/flatgeobuf/tree/master/src/fbs
In fact, we should probably bump the generated headers in that repo simultaneously with updating them in this one
Thanks for your help, @bdon ... I was able to submit https://github.com/felt/tippecanoe/pull/26 with detailed notes in each commit. Hopefully those notes are helpful in confirming that I've done everything correctly.
In fact, we should probably bump the generated headers in that repo simultaneously with updating them in this one
I'm unsure of what's required within flatgeobuf for that suggested step. Are you suggesting I update the package.json
from 2.0.7 to 22.9.29? (https://github.com/flatgeobuf/flatgeobuf/blob/master/package.json#L59)
I would suggest opening a PR to replace *_generated.h
in https://github.com/flatgeobuf/flatgeobuf/tree/master/src/cpp and verify any programs in there work as well
Something about https://github.com/felt/tippecanoe/commit/35b576d0fdbb5062a6a0f861e7eba1a3fc3891a2 (v2.1.0) broke compilation within Alpine Linux. It's corresponding pull request is https://github.com/protomaps/tippecanoe/pull/10
This can be reproduced via these steps:
docker run -it --rm alpine:latest sh
apk add git build-base sqlite-dev zlib-dev
git clone https://github.com/felt/tippecanoe
cd tippecanoe
git checkout 7f69b803818e18b14d3e84245d653a66b06e01a3
make
git reset --hard
git checkout bb2aa65bcc2e2a4779e28755e26b62fa3bcbbdb5
make
The error message it produces is:
(I noticed mentions of sh vs bash in https://github.com/felt/tippecanoe/issues/18 and tested this via bash with the same result)
I believe this is related to https://github.com/google/flatbuffers/issues/7265 which they resolved by moving
#include "flatbuffers/util.h"
frominclude/flatbuffers/verifier.h
tosrc/binary_annotator.h
(which doesn't exist in this repository) https://github.com/google/flatbuffers/pull/7266/filesCommenting out
#include "flatbuffers/util.h"
fromflatbuffers/verifier.h
resulted in a successful compilation.I'm quite out of my depth at this point, so I don't want to waste anyone's time by submitting a pull request which removes that line if that's not the appropriate path forward. Another approach might be to replace the files with updated versions from https://github.com/google/flatbuffers/tree/master/include/flatbuffers 🤷
I'm happy to continue helping resolve this issue, but I think it's best if I get direction on which of the paths is most appropriate ... if either of them are 😅