1. 04 Oct, 2019 3 commits
    • Wez Furlong's avatar
      watchman: getdeps: Capture artifacts from Github Actions CI builds (#750) · 03191fe7
      Wez Furlong authored
      Summary:
      This diff teaches the generated Github Actions configuration to copy the
      executable outputs from the leaf project into an artifacts dir, and then capture
      the artifacts in the build.
      
      This page has details on the artifacts mechanism used by Github Actions:
      https://github.com/actions/upload-artifact
      
      This page has the "Artifacts" link on the RHS where an example of the artifacts
      can be downloaded:
      https://github.com/facebook/watchman/pull/750/checks?check_run_id=244088199
      
      Here's the actual download:
      https://github.com/facebook/watchman/suites/247296465/artifacts/74686
      
      And here's what the inside of that zip file contains for the watchman build:
      
      ```
      $ find . -ls
      49685444        0 drwxr-xr-x    6 wez              mygroup      192 Oct  1 18:50 .
      49685487       16 -rw-r--r--    1 wez              mygroup     6148 Oct  1 18:51 ./.DS_Store
      49685446        0 drwxr-xr-x    5 wez              mygroup      160 Oct  1 18:51 ./mac
      49685501       16 -rw-r--r--    1 wez              mygroup     6148 Oct  1 18:51 ./mac/.DS_Store
      49685453        0 drwxr-xr-x    3 wez              mygroup       96 Oct  1 18:50 ./mac/bin
      49685455     5432 -rwxr-xr-x    1 wez              mygroup  2778500 Oct  2 01:02 ./mac/bin/watchman
      49685454        0 drwxr-xr-x    7 wez              mygroup      224 Oct  1 18:50 ./mac/lib
      49685457      296 -rwxr-xr-x    1 wez              mygroup   149096 Oct  2 01:02 ./mac/lib/libgflags.2.2.dylib
      49685460     1072 -rwxr-xr-x    1 wez              mygroup   546348 Oct  2 01:02 ./mac/lib/libssl.1.1.dylib
      49685459      272 -rwxr-xr-x    1 wez              mygroup   135524 Oct  2 01:02 ./mac/lib/liblz4.1.dylib
      49685458      352 -rwxr-xr-x    1 wez              mygroup   176900 Oct  2 01:02 ./mac/lib/libglog.0.dylib
      49685456     4888 -rwxr-xr-x    1 wez              mygroup  2501012 Oct  2 01:02 ./mac/lib/libcrypto.1.1.dylib
      49685445        0 drwxr-xr-x    5 wez              mygroup      160 Oct  1 18:50 ./linux
      49685486       16 -rw-r--r--    1 wez              mygroup     6148 Oct  1 18:50 ./linux/.DS_Store
      49685448        0 drwxr-xr-x    3 wez              mygroup       96 Oct  1 18:50 ./linux/bin
      49685450   196264 -rwxr-xr-x    1 wez              mygroup 100486648 Oct  2 01:16 ./linux/bin/watchman
      49685449        0 drwxr-xr-x    4 wez              mygroup      128 Oct  1 18:50 ./linux/lib
      49685451     3864 -rwxr-xr-x    1 wez              mygroup  1976888 Oct  2 01:16 ./linux/lib/libgflags.so.2.2
      49685452     2208 -rwxr-xr-x    1 wez              mygroup  1127336 Oct  2 01:16 ./linux/lib/libglog.so.0
      49685447        0 drwxr-xr-x    4 wez              mygroup      128 Oct  1 18:51 ./windows
      49685513       16 -rw-r--r--    1 wez              mygroup     6148 Oct  1 18:51 ./windows/.DS_Store
      49685461        0 drwxr-xr-x    5 wez              mygroup      160 Oct  2 01:44 ./windows/bin
      49685464     7880 -rwxr-xr-x    1 wez              mygroup  4030976 Oct  2 01:44 ./windows/bin/watchman.exe
      49685463      488 -rwxr-xr-x    1 wez              mygroup   249856 Oct  2 01:44 ./windows/bin/glog.dll
      49685462      544 -rwxr-xr-x    1 wez              mygroup   278016 Oct  2 01:44 ./windows/bin/gflags.dll
      ```
      
      The `main.yml` file was updated by running:
      
      ```
      $ opensource/fbcode_builder/getdeps.py generate-github-actions --output-file watchman/.github/workflows/main.yml watchman
      ```
      
      Pull Request resolved: https://github.com/facebook/watchman/pull/750
      
      Test Plan: See description above
      
      Reviewed By: pkaush
      
      Differential Revision: D17705148
      
      Pulled By: wez
      
      fbshipit-source-id: 4f3c466180f5a1cb9fa31a9b3b3f117876f8b89d
      03191fe7
    • Nathan Bronson's avatar
      enable some production CHECK in F14 code · c510b2ad
      Nathan Bronson authored
      Summary:
      Production-enabled assertions have shown value in detecting
      a variety of issues that should be impossible but are observed to
      occur. This diff adds some checks to F14 that may fail under some types
      of memory corruption, tag missearch, or hash miscomputation.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17739592
      
      fbshipit-source-id: 92c9839ed5dab030350408d704a01c97573e3123
      c510b2ad
    • Nanshu Chen's avatar
      import folly::down_cast to Python/Cython · b695c6bc
      Nanshu Chen authored
      Summary: In Cython, use `from folly.cast cimport down_cast` to import the function.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17652305
      
      fbshipit-source-id: 6b038c5ac6c2a8ecd8e95f33ae3a37647a2bfdff
      b695c6bc
  2. 03 Oct, 2019 4 commits
    • Yedidya Feldblum's avatar
      Fix missing qualification in FOLLY_SAFE_DCHECK macro · df680df3
      Yedidya Feldblum authored
      Summary: [Folly] Fix missing qualification in `FOLLY_SAFE_DCHECK` macro.
      
      Reviewed By: nbronson
      
      Differential Revision: D17747688
      
      fbshipit-source-id: 1bab5770891c900252f767252b5d7769e209bcb1
      df680df3
    • Yedidya Feldblum's avatar
      Export folly::json::parse_error · 8ea70e3d
      Yedidya Feldblum authored
      Summary:
      [Folly] Export `folly::json::parse_error` v.s. having it be a hidden type.
      
      * Move class body to `.h`.
      * Leave helper function, previously the constructor, in anonymous namespace in `.cpp`.
      
      Reviewed By: vitaut
      
      Differential Revision: D17578773
      
      fbshipit-source-id: 0d50fdf662bbf67e844ff0ec9ef24975cea92f62
      8ea70e3d
    • Wez Furlong's avatar
      getdeps: ensure that INST/lib/*.dll are found in PATH on windows · a8d1fd8e
      Wez Furlong authored
      Summary:
      We were troubleshooting an issue with the eden tests on windows
      where the boost dlls where not being found during gtest discovery.
      
      When we compute the environment, we were only including INST/bin in the
      PATH on windows.  On Windows, the dlls are searched for in the PATH, and
      since boost installs those into its `lib` dir we were missing those.
      
      This diff causes `lib` dirs to get added to PATH on windows in the same
      manner that we would add them to `LD_LIBRARY_PATH` on linux.
      
      Reviewed By: pkaush
      
      Differential Revision: D17694542
      
      fbshipit-source-id: 143a907e6d30d8c12360caa43c8d9c26ff8c88c6
      a8d1fd8e
    • Wez Furlong's avatar
      getdeps: fixup-dyn-deps: use patchelf from our manifest on linux · 93c3a4e2
      Wez Furlong authored
      Summary:
      On linux we use `patchelf` to manipulate dynamic deps but it
      isn't guaranteed to be installed everywhere.  We have a manifest file
      that describes how to build it, but so far nothing has told getdeps
      that it should build it.
      
      This diff updates the ELF dep munging code to literally run
      `getdeps.py build patchelf` and then use that patchelf binary to
      manipulate the object files.
      
      Refs: https://github.com/facebook/watchman/pull/750
      
      Reviewed By: pkaush
      
      Differential Revision: D17705351
      
      Pulled By: wez
      
      fbshipit-source-id: 358ef239edb389fbd51fa023ff553963aa80b6c7
      93c3a4e2
  3. 02 Oct, 2019 5 commits
    • Scott Wolchok's avatar
      CacheLocality: reserve less space on mobile · 17cd1d8e
      Scott Wolchok authored
      Summary: Mobile phones have more like 16 CPUs and less like 128 CPUs.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16151292
      
      fbshipit-source-id: 87caed64d9a874f71e85ee2842194405e43568a3
      17cd1d8e
    • Yedidya Feldblum's avatar
      Dead Code: PriorityMPMCQueue · 2f06c17f
      Yedidya Feldblum authored
      Summary: [Folly] Dead Code: `PriorityMPMCQueue`.
      
      Reviewed By: LeeHowes
      
      Differential Revision: D17718372
      
      fbshipit-source-id: c79c376abadf7149b94d343cd6705f030fd71666
      2f06c17f
    • Yedidya Feldblum's avatar
      down_cast · be4a3034
      Yedidya Feldblum authored
      Summary: [Folly] `down_cast` for polymorphic checked-in-debug down-casts.
      
      Reviewed By: nbronson
      
      Differential Revision: D17650399
      
      fbshipit-source-id: 9cdd224b3f97ba40f88013877f968ed311a3ab3c
      be4a3034
    • Mingtao Yang's avatar
      Fix SSLContext tests that fail under OpenSSL 1.1.1 · df012bf4
      Mingtao Yang authored
      Summary:
      SSL_CTX_get_cipher_list() has different semantics when running under
      OpenSSL 1.1.1.
      
      This adjusts the tests that explicitly call SSLContext::setCiphers() to only
      check expectations against < TLS 1.3 cipher names.
      
      Reviewed By: knekritz
      
      Differential Revision: D17539611
      
      fbshipit-source-id: c293bd1e6b886dbc575a0677a98776d256b23fb5
      df012bf4
    • Rosen Penev's avatar
      asnTimeToTimepoint: Use a const parameter (#1235) · b2955150
      Rosen Penev authored
      Summary:
      X509_get0_notBefore returns and takes const parameters.
      Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
      
      ping reanimus
      Pull Request resolved: https://github.com/facebook/folly/pull/1235
      
      Test Plan: Build
      
      Reviewed By: knekritz
      
      Differential Revision: D17695324
      
      Pulled By: reanimus
      
      fbshipit-source-id: bebdb11fc9dd0b49354e7efcd1adc4f87a6675bc
      b2955150
  4. 01 Oct, 2019 6 commits
    • Maged Michael's avatar
      hazptr: Fix batch push obj · d0e76dbb
      Maged Michael authored
      Summary:
      Fix missing null check.
      It is possible for a thread to successfully CAS count from >= threshold to 0 and also pop an empty list.
      Example with 2 threads:
      - Batch contains Threshold - 1 objects
      - Thread 1 pushes an object, finds count == Threshold, CAS-es count to 0 successfully.
      - Thread 2 pushes Threshold more objects, finds count == Threshold, CAS-es count to 0 successfully.
      - Thread 1 pops all 2xThreshold objects (that's ok)
      - Thread 2 pops 0 objects (that's ok too but we need to do null check before dereferencing the head of the list).
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D17680391
      
      fbshipit-source-id: a1d68997668077cc0b34cc66405628ed2f95702b
      d0e76dbb
    • Taewook Oh's avatar
      add nothrow attributes to jemalloc non-standard API declarations. · 2cc6ef64
      Taewook Oh authored
      Summary: According to https://github.com/jemalloc/jemalloc/issues/237 and https://fburl.com/aeia78qk, `__attribute__((nothrow))` is added to jemalloc API functions to be in compatible with `stdlib.h`.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17679036
      
      fbshipit-source-id: 525a076f19719d2406c0dce92ca814f5f5011497
      2cc6ef64
    • Adam Simpkins's avatar
      getdeps: add manifests for pexpect and python-ptyprocess · 280ed609
      Adam Simpkins authored
      Summary:
      Add a manifest to download pexpect-4.7.0 from PyPI, as well as its ptyprocess
      dependency.
      
      Reviewed By: wez
      
      Differential Revision: D17669618
      
      fbshipit-source-id: 13395ec07f503f39adb3dc5aa8d0c2d8d0f1d927
      280ed609
    • Adam Simpkins's avatar
      getdeps: update the python wheel builder to support dependencies · 62ed81a0
      Adam Simpkins authored
      Summary:
      Correctly emit dependency information when one Python package depends on
      another.
      
      Reviewed By: wez
      
      Differential Revision: D17669620
      
      fbshipit-source-id: f51c7851470fe50dc0c17263c94c4d858d6e0921
      62ed81a0
    • Yedidya Feldblum's avatar
      Assorted nits · 4474c86b
      Yedidya Feldblum authored
      Summary: [Folly] Assorted nits.
      
      Reviewed By: chadaustin
      
      Differential Revision: D17677721
      
      fbshipit-source-id: a5903a61059cd60e093423d087b9e1d7e9e5d443
      4474c86b
    • Yedidya Feldblum's avatar
      aligned and cacheline_aligned · e984df45
      Yedidya Feldblum authored
      Summary: [Folly] `aligned` and `cacheline_aligned`, aligned and implicitly padded value wrapper types.
      
      Reviewed By: nbronson
      
      Differential Revision: D17386115
      
      fbshipit-source-id: 6da33a4d97f40ada59682e02af9d56863ccaff3d
      e984df45
  5. 30 Sep, 2019 10 commits
    • Igor Sugak's avatar
      fix typo in README.md · 093c9442
      Igor Sugak authored
      Summary:
      ```
      s/safer to safer to log/safer to log/
      ```
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17629820
      
      fbshipit-source-id: 8f9c3e412dfe52664ac1ae45e521f7df8815cef1
      093c9442
    • Brian Bustamante's avatar
      collectAllSemiFuture propagate completeKA to permit inlining · 51e2bb94
      Brian Bustamante authored
      Summary: Allow propagation of completing executor KA in order to permit inlining
      
      Reviewed By: LeeHowes
      
      Differential Revision: D17123836
      
      fbshipit-source-id: 7524868284f9482f56e5b8cd8b9e33bc4212de74
      51e2bb94
    • Luca Niccolini's avatar
      add gperf manifest · bba44900
      Luca Niccolini authored
      Reviewed By: dddmello
      
      Differential Revision: D17642516
      
      fbshipit-source-id: 5e9820df831fd907c97fab1238b38712ce2f6e64
      bba44900
    • wez@fb.com's avatar
      getdeps: update run_cmake.py to also support running tests · c6e6dff1
      wez@fb.com authored
      Summary: Add a `--mode=tests` behavior for invoking `ctest`
      
      Reviewed By: simpkins
      
      Differential Revision: D17610033
      
      fbshipit-source-id: 6284fe1dbfb7adf38a67820c842a5531eefd72fa
      c6e6dff1
    • wez@fb.com's avatar
      getdeps: add an `add_fb_python_unittest()` function · 748c7e0c
      wez@fb.com authored
      Summary:
      Add a function for defining Python unit tests.  This creates the test
      executable, and also emits logic to perform test discovery for ctest.
      
      Reviewed By: simpkins
      
      Differential Revision: D17610034
      
      fbshipit-source-id: cdf15b0b04acc1d3e906a1e2a95eb327951176ba
      748c7e0c
    • wez@fb.com's avatar
      getdeps: export a property that contains the path to the output executable · 8f2735ff
      wez@fb.com authored
      Summary:
      Export a property that indicates the path to the test executable.  This is
      useful for callers that want to install the binary or run it from other CMake
      rules.
      
      Reviewed By: simpkins
      
      Differential Revision: D17647146
      
      fbshipit-source-id: b32e2694e44a07d7c234e53a7a5c8443cb144487
      8f2735ff
    • Fred Emmott's avatar
      Support building on GCC 6.3 · c77641cc
      Fred Emmott authored
      Summary:
      This is a little strange: we already build with the system GCC on Debian 9 (Stretch),
      which is GCC 6.3 - but these changes are needed on other distributions when building GCC 6.3
      verbatim from upstream.
      
      fixes facebook/folly#823
      
      Reviewed By: jjergus
      
      Differential Revision: D17533036
      
      fbshipit-source-id: 32f7d1dc1fb9af3a89fe628185c0b239203e86d5
      c77641cc
    • Ming Zhao's avatar
      Add terminateOrKill function to folly::Subprocess to use a combination of... · 3fb0bf3b
      Ming Zhao authored
      Add terminateOrKill function to folly::Subprocess to use a combination of SIGTERM/SIGKILL to terminate a process.
      
      Summary:
      Add terminateOrKill function to folly::Subprocess to use a
      combination of SIGTERM/SIGKILL to terminate a process. The document
      has clearly indicated this class is thread-unsafe, and it's strongly
      suggested to call signal and wait in the same thread to avoid
      unintended consequence, yet there is code that tried to do that in
      mutliple threads and ends with potential kill(-1).
      
      By providing a function that basically does `terminate();
      waitpid_with_timeout(); kill(); waitpid()`, it should help eliminate
      usage errors mentioned above.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17662349
      
      fbshipit-source-id: 3a68ede5ca09270f804c88839a798ae31b615ae3
      3fb0bf3b
    • Yedidya Feldblum's avatar
      Fix cmake rule for JsonOtherTest.cpp · 50d64f75
      Yedidya Feldblum authored
      Summary: [Folly] Fix cmake rule for `JsonOtherTest.cpp`, which should no longer have an associated `CONTENT_DIR`.
      
      Reviewed By: Orvid
      
      Differential Revision: D17649973
      
      fbshipit-source-id: dc703884e1ccb5cad008cbb54acb24028570b126
      50d64f75
    • REDMOND\acoates's avatar
      Build fix for latest version of MSVC (#1234) · 6e58e89b
      REDMOND\acoates authored
      Summary:
      Newest builds of MSVC have a few more builtin's supported, so those polyfills need to be removed when using newer builds of MSVC.
      Pull Request resolved: https://github.com/facebook/folly/pull/1234
      
      Reviewed By: Orvid
      
      Differential Revision: D17649918
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 6c0fbd25bc77000228439a2ad1d66c815cb9f2c1
      6e58e89b
  6. 29 Sep, 2019 2 commits
  7. 28 Sep, 2019 1 commit
  8. 27 Sep, 2019 4 commits
    • Andrii Grynenko's avatar
      Fix addTaskRemoteFuture to work for functors returning Try<T> · e575bf39
      Andrii Grynenko authored
      Reviewed By: yfeldblum
      
      Differential Revision: D17619144
      
      fbshipit-source-id: 2d0c533fbf55b4ce1cfc787f53711fd1864a03c6
      e575bf39
    • Udip Pant's avatar
      function to enable or disable pathmtu discovery · 09ce44b3
      Udip Pant authored
      Summary:
      Allows us to set IPV6_PMTUDISC_PROBE
      See http://man7.org/linux/man-pages/man7/ip.7.html for reference
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17624135
      
      fbshipit-source-id: 46c1e71c768a0a7d0fbab5b728ba5df1b2f781b3
      09ce44b3
    • Maged Michael's avatar
      hazptr: Avoid unnecessary access to domain tagged list · b73bf8c1
      Maged Michael authored
      Summary:
      This diff avoids locking and traversing the domain's tagged list on shutdown of batches that never pushed objects to the list.
      
      This change required batches to keep track of pushing objects to the domain's tagged list.
      This in turn required reclamation of tagged objects to be invoked by the batch rather than using the free function hazptr_cleanup_batch_tag.
      In order to avoid batches keeping track of the associated domain (and adding an extra field), batches are used only with the default domain.
      
      Reviewed By: davidtgoldblatt
      
      Differential Revision: D17416380
      
      fbshipit-source-id: e5a3cd1492c1f1daf499b44fa1cfb4bb822062f7
      b73bf8c1
    • Aditya Kumar's avatar
      Reducing calls to malloc in AsyncSocket · a8f674ce
      Aditya Kumar authored
      Summary:
      Reduce calls to string::operator+.
      Constructing a single string by precalculating the size.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17573761
      
      fbshipit-source-id: 3918d1774949873fab3ba702d47cdeb80b44ab1d
      a8f674ce
  9. 26 Sep, 2019 2 commits
    • Yedidya Feldblum's avatar
      No need to load test files at runtime in json test · d3f8fa39
      Yedidya Feldblum authored
      Summary: [Folly] No need to load test files at runtime in json test - just embed the content into the test source as usual.
      
      Reviewed By: vitaut
      
      Differential Revision: D17578929
      
      fbshipit-source-id: 65b0bb7fe94f03b3defa9c539c2837c341e042c3
      d3f8fa39
    • Jason Gauci's avatar
      Add boost dependencies from folly · 2aa07752
      Jason Gauci authored
      Reviewed By: yfeldblum
      
      Differential Revision: D17556725
      
      fbshipit-source-id: 693ab8a2288584d3a05298790b6289483814e895
      2aa07752
  10. 25 Sep, 2019 2 commits
    • Yedidya Feldblum's avatar
      Fix stack-use-after-scope in folly::json::serialize · f1fe2fe9
      Yedidya Feldblum authored
      Summary:
      [Folly] Fix stack-use-after-scope in `folly::json::serialize` internals in `std::sort` comparison in `Printer::printObject`.
      
      Also avoid an extra layer of indirection around the comparison function. Possibly useful because the function is called repeatedly within the loop.
      
      Fixes #1190.
      
      Reviewed By: vitaut
      
      Differential Revision: D17560072
      
      fbshipit-source-id: 787584dc1f7d70762a712869788f8d892dd19ed5
      f1fe2fe9
    • Andrew Krieger's avatar
      Avoid -Wundef in ThreadName.cpp · a6306282
      Andrew Krieger authored
      Summary:
      There's already some ifdef for _WIN32 but it's not consistent.
      Also nothing ever sets the define for the supported functions to 0,
      so bail on those.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D17559767
      
      fbshipit-source-id: d0eebea980ef4f2b1288bdcc39547453efd3e9be
      a6306282
  11. 24 Sep, 2019 1 commit
    • Ezequiel Gomez's avatar
      New helper method to set the ciphersuites list of an SSLContext · 2e5c9c92
      Ezequiel Gomez authored
      Summary: Add new helper method setCiphersuites to folly SSLOptions. Same behavior as the templated setCipherSuites that takes in a TSLOptions. Instead of getting the ciphersuites from the static TSLOptions::ciphers(), this method allows use caller to pass in the ciphersuite list.
      
      Reviewed By: mingtaoy
      
      Differential Revision: D17432484
      
      fbshipit-source-id: 8a08b3651e209b5a4dfe4eca2352a9042206a48a
      2e5c9c92