Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
Test plan:

build locally with VS 2019 Build Tools

before, broken

after, works
  • Loading branch information
ahornby committed Dec 3, 2023
1 parent 315bdb6 commit 41126a6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 19 deletions.
49 changes: 32 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
BENCHMARK foreach_benchmark SOURCES ForeachBenchmark.cpp
TEST foreach_test SOURCES ForeachTest.cpp
TEST merge_test SOURCES MergeTest.cpp
BENCHMARK sparse_byte_set_benchmark SOURCES SparseByteSetBenchmark.cpp
BENCHMARK sparse_byte_set_benchmark WINDOWS_DISABLED
SOURCES SparseByteSetBenchmark.cpp
TEST sparse_byte_set_test SOURCES SparseByteSetTest.cpp
TEST util_test SOURCES UtilTest.cpp

Expand Down Expand Up @@ -668,13 +669,14 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST simple_simd_string_utils_test SOURCES SimpleSimdStringUtilsTest.cpp

DIRECTORY detail/test/
TEST split_string_simd_test SOURCES SplitStringSimdTest.cpp
TEST split_string_simd_test WINDOWS_DISABLED
SOURCES SplitStringSimdTest.cpp

DIRECTORY detail/test/
TEST unroll_utils_test SOURCES UnrollUtilsTest.cpp

DIRECTORY detail/base64_detail/tests/
TEST base64_detail_test
TEST base64_detail_test WINDOWS_DISABLED
SOURCES
Base64AgainstScalarTest.cpp
Base64PlatformTest.cpp
Expand All @@ -686,10 +688,11 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
BENCHMARK edf_thread_pool_executor_benchmark
SOURCES EDFThreadPoolExecutorBenchmark.cpp
TEST executor_test SOURCES ExecutorTest.cpp
TEST fiber_io_executor_test WINDOWS_DISABLED
TEST fiber_io_executor_test
SOURCES FiberIOExecutorTest.cpp
TEST global_executor_test SOURCES GlobalExecutorTest.cpp
TEST serial_executor_test SOURCES SerialExecutorTest.cpp
TEST serial_executor_test WINDOWS_DISABLED
SOURCES SerialExecutorTest.cpp
# Fails in ThreadPoolExecutorTest.RequestContext:719 data2 != nullptr
TEST thread_pool_executor_test BROKEN WINDOWS_DISABLED
SOURCES ThreadPoolExecutorTest.cpp
Expand Down Expand Up @@ -741,7 +744,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST config_update_test SOURCES ConfigUpdateTest.cpp
TEST file_handler_factory_test WINDOWS_DISABLED
SOURCES FileHandlerFactoryTest.cpp
TEST glog_formatter_test SOURCES GlogFormatterTest.cpp
TEST glog_formatter_test WINDOWS_DISABLED
SOURCES GlogFormatterTest.cpp
TEST immediate_file_writer_test SOURCES ImmediateFileWriterTest.cpp
TEST log_category_test SOURCES LogCategoryTest.cpp
TEST logger_db_test SOURCES LoggerDBTest.cpp
Expand All @@ -763,13 +767,15 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)

DIRECTORY fibers/test/
# FiberManager swapWithException fails with segfault
BENCHMARK fibers_benchmark SOURCES FibersBenchmark.cpp
BENCHMARK fibers_benchmark WINDOWS_DISABLED
SOURCES FibersBenchmark.cpp
TEST fibers_test BROKEN SOURCES FibersTest.cpp

DIRECTORY functional/test/
TEST apply_tuple_test WINDOWS_DISABLED
SOURCES ApplyTupleTest.cpp
TEST functional_invoke_test SOURCES InvokeTest.cpp
TEST functional_invoke_test WINDOWS_DISABLED
SOURCES InvokeTest.cpp
TEST partial_test SOURCES PartialTest.cpp
TEST functional_protocol_test SOURCES protocol_test.cpp
TEST functional_traits_test SOURCES traits_test.cpp
Expand Down Expand Up @@ -825,7 +831,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST parallel_test SOURCES ParallelTest.cpp

DIRECTORY hash/test/
BENCHMARK checksum_benchmark SOURCES ChecksumBenchmark.cpp
BENCHMARK checksum_benchmark WINDOWS_DISABLED
SOURCES ChecksumBenchmark.cpp
TEST checksum_test SOURCES ChecksumTest.cpp
TEST farm_hash_test SOURCES FarmHashTest.cpp
BENCHMARK hash_benchmark WINDOWS_DISABLED
Expand Down Expand Up @@ -938,7 +945,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST libgen-test SOURCES LibgenTest.cpp
TEST openssl_portability_test SOURCES OpenSSLPortabilityTest.cpp
TEST pthread_test SOURCES PThreadTest.cpp
TEST time-test SOURCES TimeTest.cpp
TEST time-test WINDOWS_DISABLED
SOURCES TimeTest.cpp

