Skip to content

Commit

Permalink
Merge tag 'v2023.10.30.00'
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaoew1991 committed Nov 2, 2023
2 parents baeebe5 + 82ce15a commit 217613f
Show file tree
Hide file tree
Showing 603 changed files with 29,557 additions and 7,290 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,20 @@ on:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Show disk space at start
run: df -h
- name: Free up disk space
run: sudo rm -rf /usr/local/lib/android
- name: Show disk space after freeing up
run: df -h
- name: Fetch boost
run: python3 build/fbcode_builder/getdeps.py fetch --no-tests boost
- name: Fetch ninja
Expand Down Expand Up @@ -50,39 +59,39 @@ jobs:
- name: Fetch xz
run: python3 build/fbcode_builder/getdeps.py fetch --no-tests xz
- name: Build boost
run: python3 build/fbcode_builder/getdeps.py build --no-tests boost
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests boost
- name: Build ninja
run: python3 build/fbcode_builder/getdeps.py build --no-tests ninja
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests ninja
- name: Build cmake
run: python3 build/fbcode_builder/getdeps.py build --no-tests cmake
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests cmake
- name: Build double-conversion
run: python3 build/fbcode_builder/getdeps.py build --no-tests double-conversion
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests double-conversion
- name: Build fmt
run: python3 build/fbcode_builder/getdeps.py build --no-tests fmt
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests fmt
- name: Build gflags
run: python3 build/fbcode_builder/getdeps.py build --no-tests gflags
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests gflags
- name: Build glog
run: python3 build/fbcode_builder/getdeps.py build --no-tests glog
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests glog
- name: Build googletest
run: python3 build/fbcode_builder/getdeps.py build --no-tests googletest
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests googletest
- name: Build libevent
run: python3 build/fbcode_builder/getdeps.py build --no-tests libevent
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests libevent
- name: Build lz4
run: python3 build/fbcode_builder/getdeps.py build --no-tests lz4
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests lz4
- name: Build snappy
run: python3 build/fbcode_builder/getdeps.py build --no-tests snappy
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests snappy
- name: Build zstd
run: python3 build/fbcode_builder/getdeps.py build --no-tests zstd
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests zstd
- name: Build autoconf
run: python3 build/fbcode_builder/getdeps.py build --no-tests autoconf
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests autoconf
- name: Build automake
run: python3 build/fbcode_builder/getdeps.py build --no-tests automake
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests automake
- name: Build libtool
run: python3 build/fbcode_builder/getdeps.py build --no-tests libtool
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests libtool
- name: Build libsodium
run: python3 build/fbcode_builder/getdeps.py build --no-tests libsodium
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests libsodium
- name: Build xz
run: python3 build/fbcode_builder/getdeps.py build --no-tests xz
run: python3 build/fbcode_builder/getdeps.py build --free-up-disk --no-tests xz
- name: Build folly
run: python3 build/fbcode_builder/getdeps.py build --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Copy artifacts
Expand All @@ -93,3 +102,5 @@ jobs:
path: _artifacts
- name: Test folly
run: python3 build/fbcode_builder/getdeps.py test --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Show disk space at end
run: df -h
7 changes: 3 additions & 4 deletions CMake/FollyCompilerUnix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@ set(
)
mark_as_advanced(CXX_STD)

set(CMAKE_CXX_FLAGS_COMMON "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_COMMON "-g -Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_CXX_FLAGS_COMMON}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX_FLAGS_COMMON} -O3")

