Commit Graph

25 Commits

Author SHA1 Message Date
Davide Cavalca
22a5690f3a proxygen: fix shared libs build
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
2020-11-10 14:25:15 -08:00
Alexey Spiridonov
d0faf27e9f Fix OSS build
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
2020-11-04 16:16:49 -08:00
Lukas Piatkowski
87db93687e rust/shed/hostname: rename hostname dependency to unbreak doctests (#15)
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
2020-10-19 07:21:38 -07:00
Luca Niccolini
49e3719cd0 fizz, mvfst, wangle, proxygen: add gmock as fbcode_build dependency
Summary: they were all transitively pulling it from folly

Reviewed By: mjoras

Differential Revision: D23683292

fbshipit-source-id: 2085a580584891b3fd0960c14505c0f675a11bd5
2020-09-14 22:04:48 -07:00
Stanislau Hlebik
9d18c46b1f remediation of S205607
fbshipit-source-id: 798decc90db4f13770e97cdce3c0df7d5421b2a3
2020-07-17 17:16:13 -07:00
Stanislau Hlebik
3665548bb0 remediation of S205607
fbshipit-source-id: 5113fe0c527595e4227ff827253b7414abbdf7ac
2020-07-17 17:16:13 -07:00
Jon Maltiel Swenson
7d47c4b523 Remove rsocket-cpp dependency from OSS projects depending on fbthrift
Summary: fbthrift no longer depends on rsocket-cpp

Reviewed By: simpkins

Differential Revision: D22275231

fbshipit-source-id: c1f217f1ce97591b8ebca002bf8ae3af701be641
2020-07-01 11:24:22 -07:00
Victor Zverovich
f9c4acfa84 Update fmt version to 6.2.1
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
2020-06-03 09:48:54 -07:00
Yixian Jiang
a72245ef36 clean sigar build dependency
Summary:
Clean the sigar build dependency completely under:
- fbcode/fbzmq/public_tld/build/...
- fbcode/openr/public_tld/build/...

Delete files:
- fbcode/opensource/fbcode_builder/manifests/sigar
- fbcode/opensource/fbcode_builder/specs/sigar.py

Reviewed By: steven1327

Differential Revision: D20376067

fbshipit-source-id: 3321a14df2551525acee605028ef06a04cda7c6a
2020-03-11 19:13:20 -07:00
Yixian Jiang
19472ea493 Remove dependency on fbzmq::ResourceMonitor & sigar
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
2020-03-04 16:37:28 -08:00
Lukasz Piatkowski
d2520b62e2 Fixes for travic CI build (#3)
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
2019-12-10 04:56:56 -08:00
Victor Zverovich
3285a8f909 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:08 -08:00
Alexey Spiridonov
b93ff4720d Re-enable BUILD_TESTS for fbcode_builder
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
2019-10-09 15:20:00 -07:00
Alexey Spiridonov
3fdcdad190 Revert / fix up D17158685
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
2019-10-08 21:47:29 -07:00
Luca Niccolini
ebdaad98a9 BUILD_SHARED_LIBS=OFF for CI build
Summary: fixes the CI build

Reviewed By: dddmello

Differential Revision: D17158685

fbshipit-source-id: 44ea871eab4d8c964b8372fb8d84879fa823ca50
2019-09-03 09:32:58 -07:00
Adam Simpkins
7f813eafed fbcode_builder: update the old fbcode_builder spec for fbzmq
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
2019-08-26 11:47:03 -07:00
Alexey Spiridonov
11b71545ef Fix gmock handling in rsocket opensource build
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
2019-07-30 23:00:11 -07:00
Luca Niccolini
38248b678e Deprecate autoconf
Summary:
Remove all the autoconf files.
And fully switch to the cmake build

Reviewed By: udippant

Differential Revision: D16066986

fbshipit-source-id: 9e3082dded77ce85449cf5a3a03bed31c16b711f
2019-07-02 01:33:48 -07:00
Luca Niccolini
bb4ee0e5ba enable CMake build (with HTTP/3) -- take 2
Reviewed By: snarkmaster

Differential Revision: D15730421

fbshipit-source-id: 51eaac2ad443aadbab3ba772e651287c6b330408
2019-06-25 02:59:20 -07:00
Jingyi Yang
e0f7463bc6 add fiber support
Summary: This diff allows zmq socket to run on folly::fibers

Reviewed By: saifhhasan

Differential Revision: D15113447

fbshipit-source-id: 8a0e1f91d719a9deda48837d4ff1065408280b72
2019-06-10 08:46:14 -07:00
Luca Niccolini
4e1449545d Back out "[proxygen][oss] enable CMake build (with HTTP/3)"
Summary: Original commit changeset: 5e101fc38417

Reviewed By: snarkmaster

Differential Revision: D15726457

fbshipit-source-id: 001ee9ebaee81ebc60996e5fb95c1870121b2dec
2019-06-09 15:23:48 -07:00
Luca Niccolini
33ec8c8bfc enable CMake build (with HTTP/3)
Reviewed By: udippant

Differential Revision: D15368849

fbshipit-source-id: 5e101fc38417b807a531fa456b38234d6dd08b7a
2019-05-19 19:17:18 -07:00
Yuhan Hao
4ad67b815c remove mstch from fbthrift's fbcode_builder spec
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
2019-05-09 12:39:24 -07:00
Udip Pant
a7a9264951 add fbcode_builder_config for mvfst build in oss
Summary: support for fbcode_build and travis build

Reviewed By: siyengar

Differential Revision: D15184766

fbshipit-source-id: 5117164c324d3d3c867592a88670a53b6f862477
2019-05-07 19:40:54 -07:00
Adam Simpkins
bcad7419bf add fbcode_builder sources
Summary:
Initial commit to include the fbcode_builder sources in the
eden github repository.

fbshipit-source-id: 49098cecda04a7e9dd9dcc0b569fffc96f0f719b
2019-04-26 11:31:58 -07:00