Skip to content

Commit

Permalink
Merge branch 'facebook:main' into update-mcrouter-manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
mszabo-wikia authored Nov 14, 2024
2 parents c9545b9 + 334481f commit 2e47b65
Show file tree
Hide file tree
Showing 749 changed files with 13,224 additions and 8,531 deletions.
23 changes: 6 additions & 17 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
[cells]
root = .
prelude = prelude
toolchains = shim
shim = shim
none = none
gh_facebook_folly = .
shim_DISABLED = shim

[cell_aliases]
config = prelude
ovr_config = prelude
fbcode = shim
fbsource = shim
fbcode_macros = shim
buck = none
bazel_skylib = shim
root = gh_facebook_folly

[external_cells]
prelude = bundled

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default
[oss]
internal_cell = fbcode
project_dirs = folly
20 changes: 20 additions & 0 deletions .buckconfig.d/common.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[cells]
prelude = prelude
none = none

[cell_aliases]
config = prelude
ovr_config = prelude
bazel_skylib = gh_facebook_buck2_shims_meta
buck = gh_facebook_buck2_shims_meta
fbcode = gh_facebook_buck2_shims_meta
fbcode_macros = gh_facebook_buck2_shims_meta
fbsource = gh_facebook_buck2_shims_meta
shim = gh_facebook_buck2_shims_meta
toolchains = gh_facebook_buck2_shims_meta

[external_cells]
prelude = bundled

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[cells]
gh_facebook_buck2_shims_meta = gh_facebook_buck2_shims_meta

[external_cells]
gh_facebook_buck2_shims_meta = git

[external_cell_gh_facebook_buck2_shims_meta]
git_origin = https://github.com/facebook/buck2-shims-meta.git
commit_hash = dc8551f7918c9e7c54f823864852b6f3f455e906
7 changes: 6 additions & 1 deletion .github/workflows/TagIt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ on:

name: TagIt

permissions:
contents: read

jobs:
build:
permissions:
contents: write # for actions/create-release to create a release
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Archive project
id: archive_project
run: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
- name: Fetch double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
- name: Fetch fast_float
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fast_float
- name: Fetch fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch gflags
Expand Down Expand Up @@ -80,6 +82,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests cmake
- name: Build double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests double-conversion
- name: Build fast_float
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fast_float
- name: Build fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fmt
- name: Build gflags
Expand Down Expand Up @@ -118,11 +122,12 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Copy artifacts
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --strip --src-dir=. folly _artifacts/linux --project-install-prefix folly:/usr/local --final-install-prefix /usr/local
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: folly
path: _artifacts
- name: Test folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Show disk space at end
if: always()
run: df -h
7 changes: 6 additions & 1 deletion .github/workflows/getdeps_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
- name: Fetch double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
- name: Fetch fast_float
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fast_float
- name: Fetch fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch gflags
Expand Down Expand Up @@ -74,6 +76,8 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests cmake
- name: Build double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests double-conversion
- name: Build fast_float
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fast_float
- name: Build fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fmt
- name: Build gflags
Expand Down Expand Up @@ -106,11 +110,12 @@ jobs:
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Copy artifacts
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --src-dir=. folly _artifacts/mac --project-install-prefix folly:/usr/local --final-install-prefix /usr/local
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: folly
path: _artifacts
- name: Test folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. folly --project-install-prefix folly:/usr/local
- name: Show disk space at end
if: always()
run: df -h
6 changes: 5 additions & 1 deletion .github/workflows/getdeps_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: python build/fbcode_builder/getdeps.py fetch --no-tests cmake
- name: Fetch double-conversion
run: python build/fbcode_builder/getdeps.py fetch --no-tests double-conversion
- name: Fetch fast_float
run: python build/fbcode_builder/getdeps.py fetch --no-tests fast_float
- name: Fetch fmt
run: python build/fbcode_builder/getdeps.py fetch --no-tests fmt
- name: Fetch gflags
Expand Down Expand Up @@ -69,6 +71,8 @@ jobs:
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests cmake
- name: Build double-conversion
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests double-conversion
- name: Build fast_float
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests fast_float
- name: Build fmt
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests fmt
- name: Build gflags
Expand Down Expand Up @@ -97,7 +101,7 @@ jobs:
run: python build/fbcode_builder/getdeps.py build --src-dir=. folly
- name: Copy artifacts
run: python build/fbcode_builder/getdeps.py fixup-dyn-deps --src-dir=. folly _artifacts/windows --final-install-prefix /usr/local
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: folly
path: _artifacts
Expand Down
6 changes: 5 additions & 1 deletion BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ buck_genrule(
out = "folly-config.h",
cmd = "cmake . && mv folly/folly-config.h $OUT",
default_target_platform = "prelude//platforms:default",
labels = ["third-party:homebrew:cmake"],
labels = [
"third-party:fedora:cmake",
"third-party:homebrew:cmake",
"third-party:ubuntu:cmake",
],
remote = False,
)
30 changes: 30 additions & 0 deletions CMake/FindFastFloat.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# - Try to find fast_float library
# This will define
# FASTFLOAT_FOUND
# FASTFLOAT_INCLUDE_DIR
#

