Skip to content

Commit 2e47b65

Browse files
authored
Merge branch 'facebook:main' into update-mcrouter-manifest
2 parents c9545b9 + 334481f commit 2e47b65

File tree

749 files changed

+13224
-8531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

749 files changed

+13224
-8531
lines changed

.buckconfig

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
[cells]
2-
root = .
3-
prelude = prelude
4-
toolchains = shim
5-
shim = shim
6-
none = none
2+
gh_facebook_folly = .
3+
shim_DISABLED = shim
74

85
[cell_aliases]
9-
config = prelude
10-
ovr_config = prelude
11-
fbcode = shim
12-
fbsource = shim
13-
fbcode_macros = shim
14-
buck = none
15-
bazel_skylib = shim
6+
root = gh_facebook_folly
167

17-
[external_cells]
18-
prelude = bundled
19-
20-
[parser]
21-
target_platform_detector_spec = target:root//...->prelude//platforms:default
8+
[oss]
9+
internal_cell = fbcode
10+
project_dirs = folly

.buckconfig.d/common.buckconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[cells]
2+
prelude = prelude
3+
none = none
4+
5+
[cell_aliases]
6+
config = prelude
7+
ovr_config = prelude
8+
bazel_skylib = gh_facebook_buck2_shims_meta
9+
buck = gh_facebook_buck2_shims_meta
10+
fbcode = gh_facebook_buck2_shims_meta
11+
fbcode_macros = gh_facebook_buck2_shims_meta
12+
fbsource = gh_facebook_buck2_shims_meta
13+
shim = gh_facebook_buck2_shims_meta
14+
toolchains = gh_facebook_buck2_shims_meta
15+
16+
[external_cells]
17+
prelude = bundled
18+
19+
[parser]
20+
target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[cells]
2+
gh_facebook_buck2_shims_meta = gh_facebook_buck2_shims_meta
3+
4+
[external_cells]
5+
gh_facebook_buck2_shims_meta = git
6+
7+
[external_cell_gh_facebook_buck2_shims_meta]
8+
git_origin = https://github.com/facebook/buck2-shims-meta.git
9+
commit_hash = dc8551f7918c9e7c54f823864852b6f3f455e906

.github/workflows/TagIt.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ on:
66

77
name: TagIt
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
14+
permissions:
15+
contents: write # for actions/create-release to create a release
1116
name: Release
1217
runs-on: ubuntu-latest
1318
steps:
1419
- name: Checkout code
15-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
1621
- name: Archive project
1722
id: archive_project
1823
run: |

.github/workflows/getdeps_linux.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
3939
- name: Fetch double-conversion
4040
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
41+
- name: Fetch fast_float
42+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fast_float
4143
- name: Fetch fmt
4244
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
4345
- name: Fetch gflags
@@ -80,6 +82,8 @@ jobs:
8082
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests cmake
8183
- name: Build double-conversion
8284
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests double-conversion
85+
- name: Build fast_float
86+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fast_float
8387
- name: Build fmt
8488
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fmt
8589
- name: Build gflags
@@ -118,11 +122,12 @@ jobs:
118122
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. folly --project-install-prefix folly:/usr/local
119123
- name: Copy artifacts
120124
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
121-
- uses: actions/upload-artifact@v2
125+
- uses: actions/upload-artifact@v4
122126
with:
123127
name: folly
124128
path: _artifacts
125129
- name: Test folly
126130
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. folly --project-install-prefix folly:/usr/local
127131
- name: Show disk space at end
132+
if: always()
128133
run: df -h

.github/workflows/getdeps_mac.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
3737
- name: Fetch double-conversion
3838
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
39+
- name: Fetch fast_float
40+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fast_float
3941
- name: Fetch fmt
4042
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
4143
- name: Fetch gflags
@@ -74,6 +76,8 @@ jobs:
7476
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests cmake
7577
- name: Build double-conversion
7678
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests double-conversion
79+
- name: Build fast_float
80+
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fast_float
7781
- name: Build fmt
7882
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --free-up-disk --no-tests fmt
7983
- name: Build gflags
@@ -106,11 +110,12 @@ jobs:
106110
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. folly --project-install-prefix folly:/usr/local
107111
- name: Copy artifacts
108112
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
109-
- uses: actions/upload-artifact@v2
113+
- uses: actions/upload-artifact@v4
110114
with:
111115
name: folly
112116
path: _artifacts
113117
- name: Test folly
114118
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. folly --project-install-prefix folly:/usr/local
115119
- name: Show disk space at end
120+
if: always()
116121
run: df -h

.github/workflows/getdeps_windows.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ jobs:
3535
run: python build/fbcode_builder/getdeps.py fetch --no-tests cmake
3636
- name: Fetch double-conversion
3737
run: python build/fbcode_builder/getdeps.py fetch --no-tests double-conversion
38+
- name: Fetch fast_float
39+
run: python build/fbcode_builder/getdeps.py fetch --no-tests fast_float
3840
- name: Fetch fmt
3941
run: python build/fbcode_builder/getdeps.py fetch --no-tests fmt
4042
- name: Fetch gflags
@@ -69,6 +71,8 @@ jobs:
6971
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests cmake
7072
- name: Build double-conversion
7173
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests double-conversion
74+
- name: Build fast_float
75+
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests fast_float
7276
- name: Build fmt
7377
run: python build/fbcode_builder/getdeps.py build --free-up-disk --no-tests fmt
7478
- name: Build gflags
@@ -97,7 +101,7 @@ jobs:
97101
run: python build/fbcode_builder/getdeps.py build --src-dir=. folly
98102
- name: Copy artifacts
99103
run: python build/fbcode_builder/getdeps.py fixup-dyn-deps --src-dir=. folly _artifacts/windows --final-install-prefix /usr/local
100-
- uses: actions/upload-artifact@v2
104+
- uses: actions/upload-artifact@v4
101105
with:
102106
name: folly
103107
path: _artifacts

