- 18 Sep, 2020 7 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Cut old memrchr port in global namespace since it is excessively difficult to make it portable across all platforms. Fixes: https://github.com/facebook/folly/issues/817. Fixes: https://github.com/facebook/folly/issues/1391. Reviewed By: Orvid Differential Revision: D22130039 fbshipit-source-id: 43511aa95c749d5f603ff8043c438ba63d44f6c1
-
Wez Furlong authored
Summary: D23695665 (https://github.com/facebook/folly/commit/5c3b9d59a815b94df1afed0b7e0050bb75e09178) calls functions defined by this module, but doesn't ensure that it has been imported. I believe this to be the reason behind this build failure: https://github.com/facebook/watchman/pull/856/checks?check_run_id=1135919864#step:52:217 Reviewed By: chadaustin Differential Revision: D23794292 fbshipit-source-id: 897cfac862fda7420d1c53b0976492231b53dcf8
-
Chad Austin authored
Summary: Refine some guards to be more precise. Reviewed By: yfeldblum, luciang Differential Revision: D23361317 fbshipit-source-id: 806d899890c990a840c4275fb1180e45a944715d
-
Chad Austin authored
Summary: Instead of assuming every posix-y system has ucontext.h, detect swapcontext's existence at build time. Android NDK provides ucontext.h but not its corresponding functions. Reviewed By: yfeldblum Differential Revision: D23695665 fbshipit-source-id: 9e49c6fbf553abff6249d55c780c09cc19d0bb48
-
Lukas Piatkowski authored
eden/edenapi and mononoke integration tests: add edenapi/tools to getdeps and use them in tests (#51) Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/51 This diff extends capabilities of CargoBuilder in getdeps so that individual manifests can be build even without workspaces. Thanks to that a build for edenapi/tools can be made and its artifacts can be used in mononoke integration tests. Reviewed By: StanislavGlebik Differential Revision: D23574887 fbshipit-source-id: 8a974a6b5235d36a44fe082aad55cd380d84dd09
-
Maged Michael authored
Summary: Use folly::get_cached_pid(), a faster getpid() replacement, in NotificationQueue. Outline CHECK_EQ from checkPid(). Reviewed By: yfeldblum Differential Revision: D23433868 fbshipit-source-id: 66ef0e243d74aa176a496e1ae15aeae5e67e4f5c
-
Alexander Sklar authored
Summary: Constant from: http://eel.is/c++draft/cpp.predefined#1.1 Fixes https://github.com/facebook/folly/issues/1454 Pull Request resolved: https://github.com/facebook/folly/pull/1455 Reviewed By: yfeldblum Differential Revision: D23702274 Pulled By: Orvid fbshipit-source-id: a08f922cc11c086362b91c93922b59c9a5c62e51
-
- 17 Sep, 2020 5 commits
-
-
Lukas Piatkowski authored
Reviewed By: krallin Differential Revision: D23757084 fbshipit-source-id: 7e49228805e272064ad52d43141b5815eba4190a
-
Yedidya Feldblum authored
Summary: [Folly] Always enable fiber support in futures. (Note: this ignores all push blocking failures!) Reviewed By: andriigrynenko Differential Revision: D19229519 fbshipit-source-id: f0a034e9387c5ccad676a911213fab74364ca340
-
Lewis Baker authored
Summary: Add the ability for an AsyncGenerator to yield an error without needing to throw an exception and for consumers to retrieve the error without rethrowing the exception. Added a new `folly::coro::co_error` type that acts as a simple wrapper around a `folly::exception_wrapper` that can be used to indicate that this value is an error. This allows `AsyncGenerator` bodies to now `co_yield` a `co_error` as a way of completing with an error without needing to throw the exception. For example: ``` class SomeError : public std::exception { ... }; folly::coro::AsyncGenerator<int> example() { co_yield 42; co_yield folly::coro::co_error(SomeError{}); } ``` This diff also adds support for `folly::coro::co_awaitTry()` to the `AsyncGenerator::next()` method. For example: ``` folly::coro::Task<void> consumer() { folly::coro::AsyncGenerator<int> gen = example(); folly::Try<int> result = co_await folly::coro::co_awaitTry(gen.next()); // use result } ``` Added a benchmark to compare performance of the new interfaces vs the existing throwing-based error handling. Reviewed By: yfeldblum Differential Revision: D18015926 fbshipit-source-id: 27d2e16e7dde9b4c871846f5d17b40ec3737330a
-
Lee Howes authored
Summary: getVia is destructive like other forms of get. This change r-value qualifies it to highlight that in code. Reviewed By: yfeldblum Differential Revision: D23603722 fbshipit-source-id: d2aecac3c6eb09e0fcf55a07e310114ebc13b932
-
Dan Melnic authored
Summary: Add support for polling the io_uring submission/completion queues Reviewed By: kevin-vigor Differential Revision: D23566444 fbshipit-source-id: 7f8331d1f34db78dc4bca4aea3e5f5a1c8f00023
-
- 16 Sep, 2020 3 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Tweak `partial` to avoid a poorly-understood build failure on macos with clang++ and libc++. ``` In file included from folly/functional/test/PartialTest.cpp:19: In file included from folly/folly/Function.h:230: folly/functional/Invoke.h:65:25: error: attempt to use a deleted function noexcept(noexcept(std::mem_fn(f)(static_cast<A&&>(a)...))) ^ folly/functional/Partial.h:41:19: note: in instantiation of exception specification for 'operator()<int (int &, int &, int &), Foo, const Foo &, const int &, const int &, int &>' requested here -> decltype(invoke( ^ folly/functional/Partial.h:65:56: note: while substituting deduced template arguments into function template 'invokeForward' [with Self = const folly::detail::partial::Partial<int (Foo::*)(int &, int &, int &), std::__1::tuple<Foo, int, int> > &, I = <0, 1, 2>, Args = <int &>] auto operator()(CArgs&&... cargs) const& -> decltype(invokeForward( ^ folly/functional/test/PartialTest.cpp:59:21: note: while substituting deduced template arguments into function template 'operator()' [with CArgs = <int &>] EXPECT_EQ(1234, p0(four)); ^ type_traits:1743:5: note: '~__nat' has been explicitly marked deleted here ~__nat() = delete; ^ ``` Reviewed By: chadaustin Differential Revision: D23722804 fbshipit-source-id: 7b3d6307a46fa12eadea13db327f10aafb89691c
-
Xavier Deguillard authored
Summary: The getuid and getgid are defined as returning uid_t and gid_t. Defining these types here will prevent downstream consumer from having to redefine these types for Windows. (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum, Orvid Differential Revision: D23693492 fbshipit-source-id: 1ec9221509bffdd5f6d241c4bc08d7809cdb6162
-
Luca Niccolini authored
Summary: no need to install when not building tests Reviewed By: wez Differential Revision: D23714375 fbshipit-source-id: 6f34ab59ed2155df5646ad279d1347e904f393c4
-
- 15 Sep, 2020 6 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Cache python-import in `getExecutor` so that it happens only once overall rather than once per call. Reviewed By: nanshu Differential Revision: D23657508 fbshipit-source-id: 06d3bd53303cac9c10fff74f4e6daaeccdc59471
-
Luca Niccolini authored
Summary: required. not installed with CMake ExternalProject anymore Reviewed By: xttjsn Differential Revision: D23700095 fbshipit-source-id: 807105a1e3d4bd837a35e39c6dced53744edd8de
-
Luca Niccolini authored
Summary: in getdeps we currently don't build and run the tests There are a few issues: 1. we need to also build tests for fizz, wangle, mvfst since proxygen tests include headers only exported if building tests in dependencies 2. we use `ExternalProject_add` for gtest/gmock. but doesn't seem to be playing nicely with getdeps Reviewed By: dddmello, mjoras Differential Revision: D16934955 fbshipit-source-id: fb1c52237f9f0c71da86643409972c94d16e6a71
-
Luca Niccolini authored
Summary: properly find the required GMock version (1.8.0) and allow building tests in getdeps Reviewed By: mjoras Differential Revision: D16935741 fbshipit-source-id: 46f62511e2feaf553d028e286a862aa5b30393c6
-
Luca Niccolini authored
Summary: also always install fizz test headers for mvfst and proxygen tests to consume without needing to build fizz tests Reviewed By: yfeldblum Differential Revision: D23676344 fbshipit-source-id: 7ae78c81c2d67bb8da135fcd69d4be119b50a27e
-
Luca Niccolini authored
Summary: they were all transitively pulling it from folly Reviewed By: mjoras Differential Revision: D23683292 fbshipit-source-id: 2085a580584891b3fd0960c14505c0f675a11bd5
-
- 14 Sep, 2020 5 commits
-
-
Sotirios Delimanolis authored
Summary: This diff introduces a callback, `CertificateIdentityVerifier` that can probe peer end-entity certificates during a TLS handshake in `AsyncSSLSocket`. The verifier gets called only if regular chain verification (OpenSSL's and a `HandshakeCB`'s) succeeds and can return a `Try` with a `CertificateIdentityVerifierException` to indicate that a failure occurred. `AsyncSSLSocket` will then fail the TLS handshake. The diff also adds a new `AsyncSSLSocket` constructor with a new `Options` parameter that groups together some optional properties, including the verifier. We can eventually refactor the other constructors to use it too. Reviewed By: mingtaoy Differential Revision: D22821714 fbshipit-source-id: b63b141862b5703eb5274fb6ef8aa98934a55df0
-
Chad Austin authored
Summary: exception_tracer is currently gated on FOLLY_USE_SYMBOLIZER, and when I enabled it, I didn't notice the CMake build of Folly on macOS stopped working. Fix it by adding correct conditionals, and removing the removed std::unexpected_handler. Reviewed By: yfeldblum, lnicco Differential Revision: D23690777 fbshipit-source-id: 76ada7911ac33de3b1e8b0a73cebf3c2d04a58ef
-
Songqiao Su authored
Summary: As the main purpose of write callback is to signal the buffer is on longer needed and may be released (https://fburl.com/diffusion/ahbbb6oy). Release the buffer then calling the write callback seems more reasonable Differential Revision: D23411380 fbshipit-source-id: c9b421716368253eafb4ecb8b72f48c8b47c2f9f
-
Stepan Palamarchuk authored
Summary: This API allows for an easier way to configure EventBase without a need to introduce yet another constructor with variable amount of arguments. In particular, we have an ad-hoc constructor for overriding just the wheel timer interval, but it's not possible to override it in other constructors. Reviewed By: yfeldblum Differential Revision: D23511659 fbshipit-source-id: 2f8de3a527ee07dbf2dc19f2e369014793d906c1
-
Luca Niccolini authored
Summary: needed by a few projects [wangle, mvfst, proxygen] it's already in lfs https://www.internalfb.com/intern/diffusion/FBS/browse/master/fbcode/tools/lfs/.lfs-pointers?lines=41 Reviewed By: mzlee Differential Revision: D23676343 fbshipit-source-id: 0fa04d4224f27e756f683924af0c21ea63a90647
-
- 13 Sep, 2020 3 commits
-
-
Lee Howes authored
Summary: Fixes across the codebase to allow for r-value qualified getVia. Change is behaviour neutral - getVia is already destructive internally. Reviewed By: yfeldblum Differential Revision: D23605722 fbshipit-source-id: 75dfe6faca1c888eae9b262552372dd557eb6933
-
Mohammed Das authored
Summary: Moving CoReturn and CoThrow helpers for use with GTest. CoReturn() and CoThrow() work similar to Return() and Throw() provided in GTest framework. Reviewed By: yfeldblum Differential Revision: D23502840 fbshipit-source-id: 3e5f35135d8291543b91d3615e86398d794a7ba9
-
Chad Austin authored
Summary: Enable FOLLY_USE_SYMBOLIZER on macOS and teach SafeStackTracePrinter to use `backtrace_symbols_fd` on non-ELF platforms. Reviewed By: luciang Differential Revision: D23017169 fbshipit-source-id: 1ad6cbf6d9ad11276d95b821095e37a86c8bb862
-
- 12 Sep, 2020 2 commits
-
-
Michael Lee (Engineering) authored
Summary: Before: While the Xcode constants are pretty well standardized, discoverability and use within folly is non-trivial. We have constants for various other attributes about the OS and target platform, so add a sane mapping for Apple targets as well. Reviewed By: yfeldblum Differential Revision: D23605949 fbshipit-source-id: cd4212dd30d9ec6a3c48a6d7a787a67fdeb9dd1f
-
Yedidya Feldblum authored
Summary: [Folly] Some static-asserts in `Executor::KeepAlive`: standard-layout, pointer-size, pointer-align. Reviewed By: LeeHowes Differential Revision: D23656740 fbshipit-source-id: ff6c5aa3de01a37144fe8ef0961f06d13938654a
-
- 11 Sep, 2020 4 commits
-
-
Lee Howes authored
Summary: For consistency with get() make getTryVia r-value qualified and move the result out. This has the benefit of removing surprise copies in code that already operated on a temporary future but ended up with an l-value reference to copy from as a result of this operation. Reviewed By: ispeters Differential Revision: D23610051 fbshipit-source-id: a11344b9c8680f9498abc307ba1c7c793e3403e1
-
Yedidya Feldblum authored
Summary: [Folly] Cut explicit `main` from test programs in `folly/gen/test/` and prefer the linked-in version. Reviewed By: simpkins Differential Revision: D23643891 fbshipit-source-id: 20152ae4feeeccd43038580043d45759c39c075c
-
Ivan Egorov authored
Summary: This makes sense on systems without `backtrace` and with LLVM libunwind implementations. Reviewed By: yfeldblum Differential Revision: D23625739 fbshipit-source-id: 6ec50c94c73bda227118ffc36d6856bcd8dd0d8b
-
Nathan Bronson authored
Summary: `std::shared_ptr` has an aliasing constructor, but `std::weak_ptr` has none. This diff implements a helper function that implements the functionality. For libstdc++ it uses ABI-specific hacks to avoid the need to construct a temporary `std::shared_ptr`. Reviewed By: yfeldblum Differential Revision: D23580416 fbshipit-source-id: 71712270519b0e7522d8019a5c356679c7dc5397
-
- 10 Sep, 2020 5 commits
-
-
Yedidya Feldblum authored
Summary: [Folly] Decay char-array and trivial args to `throw_exception` and `terminate_with`. The motivation is to ensure smaller call-site code size in the common cases, where the solitary argument is a string literal. Extend to cases where arguments are numbers and the like as well, since that is simple enough and is something that `Function` already does. Reviewed By: aary Differential Revision: D23550096 fbshipit-source-id: d3a2066dc28dc4cfac6b65e2b8972613ce55d06c
-
Yedidya Feldblum authored
Summary: [Folly] `byte`, backported from `std::byte` in C++17. Reviewed By: Alfus, vitaut Differential Revision: D23535105 fbshipit-source-id: 056c634362b2ca226306a97ae9994a4631d07ee5
-
Orvid King authored
Summary: In newer versions of the windows STL, this gets included in <thread>, so explicitly include it in Unistd.h and remove the definition of getpid. Reviewed By: yfeldblum Differential Revision: D23498073 fbshipit-source-id: 5fe07dbbaa9fb1bf5c904286bd15beccbf1d1615
-
Yedidya Feldblum authored
Summary: [Folly] Revise invoke to be an invoker rather than a function, and therefore insusceptible to ADL, and revise invocability traits for compile-time perf. Do the same for apply and applicability traits. Reviewed By: Mizuchi Differential Revision: D23334895 fbshipit-source-id: 4d3241a3f34a7bede44f8ab54a30a3074d9fd3ed
-
Yedidya Feldblum authored
Summary: [Folly] Tweaks to hash primitives: twang, jenkins_rev, fnv Reviewed By: ot, luciang Differential Revision: D23290185 fbshipit-source-id: 080dfa8a5f357065473f3973654c91d01c683c3c
-