aboutsummaryrefslogtreecommitdiff
path: root/ports/caffe2
diff options
context:
space:
mode:
authorCarlos O'Ryan <coryan@users.noreply.github.com>2021-09-22 13:09:55 -0700
committerGitHub <noreply@github.com>2021-09-22 13:09:55 -0700
commitb29f8ef37edb1cedd5c2e403dbcb355443b939f6 (patch)
tree4ccc9c0b3655d54b05c41e88f3e129125eac1800 /ports/caffe2
parent93885afd50ff1a1408e1785dceffb01ff648c7d9 (diff)
downloadvcpkg-b29f8ef37edb1cedd5c2e403dbcb355443b939f6.tar.gz
vcpkg-b29f8ef37edb1cedd5c2e403dbcb355443b939f6.zip
[protobuf] upgrade to latest release (v3.18.0) (#20208)
* [protobuf] upgrade to latest release (v3.18.0) This requires patching OpenCV as it uses a function removed in the latest version of protobuf (FWIW, upstream OpenCV has a similar patch). * The arcus port also needs a patch * The caffe2 port also needs a patch * The brpc port also needs a patch
Diffstat (limited to 'ports/caffe2')
-rw-r--r--ports/caffe2/fix-protobuf-deprecated.patch26
-rw-r--r--ports/caffe2/portfile.cmake1
-rw-r--r--ports/caffe2/vcpkg.json2
3 files changed, 28 insertions, 1 deletions
diff --git a/ports/caffe2/fix-protobuf-deprecated.patch b/ports/caffe2/fix-protobuf-deprecated.patch
new file mode 100644
index 000000000..4f594d430
--- /dev/null
+++ b/ports/caffe2/fix-protobuf-deprecated.patch
@@ -0,0 +1,26 @@
+diff --git a/caffe2/utils/proto_utils.cc b/caffe2/utils/proto_utils.cc
+index ab2d756..2c36ec4 100644
+--- a/caffe2/utils/proto_utils.cc
++++ b/caffe2/utils/proto_utils.cc
+@@ -102,10 +102,9 @@ bool ReadProtoFromBinaryFile(const char* filename, MessageLite* proto) {
+ ::google::protobuf::io::CopyingInputStreamAdaptor stream(
+ new IfstreamInputStream(filename));
+ stream.SetOwnsCopyingStream(true);
+- // Total bytes hard limit / warning limit are set to 1GB and 512MB
+- // respectively.
++ // Total bytes hard limit is set to 1GB.
+ ::google::protobuf::io::CodedInputStream coded_stream(&stream);
+- coded_stream.SetTotalBytesLimit(1024LL << 20, 512LL << 20);
++ coded_stream.SetTotalBytesLimit(1024LL << 20);
+ return proto->ParseFromCodedStream(&coded_stream);
+ }
+
+@@ -155,7 +154,7 @@ bool ReadProtoFromBinaryFile(const char* filename, MessageLite* proto) {
+ std::unique_ptr<CodedInputStream> coded_input(
+ new CodedInputStream(raw_input.get()));
+ // A hack to manually allow using very large protocol buffers.
+- coded_input->SetTotalBytesLimit(1073741824, 536870912);
++ coded_input->SetTotalBytesLimit(1073741824);
+ bool success = proto->ParseFromCodedStream(coded_input.get());
+ coded_input.reset();
+ raw_input.reset();
diff --git a/ports/caffe2/portfile.cmake b/ports/caffe2/portfile.cmake
index 0b19b9eb9..d7ec68e6a 100644
--- a/ports/caffe2/portfile.cmake
+++ b/ports/caffe2/portfile.cmake
@@ -13,6 +13,7 @@ vcpkg_from_github(
PATCHES
msvc-fixes.patch
fix-space.patch
+ fix-protobuf-deprecated.patch
)
if(VCPKG_CRT_LINKAGE STREQUAL static)
diff --git a/ports/caffe2/vcpkg.json b/ports/caffe2/vcpkg.json
index 1f4f34d63..eeecad531 100644
--- a/ports/caffe2/vcpkg.json
+++ b/ports/caffe2/vcpkg.json
@@ -1,7 +1,7 @@
{
"name": "caffe2",
"version-string": "0.8.1",
- "port-version": 4,
+ "port-version": 5,
"description": "Caffe2 is a lightweight, modular, and scalable deep learning framework.",
"homepage": "https://github.com/caffe2/caffe2",
"supports": "!x86",