# Note that CMAKE_REQUIRED_FLAGS must be a string, not a list
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=${CXX_STD}")
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
function(apply_folly_compile_options_to_target THETARGET)
target_compile_definitions(${THETARGET}
Expand All @@ -44,6 +42,7 @@ function(apply_folly_compile_options_to_target THETARGET)
target_compile_options(${THETARGET}
PRIVATE
-std=${CXX_STD}
-g
-finput-charset=UTF-8
-fsigned-char
-Wall
Expand Down
3 changes: 2 additions & 1 deletion CMake/folly-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#
# It also defines the following variables, although using these directly is not
# necessary if you use the Folly::folly target instead.
# FOLLY_INCLUDE_DIRS
# FOLLY_INCLUDE_DIR
# FOLLY_LIBRARIES

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

set_and_check(FOLLY_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(FOLLY_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(FOLLY_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@")

Expand Down
50 changes: 36 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,16 @@ set(FOLLY_SUPPORT_SHARED_LIBRARY "${BUILD_SHARED_LIBS}")
include(FBBuildOptions)
fb_activate_static_library_option()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
# CMAKE_LIBRARY_ARCHITECTURE is not always set, so we have to assume
# arch might be x86_64
message(WARNING "CMAKE_LIBRARY_ARCHITECTURE not set, assuming x86_64")
set(IS_X86_64_ARCH OFF)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "setting C++ standard to C++${CMAKE_CXX_STANDARD}")
endif()

if(NOT DEFINED IS_X86_64_ARCH AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64|AMD64")
set(IS_X86_64_ARCH TRUE)
else()
string(FIND "${CMAKE_LIBRARY_ARCHITECTURE}" "x86_64" IS_X86_64_ARCH)
if(IS_X86_64_ARCH STREQUAL "-1")
set(IS_X86_64_ARCH OFF)
else()
set(IS_X86_64_ARCH ON)
endif()
set(IS_X86_64_ARCH FALSE)
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
Expand Down Expand Up @@ -204,11 +199,13 @@ list(REMOVE_ITEM files
${FOLLY_DIR}/python/GILAwareManualExecutor.cpp
${FOLLY_DIR}/python/iobuf.cpp
${FOLLY_DIR}/python/iobuf_ext.cpp
${FOLLY_DIR}/python/ProactorExecutor.cpp
)
list(REMOVE_ITEM hfiles
${FOLLY_DIR}/python/fibers.h
${FOLLY_DIR}/python/GILAwareManualExecutor.h
${FOLLY_DIR}/python/iobuf_ext.h
${FOLLY_DIR}/python/ProactorExecutor.h
)

# Explicitly include utility library code from inside
Expand All @@ -225,6 +222,8 @@ list(APPEND hfiles
${FOLLY_DIR}/io/async/test/AsyncSocketTest.h
${FOLLY_DIR}/io/async/test/AsyncSocketTest2.h
${FOLLY_DIR}/io/async/test/BlockingSocket.h
${FOLLY_DIR}/io/async/test/CallbackStateEnum.h
${FOLLY_DIR}/io/async/test/ConnCallback.h
${FOLLY_DIR}/io/async/test/MockAsyncSocket.h
${FOLLY_DIR}/io/async/test/MockAsyncServerSocket.h
${FOLLY_DIR}/io/async/test/MockAsyncSSLSocket.h
Expand All @@ -233,6 +232,7 @@ list(APPEND hfiles
${FOLLY_DIR}/io/async/test/MockTimeoutManager.h
${FOLLY_DIR}/io/async/test/ScopedBoundPort.h
${FOLLY_DIR}/io/async/test/SocketPair.h
${FOLLY_DIR}/io/async/test/TFOUtil.h
${FOLLY_DIR}/io/async/test/TestSSLServer.h
${FOLLY_DIR}/io/async/test/TimeUtil.h
${FOLLY_DIR}/io/async/test/UndelayedDestruction.h
Expand Down Expand Up @@ -566,6 +566,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
${FOLLY_DIR}/futures/test/TestExecutor.cpp
${FOLLY_DIR}/futures/test/TestExecutor.h
${FOLLY_DIR}/io/async/test/BlockingSocket.h
${FOLLY_DIR}/io/async/test/CallbackStateEnum.h
${FOLLY_DIR}/io/async/test/ConnCallback.h
${FOLLY_DIR}/io/async/test/MockAsyncServerSocket.h
${FOLLY_DIR}/io/async/test/MockAsyncSocket.h
${FOLLY_DIR}/io/async/test/MockAsyncSSLSocket.h
Expand All @@ -578,6 +580,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
${FOLLY_DIR}/io/async/test/SocketPair.h
${FOLLY_DIR}/io/async/test/SSLUtil.cpp
${FOLLY_DIR}/io/async/test/SSLUtil.h
${FOLLY_DIR}/io/async/test/TFOUtil.cpp
${FOLLY_DIR}/io/async/test/TFOUtil.h
${FOLLY_DIR}/io/async/test/TestSSLServer.cpp
${FOLLY_DIR}/io/async/test/TestSSLServer.h
${FOLLY_DIR}/io/async/test/TimeUtil.cpp
Expand Down Expand Up @@ -657,6 +661,18 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
DIRECTORY detail/test/
TEST static_singleton_manager_test SOURCES StaticSingletonManagerTest.cpp

DIRECTORY detail/test/
TEST simd_for_each_test SOURCES SimdForEachTest.cpp

DIRECTORY detail/test/
TEST simple_simd_string_utils_test SOURCES SimpleSimdStringUtilsTest.cpp

DIRECTORY detail/test/
TEST split_string_simd_test SOURCES SplitStringSimdTest.cpp

DIRECTORY detail/test/
TEST unroll_utils_test SOURCES UnrollUtilsTest.cpp

DIRECTORY detail/base64_detail/tests/
TEST base64_detail_test
SOURCES
Expand Down Expand Up @@ -753,7 +769,10 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
DIRECTORY functional/test/
TEST apply_tuple_test WINDOWS_DISABLED
SOURCES ApplyTupleTest.cpp
TEST functional_invoke_test 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

DIRECTORY futures/test/
TEST barrier_test SOURCES BarrierTest.cpp
Expand Down Expand Up @@ -823,6 +842,8 @@ if (BUILD_TESTS OR BUILD_BENCHMARKS)
TEST record_io_test WINDOWS_DISABLED SOURCES RecordIOTest.cpp
TEST ShutdownSocketSetTest HANGING
SOURCES ShutdownSocketSetTest.cpp
TEST SocketOptionValueTest HANGING
SOURCES SocketOptionValueTest.cpp

DIRECTORY io/async/test/
# A number of tests in the async_test binary are unfortunately flaky.
Expand Down Expand Up @@ -979,6 +1000,7 @@ 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 conv_test WINDOWS_DISABLED SOURCES ConvTest.cpp
TEST cpu_id_test SOURCES CpuIdTest.cpp
TEST demangle_test SOURCES DemangleTest.cpp
Expand Down
4 changes: 2 additions & 2 deletions build/fbcode_builder/CMake/FBPythonBinary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if(NOT TARGET Python3::Interpreter)
# We find with QUIET here, since otherwise this generates some noisy warnings
# on versions of CMake before 3.12
if (WIN32)
# On Windows we need both the Intepreter as well as the Development
# On Windows we need both the Interpreter as well as the Development
# libraries.
find_package(Python3 COMPONENTS Interpreter Development QUIET)
else()
Expand Down Expand Up @@ -487,7 +487,7 @@ function(add_fb_python_library LIB_NAME)
# won't complain if one of the dependencies doesn't exist (since it is
# intended to allow passing in file names for plain library files rather
# than just targets).
# - It ensures that sources for our depencencies are built before any
# - It ensures that sources for our dependencies are built before any
# executable that depends on us. Note that we depend on "${dep}.py_lib"
# rather than "${dep}.py_sources_built" for this purpose because the
# ".py_sources_built" target won't be available for imported targets.
Expand Down
3 changes: 3 additions & 0 deletions build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
--legacy-strict
--gen "mstch_cpp2:${GEN_ARG_STR}"
"${thrift_include_options}"
-I "${FBTHRIFT_INCLUDE_DIR}"
-o "${output_dir}"
"${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
WORKING_DIRECTORY
Expand Down Expand Up @@ -150,6 +151,8 @@ function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
${ARG_DEPENDS}
FBThrift::thriftcpp2
Folly::folly
mvfst::mvfst_server_async_tran
mvfst::mvfst_server
)

# Add ${generated_headers} to the PUBLIC_HEADER property for ${LIB_NAME}
Expand Down
1 change: 1 addition & 0 deletions build/fbcode_builder/CMake/FindGflags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if (gflags_FOUND)
# If gflags_INCLUDE_DIR does not actually exist, simply default it to
# /usr/include on these systems.
set(LIBGFLAGS_INCLUDE_DIR "/usr/include")
set(GFLAGS_INCLUDE_DIR "/usr/include")
endif()
set(LIBGFLAGS_FOUND ${gflags_FOUND})
# cmake module compat
Expand Down
2 changes: 1 addition & 1 deletion build/fbcode_builder/CMake/fb_py_test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def stopTest(self, test):

super(BuckTestResult, self).stopTest(test)

# If a failure occured during module/class setup, then this "test" may
# If a failure occurred during module/class setup, then this "test" may
# actually be a `_ErrorHolder`, which doesn't contain explicit info
# about the upcoming test. Since we really only care about the test
# name field (i.e. `_testMethodName`), we use that to detect an actual
Expand Down
Loading

0 comments on commit 217613f

Please sign in to comment.