The package rpms/fbthrift.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/fbthrift.git/commit/?id=79f0c3bcc...
https://src.fedoraproject.org/cgit/rpms/fbthrift.git/commit/?id=89da20efb....
Change:
+%ifarch i686 x86_64
+ExcludeArch: s390x
Thanks.
Full change:
============
commit 047938dc5e198fa6c6092257ec59eb5137abf568
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Nov 4 15:54:22 2020 -0800
Remove unneeded patch
diff --git a/fbthrift-2020.11.02.00-fix_static_build.patch
b/fbthrift-2020.11.02.00-fix_static_build.patch
deleted file mode 100644
index 41ec22a..0000000
--- a/fbthrift-2020.11.02.00-fix_static_build.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 934da73ea8b3b491b6b79f6062c07586941d4f27 Mon Sep 17 00:00:00 2001
-From: Michel Alexandre Salim <michel(a)michel-slm.name>
-Date: Wed, 4 Nov 2020 10:05:57 -0800
-Subject: [PATCH] Fix static build
-
-Signed-off-by: Michel Alexandre Salim <michel(a)michel-slm.name>
----
- thrift/compiler/CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/thrift/compiler/CMakeLists.txt b/thrift/compiler/CMakeLists.txt
-index c0e134cc6..a82ea06d0 100644
---- a/thrift/compiler/CMakeLists.txt
-+++ b/thrift/compiler/CMakeLists.txt
-@@ -145,7 +145,6 @@ add_executable(
- compiler.cc
- mutator/mutator.cc
- validator/diagnostic.cc
-- validator/validator.cc
- ast/visitor.cc
- )
- target_link_libraries(
---
-2.28.0
-
commit 4daa5edc041aed0ec77703075ca26d397b59d944
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Nov 4 15:53:43 2020 -0800
Rebase patch on top of upstream CMakeLists.txt change
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
b/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
index a3a3bb2..12e9d7c 100644
--- a/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
+++ b/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
@@ -1,17 +1,16 @@
-From 20792d34c478693be3163be51156275994db6c68 Mon Sep 17 00:00:00 2001
+From 1e3c68e045ee06c4209d3f9d90e162b67f7c9542 Mon Sep 17 00:00:00 2001
From: Michel Alexandre Salim <michel(a)michel-slm.name>
-Date: Tue, 3 Nov 2020 11:43:52 -0800
+Date: Wed, 4 Nov 2020 11:44:35 -0800
Subject: [PATCH] Fix undefined-non-weak-symbol warnings
-see
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
+Signed-off-by: Michel Alexandre Salim <michel(a)michel-slm.name>
---
- thrift/compiler/CMakeLists.txt | 3 +++
- thrift/lib/cpp/CMakeLists.txt | 3 +++
- thrift/lib/cpp2/CMakeLists.txt | 6 ++++++
- 3 files changed, 12 insertions(+)
+ thrift/compiler/CMakeLists.txt | 4 +++-
+ thrift/lib/cpp2/CMakeLists.txt | 9 +++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/thrift/compiler/CMakeLists.txt b/thrift/compiler/CMakeLists.txt
-index 1ab985ac6..c0e134cc6 100644
+index 1ab985ac6..a82ea06d0 100644
--- a/thrift/compiler/CMakeLists.txt
+++ b/thrift/compiler/CMakeLists.txt
@@ -40,6 +40,7 @@ add_library(
@@ -35,41 +34,30 @@ index 1ab985ac6..c0e134cc6 100644
compiler_base
compiler_lib
mustache_lib
-diff --git a/thrift/lib/cpp/CMakeLists.txt b/thrift/lib/cpp/CMakeLists.txt
-index 763e9b844..4bfdbfc7d 100644
---- a/thrift/lib/cpp/CMakeLists.txt
-+++ b/thrift/lib/cpp/CMakeLists.txt
-@@ -60,6 +60,9 @@ add_library(
- protocol/TProtocolException.cpp
- protocol/TSimpleJSONProtocol.cpp
- ${reflection-cpp2-SOURCES}
-+ util/VarintUtils.cpp
-+ ../cpp2/gen/module_types_cpp.cpp
-+ ../cpp2/protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep
cycle
+@@ -142,7 +145,6 @@ add_executable(
+ compiler.cc
+ mutator/mutator.cc
+ validator/diagnostic.cc
+- validator/validator.cc
+ ast/visitor.cc
)
- add_dependencies(protocol reflection-cpp2-target)
target_link_libraries(
diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt
-index edc34cae5..90ef25304 100644
+index e6a4673af..1e757f5c6 100644
--- a/thrift/lib/cpp2/CMakeLists.txt
+++ b/thrift/lib/cpp2/CMakeLists.txt
-@@ -33,12 +33,15 @@ add_library(
+@@ -34,6 +34,10 @@ add_library(
thriftmetadata
${metadata-cpp2-SOURCES}
+ gen/module_types_cpp.cpp
+ protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep cycle
++ ../cpp/protocol/TProtocolException.cpp
++ ../cpp/util/VarintUtils.cpp
)
add_dependencies(thriftmetadata metadata-cpp2-target)
target_link_libraries(
- thriftmetadata
- PUBLIC
- Folly::folly
-+ protocol
- )
-
- bypass_source_check("${frozen-cpp2-SOURCES}")
-@@ -56,6 +59,7 @@ target_link_libraries(
+@@ -57,6 +61,7 @@ target_link_libraries(
PUBLIC
Folly::folly
thriftmetadata
@@ -77,21 +65,24 @@ index edc34cae5..90ef25304 100644
${GLOG_LIBRARIES}
${LIBGFLAGS_LIBRARY}
)
-@@ -66,12 +70,14 @@ add_library(
+@@ -67,6 +72,9 @@ add_library(
${RpcMetadata-cpp2-SOURCES}
gen/module_types_cpp.cpp
+ protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep cycle
++ ../cpp/protocol/TProtocolException.cpp
++ ../cpp/util/VarintUtils.cpp
)
add_dependencies(rpcmetadata RpcMetadata-cpp2-target)
target_link_libraries(
- rpcmetadata
- PUBLIC
- Folly::folly
-+ protocol
+@@ -93,6 +101,7 @@ add_library(
+ ../cpp/protocol/TBase64Utils.cpp
+ ../cpp/protocol/TProtocolException.cpp
+ ../cpp/protocol/TSimpleJSONProtocol.cpp
++ ../cpp/util/VarintUtils.cpp
+ ${reflection-cpp2-SOURCES}
)
-
- add_library(
+ add_dependencies(thriftprotocol reflection-cpp2-target)
--
2.28.0
diff --git a/fbthrift-2020.11.02.00-fuse_protocol_thriftprotocol.patch
b/fbthrift-2020.11.02.00-fuse_protocol_thriftprotocol.patch
new file mode 100644
index 0000000..16d7036
--- /dev/null
+++ b/fbthrift-2020.11.02.00-fuse_protocol_thriftprotocol.patch
@@ -0,0 +1,147 @@
+From 54dc36c450a09d5f41c0bc31b59247063ed30ed2 Mon Sep 17 00:00:00 2001
+From: Alexey Spiridonov <lesha(a)fb.com>
+Date: Wed, 4 Nov 2020 08:43:54 -0800
+Subject: [PATCH] Fuse OSS library `protocol` into `thriftprotocol`
+
+Summary:
+I am trying to have Bistro use `find_package(FBThrift CONFIG REQUIRED)` to depend on
FBThrift.
+
+Unfortunately, if I do that, and link against `FBThrift::thrift2`, my build fails to link
with:
+
+```
+.../libprotocol.so.1.0.0: undefined reference to
`apache::thrift::CompactProtocolReader::throwBadType(unsigned char)'
+.../libprotocol.so.1.0.0: undefined reference to
`apache::thrift::CompactProtocolReader::readFieldBeginWithStateMediumSlow(apache::thrift::CompactProtocolReader::StructReadState&,
short)'
+collect2: error: ld returned 1 exit status
+```
+
+This is due to a cyclic dependency between `protocol` (aka Thrift1) and `thriftprotocol`
(aka Thrift2). Specifically:
+ - `thriftprotocol` explicitly depends on `protocol`
+ - `protocol` has an undeclared dep on `thriftprotocol` because it includes the Thrift2
build of the "reflection" interface.
+
+IMO, the "right" fix would be to make `STATIC` all "internal" Thrift
libraries, and export only a `libthrift2.so` for external consumption.
+
+However, I don't have cycles to update the entire Thrift build to do this.
+
+Therefore, fusing the circularly dependent libraries is the path of least resistance to
letting my project depend on Thrift.
+
+Reviewed By: nlaptev, yfeldblum
+
+Differential Revision: D24685618
+
+fbshipit-source-id: a679d7b3556d1c9859b64f69f98bfa6d48398b1d
+---
+ thrift/lib/cpp/CMakeLists.txt | 27 ++-------------------------
+ thrift/lib/cpp2/CMakeLists.txt | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 25 deletions(-)
+
+diff --git a/thrift/lib/cpp/CMakeLists.txt b/thrift/lib/cpp/CMakeLists.txt
+index 763e9b844..516fff445 100644
+--- a/thrift/lib/cpp/CMakeLists.txt
++++ b/thrift/lib/cpp/CMakeLists.txt
+@@ -12,7 +12,6 @@
+ # See the License for the specific language governing permissions and
+ # limitations under the License.
+
+-get_property(reflection-cpp2-SOURCES GLOBAL PROPERTY reflection-cpp2-SOURCES)
+
+ add_library(
+ thrift-core
+@@ -50,27 +49,6 @@ target_link_libraries(
+ ${GLOG_LIBRARIES}
+ )
+
+-bypass_source_check("${reflection-cpp2-SOURCES}")
+-add_library(
+- protocol
+-
+- protocol/TDebugProtocol.cpp
+- protocol/TJSONProtocol.cpp
+- protocol/TBase64Utils.cpp
+- protocol/TProtocolException.cpp
+- protocol/TSimpleJSONProtocol.cpp
+- ${reflection-cpp2-SOURCES}
+-)
+-add_dependencies(protocol reflection-cpp2-target)
+-target_link_libraries(
+- protocol
+- PUBLIC
+- fmt::fmt
+- Folly::folly
+- ${GLOG_LIBRARIES}
+- thrift-core
+-)
+-
+ add_library(
+ transport
+
+@@ -135,7 +113,7 @@ target_link_libraries(
+ INTERFACE
+ async
+ concurrency
+- protocol
++ thriftprotocol
+ transport
+ Folly::folly
+ ${GLOG_LIBRARIES}
+@@ -157,7 +135,7 @@ endforeach()
+
+ if (BUILD_SHARED_LIBS)
+ # all but thrift since it's an interface
+- set_target_properties(thrift-core concurrency protocol transport async
++ set_target_properties(thrift-core concurrency transport async
+ PROPERTIES VERSION ${PROJECT_VERSION}
+ )
+ endif()
+@@ -166,7 +144,6 @@ install(
+ TARGETS
+ thrift-core
+ concurrency
+- protocol
+ transport
+ async
+ thrift
+diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt
+index edc34cae5..e6a4673af 100644
+--- a/thrift/lib/cpp2/CMakeLists.txt
++++ b/thrift/lib/cpp2/CMakeLists.txt
+@@ -27,6 +27,7 @@ set(LIB_CPP2_HOME ${CMAKE_CURRENT_SOURCE_DIR})
+ get_property(RpcMetadata-cpp2-SOURCES GLOBAL PROPERTY RpcMetadata-cpp2-SOURCES)
+ get_property(metadata-cpp2-SOURCES GLOBAL PROPERTY metadata-cpp2-SOURCES)
+ get_property(frozen-cpp2-SOURCES GLOBAL PROPERTY frozen-cpp2-SOURCES)
++get_property(reflection-cpp2-SOURCES GLOBAL PROPERTY reflection-cpp2-SOURCES)
+
+ bypass_source_check("${metadata-cpp2-SOURCES}")
+ add_library(
+@@ -74,6 +75,7 @@ target_link_libraries(
+ Folly::folly
+ )
+
++bypass_source_check("${reflection-cpp2-SOURCES}")
+ add_library(
+ thriftprotocol
+
+@@ -85,13 +87,24 @@ add_library(
+ protocol/JSONProtocol.cpp
+ protocol/Serializer.cpp
+ protocol/VirtualProtocol.cpp
++
++ ../cpp/protocol/TDebugProtocol.cpp
++ ../cpp/protocol/TJSONProtocol.cpp
++ ../cpp/protocol/TBase64Utils.cpp
++ ../cpp/protocol/TProtocolException.cpp
++ ../cpp/protocol/TSimpleJSONProtocol.cpp
++ ${reflection-cpp2-SOURCES}
+ )
++add_dependencies(thriftprotocol reflection-cpp2-target)
+ target_link_libraries(
+ thriftprotocol
+ PUBLIC
++ fmt::fmt
+ thrift
+ Folly::folly
+ wangle::wangle
++ ${GLOG_LIBRARIES}
++ thrift-core
+ )
+
+ add_library(
diff --git a/fbthrift.spec b/fbthrift.spec
index 91a8a6a..74a1c0f 100644
--- a/fbthrift.spec
+++ b/fbthrift.spec
@@ -1,4 +1,4 @@
-# Depends on fizz, which has linking issues on some platforms:
+## Depends on fizz, which has linking issues on some platforms:
#
https://bugzilla.redhat.com/show_bug.cgi?id=1893332
%ifarch i686 x86_64
%bcond_without static
@@ -10,14 +10,14 @@
Name: fbthrift
Version: 2020.11.02.00
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Facebook's branch of Apache Thrift, including a new C++ server
License: ASL 2.0
URL:
https://github.com/facebook/fbthrift
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
-Patch0: %{name}-%{version}-fix_undefined_symbols.patch
-Patch1: %{name}-%{version}-fix_static_build.patch
+Patch0:
%{url}/commit/54dc36c450a09d5f41c0bc31b59247063ed30ed2.patch#/%{name}-%{version}-fuse_protocol_thriftprotocol.patch
+Patch1: %{name}-%{version}-fix_undefined_symbols.patch
# Folly is known not to work on big-endian CPUs
#
https://bugzilla.redhat.com/show_bug.cgi?id=1894635
@@ -140,6 +140,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%changelog
+* Wed Nov 4 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-3
+- Rebase patch on top of upstream CMakeLists.txt change
+
* Wed Nov 4 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-2
- Enable static subpackage on architectures where fizz-static is available
commit 79f0c3bcc67bc48af93589df1da150da095ea552
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Nov 4 10:35:46 2020 -0800
Enable static subpackage on architectures where fizz-static is available
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/fbthrift-2020.11.02.00-fix_static_build.patch
b/fbthrift-2020.11.02.00-fix_static_build.patch
new file mode 100644
index 0000000..41ec22a
--- /dev/null
+++ b/fbthrift-2020.11.02.00-fix_static_build.patch
@@ -0,0 +1,25 @@
+From 934da73ea8b3b491b6b79f6062c07586941d4f27 Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <michel(a)michel-slm.name>
+Date: Wed, 4 Nov 2020 10:05:57 -0800
+Subject: [PATCH] Fix static build
+
+Signed-off-by: Michel Alexandre Salim <michel(a)michel-slm.name>
+---
+ thrift/compiler/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/thrift/compiler/CMakeLists.txt b/thrift/compiler/CMakeLists.txt
+index c0e134cc6..a82ea06d0 100644
+--- a/thrift/compiler/CMakeLists.txt
++++ b/thrift/compiler/CMakeLists.txt
+@@ -145,7 +145,6 @@ add_executable(
+ compiler.cc
+ mutator/mutator.cc
+ validator/diagnostic.cc
+- validator/validator.cc
+ ast/visitor.cc
+ )
+ target_link_libraries(
+--
+2.28.0
+
diff --git a/fbthrift.spec b/fbthrift.spec
index 6a14c52..91a8a6a 100644
--- a/fbthrift.spec
+++ b/fbthrift.spec
@@ -1,15 +1,26 @@
+# Depends on fizz, which has linking issues on some platforms:
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1893332
+%ifarch i686 x86_64
+%bcond_without static
+%else
+%bcond_with static
+%endif
+
+%global _static_builddir static_build
+
Name: fbthrift
Version: 2020.11.02.00
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Facebook's branch of Apache Thrift, including a new C++ server
License: ASL 2.0
URL:
https://github.com/facebook/fbthrift
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: %{name}-%{version}-fix_undefined_symbols.patch
+Patch1: %{name}-%{version}-fix_static_build.patch
# Folly is known not to work on big-endian CPUs
-# will add bz# after review
+#
https://bugzilla.redhat.com/show_bug.cgi?id=1894635
ExcludeArch: s390x
BuildRequires: cmake
@@ -22,6 +33,11 @@ BuildRequires: fizz-devel
BuildRequires: folly-devel
BuildRequires: python3-six
BuildRequires: wangle-devel
+%if %{with static}
+BuildRequires: fizz-static
+BuildRequires: folly-static
+BuildRequires: wangle-static
+%endif
%description
Thrift is a serialization and RPC framework for service communication. Thrift
@@ -47,11 +63,39 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
+%if %{with static}
+%package static
+Summary: Static development libraries for %{name}
+Requires: %{name}-devel%{?_isa} = %{version}-%{release}
+
+%description static
+The %{name}-static package contains static libraries for
+developing applications that use %{name}.
+%endif
+
+
%prep
%autosetup -p1
%build
+%if %{with static}
+# static build
+mkdir %{_static_builddir}
+pushd %{_static_builddir}
+%cmake .. \
+ -DBUILD_SHARED_LIBS=OFF \
+ -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name}-static \
+ -DPACKAGE_VERSION=%{version} \
+ -DFIZZ_ROOT=%{_libdir}/cmake/fizz-static \
+ -DFOLLY_ROOT=%{_libdir}/cmake/folly-static \
+ -DWANGLE_ROOT=%{_libdir}/cmake/wangle-static \
+ -Denable_tests=OFF
+%cmake_build
+popd
+
+%endif
+
%cmake \
-DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
-DCMAKE_SKIP_INSTALL_RPATH=TRUE \
@@ -61,7 +105,15 @@ developing applications that use %{name}.
%install
+%if %{with static}
+# static build
+pushd %{_static_builddir}
+%cmake_install
+popd
+%endif
+
%cmake_install
+
find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
@@ -80,8 +132,17 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%{_libdir}/*.so
%{_libdir}/cmake/%{name}
+%if %{with static}
+%files static
+%{_libdir}/*.a
+%{_libdir}/cmake/%{name}-static
+%endif
+
%changelog
+* Wed Nov 4 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-2
+- Enable static subpackage on architectures where fizz-static is available
+
* Mon Nov 2 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-1
- Update to 2020.11.02.00
- Fix undefined symbol warnings
commit 89da20efb42fc42c2faa073eb1cb89a3026af652
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Wed Nov 4 08:16:07 2020 -0800
Initial import
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..27c8098
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/fbthrift-2020.11.02.00.tar.gz
diff --git a/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
b/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
new file mode 100644
index 0000000..a3a3bb2
--- /dev/null
+++ b/fbthrift-2020.11.02.00-fix_undefined_symbols.patch
@@ -0,0 +1,97 @@
+From 20792d34c478693be3163be51156275994db6c68 Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <michel(a)michel-slm.name>
+Date: Tue, 3 Nov 2020 11:43:52 -0800
+Subject: [PATCH] Fix undefined-non-weak-symbol warnings
+
+see
https://fedoraproject.org/wiki/UnderstandingDSOLinkChange
+---
+ thrift/compiler/CMakeLists.txt | 3 +++
+ thrift/lib/cpp/CMakeLists.txt | 3 +++
+ thrift/lib/cpp2/CMakeLists.txt | 6 ++++++
+ 3 files changed, 12 insertions(+)
+
+diff --git a/thrift/compiler/CMakeLists.txt b/thrift/compiler/CMakeLists.txt
+index 1ab985ac6..c0e134cc6 100644
+--- a/thrift/compiler/CMakeLists.txt
++++ b/thrift/compiler/CMakeLists.txt
+@@ -40,6 +40,7 @@ add_library(
+ ast/t_typedef.cc
+ ast/base_types.cc
+ ast/t_scope.cc
++ ast/visitor.cc
+ )
+ target_link_libraries(compiler_ast ${OPENSSL_LIBRARIES})
+
+@@ -115,10 +116,12 @@ add_library(
+
+ ${GENERATOR_FILES}
+ $<TARGET_OBJECTS:compiler_generate_templates>
++ validator/validator.cc
+ )
+ target_link_libraries(
+ compiler_generators
+
++ compiler_ast
+ compiler_base
+ compiler_lib
+ mustache_lib
+diff --git a/thrift/lib/cpp/CMakeLists.txt b/thrift/lib/cpp/CMakeLists.txt
+index 763e9b844..4bfdbfc7d 100644
+--- a/thrift/lib/cpp/CMakeLists.txt
++++ b/thrift/lib/cpp/CMakeLists.txt
+@@ -60,6 +60,9 @@ add_library(
+ protocol/TProtocolException.cpp
+ protocol/TSimpleJSONProtocol.cpp
+ ${reflection-cpp2-SOURCES}
++ util/VarintUtils.cpp
++ ../cpp2/gen/module_types_cpp.cpp
++ ../cpp2/protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep
cycle
+ )
+ add_dependencies(protocol reflection-cpp2-target)
+ target_link_libraries(
+diff --git a/thrift/lib/cpp2/CMakeLists.txt b/thrift/lib/cpp2/CMakeLists.txt
+index edc34cae5..90ef25304 100644
+--- a/thrift/lib/cpp2/CMakeLists.txt
++++ b/thrift/lib/cpp2/CMakeLists.txt
+@@ -33,12 +33,15 @@ add_library(
+ thriftmetadata
+
+ ${metadata-cpp2-SOURCES}
++ gen/module_types_cpp.cpp
++ protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep cycle
+ )
+ add_dependencies(thriftmetadata metadata-cpp2-target)
+ target_link_libraries(
+ thriftmetadata
+ PUBLIC
+ Folly::folly
++ protocol
+ )
+
+ bypass_source_check("${frozen-cpp2-SOURCES}")
+@@ -56,6 +59,7 @@ target_link_libraries(
+ PUBLIC
+ Folly::folly
+ thriftmetadata
++ thriftprotocol
+ ${GLOG_LIBRARIES}
+ ${LIBGFLAGS_LIBRARY}
+ )
+@@ -66,12 +70,14 @@ add_library(
+
+ ${RpcMetadata-cpp2-SOURCES}
+ gen/module_types_cpp.cpp
++ protocol/CompactProtocol.cpp # can't link against thriftprotocol, dep cycle
+ )
+ add_dependencies(rpcmetadata RpcMetadata-cpp2-target)
+ target_link_libraries(
+ rpcmetadata
+ PUBLIC
+ Folly::folly
++ protocol
+ )
+
+ add_library(
+--
+2.28.0
+
diff --git a/fbthrift.spec b/fbthrift.spec
new file mode 100644
index 0000000..6a14c52
--- /dev/null
+++ b/fbthrift.spec
@@ -0,0 +1,97 @@
+Name: fbthrift
+Version: 2020.11.02.00
+Release: 1%{?dist}
+Summary: Facebook's branch of Apache Thrift, including a new C++ server
+
+License: ASL 2.0
+URL:
https://github.com/facebook/fbthrift
+Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
+Patch0: %{name}-%{version}-fix_undefined_symbols.patch
+
+# Folly is known not to work on big-endian CPUs
+# will add bz# after review
+ExcludeArch: s390x
+
+BuildRequires: cmake
+BuildRequires: gcc-c++
+# Tool dependencies
+BuildRequires: bison
+BuildRequires: flex
+# Library dependencies
+BuildRequires: fizz-devel
+BuildRequires: folly-devel
+BuildRequires: python3-six
+BuildRequires: wangle-devel
+
+%description
+Thrift is a serialization and RPC framework for service communication. Thrift
+enables these features in all major languages, and there is strong support for
+C++, Python, Hack, and Java. Most services at Facebook are written using Thrift
+for RPC, and some storage systems use Thrift for serializing records on disk.
+
+Facebook Thrift is not a distribution of Apache Thrift. This is an evolved
+internal branch of Thrift that Facebook re-released to open source community in
+February 2014. Facebook Thrift was originally released closely tracking Apache
+Thrift but is now evolving in new directions. In particular, the compiler was
+rewritten from scratch and the new implementation features a fully asynchronous
+Thrift server.
+
+
+%package devel
+Summary: Development files for %{name}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Conflicts: thrift-devel
+
+%description devel
+The %{name}-devel package contains libraries and header files for
+developing applications that use %{name}.
+
+
+%prep
+%autosetup -p1
+
+
+%build
+%cmake \
+ -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/%{name} \
+ -DCMAKE_SKIP_INSTALL_RPATH=TRUE \
+ -DPACKAGE_VERSION=%{version} \
+ -Denable_tests=ON
+%cmake_build
+
+
+%install
+%cmake_install
+find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
+
+
+%check
+%ctest
+
+
+%files
+%license LICENSE
+%{_bindir}/thrift1
+%{_libdir}/*.so.*
+
+%files devel
+%doc CODE_OF_CONDUCT.md CONTRIBUTING.md README.md
+%{_includedir}/*
+%{_libdir}/*.so
+%{_libdir}/cmake/%{name}
+
+
+%changelog
+* Mon Nov 2 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.11.02.00-1
+- Update to 2020.11.02.00
+- Fix undefined symbol warnings
+
+* Mon Nov 2 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.10.26.00-3
+- Mark fbthrift-devel as conflicting with thrift-devel
+- Disable RPATH when installing libraries
+
+* Thu Oct 29 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.10.26.00-2
+- Use shorter, canonical URL for source
+
+* Tue Oct 27 2020 Michel Alexandre Salim <salimma(a)fedoraproject.org> -
2020.10.26.00-1
+- Initial package
diff --git a/sources b/sources
new file mode 100644
index 0000000..5b42389
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (fbthrift-2020.11.02.00.tar.gz) =
e1deda0ede7a90d2990dcf2ef040183df8eb5fb3f9d8854d17eb6d788a3d138016d2b564ba34066be8927cd6e2bd32d265913644254919376f52d1cfaabbc5a6