BUCK

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ buck_genrule(
1212
out = "folly-config.h",
1313
cmd = "cmake . && mv folly/folly-config.h $OUT",
1414
default_target_platform = "prelude//platforms:default",
15-
labels = ["third-party:homebrew:cmake"],
15+
labels = [
16+
"third-party:fedora:cmake",
17+
"third-party:homebrew:cmake",
18+
"third-party:ubuntu:cmake",
19+
],
1620
remote = False,
1721
)

CMake/FindFastFloat.cmake

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
#
16+
# - Try to find fast_float library
17+
# This will define
18+
# FASTFLOAT_FOUND
19+
# FASTFLOAT_INCLUDE_DIR
20+
#
21+
22+
find_path(FASTFLOAT_INCLUDE_DIR NAMES fast_float/fast_float.h)
23+
24+
include(FindPackageHandleStandardArgs)
25+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
26+
FastFloat DEFAULT_MSG
27+
FASTFLOAT_INCLUDE_DIR
28+
)
29+
30+
mark_as_advanced(FASTFLOAT_INCLUDE_DIR)

CMake/FollyCompilerMSVC.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ function(apply_folly_compile_options_to_target THETARGET)
120120

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

124125
PRIVATE
125126
/bigobj # Support objects with > 65k sections. Needed due to templates.

CMake/GenPkgConfig.cmake

+8
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ function(gen_pkgconfig_vars)
103103
"<COMPILE_LANG_AND_ID:CUDA,NVIDIA>" "<COMPILE_LANGUAGE:CUDA>"
104104
cflags "${cflags}"
105105
)
106+
107+
endif()
108+
# patch for fmt's generator expression
109+
if (MSVC)
110+
# fmt 11.0.3 and above
111+
string(REPLACE "$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CXX_COMPILER_ID:MSVC>>:/utf-8>" "/utf-8" cflags "${cflags}")
112+
# fmt 11.0.2 and below
113+
string(REPLACE "$<$<COMPILE_LANGUAGE:CXX>:/utf-8>" "/utf-8" cflags "${cflags}")
106114
endif()
107115

108116
set("${var_prefix}_CFLAGS" "${cflags}" PARENT_SCOPE)

CMake/folly-deps.cmake

+15-3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ find_package(DoubleConversion MODULE REQUIRED)
5252
list(APPEND FOLLY_LINK_LIBRARIES ${DOUBLE_CONVERSION_LIBRARY})
5353
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${DOUBLE_CONVERSION_INCLUDE_DIR})
5454

55+
find_package(FastFloat MODULE REQUIRED)
56+
list(APPEND FOLLY_INCLUDE_DIRECTORIES ${FASTFLOAT_INCLUDE_DIR})
57+
5558
find_package(Gflags MODULE)
5659
set(FOLLY_HAVE_LIBGFLAGS ${LIBGFLAGS_FOUND})
5760
if(LIBGFLAGS_FOUND)
@@ -184,21 +187,30 @@ message(STATUS "Setting FOLLY_HAVE_DWARF: ${FOLLY_HAVE_DWARF}")
184187
check_cxx_source_compiles("
185188
#include <atomic>
186189
int main(int argc, char** argv) {
190+
std::atomic<uint8_t> a1;
191+
std::atomic<uint16_t> a2;
192+
std::atomic<uint32_t> a4;
193+
std::atomic<uint64_t> a8;
187194
struct Test { bool val; };
188195
std::atomic<Test> s;
189-
return static_cast<int>(s.is_lock_free());
196+
return a1++ + a2++ + a4++ + a8++ + unsigned(s.is_lock_free());
190197
}"
191198
FOLLY_CPP_ATOMIC_BUILTIN
192199
)
193200
if(NOT FOLLY_CPP_ATOMIC_BUILTIN)
194201
list(APPEND CMAKE_REQUIRED_LIBRARIES atomic)
195202
list(APPEND FOLLY_LINK_LIBRARIES atomic)
203+
set(ATOMIC_LIBRARY "atomic")
196204
check_cxx_source_compiles("
197205
#include <atomic>
198206
int main(int argc, char** argv) {
207+
std::atomic<uint8_t> a1;
208+
std::atomic<uint16_t> a2;
209+
std::atomic<uint32_t> a4;
210+
std::atomic<uint64_t> a8;
199211
struct Test { bool val; };
200-
std::atomic<Test> s2;
201-
return static_cast<int>(s2.is_lock_free());
212+
std::atomic<Test> s;
213+
return a1++ + a2++ + a4++ + a8++ + unsigned(s.is_lock_free());
202214
}"
203215
FOLLY_CPP_ATOMIC_WITH_LIBATOMIC
204216
)

0 commit comments

Comments
 (0)