- 03 Feb, 2022 1 commit
-
-
Yedidya Feldblum authored
Summary: The type-erased Function is widely used with lambdas and the type of every lambda is unique. Template instantiations are costly for build speed so, for the parts of Function which interact with lambdas, we choose techniques to optimize build speed. In particular, we avoid the extra layer of constructor templates which must be overload-tested and instantiated. The existing design of the extra layer was clean - it effectively used tag-dispatch and was able to deduplicate code with the coercing constructor. However, the choice of techniques was not optimal for build speed. ```name=trunk $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp 6,407,492,259 instructions:uP ``` ```name=branch $ foundation/scripts/run-perf-compile --syntax folly/futures/test/FutureTest.cpp 6,303,165,111 instructions:uP ``` Reviewed By: Gownta, ot, luciang Differential Revision: D32940920 fbshipit-source-id: 742cb67b994e7c3e6c070254386f3cdf5dffa38c
-
- 02 Feb, 2022 7 commits
-
-
Michael Voznesensky authored
Summary: We need it for lego Reviewed By: yfeldblum Differential Revision: D33910794 fbshipit-source-id: 2a326f8fc41baae0db68657331f93b3d8124b8d8
-
Adam Gleitman authored
Summary: When trying to bring react-native-macos up to date with 0.66, I was running into an issue getting RNTester to compile due to an error regarding redefining `clockid_t`. Other people have been seeing similar issues as per [these search results](https://github.com/facebook/folly/issues?q=clockid_t). The history behind this appears to be as follows: Several declarations in `<time.h>` were not available on Apple platforms until macOS 10.12 and iOS 10, which is why Folly needs to check the minimum version and set `FOLLY_HAVE_CLOCK_GETTIME` as needed. The problem is, the current logic as it stands right now is to set `FOLLY_HAVE_CLOCK_GETTIME = 1` (which implies that we don't need to declare them ourselves as the OS provides them for us) if... * ...we're building for macOS, and the minimum required version is less than 10.12, or... * ...we're building for iOS, and the minimum required version is less than 10. However, this doesn't make any sense. This is saying that we don't need to declare these missing APIs if we could be compiling Folly for use on an older version (i.e., macOS 10.11/iOS 9 or earlier), which is totally wrong! Instead, we ought to be checking if the versions are *at least* macOS 10.12 or iOS 10. React Native currently works around this by eliminating the minimum version check entirely with [this PR](https://github.com/facebook/react-native/pull/32715/), which is certainly a valid local fix ([the minimum iOS version for React Native apps is currently iOS 11](https://github.com/facebook/react-native/blob/1b31d6bb582768ccbe92d3c1a9e43354a8c531e5/template/ios/Podfile#L4)), but doesn't solve the problem at its core. This PR does solve the problem. I have not tested building this with a minimum version below the above thresholds for use on a modern version of macOS/iOS, but considering the discussion in https://github.com/facebook/folly/issues/1545, I think we should be safe to ignore these older versions from now on. Pull Request resolved: https://github.com/facebook/folly/pull/1688 Reviewed By: yfeldblum Differential Revision: D33483705 Pulled By: Orvid fbshipit-source-id: 0fe7c556af7e5b79a7679f75d003cf81a8f412ce
-
Yicheng Wang authored
Summary: ^ Reviewed By: praihan Differential Revision: D33807636 fbshipit-source-id: 0a0aaa533387284f758daf057529aaa7ddc3ce04
-
Dan Melnic authored
Summary: Add support for Linux TCP zerocopy RX (Note: this ignores all push blocking failures!) Reviewed By: simpkins Differential Revision: D32741177 fbshipit-source-id: 412981fdd4a27437d6f22a80dc7c5fc864335ddf
-
Kenny Yu authored
Summary: This removes `detail::getSingletonStackTrace` in favor of `symbolizer::getStackTraceStr`. Reviewed By: yfeldblum Differential Revision: D33783970 fbshipit-source-id: 416ff70abb79ce4e9c3180c0872432ae2966effc
-
Yedidya Feldblum authored
Summary: Check that recursion builds with specific versions of gcc. Fix failures with that version. Addresses these failures: ``` In file included from folly/test/FunctionTest.cpp:17: folly/Function.h: In substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]': folly/Function.h:761:7: required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]' folly/Function.h:293:40: required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]' folly/Function.h:363:9: required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]' folly/Function.h:761:7: required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]' folly/Function.h:293:40: required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]' folly/Function.h:363:9: [ skipping 501 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ] folly/Function.h:363:9: required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]' folly/Function.h:761:7: required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]' folly/Function.h:293:40: required by substitution of 'template<class From, class To, class> using IfSafeResultImpl = decltype ((void)(static_cast<To>(declval<From>()))) [with From = RecFolly; To = RecFolly; <template-parameter-1-3> = void]' folly/Function.h:363:9: required by substitution of 'template<class ReturnType, class ... Args> template<class F, class R> using IfSafeResult = folly::detail::function::IfSafeResultImpl<R, ReturnType> [with F = folly::Function<RecFolly()>; R = RecFolly; ReturnType = RecFolly; Args = {}]' folly/Function.h:761:7: required by substitution of 'template<class Signature, class> folly::Function<RecFolly()>::Function(folly::Function<F>&&) [with Signature = RecFolly(); <template-parameter-1-2> = <missing>]' folly/test/FunctionTest.cpp:212:54: required from here folly/Function.h:363:9: fatal error: template instantiation depth exceeds maximum of 512 (use '-ftemplate-depth=' to increase the maximum) 363 | using IfSafeResult = IfSafeResultImpl<R, ReturnType>; | ^~~~~~~~~~~~ compilation terminated. ``` ``` In file included from folly/test/FunctionTest.cpp:17: folly/Function.h: In member function 'virtual void Function_SelfMove_Test::TestBody()': folly/Function.h:709:70: error: 'f.folly::Function<int()>::exec_' is used uninitialized in this function [-Werror=uninitialized] 709 | Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) { | ~~~~~^~~~~ folly/Function.h: In member function 'virtual void Function_SelfMove2_Test::TestBody()': folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized] 709 | Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) { | ~~~~~^~~~~ folly/Function.h: In member function 'virtual void Function_SelfStdSwap_Test::TestBody()': folly/Function.h:709:70: error: 'f.folly::Function<int()>::exec_' is used uninitialized in this function [-Werror=uninitialized] 709 | Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) { | ~~~~~^~~~~ folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized] 709 | Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) { | ~~~~~^~~~~ folly/Function.h:709:70: warning: 'f.folly::Function<int()>::exec_' may be used uninitialized in this function [-Wmaybe-uninitialized] 709 | Function(Function&& that) noexcept : call_(that.call_), exec_(that.exec_) { | ~~~~~^~~~~ ``` Notes: * For some versions of gcc, the compiler sees the converting-move-ctor as a better match than the actual move-ctor and this leads the compiler to infinite recursion; to work around this, explicitly exclude the same-type case of the converting-move-ctor. * `std::exchange` on `exec_` would be incorrect for self-move because of order of operations. * `std::exchange` on `call_` might be correct but it would be an extra template instantiation which is not desireable for `folly::Function`. Differential Revision: D33881266 fbshipit-source-id: 5403b83498b9c1afa772564246eba4f112495761
-
Chad Austin authored
Summary: A long time ago, getdeps scheduled each build up to the number of hardware threads. For some builds, that was too heavy, so it got throttled back to only ever use half the hardware threads. This left parallelism on the table for CPU-bound projects that don't use much RAM per compilation. This commit makes better use of the hardware with finer-grained logic that allows each manifest to specify a `job_weight_mib` estimate in MiB, and limit concurrency to `available_ram / job_weight`. Reviewed By: ahornby Differential Revision: D33754018 fbshipit-source-id: 785bed6c6cfe3c473244e0806a77cec1fc119e1f
-
- 01 Feb, 2022 5 commits
-
-
Yedidya Feldblum authored
Summary: The flip operation, like the set and reset operations, are optimizable on x86-related architectures using the `btc` instruction, compared with `bts` and `btr` for set and reset operations. The optimization is done for gnu-like compilers. However, for MSVC, there is no interlocked intrinsic for `btc`, so the optimization is not done. Reviewed By: luciang Differential Revision: D32049844 fbshipit-source-id: 5f60f8c4c534fb0ee41d76c5d766f96f7ff94892
-
Chad Austin authored
Summary: checkout@v2 is the current action version, and the old one may have security issues. Let's just run with the latest version. Reviewed By: ahornby Differential Revision: D33834847 fbshipit-source-id: fba0733577bf23c208c9824aa3815bd01a813d9a
-
Chad Austin authored
Summary: I'm about to upgrade from checkout v1 to checkout v2. First, update the GitHub action workflows for all projects. Reviewed By: ahornby Differential Revision: D33834784 fbshipit-source-id: f4cba24f1a589588dbfaf7ad7ada7122dd8284cb
-
Xavier Deguillard authored
Summary: The public_autocargo is for external builds, not internal ones as they contain references to git repository, while the non-public_autocargo refers to path in fbcode. In Sandcastle, git repositories can fail to be accessed due to lack fo proxies, thus we shouldn't access them. Reviewed By: kmancini Differential Revision: D33907864 fbshipit-source-id: 3f2006607676cebd92201560365d179231214db4
-
Yedidya Feldblum authored
Summary: Release notes are: https://github.com/google/googletest/releases/tag/release-1.11.0. Reviewed By: bigfootjon Differential Revision: D33868235 fbshipit-source-id: 57b0e118d6ebadbaf634caccec50a0dd87f34fc8
-
- 31 Jan, 2022 4 commits
-
-
Alex Hornby authored
Summary: Workaround for getdeps builds of edenfs Reviewed By: fanzeyi Differential Revision: D33896917 fbshipit-source-id: 9aed609ca6d5b209cda4fc7eecb52e5cfa9f6dac
-
Alex Hornby authored
Summary: Move cargo logic to separate file as builder.py was getting a bit large It's just a move of source file for CargoBuilder. Diff looks a bit big as I did hg cp to preserve history Differential Revision: D33888925 fbshipit-source-id: 2d57343535ab087e09876edba4d00a6f0234fcd0
-
Michael Voznesensky authored
Summary: Title Reviewed By: yfeldblum Differential Revision: D33873064 fbshipit-source-id: 65b16ad30a7bf9f2b9e23857f072d33c94098899
-
Alex Hornby authored
Summary: Generate cargo files for hgclientconf Reviewed By: yancouto Differential Revision: D33843589 fbshipit-source-id: d9b3452be684fcaa727c0c0a1175c1d8954bf9f2
-
- 29 Jan, 2022 6 commits
-
-
Yedidya Feldblum authored
Summary: Since clang has a mode which rejects the append-va-arg construct as implemented in `FOLLY_PP_DETAIL_APPEND_VA_ARG`. Do this by avoiding appending va-args to other args. Instead, take advantage of `operator()` as a workaround. Avoids: ``` folly/Preprocessor.h:72:46: error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments] #define FOLLY_PP_DETAIL_APPEND_VA_ARG(...) , ##__VA_ARGS__ ^ ``` Reviewed By: luciang Differential Revision: D33863906 fbshipit-source-id: 14912aca73e332ab811db4c0ac772a2d224a0666
-
Yedidya Feldblum authored
Summary: So that we may easily inspect the generated code. Reviewed By: ot, luciang Differential Revision: D32161049 fbshipit-source-id: 00ca6f4196518389f7b1b18d9278085e1a3b43d2
-
Yedidya Feldblum authored
Summary: Function implements move and nuke operations via a type-erased pointer to an exec function. Both operations are explicitly noexcept but the function pointer which these operations call is not marked as noexcept. So the compiler emits unnecessary exception-handling code/data around the call. The exception-handling stuff make generated code larger and in theory may also hinder possible optimizations. But when the exec function pointer as marked as `noexcept`, the compiler may elide the exception-handling stuff, shrinking generated code and in theory permitting a class of optimizations. It is not possible for the underlying move operation to throw an exception since, if the move operation of the contained callable could throw an exception, the contained callable would be on-heap and not in-situ, and the underlying move operation would just be an infallible relocation of the in-situ `Function` state. It is possible for the underlying nuke operation to throw an exception since the destructor of the contained callable could throw an exception. But this is rare. In this case, the exec function would contain exception-handling stuff; but in general, it would not. And this would merely moves where the exception-handling stuff is for the nuke operation, from one side of the type-erasure to the other side. Reviewed By: ot, philippv, luciang Differential Revision: D32904616 fbshipit-source-id: 5853a2d81a30bef565b350b72f5f35e6c9c9a45b
-
Yedidya Feldblum authored
Summary: Avoids: ``` folly/experimental/symbolizer/StackTrace.cpp:192:15: error: the pointer incremented by 68719476736 refers past the last possible element for an array in 32-bit address space containing 64-bit (8-byte) elements (max possible 536870912 elements) [-Werror,-Warray-bounds] normalStackFrame + kMaxExpectedStackFrameSize)) { ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Reviewed By: kennyyu, luciang Differential Revision: D33837703 fbshipit-source-id: 0ca6b7ba6c2f76d0be3c54c9784c305125b525df
-
Yedidya Feldblum authored
Summary: To measure `atomic_fetch_set` across sizes and behaviors. Reviewed By: luciang Differential Revision: D32262813 fbshipit-source-id: 84510e85368cb5e012ddc8bbf2ca159444659f20
-
Max Katsev authored
Reviewed By: ot Differential Revision: D33857528 fbshipit-source-id: 265457c5771684d6830a16a3b7390e9bd99b277d
-
- 28 Jan, 2022 6 commits
-
-
Kenny Yu authored
Summary: Currently, `getSingletonStackTrace` is in the logically private `detail` namespace. This adds `symbolizer::getStackTrace` to replace `detail::getSingletonStackTrace`, and this new location mirrors the existing `symbolizer::getAsyncStackTrace`. The changes will be done in multiple parts: - Add the new version - Modify all internal callers to use the new version - Delete the old version Reviewed By: yfeldblum Differential Revision: D33783972 fbshipit-source-id: 137a1d654aea5a451bb90ca12e1916f91589b0df
-
Yedidya Feldblum authored
Summary: Like `FOLLY_SAFE_CHECK(true, ...)`. Reviewed By: luciang Differential Revision: D33801512 fbshipit-source-id: c9023f4b14e0b045c654c15a8f2b9ea0cc384617
-
Zeyi (Rice) Fan authored
Reviewed By: yns88 Differential Revision: D33850004 fbshipit-source-id: f01c3508c91049c3fc4f72bec14683b50332df77
-
Eugene Poliukhovych authored
Summary: Originally set in D1315038, 16x overhead for stacksize for ASAN was too pessimistic. The assumption that pre-allocating fiber stacks does not increase process RSS was incorrect. As a result, fiber-heavy services consume way too much memory when ASAN is enabled. Reviewed By: yfeldblum Differential Revision: D33754702 fbshipit-source-id: 7d0f3eb8aff8f3b7d17ac4a4960f5072822df05f
-
Akrama Baig Mirza authored
Summary: - Use `ThreadIdWorkerProvider` in `IOThreadPoolExecutor` for Thrift dogpiles - Only enable thread ID collection in `IOThreadPoolExecutor` if `THRIFT_FLAG(enable_io_queue_lag_detection)` is enabled Reviewed By: yfeldblum Differential Revision: D32815984 fbshipit-source-id: 9c923e44ca0e3ac93697f7332ac34a95b4c784cb
-
Xavier Deguillard authored
Summary: In buck builds, fmt is at 8.0.1 which isn't entirely compatible with fmt 7 that getdeps uses. Let's sync up the version. Reviewed By: chadaustin Differential Revision: D33832051 fbshipit-source-id: 7de71c4b675f220c0aa5b418c3466d65d78e9292
-
- 27 Jan, 2022 9 commits
-
-
Marcus Holland-Moritz authored
Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1697 Reviewed By: Gownta Differential Revision: D33483753 Pulled By: Orvid fbshipit-source-id: d08291b5d02c61e461322edd332bb5a6e744ff96
-
Muir Manders authored
Summary: Don't set the "fb" cargo feature via cmake unless we are in fb build. Reviewed By: quark-zju Differential Revision: D33781554 fbshipit-source-id: 39c61dc1631ebfd8a2c858b5e214c6a09ce0b005
-
Mingtao Yang authored
Summary: SSLAcceptRunnerFiberCloseSessionCb was leaking the SSL_SESSION because it set a custom server SSL session callback handler that did not properly manage the SSL_SESSION that it was given. Reviewed By: modiking Differential Revision: D33807657 fbshipit-source-id: 5eeaecfef5df1f1d281abe2918f9926a969ab84d
-
Alex Hornby authored
Summary: Populate the new environment variable if relevant path for it found. For the OSS getdeps builds of things depending on fb303 this will allow them to be able to be able to find the fb303 thrift files from the declared fb303 dependency, rather than needing duplicates/stubs inside each package. Also adds python as dependency to fbthrift manifest, found it needed it when testing Reviewed By: HarveyHunt Differential Revision: D33771979 fbshipit-source-id: 9635221c0e6a2ac225d7d0babe76f1c919b583de
-
Andrii Grynenko authored
Summary: The same logic that was gated for MSVC is applicable to GCC as well (note that it had to be fixed). Reviewed By: yfeldblum Differential Revision: D33799604 fbshipit-source-id: 34bd7159c0cc37b5d49d631f715339512bfc4ddd
-
Akrama Baig Mirza authored
Summary: Avoid using `bool` directly in `IOThreadPoolExecutor` constructor Reviewed By: yfeldblum, praihan Differential Revision: D33769477 fbshipit-source-id: ba16d676d2130c7680c960cd27f43174f06d0475
-
Yedidya Feldblum authored
Summary: The test looks for every function in its list of functions to be present in the example stack-trace. But, depending on optimizations, the compiler may transform some of the calls to tail calls, in which case the calling functions would be elided from the stack-trace. Prevent those tail calls. Reviewed By: kennyyu Differential Revision: D33797857 fbshipit-source-id: 1c20c19bc612cebbc6a30466ef8deb54713b1497
-
Victor Zverovich authored
Summary: Fix a bunch of issues that a blocking migration to fmt 8.x: * Missing includes * Use of deprecated APIs * Ambiguous calls to unqualified `format` (can be fmt or folly) * Unused result of `fmt::format` * Missing path formatter * Passing runtime format string Reviewed By: xavierd Differential Revision: D33767880 fbshipit-source-id: 3976c4cc0551f3fb42c05a04c29e1c9723245749
-
Nolan O'Brien authored
Summary: clang is particular about not treating strings as booleans, but it offers an "out" by using `expr && "string"` specifically for the use cases of `assert` like ours **Before** ``` assert(!"Should never happen!"); <-- clang warning: -Wstring-conversion ``` **After** ``` assert(false && "Should never happen!"); <-- no clang warning ``` Reviewed By: yfeldblum Differential Revision: D33796849 fbshipit-source-id: bd48139d0db04d50572e9ada29da777551774f84
-
- 26 Jan, 2022 2 commits
-
-
Alex Hornby authored
Summary: Bring fboss in line with other oss builds Reviewed By: shri-khare Differential Revision: D33620345 fbshipit-source-id: 26e51230e4ae3c950eca2cb366a9fa55d5c1dfee
-
Alex Hornby authored
Summary: Need to specify both gtest and gmock includes like folly does Centos stream 8 doesn't have libmnl-static, and needed different alias for nl-route-3 Reviewed By: shri-khare Differential Revision: D33537568 fbshipit-source-id: 506ef13224e71b874f8a43b52474f39da14a8d67
-