Skip to content

Commit

Permalink
Merge branch 'facebook:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx authored Dec 16, 2024
2 parents 43474b2 + 132d899 commit d469a6a
Show file tree
Hide file tree
Showing 1,163 changed files with 18,652 additions and 13,236 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 = b74887e4e5d2042de64f429a348a6eb84c80f977
14 changes: 7 additions & 7 deletions .github/scripts/bad_targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ root//folly/docs/examples/folly:synchronized_demo
root//folly/docs/examples/folly/container:array_demo
root//folly/docs/examples/folly/dynamic:array_demo
root//folly/docs/examples/folly/dynamic:object_demo
root//folly/docs/examples/folly/experimental/coro:async_scope_demo
root//folly/docs/examples/folly/experimental/coro:cancellable_async_scope_demo
root//folly/docs/examples/folly/experimental/coro:detach_on_cancel_demo
root//folly/docs/examples/folly/experimental/coro:promise_demo
root//folly/docs/examples/folly/experimental/coro:retry_demo
root//folly/docs/examples/folly/experimental/coro:task_demo
root//folly/docs/examples/folly/experimental/coro:with_cancellation_demo
root//folly/docs/examples/folly/coro:async_scope_demo
root//folly/docs/examples/folly/coro:cancellable_async_scope_demo
root//folly/docs/examples/folly/coro:detach_on_cancel_demo
root//folly/docs/examples/folly/coro:promise_demo
root//folly/docs/examples/folly/coro:retry_demo
root//folly/docs/examples/folly/coro:task_demo
root//folly/docs/examples/folly/coro:with_cancellation_demo
root//folly/docs/examples/folly/hash:hash_demo
root//folly/docs/examples/folly/io:i_o_buf_demo
root//folly/experimental/io:async_io
Expand Down
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
1 change: 1 addition & 0 deletions .github/workflows/getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,5 @@ jobs:
- 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
1 change: 1 addition & 0 deletions .github/workflows/getdeps_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ jobs:
- 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 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,
)
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
27 changes: 0 additions & 27 deletions CMake/FollyConfigChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,30 +178,3 @@ check_cxx_source_runs("
}"
HAVE_VSNPRINTF_ERRORS
)

if (FOLLY_HAVE_LIBGFLAGS)
# Older releases of gflags used the namespace "gflags"; newer releases
# use "google" but also make symbols available in the deprecated "gflags"
# namespace too. The folly code internally uses "gflags" unless we tell it
# otherwise.
list(APPEND CMAKE_REQUIRED_LIBRARIES ${FOLLY_LIBGFLAGS_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES ${FOLLY_LIBGFLAGS_INCLUDE})
check_cxx_source_compiles("
#include <gflags/gflags.h>
int main() {
gflags::GetArgv();
return 0;
}
"
GFLAGS_NAMESPACE_IS_GFLAGS
)
list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ${FOLLY_LIBGFLAGS_LIBRARY})
list(REMOVE_ITEM CMAKE_REQUIRED_INCLUDES ${FOLLY_LIBGFLAGS_INCLUDE})
if (GFLAGS_NAMESPACE_IS_GFLAGS)
set(FOLLY_UNUSUAL_GFLAGS_NAMESPACE OFF)
set(FOLLY_GFLAGS_NAMESPACE gflags)
else()
set(FOLLY_UNUSUAL_GFLAGS_NAMESPACE ON)
set(FOLLY_GFLAGS_NAMESPACE google)
endif()
endif()
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
2 changes: 0 additions & 2 deletions CMake/folly-config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#cmakedefine FOLLY_HAVE_PTHREAD_ATFORK 1

#cmakedefine FOLLY_HAVE_LIBGFLAGS 1
#cmakedefine FOLLY_UNUSUAL_GFLAGS_NAMESPACE 1
#cmakedefine FOLLY_GFLAGS_NAMESPACE @FOLLY_GFLAGS_NAMESPACE@

#cmakedefine FOLLY_HAVE_LIBGLOG 1

Expand Down
14 changes: 11 additions & 3 deletions CMake/folly-deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,13 @@ 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
)
Expand All @@ -200,9 +204,13 @@ if(NOT FOLLY_CPP_ATOMIC_BUILTIN)
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 d469a6a

Please sign in to comment.