Summary:
In OSS build, we need to enable coroutine with gnu++20 and clang.
When we build folly with CXX standard gnu++20 and clang, it will fail to build fizz, mvfst / wangle if these project has CXX standard set to 17.
example error log:
/usr/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_SHARED -DGFLAGS_IS_A_DLL=0 -DWANGLE_HAVE_SSL_SESSION_DUP -Dwangle_EXPORTS -I/tmp/fbcode_builder_getdeps-ZappZfbthriftZbuildZfbcode_builder-root/repos/github.com-facebook-wangle.git/wangle/.. -isystem /usr/include/libdwarf -isystem /usr/include/libiberty -std=gnu++20 -O2 -fcoroutines-ts -I/usr/include/python3.10/ -O2 -g -DNDEBUG -fPIC -std=c++17 -MD -MT CMakeFiles/wangle.dir/acceptor/EvbHandshakeHelper.cpp.o -MF CMakeFiles/wangle.dir/acceptor/EvbHandshakeHelper.cpp.o.d -o CMakeFiles/wangle.dir/acceptor/EvbHandshakeHelper.cpp.o -c /tmp/fbcode_builder_getdeps-ZappZfbthriftZbuildZfbcode_builder-root/repos/github.com-facebook-wangle.git/wangle/acceptor/EvbHandshakeHelper.cpp
In file included from /tmp/fbcode_builder_getdeps-ZappZfbthriftZbuildZfbcode_builder-root/repos/github.com-facebook-wangle.git/wangle/acceptor/EvbHandshakeHelper.cpp:17:
In file included from /tmp/fbcode_builder_getdeps-ZappZfbthriftZbuildZfbcode_builder-root/repos/github.com-facebook-wangle.git/wangle/../wangle/acceptor/EvbHandshakeHelper.h:22:
In file included from /usr/local/include/folly/io/async/AsyncSSLSocket.h:21:
In file included from /usr/local/include/folly/Optional.h:680:
In file included from /usr/local/include/folly/coro/Coroutine.h:40:
/usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/coroutine:334:2: error: "the coroutine header requires -fcoroutines"
#error "the coroutine header requires -fcoroutines"
When building with clang, it does not support flag: "-fcoroutines". It needs "-fcoroutines-ts" to enable coroutines support.
Change to not set CMAKE_CXX_STANDARD to 17 and set(CMAKE_CXX_EXTENSIONS OFF) when the CMAKE_CXX_STANDARD is provided
Reviewed By: jmswen
Differential Revision: D69486269
fbshipit-source-id: 9ef6ef173d3aba5f4490406457f62a135e7fedd0
Summary:
`CMAKE_INSTALL_LIBDIR` is the canonical variable name for specifying the name of the directory where 'library' files go to, but it's defined by `GNUInstallDirs` which we currently don't include: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
This was not detected in the Fedora build as it sets the override when calling cmake, but OSS builds using getdeps.sh fails.
Fix by setting this to a default if undefined.
Reviewed By: davide125
Differential Revision: D49400795
fbshipit-source-id: e30af569ce7b02c0a3f484c1eb8e0650f47f104a
Summary:
Linux distributions like Fedora prefer shared over static libraries.
For the Folly stack, since we don't have stable versions this requires
passing the date tag as the version number.
Add `PACKAGE_VERSION` (defaulting to 0) and set a version property on every
library.
Reviewed By: davide125
Differential Revision: D49202205
fbshipit-source-id: 0a65e66ba058b35adffb7f6a511103f989c8e704
Summary:
Define `CMAKE_INSTALL_MODULE_DIR` and use it instead of hardcoding
`lib/cmake/mvfst`. Also use `${CMAKE_INSTALL_LIBDIR}` rather than `lib`,
so it's easier to use this e.g. in Linux distributions where `lib64`
might be used instead of `lib` (e.g. Fedora/RHEL and derivatives and openSUSE).
Reviewed By: davide125
Differential Revision: D49202219
fbshipit-source-id: 4aee5f0f03353a34c22f627eaa48c1478ee4caa0
Summary: We don't use it, and the OSS lib hasn't been updated in a while.
Reviewed By: mjoras
Differential Revision: D46707559
fbshipit-source-id: ec102a52183a736cfb1c0241600816a837062108
Summary:
Dependencies started using C++17 so it's required by now and it seems there is some ABI breakage with fizz.
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/157
Reviewed By: yangchi
Differential Revision: D23454865
Pulled By: mjoras
fbshipit-source-id: 5e41ccab5cd05d1029c53a5e04e4fd2102bafd79
Summary: Adds dependencies and build rules for building quic with CCP_ENABLED using CMake.
Reviewed By: udippant
Differential Revision: D22736839
fbshipit-source-id: a59ac2df89312ca264ee78b217c6ccd0fcb64f29
Summary:
Now that fmt is available in Folly builds (D14813810), use it to reduce binary code size in Folly Logger. This is done by moving most of the formatting logic behind the type-erased `vformat` API. Previously it was instantiated for all combinations of formatting argument types used in calls to `FB_LOGF` and `XLOGF` in a program.
The effect of this change can be illustrated by looking at symbol sizes as given by `nm -S -td` for the following test function:
```
void test_log() {
FB_LOGF(logger, WARN, "num events: {:06d}, duration: {:6.3f}", 1234, 5.6789);
}
```
compiled in `opt` mode.
`nm` before:
```
0000000004236736 0000000000000231 T test_log()
0000000004236992 0000000000001002 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
```
`nm` after:
```
0000000004237536 0000000000000231 T test_log()
0000000004237792 0000000000000251 W std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > folly::LogStreamProcessor::formatLogString<int, double>(folly::Range<char const*>, int const&, double const&)
0000000004238048 0000000000000740 W folly::LogStreamProcessor::vformatLogString[abi:cxx11](folly::Range<char const*>, fmt::v5::format_args, bool&)
```
Before we had one 1002 byte instantiation of `formatLogString<int, double>`. With this change it was reduced 4x to 251 bytes and non-template function `vformatLogString` was added which is shared among all logging calls. The size of `test_log` remained unchanged. There are even bigger savings from Folly Formatter instantiations which are no longer needed, e.g.
```
0000000004238032 0000000000001363 W _ZNK5folly13BaseFormatterINS_9FormatterILb0EJRKiRKdEEELb0EJS3_S5_EEclIZNKS7_8appendToINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEENSt9enable_ifIXsr12IsSomeStringIT_EE5valueEvE4typeERSH_EUlNS_5RangeIPKcEEE_EEvSK_
```
So in total this change results in ~5x per-call/instantiation binary size. It is possible to reduce binary size even further but it is not done in the current diff to keep it manageable.
In addition to binary size improvements, switching to fmt will potentially
* allow catching errors in format strings at compile time,
* simplify future migration to C++20 [`std::format`](http://eel.is/c++draft/format).
Reviewed By: simpkins
Differential Revision: D15485589
fbshipit-source-id: 06db4436839f11c2c3dbed7b36658e2193343411
Summary:
- This should probably be set at the level of the build framework (aka getdeps or fbcode_builder) since mixing static & sharing linking is hard.
- This seems unnecessary (CI builds `oss-proxygen-darwin-getdeps` and `oss-proxygen-linux-getdeps` both pass on this diff).
- Less lines of code!
Reviewed By: lnicco
Differential Revision: D17811654
fbshipit-source-id: 0fbd41ff1e53e07b169236cff313efba8f49ff65
Summary:
We would like to build a version of proxygen that has minimal
dependencies on dynamic libraries.
Reviewed By: yfeldblum
Differential Revision: D17228181
fbshipit-source-id: cfd61afdfa978c49a536184f426502196241fb8a
Summary:
* Remove some old kruft and what looks like an old debugging message from `CMakeLists.txt`
* Only use `-Werror=bool-compare` if the compiler actually supports it
* Mark a bunch of C++ method parameters as `FOLLY_MAYBE_UNUSED` to avoid compiler warnings
* Fix a bunch of signed/unsigned comparisons in tests to avoid compiler warnings
Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/9
Reviewed By: yangchi
Differential Revision: D15281424
Pulled By: mjoras
fbshipit-source-id: 0d6dc6d30a93032e9ee2e9b7d0873b4a2ecd7650
Summary: This is no longer necessary now
Reviewed By: yangchi
Differential Revision: D15930219
fbshipit-source-id: d277190811c5f5f507783aeddbd8cedb1284e59a
Summary:
After changing fizz to export test headers and lib, we do not need to pull in
fizz as an ExternalProject anymore. This simplifies and fixes a lot of build
issues
Reviewed By: yangchi
Differential Revision: D15930220
fbshipit-source-id: dcb01c46b8ade545047c20af2fc5245223afff99
Summary: Do not rely on downloading it via wget in `build_helper.sh`
Reviewed By: siyengar
Differential Revision: D15215226
fbshipit-source-id: aeef31b30964674d80346aa6a1480ce03fdf478d