1. 04 Sep, 2018 3 commits
    • Yedidya Feldblum's avatar
      Apply clang-format to folly/portability/ · f21a7042
      Yedidya Feldblum authored
      Summary: [Folly] Apply `clang-format` to `folly/portability/`.
      
      Reviewed By: igorsugak
      
      Differential Revision: D9625664
      
      fbshipit-source-id: fa63f3e3a719c22ea88cd14172d34e360353145f
      f21a7042
    • Yedidya Feldblum's avatar
      Do conditional compilation for MPMCPipeline using C++ · 61276a38
      Yedidya Feldblum authored
      Summary: [Folly] Do conditional compilation for `MPMCPipeline` using C++ via selecting a base class v.s. using the preprocessor.
      
      Reviewed By: Orvid
      
      Differential Revision: D9625568
      
      fbshipit-source-id: 2e0d7195bb7fa4f44cf8b99ed3d7564b18393b73
      61276a38
    • Dan Melnic's avatar
      Remove stop() comment since it's not accurate · 3acfb909
      Dan Melnic authored
      Summary: Remove stop() comment since it's not accurate
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9600621
      
      fbshipit-source-id: 599551efc775a622d5a5b4a45ead1f3dcbf10abb
      3acfb909
  2. 03 Sep, 2018 6 commits
    • Orvid King's avatar
      Fix the autotools build · 130943d8
      Orvid King authored
      Summary:
      It was missing things.
      
      Closes https://github.com/facebook/folly/issues/925
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9631683
      
      fbshipit-source-id: 3ea572ecf5b4d640b6cd2f376cd4c6916e43ed1d
      130943d8
    • Yedidya Feldblum's avatar
      Make ThreadPoolExecutorTest.DynamicThreadsTest not timing-sensitive · 31ac3787
      Yedidya Feldblum authored
      Summary:
      [Folly] Make `ThreadPoolExecutorTest.DynamicThreadsTest` not timing-sensitive.
      
      The timing-sensitive version of the test sometimes fails under load, and is observed in some internal `folly-oss` jobs.
      
      Rewrite the test to avoid using long sleeps to try to approximate synchronization. Use a barrier and spin-yield loop instead.
      
      Differential Revision: D9628339
      
      fbshipit-source-id: fef752ad15dbff853cfa7cbaac1081580007754c
      31ac3787
    • Yedidya Feldblum's avatar
      Remove some [[noreturn]] functions · 27cfbc10
      Yedidya Feldblum authored
      Summary: [Folly] Remove some `[[noreturn]]` functions - many of them can be replaced with `throw_exception`.
      
      Reviewed By: Orvid
      
      Differential Revision: D9624966
      
      fbshipit-source-id: e5e472c660677112edf99e30e36d78c1b1718b52
      27cfbc10
    • Yedidya Feldblum's avatar
      Let StaticMeta have a deleted dtor · 685a2941
      Yedidya Feldblum authored
      Summary: [Folly] Let `StaticMeta` have a deleted dtor - a compile-time enforcement that the dtor will not be invoked, to replace the existing runtime non-enforcement.
      
      Reviewed By: elsteveogrande
      
      Differential Revision: D9624686
      
      fbshipit-source-id: 9185defbea343e4123e66c8d0d38f20c561aebea
      685a2941
    • Yedidya Feldblum's avatar
      Check the behavior of ThreadPoolExecutor destruction · 8f91fe9e
      Yedidya Feldblum authored
      Summary: [Folly] Check the behavior of ThreadPoolExecutor destruction regarding execution or dropping of outstanding tasks.
      
      Differential Revision: D9627237
      
      fbshipit-source-id: 4bb3c1480cc94ceeb3e550f52c298e3d2dcf71c5
      8f91fe9e
    • Aaryaman Sagar's avatar
      Extend futex to work with non-standard widths · 146b07b5
      Aaryaman Sagar authored
      Summary:
      Contains a subset of the functions described in p1135r0, with some additions
      for timed waiting that essentially extends the futex interface to work with
      non-standard futex widths
      
      In the regular 32 bit case, we fall back to the existing folly futex()
      implementation.  In all other cases, we use folly::ParkingLot to mimic futex()
      
      Reviewed By: djwatson
      
      Differential Revision: D9381922
      
      fbshipit-source-id: faf84e105e1d44a6dd6034e25440fcb3eb664846
      146b07b5
  3. 02 Sep, 2018 1 commit
    • Yedidya Feldblum's avatar
      Write /* static */ if as if /* constexpr */ · fafeb979
      Yedidya Feldblum authored
      Summary: [Folly] Write `/* static */ if` as `if /* constexpr */`. Once the time comes to jump to C++17, all that remains is to remove the comments.
      
      Reviewed By: aary
      
      Differential Revision: D9627826
      
      fbshipit-source-id: 56078e727a3a4420851f1c441783b80da55a8e6c
      fafeb979
  4. 01 Sep, 2018 4 commits
  5. 31 Aug, 2018 6 commits
    • Orvid King's avatar
      Disable a few tests on Windows · c1964a1f
      Orvid King authored
      Summary: Because.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9568442
      
      fbshipit-source-id: 0a1ecf1904499afa9069d345d70279a527e31b1a
      c1964a1f
    • Xiao Shi's avatar
      temporarily disable for iOS · 37b03b7b
      Xiao Shi authored
      Summary: As a mitigation for an `folly::dynamic` iteration order dependency on iOS.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9614129
      
      fbshipit-source-id: 09a822a32327fd5389e8e4d169ab3af4f428426c
      37b03b7b
    • Wez Furlong's avatar
      factor out debian_deps() · 413310bc
      Wez Furlong authored
      Summary:
      I want to access the list of deps without the install
      instructions attached later in this stack of diffs in `shell_builder.py`.
      
      Refs: https://github.com/facebook/watchman/pull/639
      
      Reviewed By: snarkmaster
      
      Differential Revision: D9552419
      
      fbshipit-source-id: 333cfa0c33bc1aa623de7ac3546a8f1785869a4f
      413310bc
    • Wez Furlong's avatar
      fix a python 2.7 vs 3 compat issue with exec · 5a9eb01a
      Wez Furlong authored
      Summary:
      This is a bit of a tricky issue; here's the bug in python 2.7
      that prevents using the function-like syntax:
      https://bugs.python.org/issue21591
      
      The nature of this bug is that scoped exec only works with nested functions
      when using the `exec` statement in 2.7.   That is a syntax error in python 3,
      which only allows using the `exec` function.
      
      To make the function syntax work in 2.7 we therefore need to avoid using
      lambdas or nested functions and have to resort to using a global variable
      to act as the "closure".
      
      Refs: https://github.com/facebook/watchman/pull/639
      
      Reviewed By: snarkmaster
      
      Differential Revision: D9552413
      
      fbshipit-source-id: a2cb9d325e18fb6fb06b9e284a84f0a0c80cfe7e
      5a9eb01a
    • Marshall Cline's avatar
      reenable (but deprecate) lvalue-qual Future::onError() · de883709
      Marshall Cline authored
      Summary: Per T33416893, D9441402 caused a regression in FB4A. Goal: reenable lvalue-qual Future::onError(). Make it deprecated to minimize the chances of anyone creating new callsites.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9597490
      
      fbshipit-source-id: 9c6a34c37c8f576e2497164bd440cdbc3565920d
      de883709
    • Yedidya Feldblum's avatar
      Use static_cast v.s. C cast in folly/Expected.h · 4d0ee00c
      Yedidya Feldblum authored
      Summary:
      [Folly] Use `static_cast` v.s. C cast in `folly/Expected.h`.
      
      And don't have empty namespaces - at least have a comment.
      
      Reviewed By: igorsugak
      
      Differential Revision: D9596449
      
      fbshipit-source-id: 6b5b712d7d46eba4a83b7f62c0628a8bcda1f722
      4d0ee00c
  6. 30 Aug, 2018 17 commits
    • Yedidya Feldblum's avatar
      Formatting of FOR_EACH etc uses · ba0cf877
      Yedidya Feldblum authored
      Summary: [Folly] Formatting of `FOR_EACH` etc uses.
      
      Reviewed By: Orvid
      
      Differential Revision: D9595505
      
      fbshipit-source-id: bdb506f8904de2577c42ada6755a2af4f3efb095
      ba0cf877
    • Teng Qin's avatar
      Avoid crash when opening broken file · c07f4bb4
      Teng Qin authored
      Summary:
      In `folly::symbolizer::ElfFile`, we `mmap` the file and access the file content via `mmap`-ed pointer directly. This is nice and efficient, but causes the whole program crashes on `SIGBUS` is the underlying frile is broken.
      
      This Diff changes the first read of the file, for ELF magic number, to use `read` syscall and check return result, instead of accessing the `mmap`-ed pointer directly. This way APIs like `ElfFile::openNoThrow` would return error instead of crashing if the underlying file is broken.
      
      It still doesn't solve the problem if the file becomes broken between we read the ELF magic number and we read file content with the `mmap`-ed file pointer later. But this is the best effort to check for the case with minimal performance cost.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9474328
      
      fbshipit-source-id: 969e0323fcb4011e6a080d914452c9215d2fd13c
      c07f4bb4
    • Xiao Shi's avatar
      disable on android, fix getAllocatedMemorySize test to account for... · c76d6b8c
      Xiao Shi authored
      disable on android, fix getAllocatedMemorySize test to account for implementation-defined bucket_count for default containers
      
      Summary:
      This serves as a mitigation until we look further into the android crashes we
      discovered in android instrumentation tests.
      
      The bucket_count of the default constructed `unordered_map` is
      implementation-defined. This diff takes that into account in the
      `getAllocatedMemorySize` test.
      
      `unordered_map|set` impl in Android NDK does not match the assumptions made in
      `visitAllocationClasses`. Temporarily disable the tests with that method.
      
      Reviewed By: mzlee
      
      Differential Revision: D9578626
      
      fbshipit-source-id: 355940b026f00f783bf65c2f1e10725d5aa920d3
      c76d6b8c
    • Wez Furlong's avatar
      fix apparent typo in fbcode_builder.py · 2d7605b0
      Wez Furlong authored
      Summary:
      I noticed this while testing some changes; the comment
      doesn't seem to match up to the `raise` statement, and attempting
      to throw a list fails in python.
      
      Reviewed By: strager
      
      Differential Revision: D9566018
      
      fbshipit-source-id: 563e43dfd30867993cc2a0f816db3b835a52e6df
      2d7605b0
    • Wez Furlong's avatar
      don't fail if /etc/issue is not present · 30eba07a
      Wez Furlong authored
      Summary:
      When running on macOS there is no /etc/issue.  When running
      with `set -e` enabled, we don't want this to break the build.
      
      Neither of these is possible today, but will be later in this diff stack.
      
      While I'm in here, also print out the cmake version.
      
      Refs: https://github.com/facebook/watchman/pull/639
      
      Reviewed By: snarkmaster
      
      Differential Revision: D9552416
      
      fbshipit-source-id: 432b5b70678908de9f79787d37c3615a7f8649d3
      30eba07a
    • Orvid King's avatar
      Remove support for generating folly-config from autoconf for builds with buck · 2e6381bb
      Orvid King authored
      Summary: Support for building Folly with autoconf is going away; this isn't going to keep working, so remove it.
      
      Reviewed By: yfeldblum, philipjameson
      
      Differential Revision: D9569019
      
      fbshipit-source-id: 1fe99453c741ff9fc8632bbcfdd69df6b1f86d01
      2e6381bb
    • Orvid King's avatar
      Implement the basic operations on sem_t · 4d119477
      Orvid King authored
      Summary: This means that Windows builds no longer require pthreads in order to run tests. (previously we were relying on the pthreads implementation we were using to provide semaphore.h for us)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9568125
      
      fbshipit-source-id: 712f542c9a29627f72b41e1def2b79d591a33317
      4d119477
    • Orvid King's avatar
      Add support for getpriority and setpriority to the SysResource portability header · c3e09627
      Orvid King authored
      Summary: It's not a perfect mapping, but it's good enough.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9569405
      
      fbshipit-source-id: 7559fb94f8a57717b5a594be0c05a99ac88c6c6e
      c3e09627
    • Orvid King's avatar
      Don't attempt to change the memory limit in the large Retrying test on Windows · a1a6981f
      Orvid King authored
      Summary: The `(get|set)rlimit` stub implementations don't support setting memory limits, and I have no intention of implementing it, so disable it, as there are no meaningful memory limits on Windows to begin with.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9569424
      
      fbshipit-source-id: 738d73f90eb33957ca4a80cb9b3c568034ef141e
      a1a6981f
    • Pádraig Brady's avatar
      folly/FixedString: leverage c++14 to support GCC 8 · 062f62a6
      Pádraig Brady authored
      Summary:
      gcc8 fails compilation with:
          error: taking address of temporary array
            return {+A{Cs..., Char(0)}, sizeof...(Cs)};
      So leverage c++14 to base manipulations on a local array.
      
      Reviewed By: yfeldblum, ericniebler, Orvid
      
      Differential Revision: D9310662
      
      fbshipit-source-id: 0ba375ac0a4cca913e437290bc277c0c6bb8fdc8
      062f62a6
    • Orvid King's avatar
      Escape the escape sequences in CustomLogFormatter · 35312df9
      Orvid King authored
      Summary: These need to be escaped (they also don't work on Windows)
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9566079
      
      fbshipit-source-id: a202673c7cea62f3534ceff9cb81ee84aca65049
      35312df9
    • Orvid King's avatar
      Fix building F14SetTest on platforms where std::array iterators are not just raw char*'s · 8a710957
      Orvid King authored
      Summary: Platforms such as MSVC.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9569093
      
      fbshipit-source-id: 3d836d5f660b610eed47a6692bc0ce33396fbfa5
      8a710957
    • Subodh Iyengar's avatar
      Add mock method for security protocol · ad2a21fb
      Subodh Iyengar authored
      Summary: as title
      
      Reviewed By: Orvid
      
      Differential Revision: D9568603
      
      fbshipit-source-id: b5ce1ba8163af87f3ec6369407e3f8546e80afb1
      ad2a21fb
    • Amir Livneh's avatar
      Temporarily disable F14NodeMap in folly::dynamic for mobile builds · a0011171
      Amir Livneh authored
      Reviewed By: JunqiWang
      
      Differential Revision: D9564136
      
      fbshipit-source-id: 3eeb42e1629fdadfee758c3b9c92e167e126c946
      a0011171
    • Orvid King's avatar
      Define O_CLOEXEC as _O_NOINHERIT · 341c36d7
      Orvid King authored
      Summary: This should work, probably.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9566267
      
      fbshipit-source-id: 052295702a46edd85471c75ca82937dc3a508577
      341c36d7
    • Orvid King's avatar
      Support __builtin_popcountl on Windows · 7350a4b1
      Orvid King authored
      Summary: Because Bits.h feels the need to exercise all variants of popcount.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9565298
      
      fbshipit-source-id: 307b3e4a70216c76d63104853e91e36a340ff1ab
      7350a4b1
    • Orvid King's avatar
      Make initializer list construction explicit · f04c4928
      Orvid King authored
      Summary: MSVC wasn't treating this as an initializer list construction, so make it do so.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9565470
      
      fbshipit-source-id: 15465b5c87a427920a7cad3f5204bb661ba230c2
      f04c4928
  7. 29 Aug, 2018 3 commits
    • Orvid King's avatar
      Explicitly include <atomic> · 98d33585
      Orvid King authored
      Summary: Because, rather impressively, it wasn't being included transitively by anything here when compiling on Windows.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9565417
      
      fbshipit-source-id: b83fa0b121d83cbeb7ff0bd79dec506b6549385e
      98d33585
    • Orvid King's avatar
      Include the SysTime portability header for timeval · 6f2907d7
      Orvid King authored
      Summary: MSVC defines timeval in a weird place, so include the portability header.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9564726
      
      fbshipit-source-id: f9e43225a889bfb0395178ef809aaa81fb9ccc36
      6f2907d7
    • Orvid King's avatar
      Disable a couple more warnings · 39f37772
      Orvid King authored
      Summary: One of these warnings is informational, the other we will continue to blissfully ignore until either includes become cheap, or the eventual heat death of the universe, whichever comes first.
      
      Reviewed By: yfeldblum
      
      Differential Revision: D9565514
      
      fbshipit-source-id: e5a8d8c868c122d4b06635b061540c8f329ec93d
      39f37772