1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-04-18 17:24:03 +03:00

25 Commits

Author SHA1 Message Date
Xiao Li
646cec48cd allow builder to customize CMAKE_CXX_STANDARD for fizz, mvfst and wangle
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
2025-02-12 15:53:39 -08:00
Michel Lind
66b5ac72a8 ensure CMAKE_INSTALL_LIBDIR is initialized
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
2023-09-19 08:11:58 -07:00
Michel Lind
ffd3804ae5 Support versioning shared objects
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
2023-09-18 12:21:23 -07:00
Michel Lind
4b23e40a0a Allow overriding where CMake module files are shipped
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
2023-09-18 12:21:23 -07:00
Konstantin Tsoy
adf16f9a07 Remove libccp from mvfst
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
2023-06-15 18:17:53 -07:00
Hani Damlaj
2660a288b3 Update Company Name
Summary: - as title

Reviewed By: lnicco

Differential Revision: D33513410

fbshipit-source-id: 282b6f512cf83b9abb7990402661135b658f7bd1
2022-01-13 12:07:48 -08:00
Konstantin Tsoy
ed7c1bb60e Add -Wunused-value
Summary: Add -Wunused-value

Reviewed By: mjoras

Differential Revision: D32011346

fbshipit-source-id: 2a86d68602e4dc654a7a63a9a95e347248bb83cc
2021-10-29 14:55:03 -07:00
Konstantin Tsoy
e52b575bfd Add -Wtype-limits
Summary: Add -Wtype-limits

Reviewed By: jbeshay, mjoras

Differential Revision: D32011134

fbshipit-source-id: c07ef6ba30f03293fbcd3f6f389c85df4ef7f849
2021-10-29 14:55:03 -07:00
Amaury Séchet
b2151a77ff Use C++17 (#157)
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
2020-09-04 06:41:08 -07:00
Frank Cangialosi
267bd4d3d2 OSS build support for quic+CCP
Summary: Adds dependencies and build rules for building quic with CCP_ENABLED using CMake.

Reviewed By: udippant

Differential Revision: D22736839

fbshipit-source-id: a59ac2df89312ca264ee78b217c6ccd0fcb64f29
2020-07-27 14:09:26 -07:00
Victor Zverovich
5762809397 Replace Folly Format with fmt in logger to reduce binary size
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
2019-11-18 05:53:05 -08:00
Luca Niccolini
f4b4ec6d7e windows build
Summary: ^

Reviewed By: mjoras

Differential Revision: D18256970

fbshipit-source-id: 4d07b961ab5ab145b620d9e10fa67116236bbf80
2019-10-31 19:03:58 -07:00
Alexey Spiridonov
c442c4663d Revert D17145350
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
2019-10-08 21:47:25 -07:00
Hasnain Lakhani
13b424652e Add CMake option to fetch deps statically
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
2019-09-12 23:35:29 -07:00
Luca Niccolini
0feb7ae160 Revert D17280739: [mvfst][PR] Added a missing boost chrono dependency
Differential Revision:
D17280739

Original commit changeset: d459ecb9ff06

fbshipit-source-id: 91ede069a9f3c199763610fe7186d3d64fc2994a
2019-09-12 19:16:18 -07:00
Asier Gutierrez
3739795c92 Added a missing boost chrono dependency
Summary: Pull Request resolved: https://github.com/facebookincubator/mvfst/pull/42

Reviewed By: afrind

Differential Revision: D17280739

Pulled By: lnicco

fbshipit-source-id: d459ecb9ff063ca4f2055b0d2bdcb0c664427541
2019-09-11 11:07:32 -07:00
Luca Niccolini
86a9569a82 SET(BUILD_SHARED_LIBS OFF)
Reviewed By: vitaut

Differential Revision: D17145350

fbshipit-source-id: a562ca1dc1e4245de52f95176161d85760798064
2019-09-03 16:38:07 -07:00
Jeff Squyres
b2f4480f00 Portability fixes and compiler warning fixes (#9)
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
2019-06-25 15:43:39 -07:00
Luca Niccolini
f62f6f89aa more specific boost deps
Reviewed By: mjoras

Differential Revision: D15983304

fbshipit-source-id: 360ae589849017cc767da340a34b50ff76b0e6ea
2019-06-25 12:01:03 -07:00
Udip Pant
bd80684a7b remove module to build fizz as an ExternalProject
Summary: This is no longer necessary now

Reviewed By: yangchi

Differential Revision: D15930219

fbshipit-source-id: d277190811c5f5f507783aeddbd8cedb1284e59a
2019-06-20 23:01:08 -07:00
Udip Pant
d8d153c13b Stop consuming fizz via ExternalProject
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
2019-06-20 21:26:41 -07:00
Udip Pant
d92acd1225 consume fizz as an external project in cmake
Summary: Favor standalone cmake config than relying on custom script

Reviewed By: siyengar

Differential Revision: D15227020

fbshipit-source-id: 949885b06daeef5e496bf5f1b67a2a3a89750ebf
2019-05-06 16:56:29 -07:00
Udip Pant
6e361a20a7 pull in appropriate googletest via cmake ExternalProject
Summary: Do not rely on downloading it via wget in `build_helper.sh`

Reviewed By: siyengar

Differential Revision: D15215226

fbshipit-source-id: aeef31b30964674d80346aa6a1480ce03fdf478d
2019-05-05 13:04:43 -07:00
Udip Pant
b50f8ecfab Require Boost 1.62 as a minimum version
Summary:
Fix for https://github.com/facebookincubator/mvfst/issues/1
The issue is fixed in
b3650685f9
(1.62)

Reviewed By: yangchi

Differential Revision: D15182758

fbshipit-source-id: d6886a74fbf817dafa22494361f7f00d5a25af26
2019-05-02 08:45:41 -07:00
udippant
50d4939e9e Initial commit of mvfst 2019-04-22 23:42:46 -07:00