- 30 Aug, 2019 1 commit
-
-
Lewis Baker authored
Summary: The `collectAll()`, `collectAllRange()` and `collectAllWindowed()` functions now cancel their subtasks when either the parent task is cancelled or when any of the subtasks fail with an exception. The `collectAllTry()`, `collectAllTryRange()` and `collectAllTryWindowed()` functions now cancel their subtasks if the parent task is cancelled, but not if the child tasks fail with an exception. The logic between the distinction here is that if you are calling one of the 'try' functions then you are intending to handle partial failure and so probably want each of the operations to run to completion independently of the others. Reviewed By: kirkshoop Differential Revision: D16820619 fbshipit-source-id: 5c203b41592a0145ff7be1c609dfccd39c41a3df
-
- 29 Aug, 2019 10 commits
-
-
Uladzislau Paulovich authored
Summary: `clang-cl` on Windows also defines `__PRETTY_FUNCTION__` which has a format different from `__FUNCSIG__`. Therefore folly breaks users of this macro. Alias should be defined only when "real" MSVC compiler is used. Reviewed By: akrieger, Orvid, blackm00n Differential Revision: D17094657 fbshipit-source-id: 4b191a61201704382e6b6e178bcc1c673511c537
-
Adam Simpkins authored
Summary: Rename the `ThriftCppLibrary.cmake` file to `FBThriftCppLibrary.cmake`, and also rename `add_thrift_cpp2_library()` to `add_fbthrift_cpp_library()`. Explicitly calling this `fbthrift` helps clearly distinguish that this is intended for use with fbthrift (https://github.com/facebook/fbthrift/), as opposed to Apache thrift. Reviewed By: wez Differential Revision: D16738440 fbshipit-source-id: 9b255e06b71c98ad74a34989f564a211958dcdd5
-
Nathan Bronson authored
Summary: CacheLocality's parsing code for /proc/cpuinfo doesn't properly handle systems in which there are offline CPUs. This diff makes it so we fall back onto the sequential cache locality implementation in the problematic scenarios. This should address https://github.com/facebook/folly/issues/1208 Reviewed By: shixiao Differential Revision: D17093176 fbshipit-source-id: 4da3a9dc53622f829af37ed70a2531c66fd92ddb
-
Aaryaman Sagar authored
Summary: Use folly::cacheline_align_v to prevent failures when running folly on platforms where extended alignment is not supported. The thread pools only used extended alignment as an optimization; so it is safe to disable it when not needed Reviewed By: yfeldblum Differential Revision: D17077439 fbshipit-source-id: 63ba59aaf7ce45231bb25427af84292c3a3464a9
-
Haijun Zhu authored
Summary: The non-atomic field `inUse_` is protected by a lock in `getStackCache`, but not in `giveBack`. This is a data race and it is caught by TSAN. Reviewed By: yfeldblum Differential Revision: D17109710 fbshipit-source-id: 7c0d5d948740516422efca0895a702566c804bb4
-
Wez Furlong authored
Summary: Windows and macOS compilers are sensitive to this, and this was overlooked in D16636130 Reviewed By: selat Differential Revision: D17113825 fbshipit-source-id: 16fe9210b07a096a58f3370df64874514e28ea46
-
Nick Sukhanov authored
Summary: Compiler passes rvalue reference for named local variable to return_value: https://reviews.llvm.org/D51741 Reviewed By: lewissbaker Differential Revision: D16963353 fbshipit-source-id: 98d846153adb2235b61bb8fb54d10f032d4c0055
-
Joe Loser authored
Summary: - Prior to commit 8cb615a2 (Differential Revision: D3394612), `Range:size()` had an assert checking that the beginning iterator of the range is less than or equal to the end iterator. Unfortunately, due to GCC bug 71448, the `assert` was not allowed if we wanted `size()` to remain a `constexpr` function. - This bug is no longer an issue with our current supported versions of GCC. As such, add the assert back in. Pull Request resolved: https://github.com/facebook/folly/pull/1155 Reviewed By: ericniebler Differential Revision: D15641627 Pulled By: yfeldblum fbshipit-source-id: 0677053c18fa55aaa4727947c241f0675362861b
-
Adam Simpkins authored
Summary: Update install_fb_python_library() to work with CMake versions older than 3.7. Previously the code used a generator expression in the directory argument supplied to `install(DIRECTORY)`. Support for generators in this parameter was only added in CMake 3.5, but it was buggy and did not correctly handle absolute paths until 3.7. This updates the code to avoid using a generator expression. This does require that the corresponding `add_fb_python_library()` statement appear before the `install_fb_python_library()` statement, but this seems like a pretty reasonable restriction. Reviewed By: chadaustin Differential Revision: D17103597 fbshipit-source-id: 54d6af93a3f530373cfe3137db99436d8484f308
-
Yedidya Feldblum authored
Summary: [Folly] RTM nits. * No nested namespace. * All status values supported. * Tests included in cmake builds. * API functions avoid `SIGILL` at runtime. Reviewed By: nbronson Differential Revision: D16636130 fbshipit-source-id: 9f9dc99b0826abbda295b069eb4823b3416af5d1
-
- 28 Aug, 2019 18 commits
-
-
Aaryaman Sagar authored
Summary: This is a useful testing utility that people can use if they use timeout APIs like `folly::futures::sleep()` Reviewed By: LeeHowes Differential Revision: D17065352 fbshipit-source-id: f9ea8366af7fc9429bfb1065328ed746c824f810
-
Mark Santaniello authored
Summary: The sorted vector types have constructors which "steal" capacity from a pre-filled container. Add tests to cover the cases where this is a folly:small_vector, and a std::pmr::vector. Reviewed By: nbronson Differential Revision: D17074150 fbshipit-source-id: e94b7e136553653081abe86559c4c013b9aac031
-
Lewis Baker authored
Summary: Adds static factory `CancellationSource::invalid()`. This can be used to construct a `CancellationSource` that can't be cancelled but that doesn't perform any heap-allocations. Reviewed By: kirkshoop Differential Revision: D16816764 fbshipit-source-id: bb87273903a6a8d245d207f4e6bda94e5c3d3dad
-
Lee Howes authored
Summary: Tweak futures::within to be completely deferred, including the timeout path, allowing it to support a SemiFuture-returning TimeKeeper. Reviewed By: yfeldblum Differential Revision: D17006080 fbshipit-source-id: cbed58579d33f6d6ecf60dce5f9c8b886fc4d4c4
-
Chris Keeline authored
Summary: wait() is guaranteed to succeed and not throw for either Baton type, so using a reference here is safe. When the future is completed on another thread, the shared_ptr causes cache contention. ``` Thread 1 Thread 2 make_shared/inc inc ... dec ref dec ref/free ``` Reviewed By: yfeldblum Differential Revision: D17077672 fbshipit-source-id: a6010ed159353decefbd5c51f4347370b16f7f60
-
Adam Simpkins authored
Summary: Update the generated `run_cmake.py` script to use `os.execve()` rather than `subprocess.call()`, so that it now propagates CMake's return code back to its caller. Reviewed By: chadaustin Differential Revision: D17089206 fbshipit-source-id: e01f05f492ccb842d4967e59fd0bc9a3e59b8a42
-
Adam Simpkins authored
Summary: Fix printing the manifest context in the error message if we cannot find a project fetcher. Previously the context in the message would be printed as something like `<getdeps.manifest.ManifestContext object at 0x7fcce987e610>`, now it shows instead as something like `{distro=ubuntu, distro_vers=18.04, fb=off, os=linux, test=off}` Reviewed By: chadaustin Differential Revision: D17089208 fbshipit-source-id: c16549b61030d813b7b5ff9f65966436dc1e1898
-
Adam Simpkins authored
Summary: This just strips off a trailing '/' from the `INSTALL_DIR` property that we set on python targets, to avoid having double-slashes in the paths that we use during installation. This shouldn't really have any material difference other than cleaning up the paths that get printed during the installation phase. Reviewed By: chadaustin Differential Revision: D17089207 fbshipit-source-id: ab36bb76c19fa60fe037f7a5290ccfd6bdbf13b0
-
Adam Simpkins authored
Summary: Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder rather than maintaining its own copy of this file. Reviewed By: chadaustin Differential Revision: D17005421 fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43
-
Adam Simpkins authored
Summary: Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when invoking the thrift compiler so that it can find all of the other thrift files that this library depends on. D16062657 was a previous attempt to do this, but suffered from a few problems: - It required all dependencies to be defined before `add_thrift_cpp2_library()` was called. This requires users to carefully order their CMake files and subdirectory include ordering. - It only handled one level of dependencies, and did not propagate include paths for deeper dependencies. - It set the include path for dependencies to the source directory path where the dependency was originally built, rather than the directory where the thrift file for that dependency would be installed. This change does require CMake 3.8+. Previous versions of CMake do not support using generator expressions to generate multiple arguments for a custom command. Reviewed By: strager Differential Revision: D17005381 fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d
-
Lee Howes authored
Summary: Allow futures::when to pass through a SemiFuture-returning function. Reviewed By: yfeldblum Differential Revision: D17001974 fbshipit-source-id: dbe8b347f0a4c3fd19774c68c4e58e3b523b971f
-
Lee Howes authored
Reviewed By: yfeldblum Differential Revision: D17086382 fbshipit-source-id: 318834a1d82025bc0c34bcf7a95fedfffdb02ddb
-
Lee Howes authored
Summary: times is hard to use with SemiFutures, leading to potential use of inline executors just to make it work. This adds native support. Reviewed By: yfeldblum Differential Revision: D16992774 fbshipit-source-id: 483110d923ca51e037439ccc80173ffa9299cd64
-
Dan Melnic authored
Summary: Use FOLLY_CL_USE_FOLLY_TLS for CacheLocality to avoid an iOS build issue Reviewed By: mzlee Differential Revision: D17085507 fbshipit-source-id: acd407c9e0045eb4d8a59348a20874dbe75fd651
-
Lee Howes authored
Summary: Earlier change to duration waiting broke propagation of the interrupt handler. This change correctly propagates it into the new future that is returned. Reviewed By: yfeldblum Differential Revision: D17061618 fbshipit-source-id: b228221acbfab3ae94118c1197a485e01aa2e41e
-
Lee Howes authored
Summary: whileDo is hard to use with SemiFutures, leading to potential use of inline executors just to make it work. This adds native support. Reviewed By: yfeldblum Differential Revision: D16988569 fbshipit-source-id: abaf36180d6ff8a5277eebb277f7f0a254315d36
-
Alex Eckert authored
Summary: All of the requisite headers are now open sourced and eden has been converted to use them. This removes any logic that references this directory and kills the now unused cmake file. Reviewed By: chadaustin Differential Revision: D16994732 fbshipit-source-id: 573b8b50540ee64590682be2a54aa94659f12368
-
Alex Eckert authored
Summary: Most stat code in fbcode was moved in to open source under fbcode/fb303. The only exception that we use internally is the MonotonicCounter class. This diff moves all of our stats code to use the open source headers and updates cmake files to pull in the open source fb303. Reviewed By: chadaustin, shri-khare Differential Revision: D16969960 fbshipit-source-id: 12b7abb54c956c242c8e27eb69fd96925c7e61f7
-
- 27 Aug, 2019 3 commits
-
-
Orvid King authored
Summary: Latest and C++17 are all we currently intend to support. Created from Diffusion's 'Open in Editor' feature. Reviewed By: yfeldblum Differential Revision: D17053747 fbshipit-source-id: 7ef2404b82242e363c9ccf1c5d7136eb52f356dc
-
Lee Howes authored
Summary: In preparation for making TimeKeeper::at and TimeKeeper::after return SemiFutures to make more explicit the need to keep work off of the TimeKeeper's executor, add *Unsafe versions of both functions to migrate code to. Differential Revision: D17052948 fbshipit-source-id: 4fb138862e417f02746ad4eaf71f091d37302e7a
-
Ying Hu authored
Summary: Fixing a comment in Evicting Cache Map, no functional code change. (Note: this ignores all push blocking failures!) Reviewed By: yfeldblum Differential Revision: D17051293 fbshipit-source-id: 7a1197790bd9a0905934888dabeecde9f7c9c165
-
- 26 Aug, 2019 5 commits
-
-
Adam Simpkins authored
Summary: Update add_thrift_cpp2_library() to add a PUBLIC_HEADER property to the generated library target, so that the generated headers can be installed using an `install()` call. Also add a `HEADER_INSTALL_DIR` property which indicates the directory they should be installed into. A `INCLUDE_DIR` argument was added to customize the include installation path, should anyone care to do so. This also removes code that was previously incorrectly installing the generated headers into the source tree. Reviewed By: wez Differential Revision: D16853404 fbshipit-source-id: 6f640b2bd347c99804e074fca0209dda37c8a9cf
-
László Várady authored
Summary: `folly::detail::std_pmr` uses either `std::pmr` or `std::experimental::pmr`. "Polymorphic Memory Resources" has been standardized in C++17, but `pmr::resource_adaptor` was [left behind](https://github.com/cplusplus/papers/issues/33), which means `resource_adaptor` is not available when a C++17 ready standard library is detected by folly. This commit reimplements `test_resource` without using the non-standard adaptor. ``` folly/test/sorted_vector_test.cpp:862:31: error: ‘folly::detail::std_pmr::resource_adaptor’ has not been declared 862 | using folly::detail::std_pmr::resource_adaptor; | ^~~~~~~~~~~~~~~~ ``` Pull Request resolved: https://github.com/facebook/folly/pull/1207 Reviewed By: nbronson Differential Revision: D17003049 Pulled By: yfeldblum fbshipit-source-id: 7bcd5b4bb4368366cd57d89b9ef88deaaff808d6
-
Tristan Rice authored
Summary: Previous within changes changed how long the executor keepalive existed for. This explicitly grabs the executor keepalive before calling within to ensure it still exists when we try to use it in `via`. Reviewed By: LeeHowes Differential Revision: D17054622 fbshipit-source-id: 7826c6ac0ad332a8f5f1331cd2d798619cf318c3
-
Adam Simpkins authored
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
-
Adam Simpkins authored
Summary: Fix the fbzmq pathmap listed in its manifest file to match the path map actually used by ShipIt. The fact that this was broken was why internal getdeps builds did not detect that D16577367 broke the build. Reviewed By: wez, jstrizich Differential Revision: D17005360 fbshipit-source-id: 046ff58ad70c03b860c3fccebaba975808df244d
-
- 25 Aug, 2019 3 commits
-
-
Adam Simpkins authored
Summary: Update ThriftCppLibrary.cmake to record that the output depends on the thrift `cpp2` template files. The `THRIFT_TEMPLATE_FILES` variable was defined in D16062657 but doesn't appear to be used anywhere. This uses it, and also updates it to only match the C++ template files. Reviewed By: wez Differential Revision: D16738442 fbshipit-source-id: aa4097e9ec1d009ef1e3ee2efd03ffa19a82ed12
-
Adam Simpkins authored
Summary: Add explicit double quotes around arguments that are intended to be exactly a single parameter. Also line wrap to 80 characters. Reviewed By: wez Differential Revision: D16738443 fbshipit-source-id: b8c9b6d50da72b44e23eaf5effbc384b6cbbc1c0
-
Adam Simpkins authored
Summary: Change ThriftCppLibrary to use `fb_cmake_parse_args()` This code doesn't really care much about handling empty arguments, so we could use the standard `cmake_parse_arguments()` function here instead of `fb_cmake_parse_args()`. However, it is slightly more convenient that `fb_cmake_parse_args()` automatically errors out on unhandled arguments, so that we don't have to check for this ourselves. Reviewed By: wez Differential Revision: D16738445 fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a
-