1. 19 Jul, 2019 5 commits
    • Adam Simpkins's avatar
      update CMakeBuilder to raise an exception if we cannot find CMake · ca788235
      Adam Simpkins authored
      Summary:
      If `path_search()` returns that CMake is not available, raise an Exception and
      fail the build.  This makes the failure somewhat easier to to identify.
      Without this the code would continue and would try to invoke `subprocess` with
      a value of `None` in the command argument list.  This error is slightly harder
      to debug, since it isn't clear which command argument or environment variable
      is not a string.
      
      Reviewed By: chadaustin
      
      Differential Revision: D16354623
      
      fbshipit-source-id: be972b02cb13bc70db0f867da70e5bf4c6cec46d
      ca788235
    • Adam Simpkins's avatar
      normalize the scratch path · 1d6854a4
      Adam Simpkins authored
      Summary:
      The scratch path is used as part of the hash computation for each project.  We
      need to make sure this path is always normalized to ensure that we compute the
      hashes consistently.
      
      Reviewed By: chadaustin
      
      Differential Revision: D16354624
      
      fbshipit-source-id: 39b5362620bdc247cd7e7f1333dac319b354dc6f
      1d6854a4
    • Adam Simpkins's avatar
      cache results of path_search() · 4c4d3911
      Adam Simpkins authored
      Summary:
      getdeps currently ends up calling `path_search()` repeatedly searching for
      various C/C++ compilers in $PATH.  It ends up doing this multiple times for
      each dependency as it computes the project hashes.  This updates the
      `path_search()` function to cache its results so that we don't keep performing
      the same searches on the file system over and over again.
      
      Reviewed By: chadaustin
      
      Differential Revision: D16354625
      
      fbshipit-source-id: 116293bd2f636632517d26436b2332e6c10624f1
      4c4d3911
    • Dan Melnic's avatar
      Fix mem leak due to observer not being freed · 9b2c712d
      Dan Melnic authored
      Summary: Fix mem leak due to observer not being freed
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16234386
      
      fbshipit-source-id: 54ea9e904cf6cde0e24edf1511c2e3b46a58376f
      9b2c712d
    • Chad Austin's avatar
      build CompressionTest on macOS · c4f04f9a
      Chad Austin authored
      Summary: This particular `std::min` is ambiguous on macOS.
      
      Reviewed By: simpkins
      
      Differential Revision: D16352637
      
      fbshipit-source-id: d444b4b5f22c94b76da5463493efe433829bbba5
      c4f04f9a
  2. 18 Jul, 2019 1 commit
    • Nanshu Chen's avatar
      Py_INCREF/Py_DECREF when bridging coro task to python future and fix typo · 7186e58a
      Nanshu Chen authored
      Summary:
      1. Py_INCREF when holding py future object in bridge function. Py_DECREF in a scope guard.
      2. fix typo("folly::coroTask" should be "folly::coro::Task")
      
      Reviewed By: yfeldblum, andriigrynenko
      
      Differential Revision: D16341866
      
      fbshipit-source-id: 1d5b946596cd86c4a949e2c66f007a6140046506
      7186e58a
  3. 17 Jul, 2019 2 commits
    • Chad Austin's avatar
      transitively carry thrift dependencies forward · 60950182
      Chad Austin authored
      Summary: eden.thrift includes fb303_core.thrift, so any cmake target that depends on eden.thrift should pull in fb303_core.thrift's include directories and libraries. Implement that machinery in CppThriftLibrary.cmake.
      
      Reviewed By: wez
      
      Differential Revision: D16062657
      
      fbshipit-source-id: d5d962960e767a138a9b634a12aebccf72d6ef43
      60950182
    • Chad Austin's avatar
      add fbcode_builder manifest · 593c828e
      Chad Austin authored
      Summary: Add a manifest and CMakeLists.txt for building fb303 with cmake.
      
      Reviewed By: wez
      
      Differential Revision: D15480895
      
      fbshipit-source-id: d47f6ef9b9383b79b31a6170c7d4c9e8337de4d8
      593c828e
  4. 16 Jul, 2019 3 commits
    • Lee Howes's avatar
      Deprecate executor-taking forms of Future::then · d81227d1
      Lee Howes authored
      Summary:
      Deprecate Future::then(executor, callback) pending removal.
      
      This form of Future::then is ambiguous, and does not yet implement the stronger
      typing of thenValue and thenTry. It is also tempting to use instead of via,
      where it is not obvious that it has the behaviour of wrapping a via call in a
      push and pop of the current executor:
      .pushCurrentExecutor().via(executor).then(callback).popCurrentExecutor().
      
      With the addition of inline continuations, we can instead make the nesting
      explicit at low cost by making it an inline continuation that launches an
      asynchronous task on the passed executor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16282826
      
      fbshipit-source-id: a94c994cf02f43f7a2bd857237885b25591fa9aa
      d81227d1
    • Chad Austin's avatar
      fbcode_builder: use build interface generator expression for thrift include directories · 9cdbf0f1
      Chad Austin authored
      Summary:
      Fix an error about source directories being included in the include
      path in add_thrift_cpp2_library. I don't know why this was failing for
      fb303 and not for other projects, but adding a generation expression
      appears to fix the issue.
      
      Reviewed By: strager
      
      Differential Revision: D15725024
      
      fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300
      9cdbf0f1
    • Rui Zhang's avatar
      Add Singleton::apply and unit tests. · 34a5bd8c
      Rui Zhang authored
      Summary: Adds a callback interface to facilitate adding elision support for folly::Singleton. Planned to add context-aware elision support which will use an adaptation method based on the interface's callsite information (ie, the type of the Singleton instance, T, and the type of the callback function, F).
      
      Reviewed By: nbronson
      
      Differential Revision: D15970597
      
      fbshipit-source-id: 1010322c64d1b7900b4bef5b35059238efabb071
      34a5bd8c
  5. 15 Jul, 2019 3 commits
  6. 12 Jul, 2019 2 commits
    • Dan Melnic's avatar
      TSAN: AtForkList::child() - ignore reads, writes and sync · 58a6cebe
      Dan Melnic authored
      Summary:
      TSAN: AtForkList::child() - ignore reads, writes and sync
      
      (Note: this ignores all push blocking failures!)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16196384
      
      fbshipit-source-id: 28ea3b9fdb317eaffcb428f6ae705d5c4e5de887
      58a6cebe
    • Adam Simpkins's avatar
      improve the code that searches for dumpbin.exe · b0e08c4a
      Adam Simpkins authored
      Summary:
      Fix dyndeps.py to find dumpbin.exe in more situations.
      
      Previously the code looked for dumpbin.exe under Visual Studio directories
      named either `BuildTools` or `Community`.  On a system with an MSVC 2017
      Professional install it is instead located under a directory named
      `Professional`.  This updates the glob to allow any directory name here.
      
      Reviewed By: pkaush
      
      Differential Revision: D16207692
      
      fbshipit-source-id: 1a57ec29653a89fd3e751b3e4408a298b4632b11
      b0e08c4a
  7. 11 Jul, 2019 4 commits
    • Ahmed Soliman's avatar
      Move iobuf Python wrapper from thrift to folly · c82e22f5
      Ahmed Soliman authored
      Summary:
      We expose iobuf to Python via the folly.iobuf Python extension. The code for this extension has historically been in the fbthrift source tree. Move it to folly so that folly produces folly extensions and thrift produces thrift extensions.
      
      Without this change we end up with the folly.iobuf Cython extension being packaged with thrift rather than folly, leading the need for a number of work-arounds to allow Python and Cython to find folly.iobuf without stopping their searches on folly.executor.
      
      The tests for IOBuf python extension has been added to folly while maintaining the thrift-specific IOBuf tests in thrift.
      
      Reviewed By: vitaut
      
      Differential Revision: D14405645
      
      fbshipit-source-id: 662a4e32c219f6d044bb6e903a2525ec1b4059c5
      c82e22f5
    • Puneet Kaushik's avatar
      getdeps: Extend is_objfile() to Windows class to only select files with .exe extension · 51a8d664
      Puneet Kaushik authored
      Summary: is_objfile() is used to find the executable files in the given project. Getdeps will only find and copy the dependencies of the binaries identified by this function. On Windows we will copy only the dependencies for an exe file.
      
      Reviewed By: chadaustin
      
      Differential Revision: D16185962
      
      fbshipit-source-id: f6b5089401b242514a845e3a97b3804051d93c1c
      51a8d664
    • Andrii Grynenko's avatar
      Fix releaseDeferredExecutor to not access Executor if callback was set · 1766f03f
      Andrii Grynenko authored
      Summary: Instead of using setCallbackAndDetach (which is hard to apply in all cases because of cancellation), this diff fixes releaseDefferedExecutor.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16189338
      
      fbshipit-source-id: 47ef192dd0cec3c13824071c8ba7e1dd06968a70
      1766f03f
    • Matt Glazar's avatar
      Fix typo in documentation · f8533d7f
      Matt Glazar authored
      Reviewed By: yfeldblum
      
      Differential Revision: D15915100
      
      fbshipit-source-id: afc131bdf143ac0eec15523e257545d63207cb34
      f8533d7f
  8. 10 Jul, 2019 1 commit
    • Wez Furlong's avatar
      RIP: travisbot notifications · f4849667
      Wez Furlong authored
      Summary:
      This are noisy and don't provide real value, so remove
      the webhooks.
      
      Reviewed By: yns88
      
      Differential Revision: D16115486
      
      fbshipit-source-id: 1daa2d78f4e786a42dcc5779ccd30c36e02d2445
      f4849667
  9. 09 Jul, 2019 3 commits
  10. 08 Jul, 2019 1 commit
    • Dan Melnic's avatar
      Add MicroSpinLock TSAN annotations · c2fcc1b6
      Dan Melnic authored
      Summary: Add MicroSpinLock TSAN annotations
      
      Reviewed By: yfeldblum
      
      Differential Revision: D14578441
      
      fbshipit-source-id: e2c9bc1806550d003cc659a86d214c089464f126
      c2fcc1b6
  11. 06 Jul, 2019 3 commits
    • Marshall Cline's avatar
      gen-to-ranges: rename folly::gen::detail types · d5711806
      Marshall Cline authored
      Summary:
      Context: migration of fbcode from folly::gen to range-v3 by way of pipe-adapters ("pipe fittings") that allow a `|`-based pipeline mixing {std-containers and/or range-v3} with folly::gen, e.g.,
      
      ```
      auto result = myVec              // anything consistent with range-v3 or these adapters
          | ranges::view::filter(...)  // zero-or-more range-v3 pipe-elems
          | <adapter-goes-here>        // <==**one of the pipe-adapters provided by this task**
          | folly::gen::blah();        // trailing pipe-elems are folly::gen
      ```
      
      Goal of this task: rename the pipe-adapter folly::gen::detail types so those names are consistent with the names of the corresponding folly::gen::objects.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16138397
      
      fbshipit-source-id: 3e6145f5bb35c8d2bd14a9a3eb645e153743d499
      d5711806
    • Marshall Cline's avatar
      folly::gen to range-v3: relo op| · 11cc0c8f
      Marshall Cline authored
      Summary:
      Relocate "folly::gen to range-v3" pipe-adapters into the corresponding adapter-struct (fix compile-time errors, plus improve clarity about the linkage between the `operator|` and corresponding type).
      
      Context: pipe-adapters ("pipe fittings") that allow a `|`-based pipeline mixing {std-containers and/or range-v3} with folly::gen, e.g.,
      
      ```
      auto result = myVec              // anything consistent with range-v3 or these adapters
          | ranges::view::filter(...)  // zero-or-more range-v3 pipe-elems
          | <adapter-goes-here>        // <==**one of the pipe-adapters provided by this task**
          | folly::gen::blah();        // trailing pipe-elems are folly::gen
      ```
      
      This diff relocates those folly::gen-to-range-v3 adapters.
      
      Reviewed By: yfeldblum, ericniebler
      
      Differential Revision: D16053008
      
      fbshipit-source-id: 078a95990d5277ac0c4e02452cd8fd36bead8306
      11cc0c8f
    • Lucian Grijincu's avatar
      folly: conv: test: expand test to showcase accepted / not-accepted combinations · 525c49f9
      Lucian Grijincu authored
      Reviewed By: yfeldblum
      
      Differential Revision: D16138503
      
      fbshipit-source-id: 49243eeb6eb24417c912b89beb84d15bae73053f
      525c49f9
  12. 05 Jul, 2019 3 commits
    • William McDonald's avatar
      Easily specify a custom Formatter · 880391a0
      William McDonald authored
      Summary:
      StandardLogHandlerFactory has a good amount of logic in it for handling
      options. It would be nice to reuse it when specifying a custom Formatter.
      
      This also exposes the WriterFactory from StreamHandlerFactory, so that a user
      can re-use the code to create the default LogWriter when using a custom
      Formatter.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16074437
      
      fbshipit-source-id: d79947e2fe93b8920b83294438a88c4dd871986b
      880391a0
    • Puneet Kaushik's avatar
      getdeps: Move print "Mapping scratch dir" to stderr · bea3d4b2
      Puneet Kaushik authored
      Summary:
      Mapping scratch dir <from> -> <to> show up in the output of all the show dir commands on Windows, so removing it.
      example: getdeps.py show-inst-dir eden
      
      Reviewed By: wez
      
      Differential Revision: D16092494
      
      fbshipit-source-id: 910288a8d23c1d68c5e70b7b2dbb36ef53a326fc
      bea3d4b2
    • Puneet Kaushik's avatar
      getdeps: Add subclass to copy dependencies for PE executables on Windows · 9e96e531
      Puneet Kaushik authored
      Summary: This adds a subclass to copy the dynamic dependencies on Windows.
      
      Reviewed By: wez
      
      Differential Revision: D16110433
      
      fbshipit-source-id: 14d876947f3ec504382fef0d459367a7119ff6cb
      9e96e531
  13. 04 Jul, 2019 1 commit
  14. 03 Jul, 2019 4 commits
    • Wez Furlong's avatar
      getdeps: dynamic dependency munging · 3baae4dd
      Wez Furlong authored
      Summary:
      This diff adds a `fixup-dyn-deps` subcommand that is intended to
      aid in packaging on multiple platforms.
      
      Its purpose is to copy a set of executable object files from the getdeps
      installation directories and place them into an installation staging
      area that will then be used to create some kind of package (rpm, tarball etc.).
      
      The dynamic dependencies of the executables are determined and also copied
      into the destination area, and the important part: the execute is rewritten
      such that it will load the deps out of an alternate installation prefix.
      
      The implementation of this command draws on similar scripts in use for
      the watchman and eden packaging on windows and macos.  This diff adds
      linux support using the `patchelf` utility.
      
      Reviewed By: pkaush
      
      Differential Revision: D16101902
      
      fbshipit-source-id: 5885125971947139407841e08c0cf9f35fdf5895
      3baae4dd
    • Wez Furlong's avatar
      getdeps: move the guts of _compute_env to a helper in buildopts · 3b937043
      Wez Furlong authored
      Summary: I want to use this logic outside of a builder implementation
      
      Reviewed By: pkaush
      
      Differential Revision: D16101914
      
      fbshipit-source-id: db3c9ac6c84a92ab84a18dddb931953b0a51f127
      3b937043
    • Wez Furlong's avatar
      getdeps: add a manifest for the patchelf utility · 6c84edde
      Wez Furlong authored
      Summary:
      The intent is to use this in a future diff to make packaging a first
      class concept; it can be used similarly to how we munge dynamic deps on darwin
      systems.
      
      Reviewed By: shri-khare
      
      Differential Revision: D16099931
      
      fbshipit-source-id: c66f994b7c07e903fbf2989946b17a0991e12a91
      6c84edde
    • Rosen Penev's avatar
      folly: Don't include wait.h (#1183) · ccc673a6
      Rosen Penev authored
      Summary:
      wait.h is a GNU header. The POSIX one is sys/wait.h. Fixes musl warning:
      
      warning redirecting incorrect #include <wait.h> to <sys/wait.h>
      Pull Request resolved: https://github.com/facebook/folly/pull/1183
      
      Reviewed By: wez
      
      Differential Revision: D16097571
      
      Pulled By: yfeldblum
      
      fbshipit-source-id: 751e4929bc9f00c99c160be9a7dd904e57ad40ce
      ccc673a6
  15. 02 Jul, 2019 4 commits
    • Wez Furlong's avatar
      getdeps: improve debugging when failing to query tests from ctest · 032369f9
      Wez Furlong authored
      Summary:
      We're seeing a failure on macOS in a CI environment but don't have much context:
      
      ```
      Stderr:
      + GETDEPS=opensource/fbcode_builder/getdeps.py
      + opensource/fbcode_builder/getdeps.py test --facebook-internal watchman
      Traceback (most recent call last):
        File "opensource/fbcode_builder/getdeps.py", line 436, in <module>
          sys.exit(main())
        File "opensource/fbcode_builder/getdeps.py", line 422, in main
          return args.func(args)
        File "opensource/fbcode_builder/getdeps.py", line 342, in run
          builder.run_tests(install_dirs, schedule_type=args.schedule_type)
        File "/data/sandcastle/boxes/trunk-hg-fbcode-fbsource/fbcode/opensource/fbcode_builder/getdeps/builder.py", line 372, in run_tests
          buck_test_info = list_tests()
        File "/data/sandcastle/boxes/trunk-hg-fbcode-fbsource/fbcode/opensource/fbcode_builder/getdeps/builder.py", line 352, in list_tests
          data = json.loads(output.decode("utf-8"))
        File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
          return _default_decoder.decode(s)
        File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
          obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        File "/opt/homebrew/Cellar/python27/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
          raise ValueError("No JSON object could be decoded")
      ValueError: No JSON object could be decoded
      ```
      
      Add some more context to that error message so we can learn more.
      
      Reviewed By: pkaush
      
      Differential Revision: D16061528
      
      fbshipit-source-id: 23603a5d18651d20641ef1987b7094e73a9b1dbe
      032369f9
    • Puneet Kaushik's avatar
      Add support to pass vcvarsall path on the command line · 278873e4
      Puneet Kaushik authored
      Summary: On Windows "--vcvars-path" can be passed to point to the toolchain we want to use.
      
      Reviewed By: wez
      
      Differential Revision: D15926044
      
      fbshipit-source-id: 2b0cde793f7c7f8473b78afde8794640bae351f3
      278873e4
    • Luca Niccolini's avatar
      add manifest for mvfst and proxygen · 68cf61fc
      Luca Niccolini authored
      Reviewed By: udippant
      
      Differential Revision: D16075865
      
      fbshipit-source-id: 172aed7ebbfce987c78eea06e588048b0e2a755f
      68cf61fc
    • Miroslav Crnic's avatar
      NotificationQueueBenchmark multi consumer benchmarks · c2cf8102
      Miroslav Crnic authored
      Summary:
      NotificationQueue, although mostly not used as such, is a multi consumer queue and it's missing benchmarks for that part.
      
      There where also a couple of issues with original benchmark which this diff addresses:
      1. Benchamrks used to do N * number of producers number of iterations and didn't report increased iteration count back to benchmark
      2. Benchmark would not run the same case during whole benchmark time as producers where stopped as soon as they produced enough request and consumer would finish without contention
      
      Since these are very tight loops I added a busy loop param which can be varied the same way as batching parameter.
      This param adds some work in a form of a busy loop in both producers and consumer to make benchmarking cases, where producers/consumers are actually doing something except from posting to the queue, easier.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D16071580
      
      fbshipit-source-id: c75f2dd9ae8617be09834cdf153a4b4ae06aaaca
      c2cf8102