find_path(FASTFLOAT_INCLUDE_DIR NAMES fast_float/fast_float.h)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
FastFloat DEFAULT_MSG
FASTFLOAT_INCLUDE_DIR
)

mark_as_advanced(FASTFLOAT_INCLUDE_DIR)
1 change: 1 addition & 0 deletions CMake/FollyCompilerMSVC.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ function(apply_folly_compile_options_to_target THETARGET)

/permissive- # Be mean, don't allow bad non-standard stuff (C++/CLI, __declspec, etc. are all left intact).
/std:${MSVC_LANGUAGE_VERSION} # Build in the requested version of C++
/utf-8 # fmt needs unicode support, which requires compiling with /utf-8

PRIVATE
/bigobj # Support objects with > 65k sections. Needed due to templates.
Expand Down
8 changes: 8 additions & 0 deletions CMake/GenPkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ function(gen_pkgconfig_vars)
"<COMPILE_LANG_AND_ID:CUDA,NVIDIA>" "<COMPILE_LANGUAGE:CUDA>"
cflags "${cflags}"
)

endif()
# patch for fmt's generator expression
if (MSVC)
# fmt 11.0.3 and above
string(REPLACE "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>" "/utf-8" cflags "${cflags}")
# fmt 11.0.2 and below
string(REPLACE "$<$<COMPILE_LANGUAGE:CXX>:/utf-8>" "/utf-8" cflags "${cflags}")
endif()

set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE)
Expand Down
18 changes: 15 additions & 3 deletions CMake/folly-deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ find_package(DoubleConversion MODULE REQUIRED)
list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})

find_package(FastFloat MODULE REQUIRED)
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${FASTFLOAT_INCLUDE_DIR})

find_package(Gflags MODULE)
set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND})
if(LIBGFLAGS_FOUND)
Expand Down Expand Up @@ -184,21 +187,30 @@ message(STATUS "Setting FOLLY_HAVE_DWARF: ${FOLLY_HAVE_DWARF}")
check_cxx_source_compiles("
#include <atomic>
int main(int argc, char** argv) {
std::atomic<uint8_t> a1;
std::atomic<uint16_t> a2;
std::atomic<uint32_t> a4;
std::atomic<uint64_t> a8;
struct Test { bool val; };
std::atomic<Test> s;
return static_cast<int>(s.is_lock_free());
return a1++ + a2++ + a4++ + a8++ + unsigned(s.is_lock_free());
}"
FOLLY_CPP_ATOMIC_BUILTIN
)
if(NOT FOLLY_CPP_ATOMIC_BUILTIN)
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
list(APPEND FOLLY_LINK_LIBRARIES atomic)
set(ATOMIC_LIBRARY "atomic")
check_cxx_source_compiles("
#include <atomic>
int main(int argc, char** argv) {
std::atomic<uint8_t> a1;
std::atomic<uint16_t> a2;
std::atomic<uint32_t> a4;
std::atomic<uint64_t> a8;
struct Test { bool val; };
std::atomic<Test> s2;
return static_cast<int>(s2.is_lock_free());
std::atomic<Test> s;
return a1++ + a2++ + a4++ + a8++ + unsigned(s.is_lock_free());
}"
FOLLY_CPP_ATOMIC_WITH_LIBATOMIC
)
Expand Down
Loading

0 comments on commit 2e47b65

Please sign in to comment.