rocksdb/third-party/folly/folly
Koby Kahane 3e745053b7 Fix MSVC-related build issues (#7439)
Summary:
This PR addresses some build and functional issues on MSVC targets, as a step towards an eventual goal of having RocksDB build successfully for Windows on ARM64.

Addressed issues include:
- BitsSetToOne and CountTrailingZeroBits do not compile on non-x64 MSVC targets. A fallback implementation of BitsSetToOne when Intel intrinsics are not available is added, based on the C++20 `<bit>` popcount implementation in Microsoft's STL.
- The implementation of FloorLog2 for MSVC targets (including x64) gives incorrect results. The unit test easily detects this, but CircleCI is currently configured to only run a specific set of tests for Windows CMake builds, so this seems to have been unnoticed.
- AsmVolatilePause does not use YieldProcessor on Windows ARM64 targets, even though it is available.
- When CondVar::TimedWait calls Microsoft STL's condition_variable::wait_for, it can potentially trigger a bug (just recently fixed in the upcoming VS 16.8's STL) that deadlocks various tests that wait for a timer to execute, since `Timer::Run` doesn't get a chance to execute before being blocked by the test function acquiring the mutex.
- In c_test, `GetTempDir` assumes a POSIX-style temp path.
- `NormalizePath` did not eliminate consecutive POSIX-style path separators on Windows, resulting in test failures in e.g., wal_manager_test.
- Various other test failures.

In a followup PR I hope to modify CircleCI's config.yml to invoke all RocksDB unit tests in Windows CMake builds with CTest, instead of the current use of `run_ci_db_test.ps1` which requires individual tests to be specified and is missing many of the existing tests.

Notes from peterd: FloorLog2 is not yet used in production code (it's for something in progress). I also added a few more inexpensive platform-dependent tests to Windows CircleCI runs. And included facebook/folly#1461 as requested

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7439

Reviewed By: jay-zhuang

Differential Revision: D24021563

Pulled By: pdillinger

fbshipit-source-id: 0ec2027c0d6a494d8a0fe38d9667fc2f7e29f7e7
2020-10-01 09:23:04 -07:00
..
chrono Fix MSVC-related build issues (#7439) 2020-10-01 09:23:04 -07:00
container Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
detail Fix clang_check and lite failures (#5680) 2019-08-07 20:19:39 -07:00
functional Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
hash Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
lang Misc things for ASSERT_STATUS_CHECKED, also gcc 4.8.5 (#6871) 2020-05-23 06:53:37 -07:00
portability Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
synchronization C++20 compatibility (#6697) 2020-04-20 13:24:25 -07:00
ConstexprMath.h Refactor/consolidate legacy Bloom implementation details (#5784) 2019-09-16 16:17:09 -07:00
CPortability.h Fix TSAN failures in DistributedMutex tests (#5684) 2019-08-14 17:01:31 -07:00
Indestructible.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
Optional.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
Portability.h Update folly/lang/Align.h (backport to C++11) (#6534) 2020-03-16 19:07:31 -07:00
ScopeGuard.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
Traits.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
Unit.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00
Utility.h Port folly/synchronization/DistributedMutex to rocksdb (#5642) 2019-08-07 14:34:19 -07:00