Skip to content

Commit 58cc594

Browse files
committed
build: update flatbuffers dependency to v23.5.26
Update the third_party flatbuffers library to v23.5.26, the current version in upstream TF. Synchronize the override BUILD and build_defs.bzl files with those from upstream TF at e4485c98eae. Also update the Makefile build, which downloads flatbuffers separately. Rebase the patch applied to the download. Regenerate the generated-and-checked-in schemas (see ci/sync_from_upstream_tf.sh), because they are stamped with the version of the flatbuffers library, and fail a static_assert if they are built with a different version of flatbuffers than they were generated with. BUG=unsuccessful attempt to fix warning in #2183
1 parent ba8364a commit 58cc594

File tree

7 files changed

+16627
-16506
lines changed

7 files changed

+16627
-16506
lines changed

tensorflow/lite/micro/tools/make/flatbuffers.patch

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h
2-
index a5ac10d..371b6fd 100644
2+
index 5c4cae79..1a631641 100644
33
--- a/include/flatbuffers/base.h
44
+++ b/include/flatbuffers/base.h
55
@@ -1,6 +1,16 @@
@@ -20,10 +20,10 @@ index a5ac10d..371b6fd 100644
2020

2121
// If activate should be declared and included first.
2222
diff --git a/include/flatbuffers/default_allocator.h b/include/flatbuffers/default_allocator.h
23-
index 8b173af..975d938 100644
23+
index d4724122..975d9380 100644
2424
--- a/include/flatbuffers/default_allocator.h
2525
+++ b/include/flatbuffers/default_allocator.h
26-
@@ -39,26 +39,20 @@ class DefaultAllocator : public Allocator {
26+
@@ -39,24 +39,18 @@ class DefaultAllocator : public Allocator {
2727
// This is to avoid having a statically or dynamically allocated default
2828
// allocator, or having to move it between the classes that may own it.
2929
inline uint8_t *Allocate(Allocator *allocator, size_t size) {
@@ -52,15 +52,11 @@ index 8b173af..975d938 100644
5252
}
5353

5454
} // namespace flatbuffers
55-
56-
-#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_
57-
\ No newline at end of file
58-
+#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_
5955
diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h
60-
index 89f3f30..6e6d0b3 100644
56+
index 8e8cac14..52dae316 100644
6157
--- a/include/flatbuffers/flexbuffers.h
6258
+++ b/include/flatbuffers/flexbuffers.h
63-
@@ -496,9 +496,24 @@ class Reference {
59+
@@ -495,9 +495,24 @@ class Reference {
6460
return static_cast<double>(ReadUInt64(Indirect(), byte_width_));
6561
case FBT_NULL: return 0.0;
6662
case FBT_STRING: {
@@ -86,10 +82,10 @@ index 89f3f30..6e6d0b3 100644
8682
case FBT_VECTOR: return static_cast<double>(AsVector().size());
8783
case FBT_BOOL:
8884
diff --git a/include/flatbuffers/util.h b/include/flatbuffers/util.h
89-
index 93a39de..1cd4e8f 100644
85+
index 1ccf3517..34a75193 100644
9086
--- a/include/flatbuffers/util.h
9187
+++ b/include/flatbuffers/util.h
92-
@@ -24,6 +24,12 @@
88+
@@ -23,6 +23,12 @@
9389
#include "flatbuffers/base.h"
9490
#include "flatbuffers/stl_emulation.h"
9591

@@ -102,4 +98,3 @@ index 93a39de..1cd4e8f 100644
10298
#ifndef FLATBUFFERS_PREFER_PRINTF
10399
# include <iomanip>
104100
# include <sstream>
105-

tensorflow/lite/micro/tools/make/flatbuffers_download.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,17 @@ DOWNLOADED_FLATBUFFERS_PATH=${DOWNLOADS_DIR}/flatbuffers
5454
if [ -d ${DOWNLOADED_FLATBUFFERS_PATH} ]; then
5555
echo >&2 "${DOWNLOADED_FLATBUFFERS_PATH} already exists, skipping the download."
5656
else
57-
ZIP_PREFIX="a66de58af9565586832c276fbb4251fc416bf07f"
57+
ZIP_PREFIX="v23.5.26"
5858
FLATBUFFERS_URL="https://github.com/google/flatbuffers/archive/${ZIP_PREFIX}.zip"
59-
FLATBUFFERS_MD5="51a7a96747e1c33eb4aac6d52513a02f"
59+
FLATBUFFERS_MD5="e87e8acd8e2d53653387ad78720316e2"
6060

6161
TEMPDIR="$(mktemp -d)"
6262
TEMPFILE="${TEMPDIR}/${ZIP_PREFIX}.zip"
6363
wget ${FLATBUFFERS_URL} -O "$TEMPFILE" >&2
6464
check_md5 "${TEMPFILE}" ${FLATBUFFERS_MD5}
6565

6666
unzip -qo "$TEMPFILE" -d "${TEMPDIR}" >&2
67-
mv "${TEMPDIR}/flatbuffers-${ZIP_PREFIX}" ${DOWNLOADED_FLATBUFFERS_PATH}
67+
mv "${TEMPDIR}/flatbuffers-${ZIP_PREFIX#v}" ${DOWNLOADED_FLATBUFFERS_PATH}
6868
rm -rf "${TEMPDIR}"
6969

7070
pushd ${DOWNLOADED_FLATBUFFERS_PATH} > /dev/null

0 commit comments

Comments
 (0)