1. 08 May, 2019 9 commits
    • Orvid King's avatar
      Fix minor compilation issue for PPC64LE · 63ad770a
      Orvid King authored
      Summary:
      Always throwing an exception in a function marked `noexcept` generates warnings that show up as errors, so just directly call `std::terminate()` instead.
      
      Fixes https://github.com/facebook/folly/issues/1124
      
      Reviewed By: aary
      
      Differential Revision: D15263327
      
      fbshipit-source-id: cf12bab76a5dc7da9414c6873fc0b0c1335691fa
      63ad770a
    • Giuseppe Ottaviano's avatar
      Implement extractFirstSet · 2180558b
      Giuseppe Ottaviano authored
      Summary: This can be useful to iterate bitmasks that are ORs of power-of-2 enum flags.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15245333
      
      fbshipit-source-id: 661e0bdbe4468b693e37fda12e513202a3b3ed17
      2180558b
    • Wez Furlong's avatar
      getdeps: introduce `build --enable-tests` option · 42925695
      Wez Furlong authored
      Summary:
      This controls whether tests are built or not.
      They are not built by default.  When `--enable-tests` is turned on,
      tests are enabled for the named project only, not all of the deps.
      This results in a faster build, because eg: the number of tests in
      folly is very large and consumers of folly don't want to spend so
      much time waiting to build tests when really all they want to do
      is build their own project.
      
      Reviewed By: strager
      
      Differential Revision: D15246336
      
      fbshipit-source-id: 2e22fd60c983b059f71639602712087f2a188ec6
      42925695
    • Wez Furlong's avatar
      getdeps: if the hash has changed, force a cmake reconfigure · 1bf2a1af
      Wez Furlong authored
      Summary:
      This is needed to correctly pick up changes made to
      eg: cmake.defines sections in the manifest for first-party
      projects.
      
      Reviewed By: strager
      
      Differential Revision: D15246337
      
      fbshipit-source-id: 35e525e885f87d6136d5ff3b94ebf34516ab947c
      1bf2a1af
    • Victor Zverovich's avatar
      Add conversion from fbstring to std::string_view · 41f67441
      Victor Zverovich authored
      Summary:
      Add an implicit conversion from `folly::fbstring` to `std::string_view` for
      compatibility with `std::string`. Among other things this enables formatting of
      `fbstring` with fmt.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15230438
      
      fbshipit-source-id: 8f5a606c5e2a761cb332421130de638abfab4065
      41f67441
    • Amol Bhave's avatar
      Add setTrafficClass method to AsycnUDPSocket · 4d8408a7
      Amol Bhave authored
      Summary: This field sets the IPV6_TCLASS attribute for the socket.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15240838
      
      fbshipit-source-id: 81a14ee0a85010926b973c221184a82412975108
      4d8408a7
    • Amol Bhave's avatar
      Add support for UNIX datagram sockets to AsyncUDPSocket · 8cc6a2f2
      Amol Bhave authored
      Summary:
      Add support for AF_UNIX datagram sockets in AsyncUDPSocket class.
      For UNIX sockets, the third argument to the socket() call should be 0,
      and getPort() throws. Fix these instances.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15073543
      
      fbshipit-source-id: 14627d256a7f15104cbc22bc4b5ce03694c90405
      8cc6a2f2
    • Udip Pant's avatar
      add fbcode_builder_config for mvfst build in oss · 90e278b9
      Udip Pant authored
      Summary: support for fbcode_build and travis build
      
      Reviewed By: siyengar
      
      Differential Revision: D15184766
      
      fbshipit-source-id: 5117164c324d3d3c867592a88670a53b6f862477
      90e278b9
    • Mingtao Yang's avatar
      Change SSL{Server,Common}Options::k{CipherList,SignatureAlgorithms} to static constexpr function · d6d6412f
      Mingtao Yang authored
      Summary:
      Taking the address of a static constexpr variable will generate undefined
      references until C++17, when static constexpr variables are implicitly inline.
      
      Turning this into a static constexpr function generates weak symbols for both
      C++14 & C++17. If anything, if you don't care about this, this makes it easier
      to add/remove ciphers since you no longer need to adjust the array size
      in the definition in SSLOptions.cpp.
      
      The original motivation for this change was to fix a build failure in proxygen
      oss, where declaring a wangle::SSLContextConfig would lead to an undefined
      symbol linker error.
      
      Reviewed By: lnicco
      
      Differential Revision: D15246869
      
      fbshipit-source-id: 44c016b9eecdf999efbffdcd381c024a6ffb11ac
      d6d6412f
  2. 07 May, 2019 3 commits
    • Lee Howes's avatar
      Always passing executor into callbacks. · bc08e06d
      Lee Howes authored
      Summary: Propagate the executor parameter through all future callbacks to make it available at any point in the set of continuations.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15225264
      
      fbshipit-source-id: 6433c9ccf8f3992fc16ebb1ea0171cc634fc3951
      bc08e06d
    • Yedidya Feldblum's avatar
      Move co_reschedule_on_current_executor · 1185bdd6
      Yedidya Feldblum authored
      Summary:
      [Folly] Move `co_reschedule_on_current_executor`, placing it alongside `co_current_executor`.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: lewissbaker
      
      Differential Revision: D15227871
      
      fbshipit-source-id: 72c125ad792ebde6bb74e288b3404116cd279cb4
      1185bdd6
    • Francois Visconte's avatar
      Export user counters in json_verbose mode · 8011691a
      Francois Visconte authored
      Summary:
      This diff expose the user counters when using json verbose mode.
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: Orvid
      
      Differential Revision: D15147243
      
      fbshipit-source-id: ebd13710d683163bdc83274bf227a2eb8d6053b3
      8011691a
  3. 06 May, 2019 11 commits
    • Yedidya Feldblum's avatar
      Rename co_schedule to co_reschedule_on_current_executor · 6b95c53d
      Yedidya Feldblum authored
      Summary: [Folly] Rename `co_schedule` to `co_reschedule_on_current_executor`, which is longer but which more clearly identifies the behavior.
      
      Reviewed By: lewissbaker
      
      Differential Revision: D15215844
      
      fbshipit-source-id: aada82e8985224608415ee5458ac8138ce13f8d0
      6b95c53d
    • Joe Loser's avatar
      Explicitly delete fbstring_core copy-assignment (#1123) · 5af16267
      Joe Loser authored
      Summary:
      - Replace `fbstring_core` private copy assignment special member function
        with an explicit `=delete` equivalent.
      Pull Request resolved: https://github.com/facebook/folly/pull/1123
      
      Reviewed By: Orvid
      
      Differential Revision: D15216597
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 319109f739d972e9efc73a7dbc2dd6ae401b18fc
      5af16267
    • Joe Loser's avatar
      Remove macro guards against GCC 4.9 code (#1096) · 11aeda2a
      Joe Loser authored
      Summary:
      - Since folly requires GCC 5+ compiler, remove several macros which were
        guarding against when we supported GCC 4.9.
      Pull Request resolved: https://github.com/facebook/folly/pull/1096
      
      Reviewed By: LeeHowes
      
      Differential Revision: D14681043
      
      Pulled By: LeeHowes
      
      fbshipit-source-id: fcc2cd25e00c512f7154a1568003e7c2f0df9c54
      11aeda2a
    • Kirk Shoop's avatar
      strengthen transform submit constraints · 54a23fa3
      Kirk Shoop authored
      Summary: constrain transform submit on the validity of the underlying submit
      
      Reviewed By: ericniebler
      
      Differential Revision: D15104546
      
      fbshipit-source-id: 7eea68074e4f9a4e51e77af55abf8c1b10e936af
      54a23fa3
    • Cornel Rat's avatar
      Add writer priority mode in TimedRWMutex · 78c14b68
      Cornel Rat authored
      Summary:
      - The current TimedRwMutex behavior is biased heavily towards readers. This can lead to writer starvation under heavy read load which can result in writers unable to acquire the lock for several minutes
      - The current change adds a writer priority mode to TimedRWMutex which can be specified at creation time. The default behavior will still be reader priority and since the logic is handled through templates it shouldn't introduce any side effects for the reader priority behavior
      
      Reviewed By: matheweis
      
      Differential Revision: D15204620
      
      fbshipit-source-id: e940868aa9cec8f4a0a6b59c695ed3beca11c11a
      78c14b68
    • Dave Watson's avatar
      Add more docs · 14010eb6
      Dave Watson authored
      Summary: Try and answer some common recurring questions
      
      Differential Revision: D15081359
      
      fbshipit-source-id: 1bb0fde2194b9b8304d556f2a4b690ac4aa1e414
      14010eb6
    • Dan Melnic's avatar
      Enforce SingletonThreadLocal uniqueness without FOLLY_TLS · 8a4aeb80
      Dan Melnic authored
      Summary: Enforce SingletonThreadLocal uniqueness without FOLLY_TLS
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15182815
      
      fbshipit-source-id: 5f2daba43a84092c5fdc43a4e94465446e828b5b
      8a4aeb80
    • Lewis Baker's avatar
      Add overload of folly::coro::co_invoke() for AsyncGenerator · 5513c472
      Lewis Baker authored
      Summary: The `co_invoke()` helper function now supports callables that return `AsyncGenerator`.
      
      Reviewed By: rhodo
      
      Differential Revision: D15054793
      
      fbshipit-source-id: d7edc7db7d2fa44115f2c25872a6849b1e07bd4c
      5513c472
    • Lewis Baker's avatar
      Add folly::coro::collectAllWindowed · e5569cdd
      Lewis Baker authored
      Summary:
      Adds some functions for concurrently awaiting a collection of tasks but with an upper bound on the number of tasks to process concurrently.
      
      - `folly::coro::collectAllWindowed(range, maxConcurrency)`
      - `folly::coro::collectAllTryWindowed(range, maxConcurrency)`
      
      Reviewed By: andriigrynenko
      
      Differential Revision: D15014011
      
      fbshipit-source-id: 8f62dbae47e0548eacec8dc59239668040d3a771
      e5569cdd
    • Dan Melnic's avatar
      SingletonThreadLocal benchmark · 8869d108
      Dan Melnic authored
      Summary: SingletonThreadLocal benchmark
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15116981
      
      fbshipit-source-id: cf44104542614ee9b79a88a14182c2ddbaf7a34c
      8869d108
    • Miroslav Crnic's avatar
      UnboundedQueue::dequeue support for non default-constructible types · d1677802
      Miroslav Crnic authored
      Summary:
      `UnboundedQueue::try_dequeue` supports non default-constructible types but `UnboundedQueue::dequeue` does not.
      This diff fixes it and cleans up functions made obsolete.
      
      Reviewed By: shixiao
      
      Differential Revision: D15199743
      
      fbshipit-source-id: b2041c5cbffbbcfe153c218c467cfe04e5e5a544
      d1677802
  4. 05 May, 2019 5 commits
    • Joe Loser's avatar
      Add non-const data() method to FBString (#1116) · e1ab01a5
      Joe Loser authored
      Summary:
      - As of C++17, `std::string` contains a non-const `data()` member function.
        This is useful when working with C APIs that have `char*` output parameters.
      - Implements P0272 for `FBString`:
        http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0272r1.html
      
      Example of workaround without this:
      
      ```
        fbstring s{};
        some_api(&s.front());
      ```
      
      - The expression `&s.front()` above causes undefined behavior since the string
        is empty.
      
      - Add non-const public member function `data()` to `fbstring` which
        delegates to `fbstring_core`.
      Pull Request resolved: https://github.com/facebook/folly/pull/1116
      
      Reviewed By: Orvid
      
      Differential Revision: D15213884
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: f533542db0a7e34c09a622e5257d7c1e66ab75e2
      e1ab01a5
    • Yedidya Feldblum's avatar
      small_vector<T>::get_allocator() · b6b647e6
      Yedidya Feldblum authored
      Summary:
      [Folly] `small_vector<T>::get_allocator()` for compatibility with other container types.
      
      While `small_vector` is not actually parameterizable over the allocator types, compatibility with generic interfaces such as the presorted-ctor interfaces of `sorted_vector_set` and `sorted_vector_map` require `get_allocator`.
      
      Reviewed By: vitaut
      
      Differential Revision: D15194509
      
      fbshipit-source-id: 3a7842d5640f8e95a09c4cd8e2a9ab6ffc4fe9ac
      b6b647e6
    • Yedidya Feldblum's avatar
      container_type member alias for sorted-vector types · 5e74cab3
      Yedidya Feldblum authored
      Summary: [Folly] container_type member alias for `sorted_vector_set` and `sorted_vector_map`, following the protocol from `std::queue`, `std::priority_queue`, and `std::stack` container adaptors.
      
      Reviewed By: vitaut
      
      Differential Revision: D15194108
      
      fbshipit-source-id: 91332478c66779690f415d598b99274b8ee52df4
      5e74cab3
    • Yedidya Feldblum's avatar
      kGlibcxxVer, from _GLIBCXX_RELEASE · 9c081d10
      Yedidya Feldblum authored
      Summary: [Folly] `kGlibcxxVer`, from `_GLIBCXX_RELEASE` if available.
      
      Differential Revision: D15209042
      
      fbshipit-source-id: 077e94db623f33ebc3ec2cb93a5d7774d384a863
      9c081d10
    • Yedidya Feldblum's avatar
      Always include bits/c++config.h if possible · 02f942e3
      Yedidya Feldblum authored
      Summary: [Folly] Always `#include <bits/c++config.h>` if possible from `folly/portability/Config.h`. This is the libstdc++ (glibcxx) version/config/features header, so include it alongside the corresponding glibc version/config/features header.
      
      Differential Revision: D15209040
      
      fbshipit-source-id: 6f624283f58523d74317f3d998aa99c1c50ee2b3
      02f942e3
  5. 04 May, 2019 2 commits
    • Krishna Kondaka's avatar
      Split validateRecord to allow validating header and data separately · 0669cd92
      Krishna Kondaka authored
      Summary:
      Split validateRecord to allow validating header and data separately. This is
      useful when the header is used while storing records on storage devices.
      Validating header alone before validating the record helps avoiding unnecessary
      device reads. It also helps avoiding unnecessary memory allocations while trying to read invalid dataLength bytes present in an invalid header.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15184763
      
      fbshipit-source-id: e1f008df82cf2d040322b8d62135ea2b5e0dcc0e
      0669cd92
    • Yedidya Feldblum's avatar
      Use noexcept in IOBuf, supporting -fno-exceptions · baa4c665
      Yedidya Feldblum authored
      Summary: [Folly] Use `noexcept` in `IOBuf` v.s. reimplementing it via explicit `catch` and `abort`, with the intended side-effect of adding support for `-fno-exceptions`.
      
      Reviewed By: simpkins
      
      Differential Revision: D15208427
      
      fbshipit-source-id: bcf9d7b0f1a556e43d996c84b1df43ff891da974
      baa4c665
  6. 03 May, 2019 10 commits
    • Chad Austin's avatar
      Revert D15073229: [folly] detect at runtime whether SKIP should fail · 846587f4
      Chad Austin authored
      Differential Revision:
      D15073229
      
      Original commit changeset: 417a1f4e42d0
      
      fbshipit-source-id: 689b010627482e9a05f3dd34e89baae485875025
      846587f4
    • Wez Furlong's avatar
      fbcode_builder: getdeps: add `build --no-deps` flag · e8c7b488
      Wez Furlong authored
      Summary:
      This is useful especially on Windows where the up-to-date
      checks for the dependencies take a long time.
      
      The idea is that you might run this to start:
      
      ```
      $ getdeps.py build eden
      ```
      
      and then while in the edit/debug/build iteration cycle:
      
      ```
      $ getdeps.py build --no-deps eden
      ```
      
      Reviewed By: pkaush
      
      Differential Revision: D15200352
      
      fbshipit-source-id: 086f2f49db967ef4d1914a69fa80067104d79136
      e8c7b488
    • Wez Furlong's avatar
      fbcode_builder: getdeps: add sqlite3 builder · a4179ec0
      Wez Furlong authored
      Summary:
      Previously, we were using autoconf to build sqlite,
      but that isn't available on Windows.  Instead, here's a builder
      that generates a little cmake configuration for building and
      installing sqlite.
      
      Using cmake for this means that we can test the same builder
      on all platforms that need to pull in sqlite.
      
      Reviewed By: simpkins
      
      Differential Revision: D15179387
      
      fbshipit-source-id: fccf969182565982bd5be55545a2d2625aa99124
      a4179ec0
    • Wez Furlong's avatar
      fbcode_builder: getdeps: add LFS caching for ArchiveFetcher · 3a777987
      Wez Furlong authored
      Summary:
      When running in FB infra, prefer to download from our local LFS
      server rather than going out to the internet.
      
      Fall back to a normal internet download if the LFS get fails for some reason.
      
      Upload to LFS after successfully verifying the hash for the downloaded archive.
      
      Add a subcommand that performs a fetch for all possible platforms so that it
      is easier to ensure that the lfs-pointers file is up to date.
      
      Reviewed By: simpkins
      
      Differential Revision: D14978660
      
      fbshipit-source-id: 240fc32fc7003d1e06c88b80d85054dae36e2f31
      3a777987
    • Wez Furlong's avatar
      eden: getdeps: add fb-mercurial dep to enable treemanifest · 13356782
      Wez Furlong authored
      Summary:
      In order to pull in the treemanifest and other libraries
      from our mercurial repo, add a manifest file for it, and then
      adjust the logic in our cmake module to look for it.
      
      The fb-mercurial manifest just copies the source tree to the
      installation dir.  In the future, we could teach it to invoke
      the build for real.
      
      Reviewed By: simpkins
      
      Differential Revision: D14969806
      
      fbshipit-source-id: cb270c5003a1c134eeea92c7481a84938f1c5957
      13356782
    • Wez Furlong's avatar
      fbcode_builder: getdeps: add `show-inst-dir` and `show-source-dir` commands · 52efa89a
      Wez Furlong authored
      Summary:
      This prints out the installation or source prefix for a given project.
      This is useful in eg: packaging scripts to figure out where they can
      find the built artifacts.
      
      Reviewed By: simpkins
      
      Differential Revision: D14967378
      
      fbshipit-source-id: 7e1b5de2ca7219af24cfb07b4b42de22aa410469
      52efa89a
    • Wez Furlong's avatar
      fbcode_builder: getdeps: use testpilot when available to record tests · 13e19d08
      Wez Furlong authored
      Summary:
      If `testpilot` is available, generate a buck compatible json file describing the available test binaries and feed that to testpilot to have it run the tests.
      
      A later (yet to be written) diff will be able to pass appropriate flags down to testpilot in continuous runs and that will allow testpilot to auto-disable and file tasks for tests in the opensource builds.
      
      Reviewed By: simpkins
      
      Differential Revision: D14766856
      
      fbshipit-source-id: 4e144ff18f6788cf5e830d29788eabd2dbbae46a
      13e19d08
    • Wez Furlong's avatar
      fbcode_builder: getdeps: introduce loader class · 0c771cad
      Wez Furlong authored
      Summary:
      The loader makes it possible to monkey patch the functions
      that are responsible for loading manifests.  It is intended to be use
      in tests that are run in bucks sandboxed environment and that don't
      have direct access to the manifest files on disk.
      
      Reviewed By: simpkins
      
      Differential Revision: D14781326
      
      fbshipit-source-id: 18f69f8ce5768dc605b1a9388a80b7b7b9ffe0f4
      0c771cad
    • Wez Furlong's avatar
      fbcode_builder: getdeps: beef up hash computation · 31984a34
      Wez Furlong authored
      Summary:
      previously, a relatively lame hash was computed to use
      for the build directory based on some hash of the source directory.
      That was good enough to get things off the ground, but in the
      interest of being able to cache the build outputs and safely
      invalidate them we need a slightly more rigorous implementation.
      
      This diff computes a hash based on the manifest contents and
      relevant environmental factors.
      
      The hash is used to name the build directory which will ultimately
      be cached eg: using the travis/appveyor cache directory configuration
      and some other means for the FB internal CI.
      
      The hash needs to be sufficient that we change the hash when
      the manifests change.  We can tolerate a false positive change
      in hash (it just means that a build will take longer), but
      cannot tolerate a false negative (which would result in an
      incorrect build).
      
      Reviewed By: simpkins
      
      Differential Revision: D14710332
      
      fbshipit-source-id: ebc2e74eafc6f3305d4412a82195bc9fb9dfa615
      31984a34
    • Wez Furlong's avatar
      fbcode_builder: getdeps: add `sandcastle` subcommand · 04e33cde
      Wez Furlong authored
      Summary:
      This command schedules a facebook specific sandcastle job for the current
      commit in your repo for each of the platforms we have support for in
      sandcastle.
      
      You can use `--dry-run` to have it print out the job specs.
      
      To support this, I've moved around some of the support utilities
      to make it easier to import them.
      
      Reviewed By: simpkins
      
      Differential Revision: D14710330
      
      fbshipit-source-id: fb1e2a2ce78e52894291159514977da97028b37f
      04e33cde