1. 01 Feb, 2022 2 commits
  2. 31 Jan, 2022 4 commits
    • Alex Hornby's avatar
      workaround for getdeps builds · 8d41a264
      Alex Hornby authored
      Summary: Workaround for getdeps builds of edenfs
      
      Reviewed By: fanzeyi
      
      Differential Revision: D33896917
      
      fbshipit-source-id: 9aed609ca6d5b209cda4fc7eecb52e5cfa9f6dac
      8d41a264
    • Alex Hornby's avatar
      move cargo logic to cargo.py · 8ff3267e
      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
      8ff3267e
    • Michael Voznesensky's avatar
      Add empty IOBuf ctor to folly cython, to match IOBuf.h · 7725223a
      Michael Voznesensky authored
      Summary: Title
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33873064
      
      fbshipit-source-id: 65b16ad30a7bf9f2b9e23857f072d33c94098899
      7725223a
    • Alex Hornby's avatar
      add autocargo for hgclientconf · 5da36fa6
      Alex Hornby authored
      Summary: Generate cargo files for hgclientconf
      
      Reviewed By: yancouto
      
      Differential Revision: D33843589
      
      fbshipit-source-id: d9b3452be684fcaa727c0c0a1175c1d8954bf9f2
      5da36fa6
  3. 29 Jan, 2022 6 commits
    • Yedidya Feldblum's avatar
      avoid append-va-arg in FOLLY_SAFE_CHECK · 53e82da0
      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
      53e82da0
    • Yedidya Feldblum's avatar
      atomic-fetch-bit-op check functions · 84ff4e5f
      Yedidya Feldblum authored
      Summary: So that we may easily inspect the generated code.
      
      Reviewed By: ot, luciang
      
      Differential Revision: D32161049
      
      fbshipit-source-id: 00ca6f4196518389f7b1b18d9278085e1a3b43d2
      84ff4e5f
    • Yedidya Feldblum's avatar
      mark Function exec pointer as noexcept · 68b03455
      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
      68b03455
    • Yedidya Feldblum's avatar
      tweak symbolizer max-expected-frame-size for 32-bit · b1cf29bd
      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
      b1cf29bd
    • Yedidya Feldblum's avatar
      a benchmark program for atomic-fetch-bit-op · f4fa2a3f
      Yedidya Feldblum authored
      Summary: To measure `atomic_fetch_set` across sizes and behaviors.
      
      Reviewed By: luciang
      
      Differential Revision: D32262813
      
      fbshipit-source-id: 84510e85368cb5e012ddc8bbf2ca159444659f20
      f4fa2a3f
    • Max Katsev's avatar
      Add atomic_ref::exchange · 914047bd
      Max Katsev authored
      Reviewed By: ot
      
      Differential Revision: D33857528
      
      fbshipit-source-id: 265457c5771684d6830a16a3b7390e9bd99b277d
      914047bd
  4. 28 Jan, 2022 6 commits
    • Kenny Yu's avatar
      add symbolizer::getStackTrace to replace detail::getSingletonStackTrace · 2b99b21b
      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
      2b99b21b
    • Yedidya Feldblum's avatar
      FOLLY_SAFE_FATAL · c24b947e
      Yedidya Feldblum authored
      Summary: Like `FOLLY_SAFE_CHECK(true, ...)`.
      
      Reviewed By: luciang
      
      Differential Revision: D33801512
      
      fbshipit-source-id: c9023f4b14e0b045c654c15a8f2b9ea0cc384617
      c24b947e
    • Zeyi (Rice) Fan's avatar
      fix Windows build · e03edde8
      Zeyi (Rice) Fan authored
      Reviewed By: yns88
      
      Differential Revision: D33850004
      
      fbshipit-source-id: f01c3508c91049c3fc4f72bec14683b50332df77
      e03edde8
    • Eugene Poliukhovych's avatar
      Set ASAN fiber stack overhead to 4x from 16x · cafcd901
      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
      cafcd901
    • Akrama Baig Mirza's avatar
      Add thread ID collection to IOThreadPoolExecutor for dogpiles · 90781bd9
      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
      90781bd9
    • Xavier Deguillard's avatar
      fmt: update fmt to 8.0.1 · 93c44c56
      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
      93c44c56
  5. 27 Jan, 2022 9 commits
    • Marcus Holland-Moritz's avatar
      Mark potentially unused argument with [[maybe_unused]] (#1697) · 14f796e0
      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
      14f796e0
    • Muir Manders's avatar
      backingstore: conditionalize use of "fb" feature · 08fd3613
      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
      08fd3613
    • Mingtao Yang's avatar
      AsyncSSLSocketTest: Fix an LSAN error · e877c2ae
      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
      e877c2ae
    • Alex Hornby's avatar
      populate THRIFT_INCLUDE_PATH · 6cc80fd5
      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
      6cc80fd5
    • Andrii Grynenko's avatar
      Fix coroutine integration with Expected on GCC · e77f06df
      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
      e77f06df
    • Akrama Baig Mirza's avatar
      Use Options struct in IOThreadPoolExecutor constructor · 0d2f150b
      Akrama Baig Mirza authored
      Summary: Avoid using `bool` directly in `IOThreadPoolExecutor` constructor
      
      Reviewed By: yfeldblum, praihan
      
      Differential Revision: D33769477
      
      fbshipit-source-id: ba16d676d2130c7680c960cd27f43174f06d0475
      0d2f150b
    • Yedidya Feldblum's avatar
      avoid tail calls in the stack-trace test example · 9ad0307f
      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
      9ad0307f
    • Victor Zverovich's avatar
      Fix compilation with fmt 8.x · 7774051a
      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
      7774051a
    • Nolan O'Brien's avatar
      Fix -Wstring-conversion warnings · 77a2e332
      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
      77a2e332
  6. 26 Jan, 2022 4 commits
    • Alex Hornby's avatar
      use same python3 as other getdeps builds · af1b432c
      Alex Hornby authored
      Summary: Bring fboss in line with other oss builds
      
      Reviewed By: shri-khare
      
      Differential Revision: D33620345
      
      fbshipit-source-id: 26e51230e4ae3c950eca2cb366a9fa55d5c1dfee
      af1b432c
    • Alex Hornby's avatar
      update fboss gtest usage for cmake 3.20+ and centos stream 8 · 4c792bf0
      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
      4c792bf0
    • Yedidya Feldblum's avatar
      add missing {} in LifoSem · 92ee56a3
      Yedidya Feldblum authored
      Reviewed By: magedm
      
      Differential Revision: D33763949
      
      fbshipit-source-id: 779c2a3d0337a357395a2554e810e7b0903a86d6
      92ee56a3
    • Lucian Grijincu's avatar
      folly::io::Cursor: fix UndefinedBehaviorSanitizer: nullptr-with-nonzero-offset · 148432cd
      Lucian Grijincu authored
      Summary:
      Per standard pointer arithmetic is only defined when keeping pointers within the bounds of an array object.
      
       Applying non-zero offset to nullptr (or making non-nullptr a nullptr by subtracting pointer's integral value from the pointer itself) is undefined behavior.
      
      Since https://reviews.llvm.org/D66608 `[InstCombine] icmp eq/ne (gep inbounds P, Idx..), null -> icmp eq/ne P, null) LLVM middle-end uses those guarantees for transformations.` and mis-compilations have been observed:
      - https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190826/687838.html
      - https://github.com/google/filament/pull/1566
      
      To prevent help weed out bugs before they lead to future miscompilations a new UBSAN check has been added: `nullptr-with-nonzero-offset`
      - https://reviews.llvm.org/D67122 [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour
      
      `folly::io::Cursor` does this type of operations when checking if `crtPos_ + N <= crtEnd_`: when it's empty it becomes `nullptr + N <= nullptr`:
        const uint8_t* crtBegin_{nullptr};
        const uint8_t* crtEnd_{nullptr};
        const uint8_t* crtPos_{nullptr};
      
      Switch to `uintptr_t` space where the math is no longer UB.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33737556
      
      fbshipit-source-id: 588b91ac1387112a6f183edfda5555ca1b7193d8
      148432cd
  7. 25 Jan, 2022 9 commits
    • Yedidya Feldblum's avatar
      check calls for Function exec ops · 30073fb9
      Yedidya Feldblum authored
      Summary: Exec ops include move and nuke ops.
      
      Reviewed By: ot, philippv
      
      Differential Revision: D32904615
      
      fbshipit-source-id: cb6ffa81f034c2dd8072ebd605dc8caabac2f199
      30073fb9
    • Yedidya Feldblum's avatar
      A place for compiler hints · a17e8443
      Yedidya Feldblum authored
      Summary:
      [Folly] A place for compiler hints in `folly/lang/Hint.h`.
      
      Add long-form names which explicitly reveal intentions:
      * `compiler_may_unsafely_assume` v.s. `assume`
      * `compiler_may_unsafely_assume_unreachable` v.s. `assume_unreachable`
      * `compiler_must_not_elide` v.s. `doNotOptimizeAway`
      * `compiler_must_not_predict` v.s. `makeUnpredictable`
      
      Reviewed By: Gownta
      
      Differential Revision: D20240392
      
      fbshipit-source-id: 5f13fafc6a426fcd66fa61465eb1e2ffe15b4187
      a17e8443
    • Alex Hornby's avatar
      update ubuntu python .deb requirement for dataclasses · d1521025
      Alex Hornby authored
      Summary: We have dataclasses dependency now in eden_scm, which means python 3.7 or later
      
      Reviewed By: quark-zju
      
      Differential Revision: D33713759
      
      fbshipit-source-id: 6f915238326201d7408f885804714981505b7fa8
      d1521025
    • Alex Hornby's avatar
      add support for testing package resolution by distro and distro version · cab74d17
      Alex Hornby authored
      Summary:
      Add support for overriding os, distro and distro version to command line when inspecting system packages so one can requested see ubuntu 18.04 package from other OS.  Makes testing easier
      
      Used shlex to shell unquote the value to be tested in the getdeps expression evaluator. getdeps expression parser didn't tolerate 18.04 as . is special char to getdeps expressions, needed to be "18.04"
      
      Reviewed By: quark-zju
      
      Differential Revision: D33741323
      
      fbshipit-source-id: d83397c7fb5180a4d985d0d8ae7b3ff33b72f828
      cab74d17
    • Akrama Baig Mirza's avatar
      DRY implementation of ThreadIdCollector · 55d6a804
      Akrama Baig Mirza authored
      Summary: ThreadManager.cpp and CPUThreadPoolExecutor.cpp both define the same implemenation of a ThreadIdCollector. Let's create one implementation that can be shared.
      
      Reviewed By: yfeldblum, amlannayak
      
      Differential Revision: D33065836
      
      fbshipit-source-id: b17ef7abbba29cc7bad3779f20c76a3b08773963
      55d6a804
    • Taewook Oh's avatar
      folly: define FOLLY_SANITIZE_DATAFLOW macro for DFSan. · fb0be74d
      Taewook Oh authored
      Summary: This defines the macro `FOLLY_SANITIZER_DATAFLOW` as other sanitizers do.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D33747374
      
      fbshipit-source-id: 3c8aa58f43ed72c4ca259bd2434e1f79d12dc65b
      fb0be74d
    • Chad Austin's avatar
      opt into pyre · 3e149ff7
      Chad Austin authored
      Summary:
      Now that we have some type annotations, we might as well support
      running the type checker.
      
      Reviewed By: xavierd
      
      Differential Revision: D33715757
      
      fbshipit-source-id: baf693e4b2415e0e1aa50b569b744ca0cfb91337
      3e149ff7
    • Chad Austin's avatar
      use python 3 type annotations · 6ba5d05e
      Chad Austin authored
      Summary: We don't support Python 2 anymore.
      
      Reviewed By: xavierd
      
      Differential Revision: D33715602
      
      fbshipit-source-id: 6cf3dba83f8207f956cab8eb8dbb3a748e1d9f89
      6ba5d05e
    • Chad Austin's avatar
      remove legacy __future__ imports · 11440db6
      Chad Austin authored
      Summary: The future is now.
      
      Reviewed By: xavierd
      
      Differential Revision: D33714537
      
      fbshipit-source-id: 8d282bbe7391c4b72b70dab54a5c252060fba457
      11440db6