1. 19 Sep, 2019 5 commits
    • Adam Simpkins's avatar
      the libraries in thrift/lib/py depend on six · 0bfa67ca
      Adam Simpkins authored
      Summary:
      The libraries in thrift/lib/py support both Python 2 and Python 3, and rely on
      the Python six module for some of this compatibility support.
      
      Update the getdeps manifest for fbthrift to indicate this dependency, and
      update fbthrift's CMakeLists.txt file to find and reference python-six
      properly.  This will ensure that the python-six code is built into any python
      executable that uses the thrift/lib/py libraries.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17401218
      
      fbshipit-source-id: 0007dda8974ae9bd87e4d7e256c74908c9a30d8f
      0bfa67ca
    • Adam Simpkins's avatar
      add a builder that can re-package python wheel files · 6e1ff036
      Adam Simpkins authored
      Summary:
      Add a new builder that can extract Python wheel files, and re-package them
      for consumption by our add_fb_python_library() and add_fb_python_executable()
      CMake functions.  This is useful for dependencies on packages from PyPI.
      
      At the moment this code only handles architecture-independent pure-Python
      packages.  It shouldn't be too hard to extend this to handle more complex
      wheels, but for now I only need to use it for some pure-Python wheels and so I
      haven't tested with more complex wheel files.
      
      This also includes two new manifests for python-six and python-toml that take
      use this new builder.
      
      Reviewed By: wez
      
      Differential Revision: D17401216
      
      fbshipit-source-id: d6f74565887c3f004e1c06503dc9ec81599dd697
      6e1ff036
    • Yedidya Feldblum's avatar
      Support -Werror=unused-function · f14e7cb7
      Yedidya Feldblum authored
      Summary: Support `-Werror=unused-function`.
      
      Reviewed By: Orvid, guangyfb
      
      Differential Revision: D17252831
      
      fbshipit-source-id: ccf3829ebaa6992341ff5b1ab84c173922eeae03
      f14e7cb7
    • Adam Simpkins's avatar
      update make_fbpy_archive.py to replace the output on Windows · d4b04b02
      Adam Simpkins authored
      Summary:
      Update the code to use `os.replace()` rather than `os.rename()` so that it
      won't fail on Windows if the destination path already exists.
      
      Reviewed By: chadaustin
      
      Differential Revision: D17462716
      
      fbshipit-source-id: cbc06319ccb2d73868f80ab1874890ebec5a621b
      d4b04b02
    • Maged Michael's avatar
      hazptr: Add microbenchmark for unused tagged obj batch · 3ea63e0b
      Maged Michael authored
      Summary:
      Adds a microbenchmark for the lifetime of an unused tagged hazptr_obj_batch in the presence of unrelated objects in the domain's tagged list.
      
      This diff also makes the calculation of the number of operations and the scalability measure for the cleanup microbenchmark more consistent with those for the other microbenchmarks.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D17416088
      
      fbshipit-source-id: b59fd1b48114d591da5d9432df7910d940683006
      3ea63e0b
  2. 18 Sep, 2019 7 commits
  3. 17 Sep, 2019 6 commits
    • Amol Bhave's avatar
      create unorderedReduceSemiFuture method · 92dd0f71
      Amol Bhave authored
      Summary:
      create a unorderedReduceSemiFuture method that returns a SemiFuture
      instead of just a Future.
      
      Reviewed By: LeeHowes
      
      Differential Revision: D16946582
      
      fbshipit-source-id: e28b4cb055b3a9c67adebb373c60a775f7005762
      92dd0f71
    • Adam Simpkins's avatar
      fix the thrift CMake rules to add dependencies on the thrift compiler · e01c5188
      Adam Simpkins authored
      Summary:
      Update the thrift C++ and Python CMake rules to indicate that the output also
      depends on the thrift compiler itself.
      
      Previously the C++ rule indicated that the output depended on the thrift
      template files, which caught most cases when the thrift compiler was updated,
      but wasn't fully correct.  The thrift templates were also removed and baked
      into the thrift compiler binary in D16356056.
      
      Reviewed By: yfeldblum, chadaustin
      
      Differential Revision: D17401217
      
      fbshipit-source-id: ae5cde7a7e5e07a74406a1b6f4469124187bc12f
      e01c5188
    • Adam Simpkins's avatar
      add a command line option to disable the build cache · c9299818
      Adam Simpkins authored
      Summary:
      This is useful when working on changes to some of the builder functions,
      to skip ever trying to use cached results.
      
      Reviewed By: chadaustin
      
      Differential Revision: D17401219
      
      fbshipit-source-id: fb7d5ea45618653957b9bd6a62eed91d8334824d
      c9299818
    • Rosen Penev's avatar
      libfolly.pc: Fix for cross compilation (#1226) · eb473c29
      Rosen Penev authored
      Summary:
      Changes libfolly.pc to a more standard format.
      
      Allows overriding of the variables by pkgconfig.
      Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
      
      I'm not sure of anything that uses pkgconfig to find libfolly but might as well fix it.
      Pull Request resolved: https://github.com/facebook/folly/pull/1226
      
      Reviewed By: simpkins
      
      Differential Revision: D17415620
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: d015c3e83783b1c5e9ac48a64ad35c0c07120dbd
      eb473c29
    • Wez Furlong's avatar
      getdeps: adjust fixup-dyn-deps to optionally use absolute paths · 9dc9ee90
      Wez Furlong authored
      Summary:
      This commit teaches fixup-dyn-deps how to generate correct
      absolute paths in the context of the ultimate install path (specified
      via the `--final-install-prefix` option)
      
      Absolute paths are desirable if you have, for example, an executable
      that you wish to install with the setuid bit set.
      
      Reviewed By: simpkins
      
      Differential Revision: D17361491
      
      fbshipit-source-id: 4c4f3f15208266300622f84dc9cd1ba83883dfb7
      9dc9ee90
    • Andrew Krieger's avatar
      s/if _WIN32/ifdef _WIN32/g · fa32bb0f
      Andrew Krieger authored
      Summary:
      Avoids -Wundef on non-Windows builds.
      folly/system/ThreadId.h had #elif _WIN32 which was changed to
      #elif defined(_WIN32)
      
      Reviewed By: Orvid
      
      Differential Revision: D17399760
      
      fbshipit-source-id: 76583374c33d5d59e7c64b9a7a05c660a817bb92
      fa32bb0f
  4. 16 Sep, 2019 8 commits
    • Chad Austin's avatar
      fbcode_builder: add a license header to FBBuildOptions.cmake · a783cdd3
      Chad Austin authored
      Summary:
      Add a license header to satisfy the open source linter. Use the same
      header the other .cmake files have.
      
      Reviewed By: mhlakhani
      
      Differential Revision: D17404782
      
      fbshipit-source-id: 66679d72c9e680f8bb8b27869e981a046b3520cf
      a783cdd3
    • Wez Furlong's avatar
      Let's try a github action to build things (#743) · a92b821d
      Wez Furlong authored
      Summary:
      This commit adds a getdeps command that is able to generate
      a workflow file for the GitHub Actions CI environment.
      
      The workflow file could be expressed more simply using the matrix
      syntax and with three steps (checkout, build, test), but I chose to
      break out the steps for each of the dependencies because the UX
      while waiting on the build is much nicer that way: the steps show
      during and live log tailing for the section of the build that is
      underway.  If they were all lumped into a single build step then
      the logs from the boost section of the build dominate and make
      the github UI work very hard.
      
      Pull Request resolved: https://github.com/facebook/watchman/pull/743
      
      Test Plan:
      https://github.com/facebook/watchman/pull/743 successfully
      executes the github actions CI flow.
      
      ```
      $ opensource/fbcode_builder/getdeps.py generate-github-actions --output-file watchman/.github/workflows/main.yml watchman
      ```
      
      Reviewed By: simpkins
      
      Differential Revision: D17384915
      
      Pulled By: wez
      
      fbshipit-source-id: 9a9e5a3e806c18f6cc38ba1cb7059740cda01ad4
      a92b821d
    • Wez Furlong's avatar
      getdeps: teach builder how to find vs 2019 · fe1ec310
      Wez Furlong authored
      Summary:
      GitHub Actions CI `windows-latest` environment has only VS 2019
      installed, so we need to expand our logic to be able to locate it.
      
      Note that Boost 1.69 doesn't know how to locate VS 2019 so we are effectively
      tied to VS 2017 at the moment; the search order in this diff reflects that.
      
      (That means that we can't target `windows-latest` on GitHub Actions, but that
      is really a concern for a later diff in this stack)
      
      Reviewed By: simpkins
      
      Differential Revision: D17385052
      
      fbshipit-source-id: 9bb0612154f42d425a625406488f39bb4ec3d8ae
      fe1ec310
    • Wez Furlong's avatar
      getdeps: prefer MSVC over gcc when building on GitHub Actions CI · 116dea9d
      Wez Furlong authored
      Summary:
      while testing https://github.com/facebook/watchman/pull/743 I
      noticed that the cmake builds were picking up the installed mingw GCC
      compiler rather than the MSVC compiler.  That would be fine except that
      boost is built with MSVC and its generated libraries cannot be subsequently
      found by a cmake gcc build that uses FindBoost.
      
      This commit forces cmake to pick cl.exe rather than gcc.  This is probably
      fine to do unconditionally on windows, but since I've only observed this
      particular problem with GitHub Actions I'm keeping it constrained to that
      environment for now.
      
      Reviewed By: simpkins
      
      Differential Revision: D17385050
      
      fbshipit-source-id: 90bef898b138e5d4bbd28a155ed1bd468acee9de
      116dea9d
    • Wez Furlong's avatar
      getdeps: restructure bison+flex dependencies · c108f833
      Wez Furlong authored
      Summary:
      We've been squeaking by with assuming that flex is installed already
      on posix systems, but that isn't the case on the github actions default
      configuration.
      
      Adjust the bison recipe: on windows it deploys both flex and bison.  We use the
      same source for both flex and bison but install flex to a separate install
      prefix to make it easier to consume the flex dependency distinct from the bison
      dependency.
      
      The latest flex release segfaults during compilation on linux unless we
      force -DGNU_SOURCE, so the manifest does that on linux.
      
      Reviewed By: simpkins
      
      Differential Revision: D17385051
      
      fbshipit-source-id: 9f31b07849af9de50099d1b20bedba517bbbdf2f
      c108f833
    • Wez Furlong's avatar
      getdeps: fix openssl dep for libevent on macos · 691ed9ec
      Wez Furlong authored
      Summary:
      while testing https://github.com/facebook/watchman/pull/743 on macOS
      I noticed that the libevent build failed to find openssl.
      
      openssl is special on macos because apple do not ship the headers.
      We already build and depend on openssl for the folly manifest on
      macos, so this is really just adding a missing edge.
      
      Reviewed By: simpkins
      
      Differential Revision: D17385053
      
      fbshipit-source-id: 1b688537fef422d81a959fc5749c871b9e868baa
      691ed9ec
    • Tom Jackson's avatar
      toPrettyJson() sorts keys for deterministic output · 800f602c
      Tom Jackson authored
      Summary: Diffing logs would be easier if the lines which pretty-printed JSON were identical if their values were identical, and they're just easier to visually scan for a value if they're sorted anyway.
      
      Reviewed By: yfeldblum, luciang
      
      Differential Revision: D17367669
      
      fbshipit-source-id: 91188f23576ce39b9edc2307be018a43f30c786d
      800f602c
    • Yedidya Feldblum's avatar
      Use a fixed mempool capacity in LifoSem · a821d1c9
      Yedidya Feldblum authored
      Summary: [Folly] Use a fixed mempool capacity in `LifoSem`, simplifying usage.
      
      Reviewed By: nbronson
      
      Differential Revision: D17251982
      
      fbshipit-source-id: e3bce99204daef178418268f1d195365400df885
      a821d1c9
  5. 13 Sep, 2019 2 commits
    • Nanshu Chen's avatar
      refactor AsyncGeneratorWrapper to use AsyncGenerator::NextResult · f65c05bb
      Nanshu Chen authored
      Summary: AsyncGeneratorWrapper uses folly::Optional as the return type for "getNext". Now the AsyncGenerator API has changed by adding `next()` method which returns a `NextResult` type, which works like folly::Optional while supporting both values and references, it's best to use `NextResult` for the wrapper as well.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16695661
      
      fbshipit-source-id: 84e9d74e8d6b17b93bd3c22e2aaf56c7b9e4b789
      f65c05bb
    • Hasnain Lakhani's avatar
      Add CMake option to fetch deps statically · 0c5ceda6
      Hasnain Lakhani authored
      Summary:
      We would like to build a version of proxygen that has minimal
      dependencies on dynamic libraries.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17228181
      
      fbshipit-source-id: cfd61afdfa978c49a536184f426502196241fb8a
      0c5ceda6
  6. 12 Sep, 2019 1 commit
  7. 11 Sep, 2019 4 commits
    • Adam Simpkins's avatar
      fbcode_builder: update FBPythonBinary.cmake to work on Windows · 32701064
      Adam Simpkins authored
      Summary:
      On Windows we have to explicitly invoke `make_fbpy_archive.py` with python.
      Therefore use CMake's built-in `FindPythonInterp` module to find the python
      executable and use that when invoking `make_fbpy_archive.py`
      
      This is slightly complicated by the effort required to find python with older
      versions of CMake.  We ideally still want to support versions of CMake back to
      at least 3.8, which means we need to still support finding Python with the
      older `FindPythonInterp.cmake` module
      
      Reviewed By: wez
      
      Differential Revision: D17128606
      
      fbshipit-source-id: 3f4beff76848b8a362ebdf21198e7a8bf1b0537f
      32701064
    • Mark Santaniello's avatar
      bugfix sorted_vector_types allocator-extended c'ctor · c27460f2
      Mark Santaniello authored
      Summary: The nested EBO classes were missing the allocator-extended c'ctor.  Fix and add tests to cover this case.
      
      Reviewed By: nbronson
      
      Differential Revision: D17284711
      
      fbshipit-source-id: 6e7e8df83712f018fd6a7558513164f319b1b7f8
      c27460f2
    • Yedidya Feldblum's avatar
      Cut dep on boost chrono · 835f77cd
      Yedidya Feldblum authored
      Summary: [Folly] Cut unused dep on boost `chrono` library from folly and proxygen.
      
      Reviewed By: vitaut
      
      Differential Revision: D17298687
      
      fbshipit-source-id: 90d0182f4fbb76c13cb341e27514e688f12590a4
      835f77cd
    • Yedidya Feldblum's avatar
      Move hash_128_to_64 to top of file · 701224e9
      Yedidya Feldblum authored
      Summary: [Folly] Move `hash_128_to_64` to top of file - it has no dependencies so there was no need to split the declaration and definition across 500 lines.
      
      Reviewed By: Orvid
      
      Differential Revision: D17276906
      
      fbshipit-source-id: f57133e8873d8b1afcfd5ab119e07615f6ee9018
      701224e9
  8. 10 Sep, 2019 5 commits
    • Matt Ma's avatar
      Support inline functions in folly stack trace symbolizer · 1c76bae6
      Matt Ma authored
      Summary:
      Basic idea is to find the subprogram for a given stack trace address, scan the inlined subroutines of that subprogram recursively for all inline function calls, then find the name and location of these inline function calls.
      
      Now only pure inline functions are supported, and class inline functions are not. Class inline functions needs a lookup path "caller->obj->type", then lookup types in .debug_types, which is more complex.
      
      The debug info parser idea was stolen from hphp/tools/debug-parser/dwarfstate.h
      
      Not sure if we want to add a flag to enable this feature. We can discuss over review.
      
      Reviewed By: luciang
      
      Differential Revision: D16760775
      
      fbshipit-source-id: 1a7c23486605e7d8837070a697a875789ae41416
      1c76bae6
    • David Goldblatt's avatar
      Add documentation to Conv.h. · cffb3628
      David Goldblatt authored
      Summary: This adds a file-level comment that explains the various usages.
      
      Differential Revision: D16259169
      
      fbshipit-source-id: 95e5e8f047cdd159899cab47c390a7b0ab8d70cb
      cffb3628
    • Nathan Bronson's avatar
      UninitializedMemoryHacks gcc 9 support · f7798632
      Nathan Bronson authored
      Summary:
      gcc 9's libstdc++ moves the definition of _M_impl._M_finish
      into a new intermediate class. It's still addressible with the same name,
      but the type of the member pointer changes. This diff switches to using
      decltype to tolerate both the old and the new implementation.
      
      Reported as issue https://github.com/facebook/folly/issues/1223
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17283175
      
      fbshipit-source-id: 9c9da28b83c3cb3584d33575b462d10b17002edb
      f7798632
    • Yedidya Feldblum's avatar
      No mutable flags in IOBuf · bbd6fb43
      Yedidya Feldblum authored
      Summary: [Folly] No mutable flags in IOBuf to avoid races when invoking `const`-qualified members concurrently.
      
      Reviewed By: simpkins
      
      Differential Revision: D17251909
      
      fbshipit-source-id: e52d333fb620d05f7229a11db9c2f14fe9f6f028
      bbd6fb43
    • Yedidya Feldblum's avatar
      Avoid ambiguous call in futures · b1233937
      Yedidya Feldblum authored
      Summary:
      [Folly] Avoid ambiguous call in futures. Because `std::atomic` is in `namespace std`, unqualified calls to `atomic_compare_exchange_strong_explicit` from within `namespace folly` are ADL-ambiguous between the overloads in `namespace std` and in `namespace folly`.
      
      Also:
      * Fix incorrectly-named prototype.
      * Fix used of `std::atomic<T>::value_type` which may not exist.
      
      Fixes #1221.
      
      Reviewed By: aary, Orvid
      
      Differential Revision: D17256763
      
      fbshipit-source-id: ffcaf171e6257cdef29de0ffb63f310d7f4a93eb
      b1233937
  9. 09 Sep, 2019 2 commits
    • Zhenyu Zhou's avatar
      Add a constructor to folly::Codel · 5ca43e12
      Zhenyu Zhou authored
      Summary: Making a new ctor so that we can pass in the parameters
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17173662
      
      fbshipit-source-id: ab518892694e1bec1179177e7d9477e3a89ff38d
      5ca43e12
    • László Várady's avatar
      Fix tests on Arch Linux (#1218) · b36f6181
      László Várady authored
      Summary:
      Compiling folly on Arch Linux triggered a few platform-specific behaviors that were not covered correctly by tests.
      
      - Fix F14{Map,Set} maxSize test cases
          The maximum size of `F14Table` is dependent of its allocator's max_size:
      
          ```
          max_size() -> std::min<std::size_t>(
              (std::numeric_limits<InternalSizeType>::max)(),
              AllocTraits::max_size(a)
          )
          ```
      
          This commit fixes the `F14{Map,Set}` maxSize tests, so they won't fail
          on platforms where the standard allocator's `max_size()` is based on
          `ptrdiff_t` (signed).
      
      -  Fix TestUtilTest
          If glog is compiled without gflags support, `SetCommandLineOptionWithMode()`
          can't force glog to use stderr.
      
          glog has its own compatibility layer for `FLAGS_*` in case gflags is missing,
          that's why `FLAGS_logtostderr` is always available.
      
      - Skip AsyncIOTest tests if O_DIRECT is not supported by the file system
          `fs::temp_directory_path()` returns `"/tmp"` on Linux.
      
          When using systemd, the /tmp directory is mounted by default as tmpfs;
          and tmpfs does not support the `O_DIRECT` flag.
      
          This commit skips tests in case the file can't be opened with `O_DIRECT`.
      Pull Request resolved: https://github.com/facebook/folly/pull/1218
      
      Reviewed By: nbronson
      
      Differential Revision: D17160597
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 00274d1f8770079e35559ee9bd8426402e949abd
      b36f6181