Summary:
Right now proxygen hardcodes a static build when using cmake and
ignores BUILD_SHARED_LIBS. Fix that, and enable PIE on the shared libs so they
can be linked properly
Closes: https://github.com/facebook/proxygen/issues/335
Reviewed By: mjoras, lnicco
Differential Revision: D24787944
fbshipit-source-id: 7a654af7cb43227ca913a1bed67f2432703a343d
Summary:
There are two separate changes here.
### Use `find_package`
The old setup of "let's manually enumerate and order the libraries that Bistro depends on" worked fine, except:
- it was a bit brittle (requiring occasional patches as deps changed), and
- it garnered a lot of feedback to the effect of "your build is weird, so it's probably broken because of that."
Now I expect to have fewer breaks and more plausible deniability :)
More importantly, this should make it much easier to migrate to `getdeps.py`.
## Statically link `fmt`
After `fmt` was added as a `folly` dependency, and linked into Folly code used by Bistro, its tests would fail to run with this error: `test_sqlite_task_store: error while loading shared libraries: libfmt.so.6: cannot open shared object file: No such file or directory`.
Something was getting messed up in the dynamic linking, and it wasn't clear to me what -- the way that Bistro is linking its dependencies certainly seems sensible. Most likely one of the dependencies is incompatible with dynamic linking in a subtle way. I suspect Proxygen.
The `fmt.py` change in this diff addresses this problem by forcing static linking on the offending library.
Reviewed By: yfeldblum
Differential Revision: D24604309
fbshipit-source-id: 35ecbbb277b25907ecaee493e8b0081d9f20b865
Summary:
Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/15
With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: https://github.com/rust-lang/cargo/issues/6819
This diff also removes the TravisCI build as it was broken and unused for some time.
Reviewed By: krallin
Differential Revision: D24390815
fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
Summary: they were all transitively pulling it from folly
Reviewed By: mjoras
Differential Revision: D23683292
fbshipit-source-id: 2085a580584891b3fd0960c14505c0f675a11bd5
Summary:
Update fmt version to 6.2.1 for better compatibility with the version used in fbcode. Among other things this fixes fbthrift build failure on Travis:
```
/home/fbthrift/thrift/lib/cpp2/async/RocketClientChannel.cpp:70:67: required from here
/home/install/include/fmt/core.h:492:3: error: static assertion failed: don't know how to format the type, include fmt/ostream.h if it provides an operator<< that should be used
```
which is caused by trying to format an enum class without a formatter - only supported as of 6.0.
Reviewed By: stevegury, avalonalex
Differential Revision: D21860076
fbshipit-source-id: 1857ab65822956b005980b8dfff7a967508f507c
Summary:
Replace the methods to get CPU and memory usage statistics:
- For the memory: use `VmRSS` of `/proc/[pid]/status`: http://man7.org/linux/man-pages/man5/proc.5.html
- For the CPU%: calculate the process is occupied how much percentage of the CPU time, use `getrusage()`: http://man7.org/linux/man-pages/man2/getrusage.2.html
- Implemented like the sigar: https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/third-party/sigar/src/sigar.c?commit=4f945812675131ea64cb3d143350b1414f34a351&lines=111-169
- Formula:
- CPU% = `process used time` during the period / `time period` * 100
- `time period` = current query timestamp - last query timestamp
- `process used time` = current `process total time` - last query `process total time`
- `process total time` = CPU time used in user mode + CPU time used in system mode // get from the API `ru_utime` and `ru_stime`
Remove the `fbzmq::ResourceMonitor` and `sigar`:
- Change and rename the UT
- `ResourceMonitorTest.cpp` -> `SystemMetricsTest.cpp`
- `ResourceMonitor` -> `SystemMetricsTest` in `openr/tests/OpenrSystemTest.cpp`
- Remove `ResourceMonitor` code and dependency for `Watchdog` and `ZmqMonitor`
- Remove `sigar` dependency used in building
Reviewed By: saifhhasan
Differential Revision: D20049944
fbshipit-source-id: 00b90c8558dc5f0fb18cc31a09b9666a47b096fe
Summary:
This should fix the Travis CI builds. It adds rust toolchain support inside docker and sets the required THRIFT env variable.
Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/3
Reviewed By: krallin
Differential Revision: D18905608
Pulled By: lukaspiatkowski
fbshipit-source-id: 5db1eff6f215a6617d8acaa0c99a62d45225956b
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: As it turns out, several of the `fizz` dependencies require it to have been built with tests enabled, so it's just easier to build them always, IIRC they only waste 1-2 minutes of time.
Reviewed By: lnicco
Differential Revision: D17837758
fbshipit-source-id: dd0c73b3aaf72831ce702dbcecd4e3ff627a4901
Summary:
Proxygen no longer uses `fbcode_builder` to run its tests, so whatever the purpose of D17158685, these `fbcode_builder` configs no longer affect Proxygen, and can be reverted to their original state.
Since the general design pattern for `fbcode_builder` has been to link everything as `.so`s, let's return to this (which helps fix Bistro's build).
Also, let's not waste time building & linking tests for libraries that are not the library under test. That is:
- Before: The Bistro build also builds tests for wangle, proxygen, etc. This is a result of some accidental changes in D17158685.
- After: We explicitly don't build test for any of the 4 dependencies here. This is OK because each project also has its own `fbcode_builder_config.py`, which **does** build tests.
This latter part should result in a build-time reduction.
Reviewed By: lnicco
Differential Revision: D17819858
fbshipit-source-id: 7cad1bed86b2f0c3934b0fc5d6fb33e6a2ee2695
Summary:
The external Travis CI builds for fbzmq are still using the older
fbcode_builder spec (as opposed to the newer getdeps manifest file).
D16577367 moved the CMakeLists.txt file to the top-level directory, but the
fbzmq spec file was still looking for it in the fbzmq subdirectory.
Reviewed By: jstrizich
Differential Revision: D17005361
fbshipit-source-id: 3f7664eadfb60ec7606124a14445b44ae586b8a7
Summary:
Simply linking `GMOCK_LIBS` into a binary was not telling CMake that the binary depends on `gmock` being built. So, let's add that dependency explicitly.
This wasn't breaking in production because we typically build with `-j 4`, and `gmock` was getting built before the first dependent binary would attempt to link.
Also, since `rsocket` bundles its own `gmock`, it is just a waste of time to compile a system-level gmock. It's not a real dependency.
NB: The change in `fbcode_builder.py` is needed because now that `rsocket` no longer depends on anything on Github, driver programs that were unconditionally setting `projects_dir` started to fail to build `rsocket`.
Reviewed By: simpkins
Differential Revision: D16461572
fbshipit-source-id: 1e95654e96256e7ed37d42e702b5433bf2fe5328
Summary:
Remove all the autoconf files.
And fully switch to the cmake build
Reviewed By: udippant
Differential Revision: D16066986
fbshipit-source-id: 9e3082dded77ce85449cf5a3a03bed31c16b711f
Summary: This diff allows zmq socket to run on folly::fibers
Reviewed By: saifhhasan
Differential Revision: D15113447
fbshipit-source-id: 8a0e1f91d719a9deda48837d4ff1065408280b72
Summary: mstch is no longer required for fbthrift, we can remove it from oss build spec
Reviewed By: vitaut
Differential Revision: D15280267
fbshipit-source-id: 5008e54af9c927f23b0d6acbf0d9beb6e004eee1
Summary: support for fbcode_build and travis build
Reviewed By: siyengar
Differential Revision: D15184766
fbshipit-source-id: 5117164c324d3d3c867592a88670a53b6f862477
Summary:
Initial commit to include the fbcode_builder sources in the
eden github repository.
fbshipit-source-id: 49098cecda04a7e9dd9dcc0b569fffc96f0f719b