1. 10 May, 2019 13 commits
    • Joe Loser's avatar
      Remove GCC 4.9 workaround in FunctionTest (#1126) · 5c57c80c
      Joe Loser authored
      Summary:
      - On GCC 4.9 and below, the type of `vec` could not be deduced in the
        `for_each` call.
      - Since folly requires GCC 5.1 or later now, which has no issues in the
        deduction, remove the workaround and associated comment.
      Pull Request resolved: https://github.com/facebook/folly/pull/1126
      
      Reviewed By: Orvid
      
      Differential Revision: D15292875
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 50533536e9e73d2c3e5d466d1b6143d0d4085648
      5c57c80c
    • John Strizich's avatar
      add option to pass options to `git clone` · 4e928185
      John Strizich authored
      Summary: We need this for dependencies that require submodules
      
      Reviewed By: saifhhasan, GirasoleY
      
      Differential Revision: D15282792
      
      fbshipit-source-id: b0cc8d645e73668252409934fd6741fb211e30ae
      4e928185
    • Zeyi (Rice) Fan's avatar
      fix encoding issue when building on Windows · cea16735
      Zeyi (Rice) Fan authored
      Summary:
      On Windows, the writing operation would fail with:
      
      ```
      Traceback (most recent call last):
        File ".\opensource\fbcode_builder\getdeps.py", line 400, in <module>
          sys.exit(main())
        File ".\opensource\fbcode_builder\getdeps.py", line 393, in main
          return args.func(args)
        File ".\opensource\fbcode_builder\getdeps.py", line 236, in run
          change_status = fetcher.update()
        File "C:\open\fbsource\fbcode\opensource\fbcode_builder\getdeps\fetcher.py", line 451, in update
          return mapping.mirror(self.build_options.fbsource_dir, self.repo_dir)
        File "C:\open\fbsource\fbcode\opensource\fbcode_builder\getdeps\fetcher.py", line 400, in mirror
          f.write(name + "\n")
        File "C:\Python36\lib\encodings\cp1252.py", line 19, in encode
          return codecs.charmap_encode(input,self.errors,encoding_table)[0]
      UnicodeEncodeError: 'charmap' codec can't encode characters in position 104-105: character maps to <undefined>
      ```
      
      and this is caused by a file in libgit2: https://github.com/libgit2/libgit2/blob/master/tests/resources/status/%E8%BF%99, which is intended to test handling non-ASCII path.
      
      Python on Windows will write file in cp1252 encoding by default, which does not contain that Chines character. (Caveat: that file on my system doesn't have the correct file name as well, it is being encoded in IBM861 for some reason. However the characters in IBM861 does not exist in CP1252 either)
      
      Reviewed By: wez
      
      Differential Revision: D15281521
      
      fbshipit-source-id: 8a75e32bc1042167c945d67e26b549fda83b6b41
      cea16735
    • Wez Furlong's avatar
      getdeps: introduce TransientFailure exception type · 4be1b74a
      Wez Furlong authored
      Summary:
      The goal is to return an error code > 127 in the case of a
      transient, retryable, infrastructure error.  This diff generates
      those in the case of failure in downloading a URL or from interacting
      with LFS.
      
      Reviewed By: strager
      
      Differential Revision: D15266838
      
      fbshipit-source-id: 4f52a791320123968869032c37912dded464a86e
      4be1b74a
    • Wez Furlong's avatar
      getdeps: respect cmake WORKING_DIRECTORY for tests · ccb63d10
      Wez Furlong authored
      Summary:
      the cmake `add_test` and related functions allow specifying
      the WORKING_DIRECTORY to use for tests.  We weren't respecting this
      value, so this diff looks up the WORKING_DIRECTORY from the ctest
      json info and adjusts the buck test info json blob that we pass
      on the testpilot.
      
      Since that interface only allows passing an argv array, we use
      the `cmake -E chdir` command to run a command in a specified
      directory in a portable manner.
      
      Reviewed By: strager
      
      Differential Revision: D15274012
      
      fbshipit-source-id: 1f02d461d73178745794703d455494e31c2e09ed
      ccb63d10
    • Amol Bhave's avatar
      Add portability support for std::remainder · b2cecfb5
      Amol Bhave authored
      Summary:
      std::remainder isn't supplied by all platforms. Specifically, uclibc
      doesn't have it. Do a similar case as with std::nextafter, i.e. implement a
      folly version in case it doesn't exists.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15291533
      
      fbshipit-source-id: 96a70b52af11135102fda3183626df69cdaf4261
      b2cecfb5
    • Amol Bhave's avatar
      Add builtin folly::nextafter when using uclibc · e265e1ef
      Amol Bhave authored
      Summary:
      When building using uclibc, std::nextafter doesn't exist. This is
      similar case as for android, where std::nextafter doesn't exist.
      Add additional condition to choose folly supplied versions of this function.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15291534
      
      fbshipit-source-id: f6c9e213248f4e2a6e88e20578aeade46dc85d6b
      e265e1ef
    • Yedidya Feldblum's avatar
      Add sorted_unique ctor to sorted_vector_set and sorted_vector_map · b8d837fc
      Yedidya Feldblum authored
      Summary: [Folly] Add `sorted_unique` ctor to `sorted_vector_set` and `sorted_vector_map`. The `presorted` ctors are used with presorted but not necessarily unique inputs, so uniquify the inputs in that ctors. The untagged ctors which take a backing container presort but do not uniquify the backing container, so switch to presorting and uniquifying.
      
      Reviewed By: vitaut
      
      Differential Revision: D15215677
      
      fbshipit-source-id: bf920103cfb6c297c186e5389701c08218dbc4b9
      b8d837fc
    • Yedidya Feldblum's avatar
      Less unneeded generality in sorted-vector ctors · 85fd07e2
      Yedidya Feldblum authored
      Summary: [Folly] Less unneeded generality in `sorted_vector_set` and `sorted_vector_map` ctors in terms of `begin` and `end` - can just use member functions.
      
      Reviewed By: vitaut
      
      Differential Revision: D15215590
      
      fbshipit-source-id: e6c8c92fdd9ae16963768b4f748aa07e9566f947
      85fd07e2
    • Yedidya Feldblum's avatar
      Use sorted_equivalent in TDigest · f75e2a2a
      Yedidya Feldblum authored
      Summary: [Folly] Use `sorted_equivalent` in `TDigest` since it is less ambiguous than `presorted` and it is a backport from C++20.
      
      Reviewed By: vitaut
      
      Differential Revision: D15195608
      
      fbshipit-source-id: 07bb4c7e3750affd10f182efcdf3d9ee9e4a8cf8
      f75e2a2a
    • Yedidya Feldblum's avatar
      Add missing comment for TDigest::merge overload · cb3ff81d
      Yedidya Feldblum authored
      Summary: [Folly] Add missing comment for `TDigest::merge` overload.
      
      Reviewed By: vitaut
      
      Differential Revision: D15215559
      
      fbshipit-source-id: 781105819d8160b73d6d70dc22937482f6851f4f
      cb3ff81d
    • Yedidya Feldblum's avatar
      sorted_unique_t, sorted_equivalent_t · 1c0529a5
      Yedidya Feldblum authored
      Summary:
      [Folly] `sorted_unique_t`, `sorted_equivalent_t`, backporting from p0429 and C++20.
      
      Note that the existing `presorted_t` is ambiguous between `sorted_unique_t` as is assumed in `sorted_vector_set` and `sorted_vector_map` and `sorted_equivalent` as is assumed in `TDigest`.
      
      http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0429r6.pdf
      
      Reviewed By: Orvid
      
      Differential Revision: D15215532
      
      fbshipit-source-id: d90379d609088c6b306a0fc5c7db9b1ad3cdeee8
      1c0529a5
    • Amol Bhave's avatar
      Fix test AsyncUDPSocketTest for stress testing · fe95b7f0
      Amol Bhave authored
      Summary:
      If multiple instances of this test are running, it is possible for a
      filename conflict to occur. This fixes that behavior by using a different temp
      name each time.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15258558
      
      fbshipit-source-id: 40e71c57e68a90bc730fb5ba427d999789f6f88c
      fe95b7f0
  2. 09 May, 2019 6 commits
    • Yuhan Hao's avatar
      remove mstch from fbthrift's fbcode_builder spec · fd4e0165
      Yuhan Hao authored
      Summary: mstch is no longer required for fbthrift, we can remove it from oss build spec
      
      Reviewed By: vitaut
      
      Differential Revision: D15280267
      
      fbshipit-source-id: 5008e54af9c927f23b0d6acbf0d9beb6e004eee1
      fd4e0165
    • Yuhan Hao's avatar
      mstch is no longer required for fbthrift · 93fea16b
      Yuhan Hao authored
      Summary: mstch is no longer required for fbthrift, we can remove it from manifests
      
      Reviewed By: vitaut
      
      Differential Revision: D15279652
      
      fbshipit-source-id: 1772de7ab51fbfe048808f66290c4ca79de60608
      93fea16b
    • Chad Austin's avatar
      require FOLLY_SKIP_AS_FAILURE to be 1 · 48f70c58
      Chad Austin authored
      Summary: yfeldblum says convention here is 1 or empty (or 0).
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15271809
      
      fbshipit-source-id: 528e4143eaa8ee86807b06c824b3d84a586ec69c
      48f70c58
    • Nick Sukhanov's avatar
      Make `next` relaxed · 6a80914d
      Nick Sukhanov authored
      Summary: We had a rare data race on next this diff is fixing that.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15120382
      
      fbshipit-source-id: d3f0e521b941fdfcd1d968a42d7e8d240c3f74e6
      6a80914d
    • Andrii Grynenko's avatar
      Use unbounded queues · 15666e6a
      Andrii Grynenko authored
      Summary: There's no way we can size such queues appropriately.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15271382
      
      fbshipit-source-id: 7d8c5b0a3faffac3e86cb87fa18d0597facc3189
      15666e6a
    • Chad Austin's avatar
      detect at runtime whether SKIP should fail · 2b928806
      Chad Austin authored
      Summary: Detect at runtime whether the test runner expects skips to fail.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D15210476
      
      fbshipit-source-id: f1948d469b1008c85de9ed3ae93cc780caaf7f32
      2b928806
  3. 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
  4. 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
  5. 06 May, 2019 9 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