DIRECTORY ssl/test/
TEST openssl_hash_test SOURCES OpenSSLHashTest.cpp
Expand Down Expand Up @@ -981,7 +989,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
DIRECTORY synchronization/test/
TEST atomic_struct_test SOURCES AtomicStructTest.cpp
TEST small_locks_test SOURCES SmallLocksTest.cpp
TEST atomic_util_test SOURCES AtomicUtilTest.cpp
TEST atomic_util_test WINDOWS_DISABLED
SOURCES AtomicUtilTest.cpp

DIRECTORY test/
TEST ahm_int_stress_test SOURCES AHMIntStressTest.cpp
Expand All @@ -1000,7 +1009,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
BENCHMARK concurrent_skip_list_benchmark
SOURCES ConcurrentSkipListBenchmark.cpp
TEST concurrent_skip_list_test SOURCES ConcurrentSkipListTest.cpp
TEST constexpr_math_test SOURCES ConstexprMathTest.cpp
TEST constexpr_math_test WINDOWS_DISABLED
SOURCES ConstexprMathTest.cpp
TEST conv_test WINDOWS_DISABLED SOURCES ConvTest.cpp
TEST cpu_id_test SOURCES CpuIdTest.cpp
TEST demangle_test SOURCES DemangleTest.cpp
Expand All @@ -1015,19 +1025,22 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
SOURCES ExceptionWrapperBenchmark.cpp
TEST exception_wrapper_test WINDOWS_DISABLED
SOURCES ExceptionWrapperTest.cpp
TEST expected_test SOURCES ExpectedTest.cpp
TEST expected_test WINDOWS_DISABLED
SOURCES ExpectedTest.cpp
BENCHMARK fbstring_benchmark WINDOWS_DISABLED
SOURCES FBStringBenchmark.cpp
HEADERS FBStringTestBenchmarks.cpp.h
TEST fbstring_test WINDOWS_DISABLED SOURCES FBStringTest.cpp
BENCHMARK fbvector_benchmark
SOURCES FBVectorBenchmark.cpp
HEADERS FBVectorBenchmarks.cpp.h
TEST fbvector_test SOURCES FBVectorTest.cpp
TEST fbvector_test WINDOWS_DISABLED
SOURCES FBVectorTest.cpp
TEST file_test SOURCES FileTest.cpp
# Open-source linux build can't handle running this.
#TEST file_lock_test SOURCES FileLockTest.cpp
TEST file_util_test SOURCES FileUtilTest.cpp
TEST file_util_test WINDOWS_DISABLED
SOURCES FileUtilTest.cpp
BENCHMARK fingerprint_benchmark SOURCES FingerprintBenchmark.cpp
TEST fingerprint_test SOURCES FingerprintTest.cpp
TEST fixed_string_test SOURCES FixedStringTest.cpp
Expand Down Expand Up @@ -1072,11 +1085,13 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST optional_test SOURCES OptionalTest.cpp
TEST packed_sync_ptr_test HANGING
SOURCES PackedSyncPtrTest.cpp
TEST padded_test SOURCES PaddedTest.cpp
TEST padded_test WINDOWS_DISABLED
SOURCES PaddedTest.cpp
#TEST poly_test SOURCES PolyTest.cpp
TEST portability_test SOURCES PortabilityTest.cpp
# Turns out this benchmark uses Linux only API for setting CPU affinity i.e. cpu_set_t.
BENCHMARK producer_consumer_queue_benchmark APPLE_DISABLED SOURCES ProducerConsumerQueueBenchmark.cpp
BENCHMARK producer_consumer_queue_benchmark APPLE_DISABLED WINDOWS_DISABLED
SOURCES ProducerConsumerQueueBenchmark.cpp
TEST producer_consumer_queue_test SLOW
SOURCES ProducerConsumerQueueTest.cpp
BENCHMARK range_find_benchmark SOURCES RangeFindBenchmark.cpp
Expand Down
1 change: 1 addition & 0 deletions folly/container/detail/BitIteratorDetail.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <type_traits>

#include <boost/iterator/iterator_adaptor.hpp>
#include <folly/portability/SysTypes.h>

namespace folly {

Expand Down
4 changes: 2 additions & 2 deletions folly/test/base64_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ namespace {
template <std::size_t N>
constexpr auto base64EncodeArray(const std::array<char, N>& in) {
std::array<char, folly::base64EncodedSize(N) + 1> res{};
folly::base64Encode(in.begin(), in.end(), res.data());
folly::base64Encode(in.data(), in.data() + in.size(), res.data());
res.back() = 0;
return res;
}

template <std::size_t N>
constexpr auto base64URLEncodeArray(const std::array<char, N>& in) {
std::array<char, folly::base64URLEncodedSize(N) + 1> res{};
folly::base64URLEncode(in.begin(), in.end(), res.data());
folly::base64URLEncode(in.data(), in.data() + in.size(), res.data());
res.back() = 0;
return res;
}
Expand Down

0 comments on commit 41126a6

Please sign in to comment.