From 8f86215addace22e0af644c7f9ebc9a578cae539 Mon Sep 17 00:00:00 2001 From: "Marvin, the Aspect bot" Date: Wed, 14 Jan 2026 18:23:45 -0800 Subject: [PATCH 001/367] aspect_rules_js@3.0.0-alpha.4 (#7149) Release: https://github.com/aspect-build/rules_js/releases/tag/v3.0.0-alpha.4 _Automated by [Publish to BCR](https://github.com/bazel-contrib/publish-to-bcr)_ Co-authored-by: jbedard <89246+jbedard@users.noreply.github.com> --- .../3.0.0-alpha.4/MODULE.bazel | 328 ++++++++++++++++++ .../3.0.0-alpha.4/attestations.json | 17 + .../patches/module_dot_bazel_version.patch | 13 + .../3.0.0-alpha.4/presubmit.yml | 12 + .../aspect_rules_js/3.0.0-alpha.4/source.json | 10 + modules/aspect_rules_js/metadata.json | 3 +- 6 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 modules/aspect_rules_js/3.0.0-alpha.4/MODULE.bazel create mode 100644 modules/aspect_rules_js/3.0.0-alpha.4/attestations.json create mode 100644 modules/aspect_rules_js/3.0.0-alpha.4/patches/module_dot_bazel_version.patch create mode 100644 modules/aspect_rules_js/3.0.0-alpha.4/presubmit.yml create mode 100644 modules/aspect_rules_js/3.0.0-alpha.4/source.json diff --git a/modules/aspect_rules_js/3.0.0-alpha.4/MODULE.bazel b/modules/aspect_rules_js/3.0.0-alpha.4/MODULE.bazel new file mode 100644 index 00000000000..4b4509a4c91 --- /dev/null +++ b/modules/aspect_rules_js/3.0.0-alpha.4/MODULE.bazel @@ -0,0 +1,328 @@ +"aspect-build/rules_js" + +module( + name = "aspect_rules_js", + bazel_compatibility = [">=7.6.0"], + compatibility_level = 1, + version = "3.0.0-alpha.4", +) + +# Lower-bounds (minimum) versions for direct runtime dependencies. +# Do not bump these unless rules_js requires a newer version to function. +bazel_dep(name = "tar.bzl", version = "0.6.0") +bazel_dep(name = "yq.bzl", version = "0.3.2") +bazel_dep(name = "jq.bzl", version = "0.4.0") +bazel_dep(name = "aspect_tools_telemetry", version = "0.3.3") +bazel_dep(name = "bazel_features", version = "1.9.0") +bazel_dep(name = "bazel_lib", version = "3.0.0") +bazel_dep(name = "bazel_skylib", version = "1.5.0") +bazel_dep(name = "platforms", version = "0.0.5") +bazel_dep(name = "rules_nodejs", version = "6.6.2") + +# Ensure any version of aspect_bazel_lib used includes: +# https://github.com/bazel-contrib/bazel-lib/commit/371362199e5e5bde58aeb15b54ea6cfb164af337 +# https://github.com/bazel-contrib/bazel-lib/commit/ceaff54210291292f35d03bd4bbc0b6ceb40e77a +# https://github.com/bazel-contrib/bazel-lib/commit/27a9e7af51c0f806f823425a03283ae487d3a953 +# https://github.com/bazel-contrib/bazel-lib/commit/e56aa707b72364bb1cc6f92580cb12ff88dfc1b4 +# https://github.com/bazel-contrib/bazel-lib/commit/2befef614904d0ebe5161beb271ac31c83e82fd2 +bazel_dep(name = "aspect_bazel_lib", version = "2.22.5", repo_name = None) + +tel = use_extension("@aspect_tools_telemetry//:extension.bzl", "telemetry") +use_repo(tel, "aspect_tools_telemetry_report") + +node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") +use_repo(node, "nodejs_toolchains") +use_repo(node, "nodejs_darwin_amd64") +use_repo(node, "nodejs_darwin_arm64") +use_repo(node, "nodejs_linux_amd64") +use_repo(node, "nodejs_linux_arm64") +use_repo(node, "nodejs_linux_ppc64le") +use_repo(node, "nodejs_linux_s390x") +use_repo(node, "nodejs_windows_amd64") + +# The default + public version of pnpm used by default. +pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm") +pnpm.pnpm(name = "pnpm") +use_repo(pnpm, "pnpm", "pnpm__links") + +bazel_lib_toolchains = use_extension("@bazel_lib//lib:extensions.bzl", "toolchains") +use_repo( + bazel_lib_toolchains, + "coreutils_darwin_amd64", + "coreutils_darwin_arm64", + "coreutils_linux_amd64", + "coreutils_linux_arm64", + "coreutils_toolchains", + "coreutils_windows_amd64", + "coreutils_windows_arm64", +) + +yq_toolchain = use_extension("@yq.bzl//yq:extensions.bzl", "yq") +use_repo( + yq_toolchain, + "yq_darwin_amd64", + "yq_darwin_arm64", + "yq_linux_amd64", + "yq_linux_arm64", + "yq_linux_ppc64le", + "yq_linux_s390x", + "yq_windows_amd64", +) + +tar_toolchains = use_extension("@tar.bzl//tar:extensions.bzl", "toolchains") +use_repo( + tar_toolchains, + "bsd_tar_toolchains", + "bsd_tar_toolchains_darwin_amd64", + "bsd_tar_toolchains_darwin_arm64", + "bsd_tar_toolchains_linux_amd64", + "bsd_tar_toolchains_linux_arm64", + "bsd_tar_toolchains_windows_amd64", + "bsd_tar_toolchains_windows_arm64", +) + +####### Dev dependencies ######## + +# Dev-only pnpm used for local testing +pnpm10 = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True) +pnpm10.pnpm( + name = "pnpm10", + pnpm_version = "10.22.0", + pnpm_version_integrity = "sha512-vwSe/plbKPUn/StBrgR0zikYb37cs79UUIe9Yfu+uyv3U2LRMH/aCcLSiOHkmXh6wS1Py2F6l0cYpgUfLu50HA==", +) +use_repo(pnpm10, "pnpm10") + +bazel_dep(name = "bazelrc-preset.bzl", version = "1.3.0", dev_dependency = True) +bazel_dep(name = "aspect_rules_lint", version = "1.13.0", dev_dependency = True) +bazel_dep(name = "buildifier_prebuilt", version = "8.0.1", dev_dependency = True) +bazel_dep(name = "rules_shell", version = "0.6.1", dev_dependency = True) + +host = use_extension( + "@bazel_lib//lib:extensions.bzl", + "host", + dev_dependency = True, +) +host.host() +use_repo(host, "bazel_lib_host") + +node_dev = use_extension( + "@rules_nodejs//nodejs:extensions.bzl", + "node", + dev_dependency = True, +) +use_repo(node_dev, "node20_linux_amd64") +use_repo(node_dev, "node20_darwin_arm64") +use_repo(node_dev, "node20_darwin_amd64") +use_repo(node_dev, "node20_linux_arm64") +use_repo(node_dev, "node20_linux_s390x") +use_repo(node_dev, "node20_linux_ppc64le") +use_repo(node_dev, "node20_windows_amd64") +use_repo(node_dev, "node22_linux_amd64") +use_repo(node_dev, "node22_darwin_arm64") +use_repo(node_dev, "node22_darwin_amd64") +use_repo(node_dev, "node22_linux_arm64") +use_repo(node_dev, "node22_linux_s390x") +use_repo(node_dev, "node22_linux_ppc64le") +use_repo(node_dev, "node22_windows_amd64") +use_repo(node_dev, "node24_linux_amd64") +use_repo(node_dev, "node24_darwin_arm64") +use_repo(node_dev, "node24_darwin_amd64") +use_repo(node_dev, "node24_linux_arm64") +use_repo(node_dev, "node24_linux_s390x") +use_repo(node_dev, "node24_linux_ppc64le") +use_repo(node_dev, "node24_windows_amd64") + +# default name+version +node_dev.toolchain() + +# additional custom name+versions +node_dev.toolchain( + name = "node20", + node_version = "20.17.0", +) +node_dev.toolchain( + name = "node22", + node_version = "22.20.0", +) +node_dev.toolchain( + name = "node24", + node_version = "24.9.0", +) + +############################################ +# npm dependencies used by examples + +npm = use_extension( + "@aspect_rules_js//npm:extensions.bzl", + "npm", + dev_dependency = True, +) +npm.npm_translate_lock( + name = "npm", + bins = { + # derived from "bin" attribute in node_modules/typescript/package.json + "typescript": [ + "tsc=./bin/tsc", + "tsserver=./bin/tsserver", + ], + }, + custom_postinstalls = { + "@aspect-test/c": "echo moo > cow.txt", + "@aspect-test/c@2.0.2": "echo mooo >> cow.txt", + "pngjs": "chmod -R a+X *", # fixes malformed tarball content file permissions in this package after extraction (see https://github.com/aspect-build/rules_js/issues/1637 for more details) + }, + data = [ + "//:package.json", + "//:pnpm-workspace.yaml", + "//examples/js_binary:package.json", + "//examples/js_lib_pkg/a:package.json", + "//examples/js_lib_pkg/b:package.json", + "//examples/linked_consumer:package.json", + "//examples/linked_empty_node_modules:package.json", + "//examples/linked_lib:package.json", + "//examples/linked_pkg:package.json", + "//examples/macro:package.json", + "//examples/nextjs:package.json", + "//examples/npm_deps:package.json", + "//examples/npm_deps/patches:meaning-of-life@1.0.0-pnpm.patch", + "//examples/npm_package/libs/lib_a:package.json", + "//examples/npm_package/packages/pkg_a:package.json", + "//examples/npm_package/packages/pkg_b:package.json", + "//examples/npm_package/packages/pkg_d:package.json", + "//examples/npm_package/packages/pkg_e:package.json", + "//examples/runfiles:package.json", + "//examples/stack_traces:package.json", + "//examples/vite3:package.json", + "//examples/vite6:package.json", + "//examples/webpack_cli:package.json", + "//js/private/coverage/bundle:package.json", + "//js/private/devserver/src:package.json", + "//js/private/test/image:package.json", + "//js/private/test/js_run_devserver:package.json", + "//js/private/test/node-patches:package.json", + "//js/private/worker/src:package.json", + "//npm/private/lifecycle:package.json", + "//npm/private/test:package.json", + "//npm/private/test:vendored/lodash-4.17.21.tgz", + "//npm/private/test/npm_package:package.json", + "//npm/private/test/npm_package_publish:package.json", + "//npm/private/test/vendored/is-odd:package.json", + "//npm/private/test/vendored/semver-max:package.json", + ], + generate_bzl_library_targets = True, + lifecycle_hooks = { + # We fetch @kubernetes/client-node from source and it has a `prepare` lifecycle hook that needs to be run + # which runs the `build` package.json script: https://github.com/kubernetes-client/javascript/blob/fc681991e61c6808dd26012a2331f83671a11218/package.json#L28. + # Here we run run build so we just run `tsc` instead of `npm run build` which ends up just running `tsc`. + "@kubernetes/client-node": ["build"], + # 'install' hook fails as it assumes the following path to `node-pre-gyp`: ./node_modules/.bin/node-pre-gyp + # https://github.com/stultuss/protoc-gen-grpc-ts/blob/53d52a9d0e1fe3cbe930dec5581eca89b3dde807/package.json#L28 + "protoc-gen-grpc@2.0.3": [], + }, + lifecycle_hooks_execution_requirements = { + "*": [ + "no-sandbox", + ], + # If @kubernetes/client-node is not sandboxed, will fail with + # ``` + # src/azure_auth.ts(97,43): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. + # src/azure_auth.ts(98,34): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. + # src/gcp_auth.ts(93,43): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. + # src/gcp_auth.ts(94,34): error TS2575: No overload expects 2 arguments, but overloads do exist that expect either 1 or 4 arguments. + # ``` + # since a `jsonpath-plus@7.2.0` that is newer then the transitive dep `jsonpath-plus@0.19.0` is found outside of the sandbox that + # includes typings that don't match the 0.19.0 "any" usage. + "@kubernetes/client-node": [], + "@figma/nodegit": [ + "no-sandbox", + "requires-network", + ], + "esbuild": [ + "no-sandbox", + "requires-network", + ], + "segfault-handler": [ + "no-sandbox", + "requires-network", + ], + "puppeteer": [ + "no-remote", + "no-sandbox", + "requires-network", + ], + }, + npmrc = "//:.npmrc", + package_visibility = { + "unused": ["//npm/private/test:__subpackages__"], + "@mycorp/pkg-a": [ + "//examples:__subpackages__", + "//js/private/test/image:__subpackages__", + ], + "@mycorp/pkg-d": [ + "//examples:__subpackages__", + "//js/private/test/image:__subpackages__", + ], + "@mycorp/pkg-e": ["//examples:__subpackages__"], + }, + pnpm_lock = "//:pnpm-lock.yaml", + public_hoist_packages = { + # Instructs the linker to hoist the ms@2.1.3 npm package to `node_modules/ms` in the `examples/npm_deps` package. + # Similar to adding `public-hoist-pattern[]=ms` in .npmrc but with control over which version to hoist and where + # to hoist it. This hoisted package can be referenced by the label `//examples/npm_deps:node_modules/ms` same as + # other direct dependencies in the `examples/npm_deps/package.json`. + "ms@2.1.3": ["examples/npm_deps"], + }, + update_pnpm_lock = True, + use_pnpm = "@pnpm10//:package/bin/pnpm.cjs", + verify_node_modules_ignored = "//:.bazelignore", + verify_patches = "//examples/npm_deps/patches:patches", +) +npm.npm_translate_lock( + name = "npm-no_optional", + no_optional = True, + npmrc = "//:.npmrc", + pnpm_lock = "//:pnpm-lock.yaml", +) +npm.npm_translate_lock( + name = "npm-no_dev", + no_dev = True, + npmrc = "//:.npmrc", + pnpm_lock = "//:pnpm-lock.yaml", +) + +# Configure package exclusions using tag class +npm.npm_exclude_package_contents( + package = "chalk", + patterns = ["**/README*"], +) +use_repo( + npm, + "npm", + "npm-no_dev", + "npm-no_optional", + "npm__es5-ext__0.10.64__links", + "npm__fsevents__2.3.3__links", + "npm__google-closure-compiler__20251111.0.0__links", + "npm__next__15.2.6_1315089095__links", + "npm__rollup__2.70.2", + "npm__rollup__2.70.2__links", + "npm__unused__0.2.2__links", + "npm__webpack-bundle-analyzer__4.5.0_bufferutil_4.0.8", +) + +# As an example, manually import a package using explicit coordinates. +# Just a demonstration of the syntax de-sugaring. +npm.npm_import( + name = "acorn__8.4.0", + bins = {"acorn": "./bin/acorn"}, + integrity = "sha512-ULr0LDaEqQrMFGyQ3bhJkLsbtrQ8QibAseGZeaSUiT/6zb9IvIkomWHJIvgvwad+hinRAgsI51JcWk2yvwyL+w==", + package = "acorn", + # Root package where to link the package store + root_package = "", + version = "8.4.0", +) +use_repo( + npm, + "acorn__8.4.0", + "acorn__8.4.0__links", +) diff --git a/modules/aspect_rules_js/3.0.0-alpha.4/attestations.json b/modules/aspect_rules_js/3.0.0-alpha.4/attestations.json new file mode 100644 index 00000000000..1ea90e9ae0f --- /dev/null +++ b/modules/aspect_rules_js/3.0.0-alpha.4/attestations.json @@ -0,0 +1,17 @@ +{ + "mediaType": "application/vnd.build.bazel.registry.attestation+json;version=1.0.0", + "attestations": { + "source.json": { + "url": "https://github.com/aspect-build/rules_js/releases/download/v3.0.0-alpha.4/source.json.intoto.jsonl", + "integrity": "sha256-Gcx+7K5oRZ2WtWrV8NJryn45Zuz5K3yBx6chqCyi2OQ=" + }, + "MODULE.bazel": { + "url": "https://github.com/aspect-build/rules_js/releases/download/v3.0.0-alpha.4/MODULE.bazel.intoto.jsonl", + "integrity": "sha256-cCXCNeGDLMSZcaiOFM2KZ1xwUjCMXRQ5H+CB+8HUyWc=" + }, + "rules_js-v3.0.0-alpha.4.tar.gz": { + "url": "https://github.com/aspect-build/rules_js/releases/download/v3.0.0-alpha.4/rules_js-v3.0.0-alpha.4.tar.gz.intoto.jsonl", + "integrity": "sha256-wU/1tEHg/EcvZjMHlFiu9oFmgAJ1EP7XE8Q3p1rjTEI=" + } + } +} diff --git a/modules/aspect_rules_js/3.0.0-alpha.4/patches/module_dot_bazel_version.patch b/modules/aspect_rules_js/3.0.0-alpha.4/patches/module_dot_bazel_version.patch new file mode 100644 index 00000000000..1601b3397c8 --- /dev/null +++ b/modules/aspect_rules_js/3.0.0-alpha.4/patches/module_dot_bazel_version.patch @@ -0,0 +1,13 @@ +=================================================================== +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -3,8 +3,9 @@ + module( + name = "aspect_rules_js", + bazel_compatibility = [">=7.6.0"], + compatibility_level = 1, ++ version = "3.0.0-alpha.4", + ) + + # Lower-bounds (minimum) versions for direct runtime dependencies. + # Do not bump these unless rules_js requires a newer version to function. diff --git a/modules/aspect_rules_js/3.0.0-alpha.4/presubmit.yml b/modules/aspect_rules_js/3.0.0-alpha.4/presubmit.yml new file mode 100644 index 00000000000..840022b09c8 --- /dev/null +++ b/modules/aspect_rules_js/3.0.0-alpha.4/presubmit.yml @@ -0,0 +1,12 @@ +bcr_test_module: + module_path: 'e2e/bzlmod' + matrix: + bazel: ['7.x', '8.x', '9.*'] + platform: ['debian10', 'macos', 'ubuntu2004', 'windows'] + tasks: + run_tests: + name: 'Run test module' + bazel: ${{ bazel }} + platform: ${{ platform }} + test_targets: + - '//...' diff --git a/modules/aspect_rules_js/3.0.0-alpha.4/source.json b/modules/aspect_rules_js/3.0.0-alpha.4/source.json new file mode 100644 index 00000000000..b2dcb350031 --- /dev/null +++ b/modules/aspect_rules_js/3.0.0-alpha.4/source.json @@ -0,0 +1,10 @@ +{ + "integrity": "sha256-Uz8OuGANRQrWitNI4qJDKsRryyf9yKO5r52x/5hY3t0=", + "strip_prefix": "rules_js-3.0.0-alpha.4", + "docs_url": "https://github.com/aspect-build/rules_js/releases/download/v3.0.0-alpha.4/rules_js-v3.0.0-alpha.4.docs.tar.gz", + "url": "https://github.com/aspect-build/rules_js/releases/download/v3.0.0-alpha.4/rules_js-v3.0.0-alpha.4.tar.gz", + "patches": { + "module_dot_bazel_version.patch": "sha256-s/tOdt8b6hyu4VXCZL0yrP92NL8XjM0+iV2SJwLPLsA=" + }, + "patch_strip": 1 +} diff --git a/modules/aspect_rules_js/metadata.json b/modules/aspect_rules_js/metadata.json index 5ddd8aeb6c0..ff53b510008 100644 --- a/modules/aspect_rules_js/metadata.json +++ b/modules/aspect_rules_js/metadata.json @@ -153,7 +153,8 @@ "2.8.3", "2.9.1", "3.0.0-alpha.2", - "3.0.0-alpha.3" + "3.0.0-alpha.3", + "3.0.0-alpha.4" ], "yanked_versions": { "2.3.2": "It contains a bug that breaks the js_image_layer rule: https://github.com/aspect-build/rules_js/pull/2145" From 4ccb38953846739ee0ea63603b9a975188212b62 Mon Sep 17 00:00:00 2001 From: Kevin Greene Date: Wed, 14 Jan 2026 18:23:51 -0800 Subject: [PATCH 002/367] Add support for linux aarch64 to folly lib (#7147) Closes https://github.com/bazelbuild/bazel-central-registry/issues/7146 Recent versions of folly regressed support for linux aarch64. There was no CI checking for that platform previously because ubuntu2004_arm64 is too old to support folly. However, now the bcr ci supports ubuntu2204_arm64. I added that to the presubmit.yml so hopefully that will prevent these types of regressions going forward. The main change here is to avoid adding libunwind and libdwarf to any deps unless the corresponding config flags are specified in the .bazelrc. That way they are not compiled / linked unless explicitly enabled. I could not get libunwind to compile and link with folly on aarch64. I also updated the README.md with all the available config options that can be added to the .bazelrc file. Sorry for the noise! --- .../folly/2025.01.13.00.bcr.5/MODULE.bazel | 59 + modules/folly/2025.01.13.00.bcr.5/README.md | 84 + .../2025.01.13.00.bcr.5/overlay/BUILD.bazel | 15 + .../overlay/CMake/BUILD.bazel | 4 + .../overlay/bzl/BUILD.bazel | 0 .../overlay/bzl/cpp_library.bzl | 16 + .../overlay/bzl/cpp_unittest.bzl | 21 + .../bzl/folly_config_optional_defines.bzl | 52 + .../overlay/folly/BUILD.bazel | 1453 ++++++++++++++++ .../overlay/folly/algorithm/simd/BUILD.bazel | 45 + .../folly/algorithm/simd/detail/BUILD.bazel | 70 + .../algorithm/simd/detail/test/BUILD.bazel | 46 + .../folly/algorithm/simd/test/BUILD.bazel | 42 + .../overlay/folly/channels/BUILD.bazel | 250 +++ .../overlay/folly/channels/detail/BUILD.bazel | 66 + .../folly/channels/detail/test/BUILD.bazel | 29 + .../overlay/folly/channels/test/BUILD.bazel | 198 +++ .../overlay/folly/chrono/BUILD.bazel | 29 + .../overlay/folly/chrono/test/BUILD.bazel | 20 + .../overlay/folly/cli/BUILD.bazel | 29 + .../overlay/folly/cli/test/BUILD.bazel | 69 + .../overlay/folly/compression/BUILD.bazel | 124 ++ .../folly/compression/elias_fano/BUILD.bazel | 40 + .../compression/elias_fano/test/BUILD.bazel | 28 + .../folly/compression/test/BUILD.bazel | 110 ++ .../overlay/folly/concurrency/BUILD.bazel | 167 ++ .../folly/concurrency/container/BUILD.bazel | 72 + .../concurrency/container/test/BUILD.bazel | 69 + .../folly/concurrency/memory/BUILD.bazel | 49 + .../folly/concurrency/memory/test/BUILD.bazel | 64 + .../folly/concurrency/test/BUILD.bazel | 200 +++ .../overlay/folly/container/BUILD.bazel | 345 ++++ .../folly/container/detail/BUILD.bazel | 113 ++ .../folly/container/detail/test/BUILD.bazel | 12 + .../overlay/folly/container/test/BUILD.bazel | 486 ++++++ .../overlay/folly/coro/BUILD.bazel | 717 ++++++++ .../overlay/folly/coro/test/BUILD.bazel | 316 ++++ .../overlay/folly/crypto/BUILD.bazel | 99 ++ .../overlay/folly/crypto/detail/BUILD.bazel | 122 ++ .../overlay/folly/crypto/test/BUILD.bazel | 73 + .../debugging/exception_tracer/BUILD.bazel | 134 ++ .../exception_tracer/test/BUILD.bazel | 58 + .../folly/debugging/symbolizer/BUILD.bazel | 190 +++ .../debugging/symbolizer/detail/BUILD.bazel | 11 + .../debugging/symbolizer/test/BUILD.bazel | 53 + .../overlay/folly/detail/BUILD.bazel | 390 +++++ .../folly/detail/base64_detail/BUILD.bazel | 96 ++ .../detail/base64_detail/tests/BUILD.bazel | 34 + .../overlay/folly/detail/test/BUILD.bazel | 125 ++ .../overlay/folly/executors/BUILD.bazel | 441 +++++ .../folly/executors/task_queue/BUILD.bazel | 59 + .../executors/task_queue/test/BUILD.bazel | 33 + .../overlay/folly/executors/test/BUILD.bazel | 350 ++++ .../executors/thread_factory/BUILD.bazel | 45 + .../overlay/folly/experimental/BUILD.bazel | 73 + .../folly/experimental/channels/BUILD.bazel | 187 +++ .../experimental/channels/detail/BUILD.bazel | 63 + .../experimental/channels/test/BUILD.bazel | 13 + .../folly/experimental/coro/BUILD.bazel | 524 ++++++ .../folly/experimental/crypto/BUILD.bazel | 43 + .../experimental/exception_tracer/BUILD.bazel | 75 + .../experimental/flat_combining/BUILD.bazel | 13 + .../flat_combining/test/BUILD.bazel | 23 + .../overlay/folly/experimental/io/BUILD.bazel | 169 ++ .../folly/experimental/io/test/BUILD.bazel | 30 + .../folly/experimental/observer/BUILD.bazel | 86 + .../experimental/observer/detail/BUILD.bazel | 24 + .../folly/experimental/settings/BUILD.bazel | 34 + .../folly/experimental/symbolizer/BUILD.bazel | 100 ++ .../symbolizer/detail/BUILD.bazel | 13 + .../folly/experimental/test/BUILD.bazel | 13 + .../overlay/folly/ext/BUILD.bazel | 9 + .../overlay/folly/ext/buck2/BUILD.bazel | 14 + .../overlay/folly/external/aor/BUILD.bazel | 71 + .../folly/external/farmhash/BUILD.bazel | 12 + .../folly/external/farmhash/test/BUILD.bazel | 10 + .../folly/external/fast-crc32/BUILD.bazel | 77 + .../folly/external/nvidia/detail/BUILD.bazel | 13 + .../folly/external/nvidia/hash/BUILD.bazel | 11 + .../external/nvidia/hash/detail/BUILD.bazel | 12 + .../overlay/folly/fibers/BUILD.bazel | 353 ++++ .../overlay/folly/fibers/async/BUILD.bazel | 123 ++ .../folly/fibers/async/test/BUILD.bazel | 29 + .../overlay/folly/fibers/detail/BUILD.bazel | 12 + .../overlay/folly/fibers/test/BUILD.bazel | 66 + .../overlay/folly/functional/BUILD.bazel | 55 + .../overlay/folly/functional/test/BUILD.bazel | 50 + .../overlay/folly/futures/BUILD.bazel | 141 ++ .../overlay/folly/futures/detail/BUILD.bazel | 33 + .../overlay/folly/futures/test/BUILD.bazel | 458 +++++ .../overlay/folly/gen/BUILD.bazel | 126 ++ .../overlay/folly/gen/test/BUILD.bazel | 103 ++ .../overlay/folly/hash/BUILD.bazel | 82 + .../overlay/folly/hash/detail/BUILD.bazel | 21 + .../overlay/folly/hash/test/BUILD.bazel | 83 + .../overlay/folly/init/BUILD.bazel | 29 + .../overlay/folly/init/test/BUILD.bazel | 12 + .../overlay/folly/io/BUILD.bazel | 158 ++ .../overlay/folly/io/async/BUILD.bazel | 786 +++++++++ .../overlay/folly/io/async/fdsock/BUILD.bazel | 24 + .../folly/io/async/fdsock/test/BUILD.bazel | 17 + .../folly/io/async/observer/BUILD.bazel | 23 + .../overlay/folly/io/async/ssl/BUILD.bazel | 67 + .../folly/io/async/ssl/test/BUILD.bazel | 38 + .../overlay/folly/io/async/test/BUILD.bazel | 1176 +++++++++++++ .../folly/io/async/test/certs/BUILD.bazel | 3 + .../overlay/folly/io/coro/BUILD.bazel | 59 + .../overlay/folly/io/coro/test/BUILD.bazel | 18 + .../overlay/folly/io/test/BUILD.bazel | 171 ++ .../overlay/folly/io/tool/BUILD.bazel | 16 + .../overlay/folly/json/BUILD.bazel | 136 ++ .../overlay/folly/json/bser/BUILD.bazel | 22 + .../overlay/folly/json/bser/test/BUILD.bazel | 11 + .../overlay/folly/json/test/BUILD.bazel | 115 ++ .../overlay/folly/json/tool/BUILD.bazel | 12 + .../overlay/folly/lang/BUILD.bazel | 280 +++ .../overlay/folly/lang/test/BUILD.bazel | 236 +++ .../overlay/folly/logging/BUILD.bazel | 206 +++ .../overlay/folly/logging/test/BUILD.bazel | 364 ++++ .../overlay/folly/memory/BUILD.bazel | 177 ++ .../overlay/folly/memory/detail/BUILD.bazel | 10 + .../overlay/folly/memory/test/BUILD.bazel | 125 ++ .../overlay/folly/net/BUILD.bazel | 68 + .../overlay/folly/net/detail/BUILD.bazel | 12 + .../overlay/folly/net/detail/test/BUILD.bazel | 15 + .../overlay/folly/net/test/BUILD.bazel | 67 + .../overlay/folly/observer/BUILD.bazel | 110 ++ .../overlay/folly/observer/detail/BUILD.bazel | 41 + .../overlay/folly/poly/BUILD.bazel | 14 + .../overlay/folly/portability/BUILD.bazel | 399 +++++ .../folly/portability/test/BUILD.bazel | 79 + .../overlay/folly/settings/BUILD.bazel | 74 + .../overlay/folly/settings/test/BUILD.bazel | 59 + .../overlay/folly/ssl/BUILD.bazel | 94 ++ .../overlay/folly/ssl/detail/BUILD.bazel | 16 + .../overlay/folly/ssl/test/BUILD.bazel | 60 + .../overlay/folly/stats/BUILD.bazel | 145 ++ .../overlay/folly/stats/detail/BUILD.bazel | 50 + .../folly/stats/detail/test/BUILD.bazel | 11 + .../overlay/folly/stats/test/BUILD.bazel | 108 ++ .../overlay/folly/synchronization/BUILD.bazel | 405 +++++ .../folly/synchronization/detail/BUILD.bazel | 93 + .../synchronization/detail/test/BUILD.bazel | 24 + .../folly/synchronization/example/BUILD.bazel | 27 + .../folly/synchronization/test/BUILD.bazel | 438 +++++ .../overlay/folly/system/BUILD.bazel | 125 ++ .../overlay/folly/system/test/BUILD.bazel | 109 ++ .../overlay/folly/test/BUILD.bazel | 1496 +++++++++++++++++ .../overlay/folly/test/common/BUILD.bazel | 23 + .../overlay/folly/test/stl_tests/BUILD.bazel | 19 + .../overlay/folly/testing/BUILD.bazel | 25 + .../overlay/folly/testing/test/BUILD.bazel | 16 + .../overlay/folly/tool/BUILD.bazel | 14 + .../overlay/folly/tracing/BUILD.bazel | 47 + .../overlay/folly/tracing/test/BUILD.bazel | 12 + .../patches/fix_async_fd_socket_test.patch | 13 + .../patches/fix_async_udp_socket_test.patch | 57 + ...fix_basic_transport_certificate_test.patch | 13 + .../patches/fix_exception_test.patch | 33 + .../fix_flat_combining_benchmark_test.patch | 13 + .../patches/fix_hasptr_test.patch | 13 + .../patches/fix_io_uring_backend_test.patch | 49 + .../patches/fix_shared_mutex_test.patch | 44 + .../patches/fix_ssl_cert_utils_test.patch | 15 + .../fix_uninitialized_memory_hacks.patch | 38 + .../patches/folly_Math.h.patch | 13 + ...folly_debugging_symbolizer_Dwarf.cpp.patch | 13 + ...y_debugging_symbolizer_DwarfImpl.cpp.patch | 13 + ...y_debugging_symbolizer_DwarfUtil.cpp.patch | 13 + ...lly_debugging_symbolizer_DwarfUtil.h.patch | 13 + ...ecutors_test_FiberIOExecutorTest.cpp.patch | 15 + ...olly_fibers_async_test_AsyncTest.cpp.patch | 26 + ...io_async_test_IoTestTempFileUtil.cpp.patch | 16 + ...t_TerminateCancellationTokenTest.cpp.patch | 13 + .../patches/test_utils_bazel_runfiles.patch | 33 + ...quote_includes_for_double_conversion.patch | 39 + .../use_quote_includes_for_snappy.patch | 15 + .../folly/2025.01.13.00.bcr.5/presubmit.yml | 39 + .../scripts/bcr_to_folly.sh | 29 + .../scripts/folly_to_bcr.sh | 31 + modules/folly/2025.01.13.00.bcr.5/source.json | 184 ++ modules/folly/metadata.json | 3 +- 182 files changed, 20650 insertions(+), 1 deletion(-) create mode 100644 modules/folly/2025.01.13.00.bcr.5/MODULE.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/README.md create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/CMake/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/bzl/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_library.bzl create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_unittest.bzl create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/bzl/folly_config_optional_defines.bzl create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/tests/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/thread_factory/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/coro/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/crypto/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/exception_tracer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/settings/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/buck2/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/aor/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/fast-crc32/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/observer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/certs/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/tool/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/tool/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/poly/BUILD.bazel create mode 100755 modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/example/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/common/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/stl_tests/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/tool/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/test/BUILD.bazel create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_async_fd_socket_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_async_udp_socket_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_basic_transport_certificate_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_exception_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_flat_combining_benchmark_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_hasptr_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_io_uring_backend_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_shared_mutex_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_ssl_cert_utils_test.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/fix_uninitialized_memory_hacks.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_Math.h.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_debugging_symbolizer_Dwarf.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_debugging_symbolizer_DwarfImpl.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_debugging_symbolizer_DwarfUtil.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_debugging_symbolizer_DwarfUtil.h.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_executors_test_FiberIOExecutorTest.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_fibers_async_test_AsyncTest.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_io_async_test_IoTestTempFileUtil.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/folly_io_async_test_TerminateCancellationTokenTest.cpp.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/test_utils_bazel_runfiles.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/use_quote_includes_for_double_conversion.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/patches/use_quote_includes_for_snappy.patch create mode 100644 modules/folly/2025.01.13.00.bcr.5/presubmit.yml create mode 100755 modules/folly/2025.01.13.00.bcr.5/scripts/bcr_to_folly.sh create mode 100755 modules/folly/2025.01.13.00.bcr.5/scripts/folly_to_bcr.sh create mode 100644 modules/folly/2025.01.13.00.bcr.5/source.json diff --git a/modules/folly/2025.01.13.00.bcr.5/MODULE.bazel b/modules/folly/2025.01.13.00.bcr.5/MODULE.bazel new file mode 100644 index 00000000000..a5abda3a5db --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/MODULE.bazel @@ -0,0 +1,59 @@ +module( + name = "folly", + version = "2025.01.13.00.bcr.5", + bazel_compatibility = [">=7.6.0"], +) + +bazel_dep(name = "bazel_skylib", version = "1.9.0") +bazel_dep(name = "boost.algorithm", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.container_hash", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.container", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.context", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.conversion", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.core", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.crc", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.filesystem", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.function_types", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.functional", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.interprocess", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.intrusive", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.iterator", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.mpl", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.multi_index", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.preprocessor", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.program_options", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.random", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.range", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.regex", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.smart_ptr", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.sort", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.thread", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.utility", version = "1.89.0.bcr.2") +bazel_dep(name = "boost.variant", version = "1.89.0.bcr.2") +bazel_dep(name = "bzip2", version = "1.0.8.bcr.3") +bazel_dep(name = "cmake_configure_file", version = "0.1.4") +bazel_dep(name = "double-conversion", version = "3.3.1") +bazel_dep(name = "fast_float", version = "8.0.2") +bazel_dep(name = "fmt", version = "12.1.0") +bazel_dep(name = "gflags", version = "2.2.2.bcr.1") +bazel_dep(name = "glog", version = "0.7.1") +bazel_dep(name = "googletest", version = "1.17.0.bcr.2") +bazel_dep(name = "libdwarf", version = "0.12.0.bcr.1") +bazel_dep(name = "libevent", version = "2.1.12-stable.bcr.0") +bazel_dep(name = "libsodium", version = "1.0.19") +bazel_dep(name = "libunwind", version = "1.8.1") +bazel_dep(name = "liburing", version = "2.10") +bazel_dep(name = "lz4", version = "1.9.4.bcr.2") +bazel_dep(name = "openssl", version = "3.3.1.bcr.9") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "range-v3", version = "0.12.0") +bazel_dep(name = "rules_cc", version = "0.2.16") +bazel_dep(name = "rules_license", version = "1.0.0") +bazel_dep(name = "snappy", version = "1.2.2") +bazel_dep(name = "xz", version = "5.4.5.bcr.7") +bazel_dep(name = "zlib", version = "1.3.1.bcr.8") +bazel_dep(name = "zstd", version = "1.5.7") + +# TODO(kgk): Enable once @libaio is added to bcr. See: +# https://github.com/bazelbuild/bazel-central-registry/issues/3756 +# bazel_dep(name = "libaio", version = "") diff --git a/modules/folly/2025.01.13.00.bcr.5/README.md b/modules/folly/2025.01.13.00.bcr.5/README.md new file mode 100644 index 00000000000..dd002502516 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/README.md @@ -0,0 +1,84 @@ +## Enabling folly optional features + +Some features of folly are only available with certain toolchains and platforms. These bazel targets do not try to auto-detect what is supported like cmake would. Instead, optional features are disabled by default to maximize compatibility. If you want to enable them for your project, you can do so using flags in your .bazelrc file. + +Below are the flags that are available: + +--@folly//folly:with_extrandom_sfmt19937 # Use __gnu_cxx::sfmt19937 from +--@folly//folly:with_getrandom # Use ::getrandom from +--@folly//folly:with_int128 # Enable int128_t +--@folly//folly:with_vla # Enable VLA support (very long arrays) +--@folly//folly:use_dwarf # Link against libdwarf and enable folly libdwarf features. +--@folly//folly:use_libunwind # Link against libunwind and use it for backtraces. + +Be sure to only enable the above features if your toolchain and platform support them. + +## Steps to Bazelfying a Folly release + +1. Clone the Folly repo: + + ```shell + git clone https://github.com/facebook/folly.git + ``` + +1. Create a Git branch at the release you want to Bazelfy. + For example: + + ```shell + git checkout -b bazel v2025.01.13.00 + ``` + +1. Create a new BCR Folly version. + +1. Run the `bcr_to_folly.sh` script, which will bootstrap your Folly repo by copying all the `BUILD` files from the BCR Folly to your repo. + This script is only meant to be run once on a clean Folly repo. + For example: + + ```shell + cd /path/to/your/bazel-central-registry/modules/folly/2025.01.13.00.bcr.3/scripts + ./bcr_to_folly.sh /path/to/your/folly/repo + ``` + +1. Update and/or add `BUILD` files in your Folly repo as needed. + Updated any source files as needed. + +1. Because of the way the `includes` work for Folly BCR, you won't actually be able to build/test targets correctly from inside the Folly repo. + The Folly repo must be tested as an external dep. + The easiest way to do this is to create another folder with its own Bazel module, use `local_path_override` to depend on Folly, and run all Bazel commands from that module. + For example in another folder's `MODULE.bazel` file: + + ```python + bazel_dep(name = "folly") + local_path_override( + module_name = "folly", + path = "../folly", # assuming this folder is beside the Folly repo + ) + ``` + + Then build/test Folly with `@folly`. + E.g., `bazel build @folly//...` + +1. Run the `folly_to_bcr.sh` script to copy the `BUILD` files back into your new BCR Folly version. + You can run this script as many times as needed while iterating. + For example: + + ```shell + cd /path/to/your/bazel-central-registry/modules/folly/2025.01.13.00.bcr.3/scripts + ./folly_to_bcr.sh /path/to/your/folly/repo + ``` + +1. Generate Git patch files for any changes you made to Folly patch files and ensure they are added to the `patches` directory in BCR Folly. + +1. Update integrity as needed (must be run from the `bazel-central-registry` module). + For example: + + ```shell + bazel run -- //tools:update_integrity folly + ``` + +## Tips and other notes + +* For Folly `BUILD` files, use our Bazel `cpp_library` macro instead of the Folly `cpp_library macro`. +* Add any custom `bzl` files under a directory called `bzl` in the Folly source tree. +* Folly uses a build system called [Buck2](https://buck2.build/) which is very similar to Bazel. + The `BUCK` files in the folly source tree can be mostly copied to a file in the same directory called `BUILD.bazel`, and then modified from there to support Bazel. diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/BUILD.bazel new file mode 100644 index 00000000000..f4b0e2bc9bb --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +exports_files( + ["CMakeLists.txt"], + visibility = ["//visibility:public"], +) + +# Any library that depends on this library (directly or indirectly) can use angle brackets to +# include headers from the root of the repo. +# Every library target that uses cpp_library depends on this. +cc_library( + name = "include_hack", + includes = ["."], + visibility = ["//:__subpackages__"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/CMake/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/CMake/BUILD.bazel new file mode 100644 index 00000000000..b36114c9d6f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/CMake/BUILD.bazel @@ -0,0 +1,4 @@ +exports_files( + ["folly-config.h.cmake"], + visibility = ["//visibility:public"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/BUILD.bazel new file mode 100644 index 00000000000..e69de29bb2d diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_library.bzl b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_library.bzl new file mode 100644 index 00000000000..9e3cf50ff23 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_library.bzl @@ -0,0 +1,16 @@ +"""Wrapper around cc_library for folly.""" + +load("@rules_cc//cc:defs.bzl", "cc_library") + +def cpp_library(name, **kwargs): + deps = kwargs.pop("deps", []) + + # Append as a list like this so it still works if deps contains a select statement. + # buildifier: disable=list-append + deps += ["//:include_hack"] + + cc_library( + name = name, + deps = deps, + **kwargs + ) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_unittest.bzl b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_unittest.bzl new file mode 100644 index 00000000000..586e9ffda0f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/cpp_unittest.bzl @@ -0,0 +1,21 @@ +"""Wrapper around cc_test to add test main.""" + +load("@rules_cc//cc:defs.bzl", "cc_test") + +def cpp_unittest(name, **kwargs): + srcs = kwargs.pop("srcs", []) + + # Change the default to small. + size = kwargs.pop("size", "small") + deps = kwargs.pop("deps", []) + + cc_test( + name = name, + srcs = srcs, + size = size, + deps = deps + [ + "//folly/test/common:test_main_lib", + "//folly/ext/buck2:test_ext", + ], + **kwargs + ) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/folly_config_optional_defines.bzl b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/folly_config_optional_defines.bzl new file mode 100644 index 00000000000..33c15a89fdf --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/bzl/folly_config_optional_defines.bzl @@ -0,0 +1,52 @@ +"""Used to generate config flags that control settings in the generated folly-config.h file.""" + +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") + +_FOLLY_CONFIG_FLAGS_AND_DEFINES = [ + # Toolchain / platform dependent flags. Enable these only if you know your compiler toolchain + # and target platform support them. They are disabled by default to be conservative and ensure + # compatibility the the most platforms. + ("with_extrandom_sfmt19937", "FOLLY_HAVE_EXTRANDOM_SFMT19937"), + ("with_getrandom", "FOLLY_HAVE_GETRANDOM"), + ("with_int128", "FOLLY_HAVE_INT128_T"), + ("with_vla", "FOLLY_HAVE_VLA"), + + # NOTE: dwarf is available for linux via the BCR. It is always compiled and linked to + # folly for linux. If this flag is not specified then folly's dwarf functionality is disabled. + ("use_dwarf", "FOLLY_HAVE_DWARF"), + + # NOTE: libunwind is available for linux via the BCR. It is always compiled and linked to + # folly for linux. If this flag is not specified, libc backtrace will be used for stack traces + # and libunwind will not actually be used. + ("use_libunwind", "FOLLY_HAVE_LIBUNWIND"), +] + +def folly_config_optional_defines(name = "folly_config_optional_defines"): + """Creates optional flags and config settings for folly-config.h. + + Args: + name: unused, required by linter + + Returns: + A list of defines created from flags. Looks something like this: + [] + select({":with_int128_setting": ["FOLLY_HAVE_INT128_T"], default: []}) + + select({":with_pipe2_setting": ["FOLLY_HAVE_PIPE2"], ...}) + """ + out = [] + for (flag_name, define_name) in _FOLLY_CONFIG_FLAGS_AND_DEFINES: + bool_flag( + name = flag_name, + build_setting_default = False, + visibility = ["//visibility:public"], + ) + config_setting_name = flag_name + "_setting" + native.config_setting( + name = config_setting_name, + flag_values = {":" + flag_name: "true"}, + visibility = ["//visibility:public"], + ) + out = out + select({ + config_setting_name: [define_name], + "//conditions:default": [], + }) + return out diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/BUILD.bazel new file mode 100644 index 00000000000..40cb712fba8 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/BUILD.bazel @@ -0,0 +1,1453 @@ +load("@cmake_configure_file//:cmake_configure_file.bzl", "cmake_configure_file") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:folly_config_optional_defines.bzl", "folly_config_optional_defines") + +package(default_visibility = ["//visibility:public"]) + +config_setting( + name = "linux_aarch64", + constraint_values = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], + visibility = ["//:__subpackages__"], +) + +cpp_library( + name = "concurrent_bit_set", + hdrs = ["ConcurrentBitSet.h"], + deps = [":portability"], +) + +cpp_library( + name = "atomic_hash_array", + hdrs = ["AtomicHashArray.h"], + textual_hdrs = ["AtomicHashArray-inl.h"], + deps = [ + ":thread_cached_int", + ":utility", + "//folly/detail:atomic_hash_utils", + "//folly/detail:iterators", + "//folly/hash", + "//folly/lang:bits", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "atomic_hash_map", + hdrs = ["AtomicHashMap.h"], + textual_hdrs = ["AtomicHashMap-inl.h"], + deps = [ + ":atomic_hash_array", + ":c_portability", + ":likely", + ":thread_cached_int", + "//folly/container:foreach", + "//folly/detail:atomic_hash_utils", + "//folly/detail:iterators", + "//folly/hash", + ], +) + +cpp_library( + name = "atomic_linked_list", + hdrs = [ + "AtomicIntrusiveLinkedList.h", + "AtomicLinkedList.h", + ], + deps = [":memory"], +) + +cpp_library( + name = "atomic_unordered_map", + hdrs = ["AtomicUnorderedMap.h"], + deps = [ + ":conv", + ":likely", + ":random", + ":scope_guard", + ":traits", + "//folly/detail:atomic_unordered_map_utils", + "//folly/lang:bits", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "base64", + hdrs = ["base64.h"], + deps = [ + ":c_portability", + ":portability", + "//folly/detail/base64_detail:base64_api", + "//folly/detail/base64_detail:base64_common", + "//folly/lang:exception", + "//folly/memory:uninitialized_memory_hacks", + ], +) + +cpp_library( + name = "benchmark_util", + hdrs = [ + "BenchmarkUtil.h", + ], + deps = [ + ":portability", + "//folly/lang:hint", + ], +) + +cpp_library( + name = "benchmark", + srcs = ["Benchmark.cpp"], + hdrs = ["Benchmark.h"], + deps = [ + ":benchmark_util", + ":file_util", + ":map_util", + ":portability", + ":preprocessor", + ":range", + ":scope_guard", + ":string", + ":traits", + "//folly/detail:perf_scoped", + "//folly/functional:invoke", + "//folly/json:dynamic", + "//folly/lang:hint", + "//folly/portability:gflags", + "@boost.function_types", + "@boost.regex", + "@glog", + ], +) + +cpp_library( + # @shim + name = "bits", + hdrs = ["Bits.h"], + deps = ["//folly/lang:bits"], +) + +cpp_library( + name = "c_portability", + hdrs = ["CPortability.h"], + deps = ["//folly/portability:config"], +) + +cpp_library( + name = "cancellation_token", + srcs = ["CancellationToken.cpp"], + hdrs = ["CancellationToken.h"], + textual_hdrs = ["CancellationToken-inl.h"], + deps = [ + ":cpp_attributes", + ":function", + ":optional", + "//folly:scope_guard", + "//folly/lang:new", + "//folly/portability:memory", + "//folly/synchronization/detail:sleeper", + "@glog", + ], +) + +cpp_library( + name = "chrono", + hdrs = ["Chrono.h"], + deps = [ + ":portability", + "//folly/lang:exception", + "//folly/portability:time", + ], +) + +cpp_library( + name = "clock_gettime_wrappers", + srcs = ["ClockGettimeWrappers.cpp"], + hdrs = ["ClockGettimeWrappers.h"], + linkopts = select({ + "@platforms//os:linux": [ + "-ldl", + "-lrt", + ], + "//conditions:default": [], + }), + deps = [ + ":c_portability", + ":likely", + "//folly/portability:time", + ], +) + +cpp_library( + name = "concurrent_lazy", + hdrs = ["ConcurrentLazy.h"], + deps = [ + "//folly/functional:invoke", + "//folly/synchronization:delayed_init", + ], +) + +cpp_library( + name = "concurrent_skip_list", + hdrs = ["ConcurrentSkipList.h"], + textual_hdrs = ["ConcurrentSkipList-inl.h"], + deps = [ + ":constexpr_math", + ":likely", + ":memory", + ":thread_local", + "//folly/detail:iterators", + "//folly/synchronization:micro_spin_lock", + "@boost.random", + "@glog", + ], +) + +cmake_configure_file( + name = "config_h_gen", + src = "//CMake:folly-config.h.cmake", + out = "folly-config.h", + cmakelists = ["//:CMakeLists.txt"], + defines = [ + "FOLLY_HAVE_LIBBZ2", + "FOLLY_HAVE_LIBGLOG", + "FOLLY_HAVE_LIBGFLAGS", + "FOLLY_HAVE_LIBLZ4", + "FOLLY_HAVE_LIBLZMA", + "FOLLY_HAVE_LIBSNAPPY", + "FOLLY_HAVE_LIBZ", + "FOLLY_HAVE_LIBZSTD", + ] + select({ + "@platforms//os:linux": [ + "FOLLY_HAVE_ACCEPT4", + "FOLLY_HAVE_BACKTRACE", + "FOLLY_HAVE_CLOCK_GETTIME", + "FOLLY_HAVE_ELF", + "FOLLY_HAVE_LINUX_VDSO", + "FOLLY_HAVE_PIPE2", + "FOLLY_HAVE_PREADV", + "FOLLY_HAVE_PWRITEV", + "FOLLY_HAVE_PTHREAD", + "FOLLY_HAVE_PTHREAD_ATFORK", + "FOLLY_HAVE_UNALIGNED_ACCESS", + "FOLLY_HAVE_WEAK_SYMBOLS", + "FOLLY_USE_SYMBOLIZER", + ], + "@platforms//os:macos": [ + "FOLLY_HAVE_BACKTRACE", + "FOLLY_HAVE_CLOCK_GETTIME", # NOTE: Requires macOS 11+ + "FOLLY_HAVE_PREADV", # NOTE: Requires macOS 11+ + "FOLLY_HAVE_PWRITEV", # NOTE: Requires macOS 11+ + "FOLLY_HAVE_PTHREAD", + "FOLLY_HAVE_PTHREAD_ATFORK", + "FOLLY_HAVE_UNALIGNED_ACCESS", + "FOLLY_USE_SYMBOLIZER", + ], + "//conditions:default": [], + }) + folly_config_optional_defines(), + undefines = [ + # jemalloc is not supported as of now. + "FOLLY_USE_JEMALLOC", + + # Bazel will always build folly this as static libs, so this is disabled. + "FOLLY_SUPPORT_SHARED_LIBRARY", + + # This is only used in folly tests, so just disable it. + "HAVE_VSNPRINTF_ERRORS", + + # This does not appear to actually be used anywhere in folly so disable it. + "FOLLY_HAVE_IFUNC", + + # The bazel build files don't enable the relevant flags for this anyways, so disable it. + "FOLLY_HAVE_SHADOW_LOCAL_WARNINGS", + + # This functionality exists on some platforms, but has a history of being "present but + # discouraged". Just disable it since folly doesn't make heavy use of it anyways. + "FOLLY_HAVE_SWAPCONTEXT", + + # Disabled since it's only used in unit tests. It also wouldn't be guaranteed to be + # supported on all platforms / toolchains. + "FOLLY_HAVE_WCHAR_SUPPORT", + + # Just undefine this since it's usage in folly is a micro-optimization and it isn't + # guaranteed to exist on all platforms + toolchain combinations. + "FOLLY_HAVE_MALLOC_USABLE_SIZE", + + # This is used only in folly/Singleton.cpp for an optional shutdown timer. Since that + # functionality is minimal, just disable it for easier toolchain / platform compatibility. + "FOLLY_HAVE_LIBRT", + ], + visibility = ["//visibility:public"], +) + +cpp_library( + name = "config", + hdrs = [":config_h_gen"], +) + +cpp_library( + name = "constexpr_math", + hdrs = ["ConstexprMath.h"], + deps = [ + ":portability", + "//folly/lang:checked_math", + "//folly/portability:constexpr", + ], +) + +cpp_library( + name = "constructor_callback_list", + hdrs = ["ConstructorCallbackList.h"], + deps = [ + ":format", + ":function", + ":shared_mutex", + "//folly/detail:static_singleton_manager", + ], +) + +cpp_library( + name = "conv", + srcs = ["Conv.cpp"], + hdrs = ["Conv.h"], + deps = [ + ":c_portability", + ":demangle", + ":expected", + ":fbstring", + ":likely", + ":portability", + ":range", + ":traits", + ":unit", + ":utility", + "//folly/lang:exception", + "//folly/lang:pretty", + "//folly/lang:safe_assert", + "//folly/lang:to_ascii", + "//folly/portability:math", + "@double-conversion", + "@fast_float", + ], +) + +cpp_library( + name = "cpp_attributes", + hdrs = ["CppAttributes.h"], + deps = [":portability"], +) + +cpp_library( + name = "cpu_id", + hdrs = ["CpuId.h"], + deps = [":portability"], +) + +cpp_library( + name = "default_keep_alive_executor", + hdrs = ["DefaultKeepAliveExecutor.h"], + deps = [ + ":executor", + "//folly/executors:sequenced_executor", + "//folly/synchronization:baton", + "@glog", + ], +) + +cpp_library( + name = "demangle", + srcs = ["Demangle.cpp"], + hdrs = ["Demangle.h"], + # TODO(kgk): Support binutils? + # os_deps = [( + # "linux", + # ["third-party//binutils:iberty"], + # )], + deps = [ + ":c_portability", + ":cpp_attributes", + ":fbstring", + ":utility", + "//folly/functional:invoke", + "//folly/lang:c_string", + "//folly/portability:config", + ], +) + +cpp_library( + name = "discriminated_ptr", + hdrs = ["DiscriminatedPtr.h"], + deps = [ + ":likely", + ":portability", + "//folly/detail:discriminated_ptr_detail", + "@glog", + ], +) + +cpp_library( + name = "dynamic", + hdrs = [ + "DynamicConverter.h", + "dynamic.h", + "dynamic-inl.h", + "json.h", + ], + deps = ["//folly/json:dynamic"], +) + +cpp_library( + name = "exception", + hdrs = ["Exception.h"], + deps = [ + ":conv", + ":fbstring", + ":likely", + ":portability", + "//folly/portability:sys_types", + ], +) + +cpp_library( + name = "exception_string", + srcs = ["ExceptionString.cpp"], + hdrs = ["ExceptionString.h"], + deps = [ + ":demangle", + ":fbstring", + "//folly/lang:exception", + "//folly/lang:type_info", + ], +) + +cpp_library( + name = "exception_wrapper", + srcs = ["ExceptionWrapper.cpp"], + hdrs = ["ExceptionWrapper.h"], + textual_hdrs = ["ExceptionWrapper-inl.h"], + deps = [ + ":c_portability", + ":cpp_attributes", + ":demangle", + ":exception_string", + ":fbstring", + ":glog", + ":portability", + ":traits", + ":utility", + "//folly/functional:traits", + "//folly/lang:assume", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "executor", + srcs = ["Executor.cpp"], + hdrs = ["Executor.h"], + deps = [ + ":exception_string", + ":function", + ":optional", + ":portability", + ":range", + ":utility", + "//folly/lang:exception", + "@glog", + ], +) + +cpp_library( + name = "expected", + hdrs = ["Expected.h"], + deps = [ + ":c_portability", + ":cpp_attributes", + ":likely", + ":portability", + ":preprocessor", + ":traits", + ":unit", + ":utility", + "//folly/coro:coroutine", + "//folly/lang:exception", + "//folly/lang:hint", + ], +) + +cpp_library( + name = "fbstring", + hdrs = ["FBString.h"], + deps = [ + ":c_portability", + ":cpp_attributes", + ":likely", + ":portability", + ":traits", + "//folly/hash", + "//folly/lang:assume", + "//folly/lang:checked_math", + "//folly/lang:exception", + "//folly/memory:malloc", + "@fmt", + ], +) + +cpp_library( + name = "fbvector", + hdrs = ["FBVector.h"], + deps = ["//folly/container:fbvector"], +) + +cpp_library( + name = "file", + srcs = ["File.cpp"], + hdrs = ["File.h"], + deps = [ + ":exception", + ":exception_wrapper", + ":expected", + ":file_util", # @manual + ":portability", + ":range", + ":scope_guard", + "//folly/portability:fcntl", + "//folly/portability:fmt_compile", + "//folly/portability:sys_file", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "file_util", + srcs = ["FileUtil.cpp"], + hdrs = ["FileUtil.h"], + deps = [ + ":portability", + ":range", + ":scope_guard", + "//folly/detail:file_util_detail", + "//folly/detail:file_util_vector_detail", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:fcntl", + "//folly/portability:sockets", + "//folly/portability:stdlib", + "//folly/portability:sys_file", + "//folly/portability:sys_stat", + "//folly/portability:sys_uio", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "fingerprint", + srcs = ["Fingerprint.cpp"], + hdrs = ["Fingerprint.h"], + deps = [ + ":portability", + ":range", + ":utility", + "//folly/detail:fingerprint_polynomial", + ], +) + +cpp_library( + name = "fixed_string", + hdrs = ["FixedString.h"], + deps = [ + ":constexpr_math", + ":portability", + ":range", + ":utility", + "//folly/lang:exception", + "//folly/lang:ordering", + "//folly/portability:constexpr", + ], +) + +cpp_library( + name = "fmt_utility", + srcs = ["FmtUtility.cpp"], + hdrs = ["FmtUtility.h"], + deps = [ + ":cpp_attributes", + ":range", + ":string", + "//folly/ssl:openssl_hash", + "@fmt", + ], +) + +cpp_library( + name = "format", + srcs = ["Format.cpp"], + hdrs = [ + "Format.h", + "FormatArg.h", + ], + textual_hdrs = ["Format-inl.h"], + deps = [ + ":c_portability", + ":constexpr_math", + ":conv", + ":cpp_attributes", + ":exception", + ":format_traits", + ":likely", + ":map_util", + ":portability", + ":range", + ":string", + ":traits", + "//folly/container:array", + "//folly/lang:exception", + "//folly/lang:to_ascii", + "//folly/portability:windows", + "@double-conversion", + ], +) + +cpp_library( + name = "format_traits", + hdrs = ["FormatTraits.h"], +) + +cpp_library( + name = "function", + hdrs = ["Function.h"], + deps = [ + ":cpp_attributes", + ":portability", + ":traits", + "//folly/functional:invoke", + "//folly/lang:align", + "//folly/lang:exception", + "//folly/lang:new", + ], +) + +cpp_library( + name = "group_varint", + srcs = ["GroupVarint.cpp"], + hdrs = ["GroupVarint.h"], + deps = [ + ":portability", + ":range", + "//folly/container:array", + "//folly/detail:group_varint_detail", + "//folly/lang:bits", + "//folly/portability:builtins", + "@glog", + ], +) + +cpp_library( + name = "hash", + hdrs = ["Hash.h"], + deps = ["//folly/hash"], +) + +cpp_library( + name = "indestructible", + hdrs = ["Indestructible.h"], + deps = [ + ":traits", + ":utility", + ], +) + +cpp_library( + name = "indexed_mem_pool", + hdrs = ["IndexedMemPool.h"], + deps = [ + ":portability", + "//folly/concurrency:cache_locality", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "//folly/synchronization:atomic_struct", + ], +) + +cpp_library( + name = "intrusive_list", + hdrs = ["IntrusiveList.h"], + deps = ["//folly/container:intrusive_list"], +) + +cpp_library( + name = "json", + deps = [":dynamic"], +) + +cpp_library( + name = "json_pointer", + hdrs = ["json_pointer.h"], + deps = ["//folly/json:json_pointer"], +) + +cpp_library( + name = "json_patch", + hdrs = ["json_patch.h"], + deps = ["//folly/json:json_patch"], +) + +cpp_library( + name = "lazy", + hdrs = ["Lazy.h"], + deps = [ + ":optional", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "likely", + hdrs = ["Likely.h"], + deps = ["//folly/lang:builtin"], +) + +cpp_library( + name = "glog", + hdrs = ["GLog.h"], + deps = [ + ":likely", + "@glog", + ], +) + +cpp_library( + name = "map_util", + hdrs = ["MapUtil.h"], + deps = ["//folly/container:map_util"], +) + +cpp_library( + name = "math", + hdrs = ["Math.h"], +) + +cpp_library( + name = "memset-impl", + srcs = ["FollyMemset.cpp"] + select({ + "@platforms//cpu:x86_64": ["memset.S"], + ":linux_aarch64": ["memset_select_aarch64.cpp"], + "//conditions:default": [], + }), + copts = select({ + "@platforms//cpu:x86_64": ["-mavx2"], + "//conditions:default": [], + }), + deps = select({ + ":linux_aarch64": [ + "//folly/external/aor:memset_aarch64", # @manual + ], + "//conditions:default": [], + }), +) + +# This exports the symbol __folly_memset to C++ via a header. +cpp_library( + name = "memset", + hdrs = ["FollyMemset.h"], + deps = [ + ":memset-impl", # @manual + ], +) + +# This overrides the libc memset with __folly_memset. +cpp_library( + name = "memset-use", + srcs = ["FollyMemset.cpp"] + select({ + "@platforms//cpu:x86_64": ["memset.S"], + ":linux_aarch64": ["memset_select_aarch64.cpp"], + "//conditions:default": [], + }), + copts = select({ + ":linux_aarch64": [ + "-DFOLLY_MEMCPY_IS_MEMCPY", + ], + "@platforms//cpu:x86_64": [ + "-DFOLLY_MEMCPY_IS_MEMCPY", + "-mavx2", + ], + "//conditions:default": [], + }), + deps = select({ + ":linux_aarch64": [ + "//folly/external/aor:memset_aarch64", # @manual + ], + "//conditions:default": [], + }), + alwayslink = True, # Set alwayslink to force linker to use __folly_memcpy +) + +# This adds the symbol __folly_memcpy but does not replace the default memcpy. +cpp_library( + name = "memcpy-impl", + srcs = ["FollyMemcpy.cpp"] + select({ + "@platforms//cpu:x86_64": ["memcpy.S"], + ":linux_aarch64": ["memcpy_select_aarch64.cpp"], + "//conditions:default": [], + }), + copts = select({ + "@platforms//cpu:x86_64": ["-mavx2"], + "//conditions:default": [], + }), + deps = select({ + ":linux_aarch64": [ + "//folly/external/aor:memcpy_aarch64", # @manual + ], + "//conditions:default": [], + }), +) + +# This exports the symbol __folly_memcpy to C++ via a header. +cpp_library( + name = "memcpy", + hdrs = ["FollyMemcpy.h"], + deps = [ + ":memcpy-impl", # @manual + ], +) + +# This overrides the libc memcpy with __folly_memcpy. +cpp_library( + name = "memcpy-use", + srcs = ["FollyMemcpy.cpp"] + select({ + "@platforms//cpu:x86_64": ["memcpy.S"], + ":linux_aarch64": ["memcpy_select_aarch64.cpp"], + "//conditions:default": [], + }), + copts = select({ + ":linux_aarch64": [ + "-DFOLLY_MEMCPY_IS_MEMCPY", + ], + "@platforms//cpu:x86_64": [ + "-DFOLLY_MEMCPY_IS_MEMCPY", + "-march=haswell", + "-mavx2", + ], + "//conditions:default": [], + }), + deps = select({ + ":linux_aarch64": [ + "//folly/external/aor:memcpy_aarch64-use", # @manual + ], + "//conditions:default": [], + }), + alwayslink = True, # Set alwayslink to force linker to use __folly_memcpy +) + +cpp_library( + name = "memory", + hdrs = ["Memory.h"], + deps = [ + ":constexpr_math", + ":likely", + ":portability", + ":traits", + ":utility", + "//folly/functional:invoke", + "//folly/lang:align", + "//folly/lang:exception", + "//folly/lang:thunk", + "//folly/memory:malloc", + "//folly/portability:config", + "//folly/portability:constexpr", + "//folly/portability:malloc", + ], +) + +cpp_library( + name = "micro_lock", + srcs = ["MicroLock.cpp"], + hdrs = ["MicroLock.h"], + deps = [ + ":optional", + ":portability", + "//folly/detail:futex", + "//folly/portability:asm", + ], +) + +cpp_library( + # @shim + name = "micro_spin_lock", + hdrs = ["MicroSpinLock.h"], + deps = ["//folly/synchronization:micro_spin_lock"], +) + +cpp_library( + name = "move_wrapper", + hdrs = ["MoveWrapper.h"], +) + +cpp_library( + name = "mpmc_pipeline", + hdrs = ["MPMCPipeline.h"], + deps = [ + ":portability", + "//folly/detail:mpmc_pipeline_detail", + "@glog", + ], +) + +cpp_library( + name = "mpmc_queue", + hdrs = ["MPMCQueue.h"], + deps = [ + ":traits", + "//folly/concurrency:cache_locality", + "//folly/detail:turn_sequencer", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "network_address", + srcs = [ + "IPAddress.cpp", + "IPAddressV4.cpp", + "IPAddressV6.cpp", + "MacAddress.cpp", + "SocketAddress.cpp", + ], + hdrs = [ + "IPAddress.h", + "IPAddressException.h", + "IPAddressV4.h", + "IPAddressV6.h", + "MacAddress.h", + "SocketAddress.h", + ], + deps = [ + ":c_portability", + ":constexpr_math", + ":conv", + ":exception", + ":expected", + ":fbstring", + ":format", + ":optional", + ":portability", + ":range", + ":scope_guard", + ":small_vector", + ":string", + ":unit", + "//folly/detail:ip_address", + "//folly/detail:ip_address_source", + "//folly/hash", + "//folly/lang:bits", + "//folly/lang:exception", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:sockets", + "@boost.container_hash", + "@fmt", + ], +) + +cpp_library( + name = "observer_container", + hdrs = ["ObserverContainer.h"], + deps = [ + ":constructor_callback_list", + ":function", + ":optional", + ":scope_guard", + ":small_vector", + "//folly/io/async:destructor_check", + "@glog", + ], +) + +cpp_library( + name = "optional", + hdrs = ["Optional.h"], + deps = [ + ":portability", + ":traits", + ":utility", + "//folly/coro:coroutine", + "//folly/hash:traits", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "replaceable", + hdrs = ["Replaceable.h"], + deps = [ + ":portability", + ":traits", + ":utility", + ], +) + +cpp_library( + name = "overload", + hdrs = ["Overload.h"], + deps = [ + ":portability", + ":traits", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "packed_sync_ptr", + hdrs = ["PackedSyncPtr.h"], + deps = [ + ":portability", + "//folly/synchronization:small_locks", + "@glog", + ], +) + +cpp_library( + name = "padded", + hdrs = ["Padded.h"], + deps = [ + ":portability", + ":traits", + "//folly/functional:invoke", + "//folly/portability:sys_types", + "@boost.iterator", + ], +) + +cpp_library( + name = "portability", + hdrs = ["Portability.h"], + deps = [ + ":c_portability", + "//folly/portability:config", + ], +) + +cpp_library( + name = "preprocessor", + hdrs = ["Preprocessor.h"], + deps = [":c_portability"], +) + +cpp_library( + name = "poly", + hdrs = ["Poly.h"], + textual_hdrs = ["Poly-inl.h"], + deps = [ + ":c_portability", + ":cpp_attributes", + ":poly_exception", + ":traits", + "//folly/detail:poly_detail", + "//folly/detail:typelist", + "//folly/lang:assume", + ], +) + +cpp_library( + name = "poly_exception", + hdrs = ["PolyException.h"], + deps = ["//folly:c_portability"], +) + +cpp_library( + name = "producer_consumer_queue", + hdrs = ["ProducerConsumerQueue.h"], + deps = ["//folly/concurrency:cache_locality"], +) + +cpp_library( + name = "random", + srcs = ["Random.cpp"], + hdrs = ["Random.h"], + textual_hdrs = ["Random-inl.h"], + # TODO(kgk): Is the bazel equivalent of this needed? + #os_deps = [( + # "windows", + # [ + # "fbsource//third-party/toolchains/win:advapi32.lib", + # ], + #)], + deps = [ + ":cpp_attributes", + ":portability", + ":singleton_thread_local", + ":thread_local", + ":traits", + "//folly/detail:file_util_detail", + "//folly/functional:invoke", + "//folly/lang:bits", + "//folly/portability:config", + "//folly/portability:sys_time", + "//folly/portability:unistd", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_library( + name = "range", + hdrs = ["Range.h"], + deps = [ + ":cpu_id", + ":likely", + ":portability", + ":traits", + "//folly/detail:range_common", + "//folly/detail:range_simd", + "//folly/hash:spooky_hash_v2", + "//folly/lang:c_string", + "//folly/lang:exception", + "//folly/portability:constexpr", + "@fmt", + ], +) + +cpp_library( + # @shim + name = "rw_spin_lock", + hdrs = ["RWSpinLock.h"], + deps = ["//folly/synchronization:rw_spin_lock"], +) + +cpp_library( + name = "scope_guard", + srcs = ["ScopeGuard.cpp"], + hdrs = ["ScopeGuard.h"], + deps = [ + ":portability", + ":preprocessor", + ":utility", + "//folly/lang:exception", + "//folly/lang:uncaught_exceptions", + ], +) + +cpp_library( + name = "shared_mutex", + srcs = ["SharedMutex.cpp"], + hdrs = ["SharedMutex.h"], + deps = [ + ":c_portability", + ":cpp_attributes", + ":indestructible", + ":likely", + "//folly/chrono:hardware", + "//folly/concurrency:cache_locality", + "//folly/detail:futex", + "//folly/lang:exception", + "//folly/portability:asm", + "//folly/portability:sys_resource", + "//folly/synchronization:lock", + "//folly/synchronization:relaxed_atomic", + "//folly/synchronization:sanitize_thread", + "//folly/system:thread_id", + ], +) + +cpp_library( + name = "singleton", + srcs = ["Singleton.cpp"], + hdrs = ["Singleton.h"], + linkopts = select({ + "@platforms//os:linux": [ + "-ldl", + "-lrt", + ], + "//conditions:default": [], + }), + textual_hdrs = ["Singleton-inl.h"], + deps = [ + ":cancellation_token", + ":demangle", + ":exception", + ":executor", + ":memory", + ":scope_guard", + ":synchronized", + "//folly/concurrency:core_cached_shared_ptr", + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/detail:singleton", + "//folly/detail:static_singleton_manager", + "//folly/experimental/symbolizer", + "//folly/hash", + "//folly/lang:exception", + "//folly/lang:safe_assert", + "//folly/memory:sanitize_leak", + "//folly/portability:config", + "//folly/portability:fmt_compile", + "//folly/synchronization:baton", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "singleton_thread_local", + srcs = ["SingletonThreadLocal.cpp"], + hdrs = ["SingletonThreadLocal.h"], + deps = [ + ":scope_guard", + ":thread_local", + "//folly/detail:iterators", + "//folly/detail:singleton", + "//folly/detail:unique_instance", + "//folly/functional:invoke", + "//folly/lang:hint", + ], +) + +cpp_library( + name = "small_vector", + hdrs = ["small_vector.h"], + deps = ["//folly/container:small_vector"], +) + +cpp_library( + name = "sorted_vector_types", + hdrs = ["sorted_vector_types.h"], + deps = ["//folly/container:sorted_vector_types"], +) + +cpp_library( + name = "spin_lock", + hdrs = ["SpinLock.h"], + deps = [ + ":portability", + "//folly/synchronization:small_locks", + ], +) + +cpp_library( + name = "stop_watch", + hdrs = ["stop_watch.h"], + deps = [ + ":chrono", + ":utility", + "//folly/portability:time", + ], +) + +cpp_library( + name = "string", + srcs = ["String.cpp"], + hdrs = ["String.h"], + textual_hdrs = ["String-inl.h"], + deps = [ + ":conv", + ":cpp_attributes", + ":exception_string", + ":optional", + ":portability", + ":range", + ":scope_guard", + ":traits", + ":unit", + "//folly/container:array", + "//folly/container:reserve", + "//folly/detail:simple_simd_string_utils", + "//folly/detail:split_string_simd", + "@glog", + ], +) + +cpp_library( + name = "subprocess", + srcs = ["Subprocess.cpp"], + hdrs = ["Subprocess.h"], + deps = [ + ":conv", + ":exception", + ":file", + ":file_util", + ":function", + ":map_util", + ":optional", + ":portability", + ":range", + ":scope_guard", + ":string", + "//folly/gen:string", + "//folly/io:iobuf", + "//folly/lang:assume", + "//folly/logging", + "//folly/portability:dirent", + "//folly/portability:fcntl", + "//folly/portability:sockets", + "//folly/portability:stdlib", + "//folly/portability:sys_resource", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "//folly/system:at_fork", + "//folly/system:shell", + "@boost.container", + "@boost.range", + "@boost.utility", + ], +) + +cpp_library( + name = "synchronized", + hdrs = ["Synchronized.h"], + deps = [ + ":function", + ":likely", + ":preprocessor", + ":shared_mutex", + ":traits", + ":utility", + "//folly/container:foreach", + "//folly/functional:apply_tuple", + "//folly/synchronization:lock", + "@glog", + ], +) + +cpp_library( + name = "synchronized_ptr", + hdrs = ["SynchronizedPtr.h"], + deps = [":synchronized"], +) + +cpp_library( + name = "thread_cached_int", + hdrs = ["ThreadCachedInt.h"], + deps = [ + ":likely", + ":thread_local", + ], +) + +cpp_library( + name = "thread_local", + hdrs = ["ThreadLocal.h"], + deps = [ + ":likely", + ":portability", + ":scope_guard", + ":shared_mutex", + "//folly/detail:thread_local_detail", + ], +) + +cpp_library( + name = "timeout_queue", + srcs = ["TimeoutQueue.cpp"], + hdrs = ["TimeoutQueue.h"], + deps = ["@boost.multi_index"], +) + +cpp_library( + name = "token_bucket", + hdrs = ["TokenBucket.h"], + deps = [ + ":constexpr_math", + ":likely", + ":optional", + "//folly/concurrency:cache_locality", + ], +) + +cpp_library( + name = "traits", + hdrs = ["Traits.h"], + deps = [":portability"], +) + +cpp_library( + name = "try", + srcs = ["Try.cpp"], + hdrs = ["Try.h"], + textual_hdrs = ["Try-inl.h"], + deps = [ + ":exception_wrapper", + ":likely", + ":memory", + ":portability", + ":unit", + ":utility", + "//folly/functional:invoke", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "unicode", + srcs = ["Unicode.cpp"], + hdrs = ["Unicode.h"], + deps = [ + ":conv", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "unit", + hdrs = ["Unit.h"], +) + +cpp_library( + name = "uri", + srcs = ["Uri.cpp"], + hdrs = ["Uri.h"], + textual_hdrs = ["Uri-inl.h"], + deps = [ + ":conv", + ":expected", + ":string", + "//folly/hash", + "@boost.regex", + ], +) + +cpp_library( + name = "utf8_string", + hdrs = ["UTF8String.h"], + deps = [ + ":range", + "@boost.regex", + ], +) + +# For things that would go in c++ stdlib : +cpp_library( + name = "utility", + hdrs = ["Utility.h"], + deps = [ + ":c_portability", + ":portability", + ":traits", + ], +) + +cpp_library( + name = "varint", + hdrs = ["Varint.h"], + deps = [ + ":conv", + ":expected", + ":likely", + ":portability", + ":range", + ], +) + +cpp_library( + name = "virtual_executor", + hdrs = ["VirtualExecutor.h"], + deps = ["//folly/executors:virtual_executor"], +) + +cpp_library( + name = "maybe_managed_ptr", + hdrs = ["MaybeManagedPtr.h"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/BUILD.bazel new file mode 100644 index 00000000000..710603d0dd8 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/BUILD.bazel @@ -0,0 +1,45 @@ +###################################################################### +# Libraries + +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "contains", + srcs = ["Contains.cpp"], + hdrs = ["Contains.h"], + deps = [ + "//folly:c_portability", + "//folly/algorithm/simd/detail:simd_contains_impl", + "//folly/algorithm/simd/detail:traits", + ], +) + +cpp_library( + name = "find_fixed", + hdrs = ["FindFixed.h"], + deps = [ + ":movemask", + "//folly:portability", + "//folly/algorithm/simd/detail:traits", + ], +) + +cpp_library( + name = "ignore", + hdrs = ["Ignore.h"], + deps = [ + "//folly/lang:bits", + ], +) + +cpp_library( + name = "movemask", + hdrs = ["Movemask.h"], + deps = [ + ":ignore", + "//folly:portability", + "//folly/lang:bits", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/BUILD.bazel new file mode 100644 index 00000000000..54b8a9e400c --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/BUILD.bazel @@ -0,0 +1,70 @@ +###################################################################### +# Libraries + +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "simd_any_of", + hdrs = ["SimdAnyOf.h"], + deps = [ + ":simd_for_each", + ":unroll_utils", + "//folly:c_portability", + ], +) + +cpp_library( + name = "simd_platform", + hdrs = ["SimdPlatform.h"], + deps = [ + "//folly:portability", + "//folly/algorithm/simd:ignore", + "//folly/algorithm/simd:movemask", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "simd_contains_impl", + hdrs = ["ContainsImpl.h"], + deps = [ + ":simd_any_of", + ":simd_platform", + "//folly:c_portability", + "//folly/container:span", + ], +) + +cpp_library( + name = "simd_for_each", + hdrs = ["SimdForEach.h"], + deps = [ + ":unroll_utils", + "//folly:c_portability", + "//folly:traits", + "//folly/algorithm/simd:ignore", + "//folly/lang:align", + ], +) + +cpp_library( + name = "traits", + hdrs = ["Traits.h"], + deps = [ + "//folly:c_portability", + "//folly:memory", + "//folly:traits", + "//folly/container:span", + ], +) + +cpp_library( + name = "unroll_utils", + hdrs = ["UnrollUtils.h"], + deps = [ + "//folly:portability", + "//folly:traits", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/test/BUILD.bazel new file mode 100644 index 00000000000..ef3ef78bd2e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/detail/test/BUILD.bazel @@ -0,0 +1,46 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "simd_any_of_test", + srcs = [ + "SimdAnyOfTest.cpp", + ], + deps = [ + "//folly:range", + "//folly/algorithm/simd/detail:simd_any_of", + "//folly/algorithm/simd/detail:simd_platform", + "//folly/container:span", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "simd_for_each_test", + srcs = ["SimdForEachTest.cpp"], + deps = [ + "//folly/algorithm/simd/detail:simd_for_each", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "traits_test", + srcs = ["TraitsTest.cpp"], + copts = ["--std=c++17"], + deps = [ + "//folly/algorithm/simd/detail:traits", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "unroll_utils_test", + srcs = [ + "UnrollUtilsTest.cpp", + ], + deps = [ + "//folly/algorithm/simd/detail:unroll_utils", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/test/BUILD.bazel new file mode 100644 index 00000000000..dd902ef6b49 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/algorithm/simd/test/BUILD.bazel @@ -0,0 +1,42 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "contains_test", + srcs = ["ContainsTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/algorithm/simd:contains", + "//folly/algorithm/simd/detail:simd_contains_impl", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "find_fixed_test", + srcs = ["FindFixedTest.cpp"], + deps = [ + "//folly:portability", + "//folly/algorithm/simd:find_fixed", + "//folly/portability:gtest", + "@fmt", + ], +) + +cpp_unittest( + name = "momemask_test", + srcs = ["MovemaskTest.cpp"], + copts = select({ + "@platforms//cpu:aarch64": ["-flax-vector-conversions"], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + "//folly/algorithm/simd:movemask", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/BUILD.bazel new file mode 100644 index 00000000000..37f857f5615 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/BUILD.bazel @@ -0,0 +1,250 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "channel", + hdrs = [ + "Channel.h", + "Channel-fwd.h", + ], + textual_hdrs = [ + "Channel-inl.h", + ], + deps = [ + "//folly:cancellation_token", + "//folly:synchronized", + "//folly/coro:coroutine", + "//folly/experimental/channels/detail:channel_bridge", + ], +) + +cpp_library( + name = "channel_callback_handle", + hdrs = [ + "ChannelCallbackHandle.h", + ], + deps = [ + "//folly:intrusive_list", + "//folly:scope_guard", + "//folly/channels:channel", + ], +) + +cpp_library( + name = "channel_processor", + hdrs = [ + "ChannelProcessor.h", + ], + textual_hdrs = [ + "ChannelProcessor-inl.h", + ], + deps = [ + "//folly:executor", + "//folly/channels:consume_channel", + "//folly/channels:merge_channel", + "//folly/channels:rate_limiter", + "//folly/channels:transform", + "//folly/executors:serial_executor", + "//folly/experimental/channels/detail:intrusive_ptr", + ], +) + +cpp_library( + name = "consume_channel", + hdrs = [ + "ConsumeChannel.h", + ], + textual_hdrs = [ + "ConsumeChannel-inl.h", + ], + deps = [ + "//folly:executor", + "//folly:format", + "//folly:intrusive_list", + "//folly:scope_guard", + "//folly/channels:channel", + "//folly/channels:channel_callback_handle", + "//folly/coro:task", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "fanout_channel", + hdrs = [ + "FanoutChannel.h", + ], + textual_hdrs = [ + "FanoutChannel-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/channels:fanout_sender", + "//folly/container:f14_hash", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "fanout_sender", + hdrs = [ + "FanoutSender.h", + ], + textual_hdrs = [ + "FanoutSender-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/container:f14_hash", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:pointer_variant", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "merge", + hdrs = [ + "Merge.h", + ], + textual_hdrs = [ + "Merge-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/container:f14_hash", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "merge_channel", + hdrs = [ + "MergeChannel.h", + ], + textual_hdrs = [ + "MergeChannel-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/container:f14_hash", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "multiplex_channel", + hdrs = [ + "MultiplexChannel.h", + ], + textual_hdrs = [ + "MultiplexChannel-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/channels:fanout_sender", + "//folly/channels:on_closed_exception", + "//folly/channels:rate_limiter", + "//folly/container:f14_hash", + "//folly/coro:future_util", + "//folly/coro:mutex", + "//folly/coro:promise", + "//folly/coro:task", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:multiplexer_traits", + "//folly/experimental/channels/detail:utility", + "@range-v3", + ], +) + +cpp_library( + name = "on_closed_exception", + hdrs = [ + "OnClosedException.h", + ], +) + +cpp_library( + name = "producer", + hdrs = [ + "Producer.h", + ], + textual_hdrs = [ + "Producer-inl.h", + ], + deps = [ + "//folly:cancellation_token", + "//folly/channels:channel", + "//folly/channels:channel_callback_handle", + "//folly/channels:consume_channel", + "//folly/coro:task", + "//folly/executors:sequenced_executor", + "@fmt", + ], +) + +cpp_library( + name = "proxy_channel", + hdrs = [ + "ProxyChannel.h", + ], + textual_hdrs = [ + "ProxyChannel-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) + +cpp_library( + name = "rate_limiter", + hdrs = [ + "RateLimiter.h", + ], + deps = [ + "//folly:function", + "//folly/executors:sequenced_executor", + ], +) + +cpp_library( + name = "max_concurrent_rate_limiter", + srcs = [ + "MaxConcurrentRateLimiter.cpp", + ], + hdrs = [ + "MaxConcurrentRateLimiter.h", + ], + deps = [ + "//folly:synchronized", + "//folly/channels:rate_limiter", + "//folly/concurrency:unbounded_queue", + "//folly/executors:sequenced_executor", + ], +) + +cpp_library( + name = "transform", + hdrs = [ + "Transform.h", + ], + textual_hdrs = [ + "Transform-inl.h", + ], + deps = [ + "//folly/channels:channel", + "//folly/channels:on_closed_exception", + "//folly/channels:rate_limiter", + "//folly/coro:async_generator", + "//folly/coro:task", + "//folly/executors:sequenced_executor", + "//folly/experimental/channels/detail:utility", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/BUILD.bazel new file mode 100644 index 00000000000..22691528f86 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/BUILD.bazel @@ -0,0 +1,66 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_queue", + hdrs = [ + "AtomicQueue.h", + ], + deps = [ + "//folly/lang:assume", + "@glog", + ], +) + +cpp_library( + name = "channel_bridge", + hdrs = ["ChannelBridge.h"], + deps = [ + "//folly:try", + "//folly/experimental/channels/detail:atomic_queue", + ], +) + +cpp_library( + name = "intrusive_ptr", + hdrs = ["IntrusivePtr.h"], + deps = [ + "@boost.smart_ptr", + ], +) + +cpp_library( + name = "multiplexer_traits", + hdrs = ["MultiplexerTraits.h"], + deps = [ + "//folly:traits", + "//folly/functional:traits", + ], +) + +cpp_library( + name = "pointer_variant", + hdrs = ["PointerVariant.h"], + deps = [ + "//folly:demangle", + "@fmt", + ], +) + +cpp_library( + name = "utility", + hdrs = [ + "Utility.h", + ], + deps = [ + "//folly:exception_wrapper", + "//folly:function", + "//folly:scope_guard", + "//folly/channels:channel", + "//folly/channels:rate_limiter", + "//folly/coro:promise", + "//folly/coro:task", + "//folly/executors:sequenced_executor", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/test/BUILD.bazel new file mode 100644 index 00000000000..86ca7d15201 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/detail/test/BUILD.bazel @@ -0,0 +1,29 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "atomic_queue_test", + srcs = [ + "AtomicQueueTest.cpp", + ], + deps = [ + "//folly/experimental/channels/detail:atomic_queue", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "pointer_variant_test", + srcs = [ + "PointerVariantTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/experimental/channels/detail:pointer_variant", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/test/BUILD.bazel new file mode 100644 index 00000000000..43227955663 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/channels/test/BUILD.bazel @@ -0,0 +1,198 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "channel_processor_test", + srcs = ["ChannelProcessorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/channels:channel_processor", + "//folly/executors:manual_executor", + "//folly/portability:gmock", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "channel_test", +# srcs = ["ChannelTest.cpp"], +# size = ["medium"], +# deps = [ +# "//folly/channels:channel", +# "//folly/channels/test:channel_test_util", +# "//folly/coro:blocking_wait", +# "//folly/executors:manual_executor", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "fanout_channel_test", +# srcs = ["FanoutChannelTest.cpp"], +# deps = [ +# "//folly/channels:consume_channel", +# "//folly/channels:fanout_channel", +# "//folly/channels/test:channel_test_util", +# "//folly/executors:manual_executor", +# "//folly/executors:serial_executor", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "fanout_sender_test", + srcs = ["FanoutSenderTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/channels:consume_channel", + "//folly/channels:fanout_sender", + "//folly/channels/test:channel_test_util", + "//folly/executors:manual_executor", + "//folly/executors:serial_executor", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "max_concurrent_rate_limiter_test", + srcs = [ + "MaxConcurrentRateLimiterTest.cpp", + ], + deps = [ + "//folly/channels:max_concurrent_rate_limiter", + "//folly/executors:manual_executor", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "merge_channel_test", +# srcs = [ +# "MergeChannelTest.cpp", +# ], +# deps = [ +# "//folly/channels:consume_channel", +# "//folly/channels:merge_channel", +# "//folly/channels/test:channel_test_util", +# "//folly/executors:manual_executor", +# "//folly/executors:serial_executor", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "merge_test", +# srcs = ["MergeTest.cpp"], +# deps = [ +# "//folly/channels:consume_channel", +# "//folly/channels:merge", +# "//folly/channels/test:channel_test_util", +# "//folly/executors:manual_executor", +# "//folly/executors:serial_executor", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "multiplex_channel_test", +# srcs = ["MultiplexChannelTest.cpp"], +# deps = [ +# "//folly/channels:consume_channel", +# "//folly/channels:max_concurrent_rate_limiter", +# "//folly/channels:multiplex_channel", +# "//folly/channels/test:channel_test_util", +# "//folly/coro:blocking_wait", +# "//folly/executors:manual_executor", +# "//folly/executors:serial_executor", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "producer_test", + srcs = ["ProducerTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/channels:producer", + "//folly/channels/test:channel_test_util", + "//folly/executors:manual_executor", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "proxy_channel_test", + srcs = ["ProxyChannelTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/channels:proxy_channel", + "//folly/channels/test:channel_test_util", + "//folly/executors:manual_executor", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "transform_test", +# srcs = ["TransformTest.cpp"], +# deps = [ +# "//folly:scope_guard", +# "//folly:synchronized", +# "//folly/channels:consume_channel", +# "//folly/channels:max_concurrent_rate_limiter", +# "//folly/channels:transform", +# "//folly/channels/test:channel_test_util", +# "//folly/coro:async_generator", +# "//folly/coro:detach_on_cancel", +# "//folly/executors:manual_executor", +# "//folly/executors:serial_executor", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_library( + name = "channel_test_util", + hdrs = ["ChannelTestUtil.h"], + deps = [ + "//folly/channels:consume_channel", + "//folly/coro:detach_on_cancel", + "//folly/coro:sleep", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/executors:sequenced_executor", + "//folly/futures:shared_promise", + "//folly/portability:gmock", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/BUILD.bazel new file mode 100644 index 00000000000..915d04e96f1 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/BUILD.bazel @@ -0,0 +1,29 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "clock", + hdrs = ["Clock.h"], +) + +cpp_library( + name = "conv", + hdrs = ["Conv.h"], + deps = [ + "//folly:constexpr_math", + "//folly:conv", + "//folly:expected", + "//folly:utility", + "//folly/portability:sys_time", + "//folly/portability:sys_types", + ], +) + +cpp_library( + name = "hardware", + hdrs = ["Hardware.h"], + deps = [ + "//folly:portability", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/test/BUILD.bazel new file mode 100644 index 00000000000..9a5e9558dc7 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/chrono/test/BUILD.bazel @@ -0,0 +1,20 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "clock_test", + srcs = ["ClockTest.cpp"], + deps = [ + "//folly/chrono:clock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "conv_test", + srcs = ["ConvTest.cpp"], + deps = [ + "//folly/chrono:conv", + "//folly/portability:gtest", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/BUILD.bazel new file mode 100644 index 00000000000..1cadfe4e510 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/BUILD.bazel @@ -0,0 +1,29 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "program_options", + srcs = [ + "NestedCommandLineApp.cpp", + "ProgramOptions.cpp", + ], + hdrs = [ + "NestedCommandLineApp.h", + "ProgramOptions.h", + ], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:file_util", + "//folly:format", + "//folly:optional", + "//folly:portability", + "//folly:string", + "//folly/experimental/io:fs_util", + "//folly/portability:gflags", + "@boost.program_options", + "@gflags", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/test/BUILD.bazel new file mode 100644 index 00000000000..c6c65b4a4e1 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/cli/test/BUILD.bazel @@ -0,0 +1,69 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "nested_command_line_app_test", + srcs = ["NestedCommandLineAppTest.cpp"], + env = { + "FOLLY_NESTED_CMDLINE_HELPER": "$(rootpath :nested_command_line_app_test_helper)", + }, + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":nested_command_line_app_test_helper", + "//folly:subprocess", + "//folly/cli:program_options", + "//folly/experimental/io:fs_util", + "//folly/portability:gtest", + "@glog", + ], +) + +cc_binary( + name = "nested_command_line_app_test_helper", + srcs = ["NestedCommandLineAppTestHelper.cpp"], + deps = [ + "//folly/cli:program_options", + "//folly/portability:gflags", + ], +) + +cpp_unittest( + name = "program_options_test", + srcs = ["ProgramOptionsTest.cpp"], + env = { + "FOLLY_PROGRAM_OPTIONS_TEST_HELPER": "$(rootpath :program_options_test_helper)", + }, + deps = [ + ":program_options_test_helper", + "//folly:file_util", + "//folly:subprocess", + "//folly/cli:program_options", + "//folly/experimental/io:fs_util", + "//folly/portability:gtest", + "@glog", + ], +) + +cc_binary( + name = "program_options_test_helper", + srcs = ["ProgramOptionsTestHelper.cpp"], + deps = [ + "//folly:conv", + "//folly/cli:program_options", + "@glog", + ], +) + +cc_binary( + name = "nested_command_line_app_example", + srcs = ["NestedCommandLineAppExample.cpp"], + deps = [ + "//folly:scope_guard", + "//folly:string", + "//folly/cli:program_options", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/BUILD.bazel new file mode 100644 index 00000000000..809a3c70871 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/BUILD.bazel @@ -0,0 +1,124 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "compression", + srcs = [ + "Compression.cpp", + "Zlib.cpp", + "Zstd.cpp", + ], + hdrs = [ + "Compression.h", + "Utils.h", + "Zlib.h", + "Zstd.h", + ], + local_defines = [ + # NOTE: This is defined in lz4_hc/lz4hc.h + # "LZ4_STATIC_LINKING_ONLY", + "LZ4_HC_STATIC_LINKING_ONLY", + "LZ4F_STATIC_LINKING_ONLY", + ], + deps = [ + ":compression_context_pool_singletons", + "//folly:conv", + "//folly:memory", + "//folly:optional", + "//folly:portability", + "//folly:random", + "//folly:range", + "//folly:scope_guard", + "//folly:stop_watch", + "//folly:varint", + "//folly/io:iobuf", + "//folly/lang:bits", + "//folly/portability:windows", + "@bzip2//:bz2", + "@glog", + "@lz4", + "@lz4//:lz4_frame", + "@lz4//:lz4_hc", + "@snappy", + "@xz//:lzma", + "@zlib", + "@zstd", + ], +) + +cpp_library( + name = "compression_context_pool", + hdrs = [ + "CompressionContextPool.h", + "CompressionCoreLocalContextPool.h", + ], + deps = [ + "//folly:memory", + "//folly:synchronized", + "//folly/concurrency:cache_locality", + ], +) + +cpp_library( + name = "compression_context_pool_singletons", + srcs = ["CompressionContextPoolSingletons.cpp"], + hdrs = ["CompressionContextPoolSingletons.h"], + deps = [ + ":compression_context_pool", + "//folly:portability", + "//folly/memory:jemalloc_huge_page_allocator", + "//folly/memory:malloc", + "//folly/portability:config", + "@zstd", + ], +) + +cpp_library( + name = "quotient_multiset", + srcs = [ + "QuotientMultiSet.cpp", + ], + hdrs = [ + "QuotientMultiSet.h", + "QuotientMultiSet-inl.h", + ], + deps = [ + "//folly:format", + "//folly:math", + "//folly:portability", + "//folly:range", + "//folly/compression:instructions", + "//folly/compression:select64", + "//folly/io:iobuf", + "//folly/lang:bits", + "//folly/lang:bits_class", + "//folly/lang:safe_assert", + "@glog", + ], +) + +cpp_library( + name = "instructions", + hdrs = ["Instructions.h"], + deps = [ + "//folly:cpu_id", + "//folly:portability", + "//folly/lang:assume", + "//folly/portability:builtins", + "@glog", + ], +) + +cpp_library( + name = "select64", + srcs = ["Select64.cpp"], + hdrs = ["Select64.h"], + deps = [ + ":instructions", + "//folly:constexpr_math", + "//folly:portability", + "//folly:utility", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/BUILD.bazel new file mode 100644 index 00000000000..ded7a1d947d --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/BUILD.bazel @@ -0,0 +1,40 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "coding_detail", + hdrs = ["CodingDetail.h"], +) + +cpp_library( + name = "bit_vector_coding", + hdrs = ["BitVectorCoding.h"], + deps = [ + "//folly:likely", + "//folly:portability", + "//folly:range", + "//folly/compression:instructions", + "//folly/compression:select64", + "//folly/compression/elias_fano:coding_detail", + "//folly/lang:bits", + "//folly/lang:bits_class", + "@glog", + ], +) + +cpp_library( + name = "elias_fano_coding", + hdrs = ["EliasFanoCoding.h"], + deps = [ + "//folly:likely", + "//folly:portability", + "//folly:range", + "//folly/compression:instructions", + "//folly/compression:select64", + "//folly/compression/elias_fano:coding_detail", + "//folly/lang:assume", + "//folly/lang:bits", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/test/BUILD.bazel new file mode 100644 index 00000000000..2a61e84ade7 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/elias_fano/test/BUILD.bazel @@ -0,0 +1,28 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "bitvector_test", + srcs = ["BitVectorCodingTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:portability", + "//folly/compression:select64", + "//folly/compression/elias_fano:bit_vector_coding", + "//folly/experimental/test:coding_test_utils", + "//folly/init", + ], +) + +cpp_unittest( + name = "eliasfano_test", + size = "large", + srcs = ["EliasFanoCodingTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:random", + "//folly/compression:select64", + "//folly/compression/elias_fano:elias_fano_coding", + "//folly/experimental/test:coding_test_utils", + "//folly/init", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/test/BUILD.bazel new file mode 100644 index 00000000000..878c3d579b6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/compression/test/BUILD.bazel @@ -0,0 +1,110 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "compression_test", + size = "enormous", + srcs = ["CompressionTest.cpp"], + deps = [ + "//folly:random", + "//folly:varint", + "//folly/compression", + "//folly/hash", + "//folly/io:iobuf", + "//folly/portability:gtest", + "@glog", + "@zstd", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "compression_context_pool_test", +# srcs = [ +# "CompressionContextPoolTest.cpp", +# ], +# deps = [ +# "//folly/compression:compression_context_pool", +# "//folly/compression:compression_context_pool_singletons", +# "//folly/portability:gtest", +# ], +# ) + +cc_binary( + name = "quotient_multiset_benchmark", + srcs = [ + "QuotientMultiSetBenchmark.cpp", + ], + deps = [ + "//folly:benchmark", + "//folly:format", + "//folly:random", + "//folly:string", + "//folly/compression:quotient_multiset", + "//folly/compression/elias_fano:elias_fano_coding", + "//folly/container:enumerate", + "//folly/container:f14_hash", + "//folly/container:foreach", + "//folly/experimental/test:coding_test_utils", + "//folly/init", + "@boost.sort", + ], +) + +cpp_unittest( + name = "quotient_multiset_test", + srcs = [ + "QuotientMultiSetTest.cpp", + ], + deps = [ + "//folly:format", + "//folly:random", + "//folly/compression:quotient_multiset", + "//folly/container:enumerate", + "//folly/io:iobuf", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "instructions_test", + srcs = ["InstructionsTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/compression:instructions", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "select64_test", + srcs = ["Select64Test.cpp"], + deps = [ + "//folly/compression:instructions", + "//folly/compression:select64", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "coding_test_utils", + srcs = ["CodingTestUtils.cpp"], + hdrs = ["CodingTestUtils.h"], + deps = [ + "//folly:benchmark", + "//folly:likely", + "//folly:optional", + "//folly/compression:instructions", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/BUILD.bazel new file mode 100644 index 00000000000..3b11ef2a5d6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/BUILD.bazel @@ -0,0 +1,167 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "cache_locality", + srcs = ["CacheLocality.cpp"], + hdrs = ["CacheLocality.h"], + linkopts = select({ + "@platforms//os:linux": ["-ldl"], + "//conditions:default": [], + }), + deps = [ + "//folly:indestructible", + "//folly:likely", + "//folly:memory", + "//folly:portability", + "//folly:scope_guard", + "//folly/detail:static_singleton_manager", + "//folly/hash", + "//folly/lang:align", + "//folly/lang:exception", + "//folly/portability:unistd", + "//folly/synchronization:atomic_ref", + "//folly/system:thread_id", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "atomic_shared_ptr", + hdrs = [ + "AtomicSharedPtr.h", + "detail/AtomicSharedPtr-detail.h", + ], + deps = [ + "//folly:packed_sync_ptr", + "//folly/lang:safe_assert", + "//folly/memory:sanitize_leak", + "//folly/synchronization:atomic_struct", + "//folly/synchronization:atomic_util", + "//folly/synchronization/detail:atomic_utils", + ], +) + +cpp_library( + name = "core_cached_shared_ptr", + hdrs = ["CoreCachedSharedPtr.h"], + deps = [ + ":cache_locality", + "//folly:cpp_attributes", + "//folly:portability", + "//folly:unit", + "//folly/synchronization:hazptr", + ], +) + +cpp_library( + name = "concurrent_hash_map", + hdrs = [ + "ConcurrentHashMap.h", + "detail/ConcurrentHashMap-detail.h", + ], + deps = [ + "//folly:optional", + "//folly/container:heterogeneous_access", + "//folly/container/detail:f14_mask", + "//folly/lang:exception", + "//folly/synchronization:hazptr", + ], +) + +cpp_library( + name = "dynamic_bounded_queue", + hdrs = [ + "DynamicBoundedQueue.h", + ], + deps = [ + ":cache_locality", + ":unbounded_queue", + "@glog", + ], +) + +cpp_library( + name = "priority_unbounded_queue_set", + hdrs = [ + "PriorityUnboundedQueueSet.h", + ], + deps = [ + ":unbounded_queue", + "//folly:memory", + "//folly/lang:align", + ], +) + +cpp_library( + name = "unbounded_queue", + hdrs = [ + "UnboundedQueue.h", + ], + deps = [ + ":cache_locality", + "//folly:constexpr_math", + "//folly:optional", + "//folly:traits", + "//folly/lang:align", + "//folly/synchronization:hazptr", + "//folly/synchronization:saturating_semaphore", + "//folly/synchronization:wait_options", + "//folly/synchronization/detail:spin", + "@glog", + ], +) + +cpp_library( + name = "deadlock_detector", + srcs = ["DeadlockDetector.cpp"], + hdrs = [ + "DeadlockDetector.h", + ], + deps = [ + "//folly:executor", + "//folly/executors:queue_observer", + ], +) + +cpp_library( + name = "thread_cached_synchronized", + hdrs = ["ThreadCachedSynchronized.h"], + deps = [ + "//folly:shared_mutex", + "//folly:thread_local", + "//folly:utility", + "//folly/lang:access", + "//folly/synchronization:lock", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_library( + name = "process_local_unique_id", + srcs = ["ProcessLocalUniqueId.cpp"], + hdrs = ["ProcessLocalUniqueId.h"], + deps = [ + "//folly:likely", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_library( + name = "singleton_relaxed_counter", + hdrs = [ + "SingletonRelaxedCounter.h", + ], + deps = [ + "//folly:likely", + "//folly:portability", + "//folly:synchronized", + "//folly:utility", + "//folly/detail:static_singleton_manager", + "//folly/detail:thread_local_globals", + "//folly/lang:safe_assert", + "//folly/synchronization:atomic_ref", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/BUILD.bazel new file mode 100644 index 00000000000..cf215e2f078 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/BUILD.bazel @@ -0,0 +1,72 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_grow_array", + hdrs = [ + "atomic_grow_array.h", + ], + deps = [ + "//folly:c_portability", + "//folly:constexpr_math", + "//folly:likely", + "//folly:scope_guard", + "//folly/container:span", + "//folly/lang:align", + "//folly/lang:bits", + "//folly/lang:new", + ], +) + +cpp_library( + name = "relaxed_concurrent_priority_queue", + hdrs = [ + "RelaxedConcurrentPriorityQueue.h", + ], + deps = [ + "//folly:random", + "//folly:spin_lock", + "//folly:thread_local", + "//folly/detail:futex", + "//folly/lang:align", + "//folly/synchronization:hazptr", + "//folly/synchronization:wait_options", + "//folly/synchronization/detail:spin", + ], +) + +cpp_library( + name = "lock_free_ring_buffer", + hdrs = ["LockFreeRingBuffer.h"], + deps = [ + "//folly:portability", + "//folly:traits", + "//folly/detail:turn_sequencer", + "//folly/portability:unistd", + "//folly/synchronization:sanitize_thread", + "@boost.utility", + ], +) + +cpp_library( + name = "flat_combining_priority_queue", + hdrs = ["FlatCombiningPriorityQueue.h"], + deps = [ + "//folly:optional", + "//folly/detail:futex", + "//folly/synchronization:flat_combining", + "@glog", + ], +) + +cpp_library( + name = "single_writer_fixed_hash_map", + hdrs = [ + "SingleWriterFixedHashMap.h", + ], + deps = [ + "//folly/lang:bits", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/test/BUILD.bazel new file mode 100644 index 00000000000..7fafca88cff --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/container/test/BUILD.bazel @@ -0,0 +1,69 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "atomic_grow_array_test", +# srcs = ["atomic_grow_array_test.cpp"], +# deps = [ +# "//folly/concurrency/container:atomic_grow_array", +# "//folly/lang:keep", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "relaxed_concurrent_priority_queue_test", + srcs = ["RelaxedConcurrentPriorityQueueTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly:spin_lock", + "//folly/concurrency/container:flat_combining_priority_queue", + "//folly/concurrency/container:relaxed_concurrent_priority_queue", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/test:deterministic_schedule", + "@boost.thread", + "@glog", + ], +) + +cpp_unittest( + name = "lock_free_ring_buffer_test", + srcs = ["LockFreeRingBufferTest.cpp"], + deps = [ + "//folly/concurrency/container:lock_free_ring_buffer", + "//folly/portability:gtest", + "//folly/test:deterministic_schedule", + ], +) + +cpp_unittest( + name = "flat_combining_priority_queue_test", + srcs = ["FlatCombiningPriorityQueueTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly/concurrency/container:flat_combining_priority_queue", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "single_writer_fixed_hash_map_test", + srcs = ["SingleWriterFixedHashMapTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly/concurrency/container:single_writer_fixed_hash_map", + "//folly/container:array", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization/test:barrier", + "@boost.thread", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/BUILD.bazel new file mode 100644 index 00000000000..d329ccc4b34 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/BUILD.bazel @@ -0,0 +1,49 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_read_mostly_main_ptr", + srcs = [ + "AtomicReadMostlyMainPtr.cpp", + ], + hdrs = [ + "AtomicReadMostlyMainPtr.h", + ], + deps = [ + "//folly:indestructible", + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/executors:inline_executor", + "//folly/synchronization:rcu", + ], +) + +cpp_library( + name = "read_mostly_shared_ptr", + hdrs = ["ReadMostlySharedPtr.h"], + deps = [ + "//folly:function", + "//folly/concurrency/memory:tl_ref_count", + ], +) + +cpp_library( + name = "primary_ptr", + hdrs = ["PrimaryPtr.h"], + deps = [ + "//folly:function", + "//folly/futures:cleanup", + "//folly/futures:core", + "@glog", + ], +) + +cpp_library( + name = "tl_ref_count", + hdrs = ["TLRefCount.h"], + deps = [ + "//folly:thread_local", + "//folly/synchronization:asymmetric_thread_fence", + "//folly/synchronization/detail:sleeper", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/test/BUILD.bazel new file mode 100644 index 00000000000..ec50f0a76b5 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/memory/test/BUILD.bazel @@ -0,0 +1,64 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "atomic_read_mostly_main_ptr_test", + srcs = ["AtomicReadMostlyMainPtrTest.cpp"], + target_compatible_with = select({ + # TODO: flaky on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/concurrency/memory:atomic_read_mostly_main_ptr", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "read_mostly_shared_ptr_stress_test", + size = "medium", + srcs = ["ReadMostlySharedPtrStressTest.cpp"], + deps = [ + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "read_mostly_shared_ptr_test", + srcs = ["ReadMostlySharedPtrTest.cpp"], + deps = [ + "//folly:memory", + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "primary_ptr_test", + srcs = ["PrimaryPtrTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/concurrency/memory:primary_ptr", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:manual_executor", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "ref_count_test", + srcs = ["RefCountTest.cpp"], + deps = [ + "//folly/concurrency/memory:tl_ref_count", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/synchronization/test:barrier", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/test/BUILD.bazel new file mode 100644 index 00000000000..000712b0603 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/concurrency/test/BUILD.bazel @@ -0,0 +1,200 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +# TODO(kgk): Fix test. +# cc_binary( +# name = "cache_locality_benchmark", +# srcs = ["CacheLocalityBenchmark.cpp"], +# deps = [ +# "//folly:benchmark", +# "//folly/concurrency:cache_locality", +# "//folly/lang:keep", +# "@glog", +# ], +# ) + +cpp_unittest( + name = "cache_locality_test", + srcs = ["CacheLocalityTest.cpp"], + deps = [ + "//folly/concurrency:cache_locality", + "//folly/portability:gtest", + "//folly/portability:sys_resource", + "//folly/portability:unistd", + "//folly/test:test_utils", + "@fmt", + "@glog", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "atomic_shared_ptr_test", +# srcs = [ +# "AtomicSharedPtrCounted.h", +# "AtomicSharedPtrTest.cpp", +# ], +# deps = [ +# "//folly:portability", +# "//folly/concurrency:atomic_shared_ptr", +# "//folly/portability:config", +# "//folly/portability:gflags", +# "//folly/portability:gtest", +# "//folly/test:deterministic_schedule", +# "@glog", +# ], +# ) + +cc_binary( + name = "atomic_shared_ptr_performance", + srcs = ["AtomicSharedPtrPerformance.cpp"], + deps = [ + "//folly/concurrency:atomic_shared_ptr", + "//folly/portability:config", + ], +) + +cpp_unittest( + name = "core_cached_shared_ptr_test", + srcs = ["CoreCachedSharedPtrTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:portability", + "//folly/concurrency:atomic_shared_ptr", + "//folly/concurrency:core_cached_shared_ptr", + "//folly/concurrency:thread_cached_synchronized", + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/portability:config", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "concurrent_hash_map_test", +# srcs = ["ConcurrentHashMapTest.cpp"], +# deps = [ +# "//folly:traits", +# "//folly/concurrency:concurrent_hash_map", +# "//folly/container/test:tracking_types", +# "//folly/hash", +# "//folly/portability:gflags", +# "//folly/portability:gtest", +# "//folly/synchronization:latch", +# "//folly/test:deterministic_schedule", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "concurrent_hash_map_test_no_simd", +# srcs = ["ConcurrentHashMapTest.cpp"], +# local_defines = ["FOLLY_F14_FORCE_FALLBACK=1"], +# deps = [ +# "//folly:traits", +# "//folly/concurrency:concurrent_hash_map", +# "//folly/container/test:tracking_types", +# "//folly/hash", +# "//folly/portability:gflags", +# "//folly/portability:gtest", +# "//folly/synchronization:latch", +# "//folly/test:deterministic_schedule", +# ], +# ) + +cpp_unittest( + name = "dynamic_bounded_queue_test", + srcs = ["DynamicBoundedQueueTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:mpmc_queue", + "//folly:producer_consumer_queue", + "//folly/concurrency:dynamic_bounded_queue", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "priority_unbounded_queue_set_test", + srcs = ["PriorityUnboundedQueueSetTest.cpp"], + deps = [ + "//folly/concurrency:priority_unbounded_queue_set", + "//folly/container:enumerate", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "unbounded_queue_test", + srcs = ["UnboundedQueueTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:mpmc_queue", + "//folly:producer_consumer_queue", + "//folly/concurrency:unbounded_queue", + "//folly/lang:keep", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@boost.thread", + "@glog", + ], +) + +cpp_unittest( + name = "thread_cached_synchronized_test", + srcs = ["ThreadCachedSynchronizedTest.cpp"], + deps = [ + "//folly/concurrency:thread_cached_synchronized", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "process_local_unique_id_test", + srcs = ["ProcessLocalUniqueIdTest.cpp"], + deps = [ + "//folly:synchronized", + "//folly/concurrency:process_local_unique_id", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "singleton_relaxed_counter_bench", + srcs = [ + "SingletonRelaxedCounterBench.cpp", + ], + deps = [ + "//folly:benchmark", + "//folly/concurrency:singleton_relaxed_counter", + "//folly/init", + "//folly/lang:keep", + "//folly/portability:gflags", + "@boost.thread", + ], +) + +cpp_unittest( + name = "singleton_relaxed_counter_test", + srcs = [ + "SingletonRelaxedCounterTest.cpp", + ], + deps = [ + "//folly:thread_local", + "//folly/concurrency:singleton_relaxed_counter", + "//folly/portability:gtest", + "@boost.thread", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/BUILD.bazel new file mode 100644 index 00000000000..8fcdadd5a1c --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/BUILD.bazel @@ -0,0 +1,345 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "access", + hdrs = ["Access.h"], + deps = [ + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "array", + hdrs = ["Array.h"], + deps = [ + "//folly:c_portability", + "//folly:traits", + "//folly:utility", + ], +) + +cpp_library( + name = "bit_iterator", + hdrs = ["BitIterator.h"], + deps = [ + "//folly:portability", + "//folly/container/detail:bit_iterator_detail", + "//folly/lang:bits", + "@boost.iterator", + ], +) + +cpp_library( + name = "iterator", + hdrs = ["Iterator.h"], + deps = [ + ":access", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + "//folly/lang:rvalue_reference_wrapper", + ], +) + +cpp_library( + name = "enumerate", + hdrs = ["Enumerate.h"], + deps = [ + "//folly:c_portability", + "//folly/portability:sys_types", + ], +) + +cpp_library( + name = "evicting_cache_map", + hdrs = ["EvictingCacheMap.h"], + deps = [ + "//folly/container:f14_hash", + "//folly/container:heterogeneous_access", + "//folly/lang:exception", + "@boost.intrusive", + "@boost.iterator", + ], +) + +cpp_library( + name = "f14_hash", + hdrs = [ + "F14Map.h", + "F14Set.h", + ], + deps = [ + ":f14_hash_fwd", + ":iterator", + ":view", + "//folly:portability", + "//folly:range", + "//folly:traits", + "//folly/container/detail:f14_hash_detail", + "//folly/container/detail:util", + "//folly/lang:exception", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "f14_hash_fwd", + hdrs = [ + "F14Map-fwd.h", + "F14Set-fwd.h", + ], + deps = [ + "//folly/container/detail:f14_defaults", + "//folly/memory:memory_resource", + ], +) + +cpp_library( + name = "heap_vector_types", + hdrs = [ + "heap_vector_types.h", + ], + deps = [ + ":iterator", + "//folly:range", + "//folly:scope_guard", + "//folly:small_vector", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + "//folly/lang:exception", + "//folly/memory:memory_resource", + "//folly/portability:builtins", + ], +) + +cpp_library( + name = "foreach", + hdrs = [ + "Foreach.h", + ], + textual_hdrs = [ + "Foreach-inl.h", + ], + deps = [ + ":access", + "//folly:portability", + "//folly:preprocessor", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "heterogeneous_access_fwd", + hdrs = [ + "HeterogeneousAccess-fwd.h", + ], +) + +cpp_library( + name = "heterogeneous_access", + hdrs = [ + "HeterogeneousAccess.h", + ], + deps = [ + ":heterogeneous_access_fwd", + "//folly:range", + "//folly:traits", + "//folly/hash", + ], +) + +cpp_library( + name = "merge", + hdrs = ["Merge.h"], +) + +cpp_library( + name = "range_traits", + hdrs = ["range_traits.h"], + deps = [ + "//folly:traits", + "//folly:utility", + ], +) + +cpp_library( + name = "regex_match_cache", + srcs = ["RegexMatchCache.cpp"], + hdrs = ["RegexMatchCache.h"], + deps = [ + ":f14_hash", + ":reserve", + ":span", + "//folly:chrono", + "//folly:function", + "//folly:map_util", + "//folly:string", + "//folly/lang:bits", + "//folly/portability:windows", + "//folly/ssl:openssl_hash", + "//folly/synchronization:atomic_util", + "@boost.regex", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "span", + hdrs = ["span.h"], + deps = [ + ":access", + ":iterator", + "//folly:cpp_attributes", + "//folly:portability", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + "//folly/portability:constexpr", + ], +) + +cpp_library( + name = "sparse_byte_set", + hdrs = ["SparseByteSet.h"], + deps = [ + "//folly:c_portability", + ], +) + +cpp_library( + name = "tape", + hdrs = [ + "tape.h", + ], + deps = [ + ":iterator", + "//folly:portability", + "//folly:range", + "//folly/container/detail:tape_detail", + "//folly/memory:uninitialized_memory_hacks", + ], +) + +cpp_library( + name = "view", + hdrs = ["View.h"], + deps = [ + "//folly:portability", + "//folly/functional:invoke", + "//folly/lang:customization_point", + ], +) + +cpp_library( + name = "weighted_evicting_cache_map", + hdrs = [ + "WeightedEvictingCacheMap.h", + ], + deps = [ + "//folly/container:evicting_cache_map", + ], +) + +cpp_library( + name = "intrusive_heap", + hdrs = [ + "IntrusiveHeap.h", + ], + deps = [ + "//folly:portability", + "@boost.core", + "@boost.intrusive", + "@glog", + ], +) + +cpp_library( + name = "reserve", + hdrs = [ + "Reserve.h", + ], + deps = [ + "//folly:likely", + "//folly:traits", + "//folly:utility", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "sorted_vector_types", + hdrs = [ + "sorted_vector_types.h", + ], + deps = [ + "//folly:scope_guard", + "//folly:traits", + "//folly:utility", + "//folly/lang:access", + "//folly/lang:exception", + "//folly/memory:memory_resource", + ], +) + +cpp_library( + name = "fbvector", + hdrs = ["FBVector.h"], + deps = [ + "//folly:format_traits", + "//folly:likely", + "//folly:scope_guard", + "//folly:traits", + "//folly/lang:checked_math", + "//folly/lang:exception", + "//folly/lang:hint", + "//folly/memory:malloc", + ], +) + +cpp_library( + name = "intrusive_list", + hdrs = ["IntrusiveList.h"], + deps = [ + "@boost.intrusive", + ], +) + +cpp_library( + name = "map_util", + hdrs = ["MapUtil.h"], + deps = [ + "//folly:optional", + "//folly:range", + "//folly/functional:invoke", + "@fmt", + ], +) + +cpp_library( + name = "small_vector", + hdrs = ["small_vector.h"], + deps = [ + "//folly:constexpr_math", + "//folly:format_traits", + "//folly:likely", + "//folly:portability", + "//folly:scope_guard", + "//folly:traits", + "//folly/functional:invoke", + "//folly/hash", + "//folly/lang:align", + "//folly/lang:assume", + "//folly/lang:checked_math", + "//folly/lang:exception", + "//folly/memory:malloc", + "//folly/memory:sanitize_leak", + "//folly/portability:malloc", + "@boost.utility", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/BUILD.bazel new file mode 100644 index 00000000000..f3c8cfb7dd9 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/BUILD.bazel @@ -0,0 +1,113 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "bit_iterator_detail", + hdrs = ["BitIteratorDetail.h"], + deps = [ + "//folly/portability:sys_types", + "@boost.iterator", + ], +) + +cpp_library( + name = "f14_intrinsics_availability", + hdrs = [ + "F14IntrinsicsAvailability.h", + ], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "f14_defaults", + hdrs = [ + "F14Defaults.h", + ], + deps = [ + "//folly/container:heterogeneous_access_fwd", + ], +) + +cpp_library( + name = "f14_hash_detail", + srcs = [ + "F14Table.cpp", + ], + hdrs = [ + "F14MapFallback.h", + "F14Policy.h", + "F14SetFallback.h", + "F14Table.h", + ], + deps = [ + ":f14_defaults", + ":f14_intrinsics_availability", + ":f14_mask", + ":util", + "//folly:bits", + "//folly:constexpr_math", + "//folly:likely", + "//folly:memory", + "//folly:optional", + "//folly:portability", + "//folly:scope_guard", + "//folly:traits", + "//folly:unit", + "//folly/container:heterogeneous_access", + "//folly/functional:invoke", + "//folly/hash", + "//folly/lang:align", + "//folly/lang:assume", + "//folly/lang:exception", + "//folly/lang:pretty", + "//folly/lang:safe_assert", + "//folly/memory:malloc", + "//folly/portability:builtins", + ], +) + +cpp_library( + name = "f14_mask", + hdrs = [ + "F14Mask.h", + ], + deps = [ + ":f14_intrinsics_availability", + "//folly:bits", + "//folly:constexpr_math", + "//folly:likely", + "//folly:portability", + "//folly/lang:assume", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "tape_detail", + hdrs = [ + "tape_detail.h", + ], + deps = [ + "//folly:portability", + "//folly:range", + "//folly/container:iterator", + "//folly/container:range_traits", + "//folly/lang:hint", + "//folly/memory:uninitialized_memory_hacks", + ], +) + +cpp_library( + name = "util", + hdrs = [ + "Util.h", + ], + deps = [ + "//folly:traits", + "//folly/container:iterator", + "//folly/functional:apply_tuple", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/test/BUILD.bazel new file mode 100644 index 00000000000..5870978c8c9 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/detail/test/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "f14_detail_test", + srcs = [ + "F14DetailTest.cpp", + ], + deps = [ + "//folly/container/detail:f14_hash_detail", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/test/BUILD.bazel new file mode 100644 index 00000000000..53bfbbbdc62 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/container/test/BUILD.bazel @@ -0,0 +1,486 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "access_test", + srcs = ["AccessTest.cpp"], + deps = [ + "//folly/container:access", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "array_test", + srcs = ["ArrayTest.cpp"], + deps = [ + "//folly/container:array", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "bit_iterator_test", + srcs = ["BitIteratorTest.cpp"], + deps = [ + "//folly/container:bit_iterator", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "enumerate_test", + srcs = ["EnumerateTest.cpp"], + deps = [ + "//folly:range", + "//folly/container:enumerate", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "evicting_cache_map_test", + srcs = ["EvictingCacheMapTest.cpp"], + deps = [ + "//folly/container:evicting_cache_map", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "f14_test_util", + hdrs = [ + "F14TestUtil.h", + ], + deps = [ + "//folly/container/detail:f14_hash_detail", + ], +) + +cpp_unittest( + name = "f14_fwd_test", + srcs = [ + "F14FwdTest.cpp", + ], + deps = [ + "//folly/container:f14_hash_fwd", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "f14_map_test", + size = "medium", + srcs = [ + "F14MapTest.cpp", + ], + deps = [ + ":f14_test_util", + ":tracking_types", + "//folly:benchmark", + "//folly:conv", + "//folly:fbstring", + "//folly:portability", + "//folly/container:f14_hash", + "//folly/hash", + "//folly/portability:gtest", + "//folly/test:test_utils", + "@glog", + ], +) + +cpp_unittest( + name = "f14_map_fallback_test", + srcs = [ + "F14MapTest.cpp", + ], + local_defines = ["FOLLY_F14_FORCE_FALLBACK"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":f14_test_util", + ":tracking_types", + "//folly:benchmark", + "//folly:conv", + "//folly:fbstring", + "//folly:portability", + "//folly/container:f14_hash", + "//folly/hash", + "//folly/portability:gtest", + "//folly/test:test_utils", + "@glog", + ], +) + +cpp_unittest( + name = "f14_policy_test", + srcs = [ + "F14PolicyTest.cpp", + ], + deps = [ + "//folly/container:f14_hash", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "f14_set_test", +# srcs = [ +# "F14SetTest.cpp", +# ], +# deps = [ +# ":f14_test_util", +# ":tracking_types", +# "//folly:benchmark", +# "//folly:conv", +# "//folly:fbstring", +# "//folly:portability", +# "//folly/container:f14_hash", +# "//folly/lang:keep", +# "//folly/portability:gtest", +# "//folly/test:test_utils", +# "@glog", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "f14_set_fallback_test", +# srcs = [ +# "F14SetTest.cpp", +# ], +# local_defines = ["FOLLY_F14_FORCE_FALLBACK=1"], +# deps = [ +# ":f14_test_util", +# ":tracking_types", +# "//folly:benchmark", +# "//folly:conv", +# "//folly:fbstring", +# "//folly:portability", +# "//folly/container:f14_hash", +# "//folly/lang:keep", +# "//folly/portability:gtest", +# "//folly/test:test_utils", +# "@glog", +# ], +# ) + +cpp_unittest( + name = "heap_vector_types_test", + srcs = ["heap_vector_types_test.cpp"], + deps = [ + "//folly:random", + "//folly:range", + "//folly:small_vector", + "//folly:sorted_vector_types", + "//folly:utility", + "//folly/container:heap_vector_types", + "//folly/memory:malloc", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "f14_interprocess_test", +# srcs = [ +# "F14InterprocessTest.cpp", +# ], +# linkopts = select({ +# "@platforms//os:windows": [], +# "//conditions:default": ["-lrt"], +# }), +# deps = [ +# "//folly:random", +# "//folly:traits", +# "//folly/container:f14_hash", +# "//folly/portability:gtest", +# "@boost.interprocess", +# "@fmt", +# ], +# ) + +cc_binary( + name = "f14_small_overheads", + srcs = [ + "F14SmallOverheads.cpp", + ], + deps = [ + "//folly/container:f14_hash", + ], +) + +cpp_unittest( + name = "f14_asan_support_test", + srcs = [ + "F14AsanSupportTest.cpp", + ], + deps = [ + "//folly:portability", + "//folly/container:f14_hash", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "foreach_test", + srcs = ["ForeachTest.cpp"], + deps = [ + "//folly/container:foreach", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "heterogeneous_access_test", + srcs = [ + "HeterogeneousAccessTest.cpp", + ], + target_compatible_with = select({ + # Test relies on char_traits, which isn't available on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:fbstring", + "//folly:portability", + "//folly:range", + "//folly:small_vector", + "//folly:traits", + "//folly/container:heterogeneous_access", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "iterator_test", + srcs = ["IteratorTest.cpp"], + deps = [ + "//folly/container:iterator", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "merge_test", + srcs = ["MergeTest.cpp"], + deps = [ + "//folly/container:merge", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "range_traits_test", + srcs = ["range_traits_test.cpp"], + deps = [ + "//folly/container:range_traits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "regex_match_cache_test", + srcs = ["RegexMatchCacheTest.cpp"], + deps = [ + "//folly:portability", + "//folly:utility", + "//folly/container:f14_hash", + "//folly/container:regex_match_cache", + "//folly/container:sorted_vector_types", + "//folly/container:span", + "//folly/lang:keep", + "//folly/portability:gmock", + "//folly/portability:gtest", + "@fmt", + ], +) + +cpp_unittest( + name = "span_test", + srcs = ["span_test.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/container:span", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "sparse_byte_set_test", + srcs = ["SparseByteSetTest.cpp"], + deps = [ + "//folly/container:sparse_byte_set", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "tracking_types", + hdrs = [ + "TrackingTypes.h", + ], + deps = [ + "//folly:function", + "//folly/hash", + "//folly/lang:safe_assert", + "//folly/portability:asm", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "tape_test", +# srcs = ["tape_test.cpp"], +# deps = [ +# "//folly:small_vector", +# "//folly/container:tape", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "tape_bench", + srcs = ["tape_bench.cpp"], + deps = [ + "//folly:benchmark", + "//folly/container:tape", + "//folly/init", + ], +) + +cpp_unittest( + name = "util_test", + srcs = ["UtilTest.cpp"], + deps = [ + "//folly:optional", + "//folly:range", + "//folly/container/detail:util", + "//folly/container/test:tracking_types", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "weighted_evicting_cache_map_test", + srcs = ["WeightedEvictingCacheMapTest.cpp"], + deps = [ + "//folly/container:weighted_evicting_cache_map", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "intrusive_heap_test", + srcs = ["IntrusiveHeapTest.cpp"], + deps = [ + "//folly:random", + "//folly/container:intrusive_heap", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "hash_maps_bench", + srcs = ["HashMapsBench.cpp"], + target_compatible_with = select({ + # Uses functions that are not available on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:benchmark", + "//folly:conv", + "//folly:format", + "//folly:function", + "//folly/container:f14_hash", + "//folly/hash", + "//folly/init", + "//folly/portability:gflags", + "@glog", + ], +) + +cpp_unittest( + name = "reserve_test", + srcs = ["ReserveTest.cpp"], + deps = [ + "//folly/container:f14_hash", + "//folly/container:reserve", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "fbvector_test", + srcs = [ + "FBVectorTest.cpp", + "FBVectorTests.cpp.h", + ], + deps = [ + "//folly:fbstring", + "//folly:fbvector", + "//folly:random", + "//folly:traits", + "//folly/container:foreach", + "//folly/portability:gtest", + "//folly/test:fbvector_test_util", + ], +) + +cpp_unittest( + name = "map_util_test", + srcs = ["MapUtilTest.cpp"], + deps = [ + "//folly:map_util", + "//folly:sorted_vector_types", + "//folly:traits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "small_vector_test", + srcs = ["small_vector_test.cpp"], + deps = [ + "//folly:conv", + "//folly:small_vector", + "//folly:sorted_vector_types", + "//folly:traits", + "//folly/container:iterator", + "//folly/portability:gtest", + "@boost.algorithm", + "@fmt", + ], +) + +cpp_unittest( + name = "sorted_vector_types_test", + srcs = ["sorted_vector_test.cpp"], + deps = [ + "//folly:optional", + "//folly:range", + "//folly:small_vector", + "//folly:sorted_vector_types", + "//folly:utility", + "//folly/memory:malloc", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/BUILD.bazel new file mode 100644 index 00000000000..0bd912a5b43 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/BUILD.bazel @@ -0,0 +1,717 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "accumulate", + hdrs = [ + "Accumulate.h", + ], + textual_hdrs = [ + "Accumulate-inl.h", + ], + deps = [ + "//folly/coro:async_generator", + "//folly/coro:coroutine", + "//folly/coro:task", + ], +) + +cpp_library( + name = "async_generator", + srcs = [], + hdrs = ["AsyncGenerator.h"], + deps = [ + "//folly:cancellation_token", + "//folly:exception_wrapper", + "//folly:traits", + "//folly:try", + "//folly/coro:auto_cleanup_fwd", + "//folly/coro:coroutine", + "//folly/coro:current_executor", + "//folly/coro:detail_malloc", + "//folly/coro:detail_manual_lifetime", + "//folly/coro:invoke", + "//folly/coro:result", + "//folly/coro:scope_exit", + "//folly/coro:via_if_async", + "//folly/coro:with_async_stack", + "//folly/coro:with_cancellation", + "//folly/tracing:async_stack", + "@glog", + ], +) + +cpp_library( + name = "async_pipe", + hdrs = ["AsyncPipe.h"], + deps = [ + "//folly:try", + "//folly/coro:async_generator", + "//folly/coro:coroutine", + "//folly/coro:invoke", + "//folly/coro:small_unbounded_queue", + "//folly/coro:via_if_async", + "//folly/fibers:semaphore", + ], +) + +cpp_library( + name = "async_scope", + hdrs = ["AsyncScope.h"], + deps = [ + "//folly:cancellation_token", + "//folly:exception_wrapper", + "//folly/coro:coroutine", + "//folly/coro:current_executor", + "//folly/coro:detail_barrier", + "//folly/coro:detail_barrier_task", + "//folly/coro:task", + "//folly/futures:core", + "//folly/portability:source_location", + "@glog", + ], +) + +cpp_library( + name = "async_stack", + hdrs = ["AsyncStack.h"], + deps = [ + "//folly:executor", + "//folly/coro:coroutine", + "//folly/coro:with_async_stack", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "baton", + srcs = ["Baton.cpp"], + hdrs = ["Baton.h"], + deps = [ + "//folly:try", + "//folly/coro:coroutine", + "//folly/synchronization:atomic_util", + ], +) + +cpp_library( + name = "blocking_wait", + hdrs = ["BlockingWait.h"], + deps = [ + "//folly:try", + "//folly/coro:coroutine", + "//folly/coro:detail_malloc", + "//folly/coro:detail_traits", + "//folly/coro:task", + "//folly/coro:traits", + "//folly/coro:via_if_async", + "//folly/coro:with_async_stack", + "//folly/executors:manual_executor", + "//folly/fibers:core", + "//folly/synchronization:baton", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "collect", + hdrs = [ + "Collect.h", + ], + textual_hdrs = [ + "Collect-inl.h", + ], + deps = [ + "//folly:cancellation_token", + "//folly:exception_wrapper", + "//folly:try", + "//folly:unit", + "//folly/container:access", + "//folly/container:iterator", + "//folly/coro:async_generator", + "//folly/coro:async_pipe", + "//folly/coro:async_scope", + "//folly/coro:coroutine", + "//folly/coro:detail_barrier", + "//folly/coro:detail_barrier_task", + "//folly/coro:detail_current_async_frame", + "//folly/coro:detail_helpers", + "//folly/coro:detail_traits", + "//folly/coro:mutex", + "//folly/coro:task", + "//folly/coro:via_if_async", + ], +) + +cpp_library( + name = "concat", + hdrs = [ + "Concat.h", + ], + textual_hdrs = [ + "Concat-inl.h", + ], + deps = [ + "//folly/coro:async_generator", + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "coroutine", + hdrs = ["Coroutine.h"], + deps = [ + "//folly:portability", + "//folly:utility", + ], +) + +cpp_library( + name = "current_executor", + hdrs = ["CurrentExecutor.h"], + deps = [ + "//folly:executor", + "//folly/coro:coroutine", + "//folly/coro:via_if_async", + "//folly/coro:with_async_stack", + "//folly/io/async:request_context", + ], +) + +cpp_library( + name = "detach_on_cancel", + hdrs = ["DetachOnCancel.h"], + deps = [ + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:detail_helpers", + "//folly/coro:invoke", + "//folly/coro:task", + "//folly/coro:traits", + ], +) + +cpp_library( + name = "detail_barrier", + hdrs = ["detail/Barrier.h"], + deps = [ + ":coroutine", + ":traits", + ":with_async_stack", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "detail_barrier_task", + hdrs = ["detail/BarrierTask.h"], + deps = [ + ":coroutine", + ":detail_barrier", + ":detail_malloc", + ":with_async_stack", + ], +) + +cpp_library( + name = "detail_current_async_frame", + hdrs = ["detail/CurrentAsyncFrame.h"], + deps = [ + ":coroutine", + ":with_async_stack", + "//folly:executor", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "detail_helpers", + hdrs = ["detail/Helpers.h"], + deps = [ + ":coroutine", + "//folly:executor", + "//folly:singleton_thread_local", + "//folly/io/async:request_context", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "detail_malloc", + srcs = ["detail/Malloc.cpp"], + hdrs = ["detail/Malloc.h"], + deps = [ + "//folly:c_portability", + "//folly/lang:hint", + "//folly/lang:new", + ], +) + +cpp_library( + name = "detail_manual_lifetime", + hdrs = ["detail/ManualLifetime.h"], + deps = [ + "//folly:scope_guard", + ], +) + +cpp_library( + name = "detail_traits", + hdrs = ["detail/Traits.h"], + deps = [ + "//folly:traits", + ], +) + +cpp_library( + name = "filter", + hdrs = [ + "Filter.h", + ], + textual_hdrs = [ + "Filter-inl.h", + ], + deps = [ + "//folly/coro:async_generator", + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "future_util", + hdrs = ["FutureUtil.h"], + deps = [ + "//folly:cancellation_token", + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:current_executor", + "//folly/coro:invoke", + "//folly/coro:task", + "//folly/coro:traits", + "//folly/futures:core", + ], +) + +cpp_library( + name = "generator", + hdrs = ["Generator.h"], + deps = [ + "//folly/coro:coroutine", + "//folly/coro:invoke", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "gmock_helpers", + hdrs = ["GmockHelpers.h"], + deps = [ + "//folly/coro:coroutine", + "//folly/coro:gtest_helpers", + "//folly/coro:result", + "//folly/coro:task", + "//folly/portability:gmock", + ], +) + +cpp_library( + name = "gtest_helpers", + hdrs = ["GtestHelpers.h"], + deps = [ + "//folly/coro:blocking_wait", + "//folly/coro:coroutine", + "//folly/coro:task", + "//folly/debugging/exception_tracer:smart_exception_stack_trace_hooks", # @manual + "//folly/debugging/exception_tracer:smart_exception_tracer", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "inline_task", + hdrs = ["detail/InlineTask.h"], + deps = [ + ":coroutine", + ":detail_malloc", + ":with_async_stack", + "//folly:scope_guard", + "//folly:try", + "//folly/lang:assume", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "invoke", + hdrs = ["Invoke.h"], + deps = [ + "//folly/functional:invoke", + "//folly/lang:customization_point", + ], +) + +cpp_library( + name = "merge", + hdrs = [ + "Merge.h", + ], + textual_hdrs = [ + "Merge-inl.h", + ], + deps = [ + "//folly:cancellation_token", + "//folly:executor", + "//folly:scope_guard", + "//folly/coro:async_generator", + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:detail_barrier", + "//folly/coro:detail_barrier_task", + "//folly/coro:detail_current_async_frame", + "//folly/coro:detail_helpers", + "//folly/coro:mutex", + "//folly/coro:task", + "//folly/coro:via_if_async", + "//folly/coro:with_cancellation", + ], +) + +cpp_library( + name = "mutex", + srcs = ["Mutex.cpp"], + hdrs = ["Mutex.h"], + deps = [ + "//folly:executor", + "//folly/coro:coroutine", + "//folly/coro:via_if_async", + ], +) + +cpp_library( + name = "promise", + hdrs = ["Promise.h"], + deps = [ + "//folly:cancellation_token", + "//folly:try", + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/futures:core", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_library( + name = "result", + hdrs = ["Result.h"], + deps = [ + "//folly:cancellation_token", + "//folly:exception_wrapper", + "//folly:try", + ], +) + +cpp_library( + name = "retry", + hdrs = ["Retry.h"], + deps = [ + "//folly:cancellation_token", + "//folly:constexpr_math", + "//folly:exception_wrapper", + "//folly:random", + "//folly:try", + "//folly/coro:coroutine", + "//folly/coro:result", + "//folly/coro:sleep", + "//folly/coro:task", + "//folly/coro:traits", + ], +) + +cpp_library( + name = "rust_adaptors", + hdrs = ["RustAdaptors.h"], + deps = [ + "//folly:cancellation_token", + "//folly:executor", + "//folly:optional", + "//folly/coro:async_generator", + "//folly/coro:task", + "//folly/futures:core", + "//folly/synchronization:baton", + ], +) + +cpp_library( + name = "scope_exit", + hdrs = ["ScopeExit.h"], + deps = [ + "//folly:exception_wrapper", + "//folly:executor", + "//folly:scope_guard", + "//folly/coro:coroutine", + "//folly/coro:traits", + "//folly/coro:via_if_async", + "//folly/functional:invoke", + "//folly/lang:assume", + "//folly/lang:customization_point", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "shared_lock", + hdrs = ["SharedLock.h"], + deps = [ + "//folly:portability", + "//folly/coro:coroutine", + "@glog", + ], +) + +cpp_library( + name = "shared_mutex", + srcs = ["SharedMutex.cpp"], + hdrs = ["SharedMutex.h"], + deps = [ + "//folly:executor", + "//folly:spin_lock", + "//folly:synchronized", + "//folly/coro:coroutine", + "//folly/coro:shared_lock", + "//folly/coro:via_if_async", + ], +) + +cpp_library( + name = "sleep", + hdrs = [ + "Sleep.h", + ], + textual_hdrs = [ + "Sleep-inl.h", + ], + deps = [ + "//folly/coro:coroutine", + "//folly/coro:future_util", + "//folly/coro:task", + "//folly/futures:core", + ], +) + +cpp_library( + name = "small_unbounded_queue", + hdrs = ["SmallUnboundedQueue.h"], + deps = [ + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:mutex", + "//folly/coro:task", + "//folly/experimental/channels/detail:atomic_queue", + ], +) + +cpp_library( + name = "task", + hdrs = ["Task.h"], + deps = [ + "//folly:cancellation_token", + "//folly:executor", + "//folly:glog", + "//folly:portability", + "//folly:scope_guard", + "//folly:traits", + "//folly:try", + "//folly/coro:coroutine", + "//folly/coro:current_executor", + "//folly/coro:detail_malloc", + "//folly/coro:detail_traits", + "//folly/coro:inline_task", + "//folly/coro:invoke", + "//folly/coro:result", + "//folly/coro:scope_exit", + "//folly/coro:traits", + "//folly/coro:via_if_async", + "//folly/coro:with_async_stack", + "//folly/coro:with_cancellation", + "//folly/futures:core", + "//folly/io/async:request_context", + "//folly/lang:assume", + "//folly/tracing:async_stack", + "@glog", + ], +) + +cpp_library( + name = "task_wrapper", + hdrs = ["TaskWrapper.h"], + deps = [":task"], +) + +cpp_library( + name = "timed_wait", + hdrs = ["TimedWait.h"], + deps = [ + "//folly:optional", + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:detail_helpers", + "//folly/coro:invoke", + "//folly/coro:task", + "//folly/coro:traits", + "//folly/futures:core", + ], +) + +cpp_library( + name = "timeout", + hdrs = [ + "Timeout.h", + ], + textual_hdrs = [ + "Timeout-inl.h", + ], + deps = [ + "//folly:cancellation_token", + "//folly/coro:baton", + "//folly/coro:coroutine", + "//folly/coro:task", + "//folly/coro:traits", + "//folly/coro:with_cancellation", + "//folly/futures:core", + ], +) + +cpp_library( + name = "traits", + hdrs = ["Traits.h"], + deps = [ + "//folly:traits", + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "transform", + hdrs = [ + "Transform.h", + ], + textual_hdrs = [ + "Transform-inl.h", + ], + deps = [ + "//folly:traits", + "//folly/coro:async_generator", + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "unbounded_queue", + hdrs = ["UnboundedQueue.h"], + deps = [ + "//folly/concurrency:unbounded_queue", + "//folly/coro:coroutine", + "//folly/coro:task", + "//folly/fibers:semaphore", + ], +) + +cpp_library( + name = "via_if_async", + hdrs = ["ViaIfAsync.h"], + deps = [ + "//folly:executor", + "//folly:traits", + "//folly/coro:coroutine", + "//folly/coro:detail_malloc", + "//folly/coro:traits", + "//folly/coro:with_async_stack", + "//folly/coro:with_cancellation", + "//folly/io/async:request_context", + "//folly/lang:customization_point", + "//folly/tracing:async_stack", + "@glog", + ], +) + +cpp_library( + name = "with_async_stack", + hdrs = ["WithAsyncStack.h"], + deps = [ + "//folly/coro:coroutine", + "//folly/coro:traits", + "//folly/functional:invoke", + "//folly/lang:assume", + "//folly/lang:customization_point", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "with_cancellation", + hdrs = ["WithCancellation.h"], + deps = [ + "//folly:cancellation_token", + "//folly/coro:coroutine", + "//folly/lang:customization_point", + ], +) + +cpp_library( + name = "bounded_queue", + hdrs = ["BoundedQueue.h"], + deps = [ + "//folly:mpmc_queue", + "//folly:producer_consumer_queue", + "//folly/coro:task", + "//folly/fibers:semaphore", + ], +) + +cpp_library( + name = "shared_promise", + hdrs = [ + "SharedPromise.h", + ], + deps = [ + "//folly:small_vector", + "//folly:synchronized", + "//folly:utility", + "//folly/coro:promise", + "//folly/futures:core", + ], +) + +cpp_library( + name = "cleanup", + hdrs = [ + "Cleanup.h", + ], + deps = [ + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "auto_cleanup_fwd", + hdrs = [ + "AutoCleanup-fwd.h", + ], + deps = [ + "//folly/coro:cleanup", + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "auto_cleanup", + hdrs = [ + "AutoCleanup.h", + ], + deps = [ + "//folly/coro:auto_cleanup_fwd", + "//folly/coro:collect", + "//folly/coro:task", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/test/BUILD.bazel new file mode 100644 index 00000000000..7c0fcfb1ac3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/coro/test/BUILD.bazel @@ -0,0 +1,316 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_stack_test", + srcs = [ + "AsyncStackTest.cpp", + ], + deps = [ + "//folly:portability", + "//folly/coro:async_stack", + "//folly/coro:baton", + "//folly/coro:blocking_wait", + "//folly/coro:collect", + "//folly/coro:mutex", + "//folly/coro:task", + "//folly/portability:gtest", + "//folly/tracing:async_stack", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "async_generator_test", +# srcs = ["AsyncGeneratorTest.cpp"], +# deps = [ +# "//folly:portability", +# "//folly:scope_guard", +# "//folly:traits", +# "//folly/coro:async_generator", +# "//folly/coro:baton", +# "//folly/coro:blocking_wait", +# "//folly/coro:collect", +# "//folly/coro:invoke", +# "//folly/coro:sleep", +# "//folly/coro:task", +# "//folly/coro:with_cancellation", +# "//folly/futures:core", +# "//folly/portability:gtest", +# "//folly/portability:pthread", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "coro_test", +# srcs = [ +# "AccumulateTest.cpp", +# "AsyncPipeTest.cpp", +# "AsyncScopeTest.cpp", +# "BatonTest.cpp", +# "BlockingWaitTest.cpp", +# "BoundedQueueTest.cpp", +# "CollectTest.cpp", +# "ConcatTest.cpp", +# "CoroTest.cpp", +# "CurrentExecutorTest.cpp", +# "ErrorTest.cpp", +# "FilterTest.cpp", +# "FutureUtilTest.cpp", +# "InlineTaskTest.cpp", +# "MergeTest.cpp", +# "MutexTest.cpp", +# "ScopeExitTest.cpp", +# "SharedMutexTest.cpp", +# "SmallUnboundedQueueTest.cpp", +# "TaskTest.cpp", +# "TimeoutTest.cpp", +# "TraitsTest.cpp", +# "TransformTest.cpp", +# "UnboundedQueueTest.cpp", +# ], +# deps = [ +# "//folly:cancellation_token", +# "//folly:chrono", +# "//folly:conv", +# "//folly:exception_wrapper", +# "//folly:optional", +# "//folly:portability", +# "//folly:scope_guard", +# "//folly:utility", +# "//folly/coro:accumulate", +# "//folly/coro:async_generator", +# "//folly/coro:async_pipe", +# "//folly/coro:async_scope", +# "//folly/coro:auto_cleanup", +# "//folly/coro:baton", +# "//folly/coro:blocking_wait", +# "//folly/coro:bounded_queue", +# "//folly/coro:collect", +# "//folly/coro:concat", +# "//folly/coro:coroutine", +# "//folly/coro:current_executor", +# "//folly/coro:detach_on_cancel", +# "//folly/coro:filter", +# "//folly/coro:future_util", +# "//folly/coro:generator", +# "//folly/coro:gtest_helpers", +# "//folly/coro:inline_task", +# "//folly/coro:invoke", +# "//folly/coro:merge", +# "//folly/coro:mutex", +# "//folly/coro:result", +# "//folly/coro:shared_mutex", +# "//folly/coro:sleep", +# "//folly/coro:small_unbounded_queue", +# "//folly/coro:task", +# "//folly/coro:timed_wait", +# "//folly/coro:timeout", +# "//folly/coro:traits", +# "//folly/coro:transform", +# "//folly/coro:unbounded_queue", +# "//folly/coro:with_cancellation", +# "//folly/executors:cpu_thread_pool_executor", +# "//folly/executors:global_executor", +# "//folly/executors:inline_executor", +# "//folly/executors:manual_executor", +# "//folly/fibers:core_manager", +# "//folly/fibers:fiber_manager_map", +# "//folly/fibers:semaphore", +# "//folly/futures:core", +# "//folly/io/async:request_context", +# "//folly/io/async:scoped_event_base_thread", +# "//folly/lang:assume", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "coroutine_test", + srcs = ["CoroutineTest.cpp"], + deps = [ + "//folly/coro:coroutine", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "generator_test", + srcs = ["GeneratorTest.cpp"], + deps = [ + "//folly:portability", + "//folly:scope_guard", + "//folly/coro:generator", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "gmock_helpers_test", +# srcs = [ +# "GmockHelpersTest.cpp", +# ], +# deps = [ +# "//folly:portability", +# "//folly/coro:blocking_wait", +# "//folly/coro:gmock_helpers", +# "//folly/coro:gtest_helpers", +# "//folly/coro:task", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "gtest_helpers_test", +# srcs = [ +# "GtestHelpersTest.cpp", +# ], +# deps = [ +# "//folly/coro:gtest_helpers", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "request_context_test", + srcs = ["RequestContextTest.cpp"], + deps = [ + "//folly/coro:async_generator", + "//folly/coro:async_scope", + "//folly/coro:baton", + "//folly/coro:blocking_wait", + "//folly/coro:mutex", + "//folly/coro:task", + "//folly/coro:unbounded_queue", + "//folly/executors:manual_executor", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "retry_test", + srcs = ["RetryTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + "//folly/coro:blocking_wait", + "//folly/coro:retry", + "//folly/coro:sleep", + "//folly/coro:task", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "shared_promise_test", + srcs = [ + "SharedPromiseTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/coro:blocking_wait", + "//folly/coro:detach_on_cancel", + "//folly/coro:shared_promise", + "//folly/executors:cpu_thread_pool_executor", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "sleep_test", +# srcs = [ +# "SleepTest.cpp", +# ], +# deps = [ +# "//folly:portability", +# "//folly/coro:async_scope", +# "//folly/coro:gtest_helpers", +# "//folly/coro:sleep", +# "//folly/coro:task", +# "//folly/executors:manual_executor", +# "//folly/futures:manual_timekeeper", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "suspended_stack_test", +# srcs = [ +# "SuspendedStackTest.cpp", +# ], +# deps = [ +# "//folly/coro:async_stack", +# "//folly/coro:baton", +# "//folly/coro:gtest_helpers", +# "//folly/coro:mutex", +# "//folly/coro:task", +# "//folly/debugging/symbolizer", +# "//folly/lang:keep", +# "//folly/portability:gtest", +# ], +# ) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "task_wrapper_test", +# srcs = ["TaskWrapperTest.cpp"], +# deps = [ +# "//folly/coro:gtest_helpers", +# "//folly/coro:task_wrapper", +# "//folly/coro:timeout", +# "//folly/fibers:semaphore", +# ], +# ) + +cpp_unittest( + name = "RustAdaptorsTest", + srcs = [ + "RustAdaptorsTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:cancellation_token", + "//folly:portability", + "//folly/coro:baton", + "//folly/coro:rust_adaptors", + "//folly/coro:sleep", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "PromiseTest", +# srcs = [ +# "PromiseTest.cpp", +# ], +# deps = [ +# "//folly:portability", +# "//folly/coro:blocking_wait", +# "//folly/coro:collect", +# "//folly/coro:gtest_helpers", +# "//folly/coro:promise", +# "//folly/coro:task", +# "//folly/coro:with_cancellation", +# "//folly/portability:gtest", +# ], +# ) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/BUILD.bazel new file mode 100644 index 00000000000..913b30f9020 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/BUILD.bazel @@ -0,0 +1,99 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "blake2xb", + srcs = [ + "Blake2xb.cpp", + ], + hdrs = [ + "Blake2xb.h", + ], + deps = [ + "//folly:range", + "//folly/lang:bits", + "@libsodium", + ], +) + +cpp_library( + name = "lt_hash", + srcs = [ + "LtHash.cpp", + ], + hdrs = [ + "LtHash.h", + ], + textual_hdrs = [ + "LtHash-inl.h", + ], + deps = [ + ":blake2xb", + "//folly:cpu_id", + "//folly:memory", + "//folly:optional", + "//folly:range", + "//folly/crypto/detail:lt_hash_internal", + "//folly/crypto/detail:math_operation_avx2_disable", # @manual + "//folly/crypto/detail:math_operation_simple", # @manual + "//folly/crypto/detail:math_operation_sse2_disable", # @manual + "//folly/io:iobuf", + "//folly/lang:bits", + "@libsodium", + ], +) + +cpp_library( + name = "lt_hash_sse2", + srcs = [ + "LtHash.cpp", + ], + hdrs = [ + "LtHash.h", + ], + textual_hdrs = [ + "LtHash-inl.h", + ], + deps = [ + ":blake2xb", + "//folly:cpu_id", + "//folly:memory", + "//folly:optional", + "//folly:range", + "//folly/crypto/detail:lt_hash_internal", + "//folly/crypto/detail:math_operation_avx2_disable", # @manual + "//folly/crypto/detail:math_operation_simple", # @manual + "//folly/crypto/detail:math_operation_sse2", # @manual + "//folly/io:iobuf", + "//folly/lang:bits", + "@libsodium", + ], +) + +cpp_library( + name = "lt_hash_avx2", + srcs = [ + "LtHash.cpp", + ], + hdrs = [ + "LtHash.h", + ], + textual_hdrs = [ + "LtHash-inl.h", + ], + deps = [ + ":blake2xb", + "//folly:cpu_id", + "//folly:memory", + "//folly:optional", + "//folly:range", + "//folly/crypto/detail:lt_hash_internal", + "//folly/crypto/detail:math_operation_avx2", # @manual + "//folly/crypto/detail:math_operation_simple", # @manual + "//folly/crypto/detail:math_operation_sse2", # @manual + "//folly/io:iobuf", + "//folly/lang:bits", + "@libsodium", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/detail/BUILD.bazel new file mode 100644 index 00000000000..a29807bc88d --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/detail/BUILD.bazel @@ -0,0 +1,122 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "lt_hash_internal", + hdrs = [ + "LtHashInternal.h", + ], + deps = [ + "//folly:range", + ], +) + +cpp_library( + name = "math_operation_simple", + srcs = [ + "MathOperation_Simple.cpp", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mno-avx", + "-mno-avx2", + "-mno-sse2", + ], + "//conditions:default": [], + }), + deps = [ + ":lt_hash_internal", + "//folly:memory", + "//folly/lang:bits", + "@glog", + ], +) + +cpp_library( + name = "math_operation_sse2", + srcs = [ + "MathOperation_SSE2.cpp", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mno-avx", + "-mno-avx2", + "-msse2", + ], + "//conditions:default": [], + }), + deps = [ + ":lt_hash_internal", + "//folly:memory", + "//folly/lang:bits", + "@glog", + "@libsodium", + ], +) + +cpp_library( + name = "math_operation_avx2", + srcs = [ + "MathOperation_AVX2.cpp", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mavx", + "-mavx2", + "-msse2", + ], + "//conditions:default": [], + }), + deps = [ + ":lt_hash_internal", + "//folly:memory", + "//folly/lang:bits", + "@glog", + "@libsodium", + ], +) + +cpp_library( + name = "math_operation_sse2_disable", + srcs = [ + "MathOperation_SSE2.cpp", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mno-avx", + "-mno-avx2", + "-mno-sse2", + ], + "//conditions:default": [], + }), + deps = [ + ":lt_hash_internal", + "//folly:memory", + "//folly/lang:bits", + "@glog", + "@libsodium", + ], +) + +cpp_library( + name = "math_operation_avx2_disable", + srcs = [ + "MathOperation_AVX2.cpp", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mno-avx", + "-mno-avx2", + "-mno-sse2", + ], + "//conditions:default": [], + }), + deps = [ + ":lt_hash_internal", + "//folly:memory", + "//folly/lang:bits", + "@glog", + "@libsodium", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/test/BUILD.bazel new file mode 100644 index 00000000000..350536823f6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/crypto/test/BUILD.bazel @@ -0,0 +1,73 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "blake2xb_test", + srcs = ["Blake2xbTest.cpp"], + deps = [ + "//folly:string", + "//folly/crypto:blake2xb", + "//folly/io:iobuf", + "//folly/portability:gtest", + "@libsodium", + ], +) + +cpp_unittest( + name = "lt_hash_test", + srcs = [ + "LtHashTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly:string", + "//folly/crypto:lt_hash", + "//folly/io:iobuf", + "//folly/portability:gtest", + "@libsodium", + ], +) + +cpp_unittest( + name = "lt_hash_test_sse2", + srcs = [ + "LtHashTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly:string", + "//folly/crypto:lt_hash_sse2", # @manual + "//folly/io:iobuf", + "//folly/portability:gtest", + "@libsodium", + ], +) + +cpp_unittest( + name = "lt_hash_test_avx2", + srcs = [ + "LtHashTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly:string", + "//folly/crypto:lt_hash_avx2", # @manual + "//folly/io:iobuf", + "//folly/portability:gtest", + "@libsodium", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/BUILD.bazel new file mode 100644 index 00000000000..794d7a5356f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/BUILD.bazel @@ -0,0 +1,134 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "exception_abi", + hdrs = ["ExceptionAbi.h"], +) + +cpp_library( + name = "exception_counter", + srcs = ["ExceptionCounterLib.cpp"], + hdrs = ["ExceptionCounterLib.h"], + deps = [ + ":exception_tracer_base", + ":exception_tracer_callbacks", + ":stacktrace", + "//folly:range", + "//folly:synchronized", + "//folly:thread_local", + "//folly/experimental/symbolizer", + "//folly/hash:spooky_hash_v2", + "//folly/synchronization:rw_spin_lock", + ], + alwayslink = True, +) + +cpp_library( + name = "exception_tracer", + srcs = ["ExceptionStackTraceLib.cpp"], + deps = [ + ":exception_abi", + ":exception_tracer_base", + ":exception_tracer_callbacks", + ":stacktrace", + "//folly/experimental/symbolizer", + ], + alwayslink = True, +) + +cpp_library( + name = "exception_tracer_base", + srcs = ["ExceptionTracer.cpp"], + hdrs = ["ExceptionTracer.h"], + linkopts = select({ + "@platforms//os:linux": ["-ldl"], + "//conditions:default": [], + }), + deps = [ + ":exception_abi", + ":stacktrace", + "//folly:cpp_attributes", + "//folly:portability", + "//folly:string", + "//folly/experimental/symbolizer", + "//folly/portability:config", + "@glog", + ], +) + +cpp_library( + name = "exception_tracer_callbacks", + srcs = ["ExceptionTracerLib.cpp"], + hdrs = ["ExceptionTracerLib.h"], + linkopts = select({ + "@platforms//os:linux": ["-ldl"], + "//conditions:default": [], + }), + deps = [ + "//folly:indestructible", + "//folly:portability", + "//folly:shared_mutex", + "//folly:synchronized", + ], + alwayslink = True, +) + +cpp_library( + name = "stacktrace", + srcs = ["StackTrace.cpp"], + hdrs = ["StackTrace.h"], + deps = [ + "//folly:portability", + "//folly/experimental/symbolizer:stack_trace", + ], +) + +cpp_library( + name = "smart_exception_tracer_singleton", + srcs = [ + "SmartExceptionTracerSingleton.cpp", + ], + hdrs = [ + "SmartExceptionTracerSingleton.h", + ], + deps = [ + ":stacktrace", + "//folly:synchronized", + "//folly/container:f14_hash", + ], +) + +cpp_library( + name = "smart_exception_stack_trace_hooks", + srcs = [ + "SmartExceptionStackTraceHooks.cpp", + ], + deps = [ + ":exception_tracer_callbacks", + ":smart_exception_tracer_singleton", + "//folly/experimental/symbolizer", + ], + alwayslink = True, +) + +cpp_library( + name = "smart_exception_tracer", + srcs = ["SmartExceptionTracer.cpp"], + hdrs = ["SmartExceptionTracer.h"], + deps = [ + ":exception_tracer_base", + ":exception_tracer_callbacks", + ":smart_exception_tracer_singleton", + ":stacktrace", + "//folly:exception_wrapper", + "//folly:map_util", + "//folly:scope_guard", + "//folly:synchronized", + "//folly/container:f14_hash", + "//folly/experimental/symbolizer", + "//folly/lang:exception", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/test/BUILD.bazel new file mode 100644 index 00000000000..946b970e4d6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/exception_tracer/test/BUILD.bazel @@ -0,0 +1,58 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "exception_counter_test", + srcs = ["ExceptionCounterTest.cpp"], + deps = [ + "//folly/debugging/exception_tracer:exception_counter", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "exception_tracer_benchmark_main", + srcs = ["ExceptionTracerBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/debugging/exception_tracer:exception_tracer_base", + "//folly/portability:gflags", + "@glog", + ], +) + +cpp_library( + name = "exception_tracer_test_main", + srcs = ["ExceptionTracerTest.cpp"], + deps = [ + "//folly/debugging/exception_tracer:exception_tracer_base", + ], +) + +cc_binary( + name = "exception_tracer_base_test", + deps = [ + ":exception_tracer_test_main", # @manual + ], +) + +cc_binary( + name = "exception_tracer_test", + deps = [ + ":exception_tracer_test_main", # @manual + "//folly/debugging/exception_tracer", # @manual # @manual + ], +) + +cpp_unittest( + name = "smart_exception_tracer_test", + srcs = ["SmartExceptionTracerTest.cpp"], + deps = [ + "//folly/coro:blocking_wait", + "//folly/coro:task", + "//folly/debugging/exception_tracer:smart_exception_stack_trace_hooks", # @manual + "//folly/debugging/exception_tracer:smart_exception_tracer", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/BUILD.bazel new file mode 100644 index 00000000000..df81b66a83d --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/BUILD.bazel @@ -0,0 +1,190 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "dwarf", + srcs = [ + "Dwarf.cpp", + "DwarfImpl.cpp", + "DwarfLineNumberVM.cpp", + "DwarfSection.cpp", + "DwarfUtil.cpp", + ], + hdrs = [ + "Dwarf.h", + "DwarfImpl.h", + "DwarfLineNumberVM.h", + "DwarfSection.h", + "DwarfUtil.h", + ], + deps = [ + "//folly:function", + "//folly:optional", + "//folly:range", + "//folly/experimental/symbolizer:elf", + "//folly/experimental/symbolizer:elf_cache", + "//folly/experimental/symbolizer:symbolized_frame", + "//folly/lang:safe_assert", + "//folly/portability:config", + "//folly/portability:unistd", + ] + select({ + "//folly:use_dwarf_setting": ["@libdwarf"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "elf", + srcs = [ + "Elf.cpp", + ], + hdrs = [ + "Elf.h", + ], + textual_hdrs = [ + "Elf-inl.h", + ], + deps = [ + "//folly:conv", + "//folly:exception", + "//folly:likely", + "//folly:range", + "//folly:scope_guard", + "//folly/lang:c_string", + "//folly/lang:safe_assert", + "//folly/portability:config", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "symbolized_frame", + srcs = ["SymbolizedFrame.cpp"], + hdrs = ["SymbolizedFrame.h"], + deps = [ + "//folly:range", + ], +) + +cpp_library( + name = "line_reader", + srcs = ["LineReader.cpp"], + hdrs = ["LineReader.h"], + deps = [ + "//folly:file_util", + "//folly:range", + ], +) + +cpp_library( + name = "stack_trace", + srcs = ["StackTrace.cpp"], + hdrs = ["StackTrace.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:portability", + "//folly/portability:config", + "//folly/portability:libunwind", + "//folly/portability:sys_types", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "elf_cache", + srcs = [ + "ElfCache.cpp", + ], + hdrs = [ + "ElfCache.h", + ], + deps = [ + "//folly:optional", + "//folly:range", + "//folly:scope_guard", + "//folly/experimental/symbolizer:elf", + "//folly/hash", + "//folly/memory:reentrant_allocator", + "//folly/portability:config", + "//folly/portability:sys_mman", + "@boost.intrusive", + ], +) + +cpp_library( + name = "symbolize_printer", + srcs = [ + "SymbolizePrinter.cpp", + ], + hdrs = [ + "SymbolizePrinter.h", + ], + deps = [ + "//folly:demangle", + "//folly:fbstring", + "//folly:file_util", + "//folly:range", + "//folly:scope_guard", + "//folly/experimental/symbolizer:symbolized_frame", + "//folly/io:iobuf", + "//folly/lang:to_ascii", + ], +) + +cpp_library( + name = "symbolizer", + srcs = [ + "Symbolizer.cpp", + ], + hdrs = [ + "Symbolizer.h", + ], + deps = [ + "//folly:fbstring", + "//folly:file_util", + "//folly:memory", + "//folly:optional", + "//folly:range", + "//folly:scope_guard", + "//folly:string", + "//folly:synchronized", + "//folly/container:evicting_cache_map", + "//folly/experimental/symbolizer:dwarf", + "//folly/experimental/symbolizer:elf", + "//folly/experimental/symbolizer:elf_cache", + "//folly/experimental/symbolizer:line_reader", + "//folly/experimental/symbolizer:stack_trace", + "//folly/experimental/symbolizer:symbolize_printer", + "//folly/experimental/symbolizer:symbolized_frame", + "//folly/experimental/symbolizer/detail:debug", + "//folly/io:iobuf", + "//folly/lang:safe_assert", + "//folly/lang:to_ascii", + "//folly/memory:sanitize_address", + "//folly/portability:config", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "//folly/tracing:async_stack", + ], +) + +cpp_library( + name = "signal_handler", + srcs = [ + "SignalHandler.cpp", + ], + hdrs = [ + "SignalHandler.h", + ], + deps = [ + "//folly:scope_guard", + "//folly/experimental/symbolizer", + "//folly/lang:to_ascii", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/detail/BUILD.bazel new file mode 100644 index 00000000000..f3a554260f8 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/detail/BUILD.bazel @@ -0,0 +1,11 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "debug", + hdrs = ["Debug.h"], + deps = [ + "//folly:cpp_attributes", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/test/BUILD.bazel new file mode 100644 index 00000000000..1ebd3656139 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/debugging/symbolizer/test/BUILD.bazel @@ -0,0 +1,53 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cc_binary( + name = "crash", + srcs = ["Crash.cpp"], + deps = [ + "//folly/experimental/symbolizer:signal_handler", + ], +) + +cc_binary( + name = "small_sigaltstack_crash", + srcs = ["SmallSigAltStackCrash.cpp"], + deps = [ + "//folly/experimental/symbolizer:signal_handler", + ], +) + +cpp_unittest( + name = "symbolized_frame_test", + srcs = ["SymbolizedFrameTest.cpp"], + deps = [ + "//folly/experimental/symbolizer:symbolized_frame", + "//folly/portability:gtest", + "@glog", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "elf_test", +# srcs = ["ElfTest.cpp"], +# deps = [ +# "//folly:file_util", +# "//folly/experimental/symbolizer:elf", +# "//folly/experimental/symbolizer/detail:debug", +# "//folly/portability:gtest", +# "//folly/testing:test_util", +# ], +# ) + +cpp_unittest( + name = "line_reader_test", + srcs = ["LineReaderTest.cpp"], + deps = [ + "//folly:file_util", + "//folly/experimental/symbolizer:line_reader", + "//folly/portability:gtest", + "//folly/testing:test_util", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/BUILD.bazel new file mode 100644 index 00000000000..649dcfdfe94 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/BUILD.bazel @@ -0,0 +1,390 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_trace", + srcs = ["AsyncTrace.cpp"], + hdrs = ["AsyncTrace.h"], + deps = [ + "//folly:optional", + "//folly:portability", + ], +) + +cpp_library( + name = "atomic_hash_utils", + hdrs = ["AtomicHashUtils.h"], + deps = [ + "//folly/portability:asm", + ], +) + +cpp_library( + name = "atomic_unordered_map_utils", + hdrs = ["AtomicUnorderedMapUtils.h"], + deps = [ + "//folly:exception", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "discriminated_ptr_detail", + hdrs = ["DiscriminatedPtrDetail.h"], + deps = [ + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "file_util_detail", + srcs = ["FileUtilDetail.cpp"], + hdrs = ["FileUtilDetail.h"], + deps = [ + "//folly/portability:config", + "//folly/portability:sys_types", + ], +) + +cpp_library( + name = "file_util_vector_detail", + hdrs = ["FileUtilVectorDetail.h"], + deps = [ + ":file_util_detail", + "//folly/portability:sys_uio", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "fingerprint_polynomial", + hdrs = ["FingerprintPolynomial.h"], +) + +cpp_library( + name = "futex", + srcs = ["Futex.cpp"], + hdrs = [ + "Futex.h", + ], + textual_hdrs = [ + "Futex-inl.h", + ], + deps = [ + "//folly:scope_guard", + "//folly/hash", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "//folly/synchronization:parking_lot", + ], +) + +cpp_library( + name = "group_varint_detail", + hdrs = ["GroupVarintDetail.h"], +) + +cpp_library( + name = "ip_address", + srcs = ["IPAddress.cpp"], + hdrs = ["IPAddress.h"], + deps = [ + "//folly/portability:fmt_compile", + "//folly/portability:sockets", + ], +) + +cpp_library( + name = "ip_address_source", + hdrs = ["IPAddressSource.h"], + deps = [ + ":ip_address", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "iterators", + hdrs = ["Iterators.h"], +) + +cpp_library( + name = "memory_idler", + srcs = ["MemoryIdler.cpp"], + hdrs = ["MemoryIdler.h"], + deps = [ + ":futex", + "//folly:glog", + "//folly:portability", + "//folly:scope_guard", + "//folly/concurrency:cache_locality", + "//folly/hash", + "//folly/memory:mallctl_helper", + "//folly/memory:malloc", + "//folly/portability:gflags", + "//folly/portability:pthread", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "//folly/synchronization:atomic_struct", + "//folly/system:pid", + "//folly/system:thread_id", + ], +) + +cpp_library( + name = "perf_scoped", + srcs = ["PerfScoped.cpp"], + hdrs = ["PerfScoped.h"], + deps = [ + "//folly:conv", + "//folly/system:pid", + "//folly/testing:test_util", + ] + select({ + # folly subprocess is not supported on windows + "@platforms//os:linux": ["//folly:subprocess"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "mpmc_pipeline_detail", + hdrs = ["MPMCPipelineDetail.h"], + deps = [ + "//folly:mpmc_queue", + ], +) + +cpp_library( + name = "poly_detail", + hdrs = ["PolyDetail.h"], + deps = [ + ":typelist", + "//folly:poly_exception", + "//folly:portability", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + "//folly/lang:exception", + "//folly/lang:static_const", + ], +) + +cpp_library( + name = "range_common", + srcs = ["RangeCommon.cpp"], + hdrs = ["RangeCommon.h"], + deps = [ + "//folly:likely", + "//folly/container:sparse_byte_set", + ], +) + +cpp_library( + name = "range_simd", + srcs = ["RangeSimd.cpp"], + hdrs = ["RangeSimd.h"], + deps = [ + ":range_common", + ":range_sse42", + "//folly:portability", + "//folly/external/nvidia/detail:range_sve2", + ], +) + +cpp_library( + name = "range_sse42", + srcs = ["RangeSse42.cpp"], + hdrs = ["RangeSse42.h"], + deps = [ + ":range_common", + ":sse", + "//folly:likely", + "//folly:portability", + ], +) + +cpp_library( + name = "singleton", + hdrs = ["Singleton.h"], + deps = [ + "//folly:traits", + ], +) + +cpp_library( + name = "slow_fingerprint", + hdrs = ["SlowFingerprint.h"], + deps = [ + ":fingerprint_polynomial", + "//folly:fingerprint", + "//folly:range", + ], +) + +cpp_library( + name = "sse", + srcs = ["Sse.cpp"], + hdrs = ["Sse.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "simple_simd_string_utils", + srcs = ["SimpleSimdStringUtils.cpp"], + hdrs = [ + "SimpleSimdStringUtils.h", + "SimpleSimdStringUtilsImpl.h", + ], + deps = [ + "//folly:range", + "//folly/algorithm/simd/detail:simd_any_of", + "//folly/algorithm/simd/detail:simd_platform", + ], +) + +cpp_library( + name = "split_string_simd", + srcs = ["SplitStringSimd.cpp"], + hdrs = [ + "SplitStringSimd.h", + "SplitStringSimdImpl.h", + ], + deps = [ + "//folly:fbstring", + "//folly:fbvector", + "//folly:portability", + "//folly:range", + "//folly:small_vector", + "//folly/algorithm/simd:ignore", + "//folly/algorithm/simd:movemask", + "//folly/algorithm/simd/detail:simd_for_each", + "//folly/algorithm/simd/detail:simd_platform", + "//folly/lang:bits", + ], +) + +cpp_library( + name = "socket_fast_open", + srcs = ["SocketFastOpen.cpp"], + hdrs = ["SocketFastOpen.h"], + deps = [ + "//folly/net:network_socket", + "//folly/portability:sockets", + ], +) + +cpp_library( + name = "static_singleton_manager", + srcs = ["StaticSingletonManager.cpp"], + hdrs = ["StaticSingletonManager.h"], + deps = [ + ":singleton", + "//folly:c_portability", + "//folly:indestructible", + "//folly:likely", + "//folly:utility", + "//folly/lang:thunk", + "//folly/lang:type_info", + "//folly/memory:reentrant_allocator", + ], +) + +cpp_library( + name = "thread_local_detail", + srcs = ["ThreadLocalDetail.cpp"], + hdrs = ["ThreadLocalDetail.h"], + deps = [ + ":static_singleton_manager", + ":thread_local_globals", + ":unique_instance", + "//folly:constexpr_math", + "//folly:exception", + "//folly:function", + "//folly:map_util", + "//folly:portability", + "//folly:scope_guard", + "//folly:shared_mutex", + "//folly:synchronized", + "//folly:utility", + "//folly/concurrency/container:atomic_grow_array", + "//folly/container:foreach", + "//folly/lang:exception", + "//folly/lang:hint", + "//folly/memory:malloc", + "//folly/memory:sanitize_leak", + "//folly/portability:pthread", + "//folly/synchronization:call_once", + "//folly/synchronization:micro_spin_lock", + "//folly/synchronization:relaxed_atomic", + "//folly/system:at_fork", + "//folly/system:thread_id", + "@glog", + ], +) + +cpp_library( + name = "thread_local_globals", + srcs = ["thread_local_globals.cpp"], + hdrs = ["thread_local_globals.h"], + deps = [ + ":static_singleton_manager", + "//folly/lang:exception", + "//folly/portability:pthread", + ], +) + +cpp_library( + name = "turn_sequencer", + hdrs = ["TurnSequencer.h"], + deps = [ + ":futex", + "//folly:portability", + "//folly/chrono:hardware", + "//folly/portability:asm", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "typelist", + hdrs = ["TypeList.h"], + deps = [ + "//folly:traits", + "//folly:utility", + ], +) + +cpp_library( + name = "unique_instance", + srcs = ["UniqueInstance.cpp"], + hdrs = ["UniqueInstance.h"], + deps = [ + ":static_singleton_manager", + "//folly:cpp_attributes", + "//folly:demangle", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "traponavx512", + srcs = ["TrapOnAvx512.cpp"], + hdrs = ["TrapOnAvx512.h"], + copts = select({ + "@platforms//cpu:x86_64": [ + "-msse4.2", + "-mavx512f", + "-mavx512vl", + ], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/BUILD.bazel new file mode 100644 index 00000000000..b665a4e284f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/BUILD.bazel @@ -0,0 +1,96 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "base64_api", + srcs = ["Base64Api.cpp"], + hdrs = ["Base64Api.h"], + deps = [ + ":base64_common", + ":base64_scalar", + ":base64_sse4_2", + ":base64_swar", + "//folly:cpu_id", + "//folly:portability", + "//folly/portability:constexpr", + ], +) + +cpp_library( + name = "base64_common", + hdrs = ["Base64Common.h"], +) + +cpp_library( + name = "base64_constants", + hdrs = ["Base64Constants.h"], +) + +cpp_library( + name = "base64_hidden_constants", + hdrs = ["Base64HiddenConstants.h"], + deps = [ + ":base64_constants", + ], +) + +cpp_library( + name = "base64_scalar", + hdrs = ["Base64Scalar.h"], + deps = [ + ":base64_common", + ":base64_constants", + ], +) + +cpp_library( + name = "base64_simd", + hdrs = ["Base64Simd.h"], + deps = [ + ":base64_common", + ":base64_constants", + ":base64_hidden_constants", + ":base64_scalar", + ":base64_swar", + "//folly:c_portability", + ], +) + +cpp_library( + name = "base64_sse4_2_platform", + hdrs = ["Base64_SSE4_2_Platform.h"], + deps = [ + ":base64_hidden_constants", + "//folly:portability", + ], +) + +cpp_library( + name = "base64_sse4_2", + srcs = ["Base64_SSE4_2.cpp"], + hdrs = ["Base64_SSE4_2.h"], + copts = select({ + "@platforms//cpu:x86_64": ["-msse4.2"], + "//conditions:default": [], + }), + deps = [ + ":base64_common", + ":base64_simd", + ":base64_sse4_2_platform", + "//folly:portability", + ], +) + +cpp_library( + name = "base64_swar", + srcs = ["Base64SWAR.cpp"], + hdrs = ["Base64SWAR.h"], + deps = [ + ":base64_common", + ":base64_constants", + ":base64_hidden_constants", + ":base64_scalar", + "//folly:portability", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/tests/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/tests/BUILD.bazel new file mode 100644 index 00000000000..c4b3f9d8109 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/base64_detail/tests/BUILD.bazel @@ -0,0 +1,34 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "base64_against_scalar_test", + srcs = ["Base64AgainstScalarTest.cpp"], + deps = [ + "//folly/detail/base64_detail:base64_common", + "//folly/detail/base64_detail:base64_scalar", + "//folly/detail/base64_detail:base64_sse4_2", + "//folly/detail/base64_detail:base64_swar", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "base64_platform_test", + srcs = ["Base64PlatformTest.cpp"], + deps = [ + "//folly/detail/base64_detail:base64_sse4_2_platform", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "base64_special_cases_test", + srcs = ["Base64SpecialCasesTest.cpp"], + deps = [ + "//folly/detail/base64_detail:base64_scalar", + "//folly/detail/base64_detail:base64_simd", + "//folly/detail/base64_detail:base64_sse4_2", + "//folly/portability:constexpr", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/test/BUILD.bazel new file mode 100644 index 00000000000..2d6b4e4d998 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/detail/test/BUILD.bazel @@ -0,0 +1,125 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_trace_test", + srcs = ["AsyncTraceTest.cpp"], + deps = [ + "//folly/detail:async_trace", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "static_singleton_manager_test", + srcs = ["StaticSingletonManagerTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/detail:static_singleton_manager", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "unique_instance_test", + srcs = ["UniqueInstanceTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:string", + "//folly:traits", + "//folly/detail:unique_instance", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "file_util_detail_test", + srcs = [ + "FileUtilDetailTest.cpp", + ], + deps = [ + "//folly/detail:file_util_detail", + "//folly/portability:gtest", + ], +) + +# Disabled because perf needs special permissions on the machine in order to run. +# cpp_unittest( +# name = "perf_scoped_test", +# srcs = [ +# "PerfScopedTest.cpp", +# ], +# deps = [ +# "//folly/detail:perf_scoped", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "//folly/portability:unistd", +# "//folly/test:test_utils", +# ], +# ) + +cpp_unittest( + name = "simple_simd_string_utils_test", + srcs = [ + "SimpleSimdStringUtilsTest.cpp", + ], + deps = [ + "//folly/algorithm/simd/detail:simd_platform", + "//folly/detail:simple_simd_string_utils", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "split_string_simd_test", + srcs = [ + "SplitStringSimdTest.cpp", + ], + deps = [ + "//folly:fbstring", + "//folly:fbvector", + "//folly:range", + "//folly:small_vector", + "//folly/detail:split_string_simd", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "thread_local_detail_test", + srcs = [ + "ThreadLocalDetailTest.cpp", + ], + deps = [ + "//folly:synchronized", + "//folly:thread_local", + "//folly/portability:gtest", + "//folly/synchronization/test:barrier", + ], +) + +cpp_unittest( + name = "traponavx512_test_negative", + srcs = ["TrapOnAvx512TestNegative.cpp"], + deps = [ + "//folly/detail:traponavx512", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "detail_typelist_test", + srcs = ["TypeListTest.cpp"], + deps = [ + "//folly/detail:typelist", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/BUILD.bazel new file mode 100644 index 00000000000..b9121ed59c4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/BUILD.bazel @@ -0,0 +1,441 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "executors", + deps = [ + ":async", # @manual + ":cpu_thread_pool_executor", # @manual + ":fiber_io_executor", # @manual + ":future_executor", # @manual + ":global_executor", # @manual + ":io_executor", # @manual + ":io_object_cache", # @manual + ":io_thread_pool_executor", # @manual + ":serial_executor", # @manual + ":thread_pool_executor", # @manual + ":threaded_executor", # @manual + "//folly/executors/task_queue:blocking_queue", # @manual + "//folly/executors/task_queue:lifo_sem_mpmc_queue", # @manual + "//folly/executors/task_queue:priority_lifo_sem_mpmc_queue", # @manual + "//folly/executors/task_queue:unbounded_blocking_queue", # @manual + "//folly/executors/thread_factory", # @manual + "//folly/executors/thread_factory:named_thread_factory", # @manual + "//folly/executors/thread_factory:priority_thread_factory", # @manual + ], +) + +cpp_library( + name = "async", + hdrs = ["Async.h"], + deps = [ + ":global_executor", + "//folly/futures:core", + ], +) + +cpp_library( + name = "codel", + srcs = ["Codel.cpp"], + hdrs = ["Codel.h"], + deps = [ + "//folly/portability:gflags", + ], +) + +cpp_library( + name = "cpu_thread_pool_executor", + srcs = ["CPUThreadPoolExecutor.cpp"], + hdrs = ["CPUThreadPoolExecutor.h"], + deps = [ + ":queue_observer", + ":thread_pool_executor", + "//folly:executor", + "//folly:memory", + "//folly:optional", + "//folly/executors/task_queue:priority_lifo_sem_mpmc_queue", + "//folly/executors/task_queue:priority_unbounded_blocking_queue", + "//folly/executors/task_queue:unbounded_blocking_queue", + "//folly/portability:gflags", + "//folly/synchronization:throttled_lifo_sem", + ], +) + +cpp_library( + name = "drivable_executor", + hdrs = ["DrivableExecutor.h"], + deps = [ + "//folly:executor", + ], +) + +cpp_library( + name = "edf_thread_pool_executor", + srcs = ["EDFThreadPoolExecutor.cpp"], + hdrs = ["EDFThreadPoolExecutor.h"], + deps = [ + ":soft_real_time_executor", + ":thread_pool_executor", + "//folly:scope_guard", + "//folly/concurrency:process_local_unique_id", + "//folly/portability:gflags", + "//folly/synchronization:lifo_sem", + "//folly/synchronization:throttled_lifo_sem", + "//folly/tracing:static_tracepoint", + "@glog", + ], +) + +cpp_library( + name = "fiber_io_executor", + hdrs = ["FiberIOExecutor.h"], + deps = [ + ":io_executor", + "//folly/fibers:fiber_manager_map", + ], +) + +cpp_library( + name = "future_executor", + hdrs = ["FutureExecutor.h"], + deps = [ + "//folly/functional:invoke", + "//folly/futures:core", + ], +) + +cpp_library( + name = "global_executor", + srcs = ["GlobalExecutor.cpp"], + hdrs = ["GlobalExecutor.h"], + deps = [ + ":cpu_thread_pool_executor", + ":inline_executor", + ":io_executor", + ":io_thread_pool_executor", + "//folly:executor", + "//folly:function", + "//folly:shared_mutex", + "//folly:singleton", + "//folly/detail:async_trace", + "//folly/portability:gflags", + "//folly/system:hardware_concurrency", + ], +) + +cpp_library( + name = "global_thread_pool_list", + srcs = ["GlobalThreadPoolList.cpp"], + hdrs = ["GlobalThreadPoolList.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:indestructible", + "//folly:synchronized", + "//folly:thread_local", + "//folly/system:thread_id", + ], +) + +cpp_library( + name = "inline_executor", + srcs = ["InlineExecutor.cpp"], + hdrs = ["InlineExecutor.h"], + deps = [ + "//folly:c_portability", + "//folly:cpp_attributes", + "//folly:executor", + "//folly:indestructible", + ], +) + +cpp_library( + name = "manual_executor", + srcs = ["ManualExecutor.cpp"], + hdrs = ["ManualExecutor.h"], + deps = [ + "//folly/executors:drivable_executor", + "//folly/executors:scheduled_executor", + "//folly/executors:sequenced_executor", + "//folly/synchronization:lifo_sem", + ], +) + +cpp_library( + name = "io_executor", + hdrs = ["IOExecutor.h"], + deps = [ + "//folly:executor", + ], +) + +cpp_library( + name = "io_object_cache", + hdrs = ["IOObjectCache.h"], + deps = [ + ":global_executor", + "//folly:thread_local", + "//folly/io/async:async_base", + ], +) + +cpp_library( + name = "io_thread_pool_executor", + srcs = ["IOThreadPoolExecutor.cpp"], + hdrs = ["IOThreadPoolExecutor.h"], + deps = [ + ":io_executor", + ":queue_observer", + ":thread_pool_executor", + "//folly:portability", + "//folly/detail:memory_idler", + "//folly/io/async:event_base_manager", + "//folly/portability:gflags", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_library( + name = "soft_real_time_executor", + srcs = ["SoftRealTimeExecutor.cpp"], + hdrs = ["SoftRealTimeExecutor.h"], + deps = [ + "//folly:executor", + "@glog", + ], +) + +cpp_library( + name = "scheduled_executor", + hdrs = ["ScheduledExecutor.h"], + deps = [ + "//folly:executor", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "serial_executor", + hdrs = [ + "SerialExecutor.h", + "SerialExecutor-inl.h", + ], + deps = [ + ":global_executor", + ":serialized_executor", + "//folly:exception_string", + "//folly:scope_guard", + "//folly/concurrency:unbounded_queue", + "//folly/io/async:request_context", + "//folly/synchronization:distributed_mutex", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_library( + name = "sequenced_executor", + hdrs = ["SequencedExecutor.h"], + deps = [ + "//folly:executor", + ], +) + +cpp_library( + name = "serialized_executor", + hdrs = ["SerializedExecutor.h"], + deps = [ + ":sequenced_executor", + ], +) + +cpp_library( + name = "strand_executor", + srcs = ["StrandExecutor.cpp"], + hdrs = ["StrandExecutor.h"], + deps = [ + ":global_executor", + ":serialized_executor", + "//folly:exception_string", + "//folly:optional", + "//folly/concurrency:unbounded_queue", + "//folly/io/async:request_context", + "@glog", + ], +) + +cpp_library( + name = "thread_pool_executor", + srcs = ["ThreadPoolExecutor.cpp"], + hdrs = ["ThreadPoolExecutor.h"], + deps = [ + ":global_thread_pool_list", + "//folly:default_keep_alive_executor", + "//folly:memory", + "//folly:shared_mutex", + "//folly/concurrency:process_local_unique_id", + "//folly/executors/task_queue:lifo_sem_mpmc_queue", + "//folly/executors/thread_factory:named_thread_factory", + "//folly/io/async:request_context", + "//folly/portability:gflags", + "//folly/portability:pthread", + "//folly/synchronization:asymmetric_thread_fence", + "//folly/synchronization:atomic_struct", + "//folly/synchronization:baton", + "//folly/tracing:static_tracepoint", + "@glog", + ], +) + +cpp_library( + name = "threaded_executor", + srcs = ["ThreadedExecutor.cpp"], + hdrs = ["ThreadedExecutor.h"], + deps = [ + "//folly:executor", + "//folly:scope_guard", + "//folly/concurrency:unbounded_queue", + "//folly/container:f14_hash", + "//folly/executors/thread_factory", + "//folly/executors/thread_factory:named_thread_factory", + "//folly/system:thread_name", + "@glog", + ], +) + +cpp_library( + name = "timed_drivable_executor", + srcs = ["TimedDrivableExecutor.cpp"], + hdrs = ["TimedDrivableExecutor.h"], + deps = [ + ":drivable_executor", + "//folly/concurrency:unbounded_queue", + ], +) + +cpp_library( + name = "timekeeper_scheduled_executor", + srcs = ["TimekeeperScheduledExecutor.cpp"], + hdrs = ["TimekeeperScheduledExecutor.h"], + deps = [ + ":scheduled_executor", + "//folly/futures:core", + "@glog", + ], +) + +cpp_library( + name = "queued_immediate_executor", + srcs = ["QueuedImmediateExecutor.cpp"], + hdrs = ["QueuedImmediateExecutor.h"], + deps = [ + ":inline_executor", + "//folly:executor", + "//folly:indestructible", + "//folly:scope_guard", + "//folly:thread_local", + "//folly/io/async:request_context", + ], +) + +cpp_library( + name = "executor_with_priority", + srcs = ["ExecutorWithPriority.cpp"], + hdrs = [ + "ExecutorWithPriority.h", + "ExecutorWithPriority-inl.h", + ], + deps = [ + "//folly:executor", + "@glog", + ], +) + +cpp_library( + name = "metered_executor", + hdrs = [ + "MeteredExecutor.h", + "MeteredExecutor-inl.h", + ], + deps = [ + ":queue_observer", + "//folly:default_keep_alive_executor", + "//folly/concurrency:unbounded_queue", + "//folly/io/async:async_base", + ], +) + +cpp_library( + name = "io_thread_pool_deadlock_detector_observer", + srcs = ["IOThreadPoolDeadlockDetectorObserver.cpp"], + hdrs = ["IOThreadPoolDeadlockDetectorObserver.h"], + deps = [ + "//folly:singleton", + "//folly/concurrency:deadlock_detector", + "//folly/executors:io_thread_pool_executor", + "//folly/executors:thread_pool_executor", + ], +) + +cpp_library( + name = "queue_observer", + srcs = ["QueueObserver.cpp"], + hdrs = [ + "QueueObserver.h", + ], + deps = [ + "//folly:function", + "//folly:portability", + "//folly:synchronized", + "//folly/portability:sys_types", + ], +) + +cpp_library( + name = "virtual_executor", + hdrs = [ + "VirtualExecutor.h", + ], + deps = [ + "//folly:default_keep_alive_executor", + ], +) + +cpp_library( + name = "function_scheduler", + srcs = ["FunctionScheduler.cpp"], + hdrs = ["FunctionScheduler.h"], + deps = [ + "//folly:conv", + "//folly:function", + "//folly:random", + "//folly:range", + "//folly:string", + "//folly/container:f14_hash", + "//folly/hash", + "//folly/system:thread_name", + "@glog", + ], +) + +cpp_library( + name = "threaded_repeating_function_runner", + srcs = ["ThreadedRepeatingFunctionRunner.cpp"], + hdrs = ["ThreadedRepeatingFunctionRunner.h"], + deps = [ + "//folly:function", + "//folly/system:thread_name", + "@glog", + ], +) + +cpp_library( + name = "execution_observer", + srcs = ["ExecutionObserver.cpp"], + hdrs = ["ExecutionObserver.h"], + deps = [ + "//folly/tracing:static_tracepoint", + "@boost.intrusive", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/BUILD.bazel new file mode 100644 index 00000000000..5f68b50f2b4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/BUILD.bazel @@ -0,0 +1,59 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "blocking_queue", + hdrs = ["BlockingQueue.h"], + deps = [ + "//folly:c_portability", + "//folly:optional", + "@glog", + ], +) + +cpp_library( + name = "lifo_sem_mpmc_queue", + hdrs = ["LifoSemMPMCQueue.h"], + deps = [ + ":blocking_queue", + "//folly:mpmc_queue", + "//folly/synchronization:lifo_sem", + ], +) + +cpp_library( + name = "priority_lifo_sem_mpmc_queue", + hdrs = ["PriorityLifoSemMPMCQueue.h"], + deps = [ + ":blocking_queue", + "//folly:executor", + "//folly:mpmc_queue", + "//folly:range", + "//folly/synchronization:lifo_sem", + "@glog", + ], +) + +cpp_library( + name = "priority_unbounded_blocking_queue", + hdrs = ["PriorityUnboundedBlockingQueue.h"], + deps = [ + ":blocking_queue", + "//folly:constexpr_math", + "//folly:executor", + "//folly/concurrency:priority_unbounded_queue_set", + "//folly/lang:exception", + "//folly/synchronization:lifo_sem", + ], +) + +cpp_library( + name = "unbounded_blocking_queue", + hdrs = ["UnboundedBlockingQueue.h"], + deps = [ + ":blocking_queue", + "//folly/concurrency:unbounded_queue", + "//folly/synchronization:lifo_sem", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/test/BUILD.bazel new file mode 100644 index 00000000000..942c0e32168 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/task_queue/test/BUILD.bazel @@ -0,0 +1,33 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "PriorityUnboundedBlockingQueueTest", + srcs = ["PriorityUnboundedBlockingQueueTest.cpp"], + deps = [ + "//folly/container:enumerate", + "//folly/executors/task_queue:priority_unbounded_blocking_queue", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "UnboundedBlockingQueueTest", + srcs = ["UnboundedBlockingQueueTest.cpp"], + deps = [ + "//folly/executors/task_queue:unbounded_blocking_queue", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "PriorityLifoSemMPMCQueueTest", + srcs = ["PriorityLifoSemMPMCQueueTest.cpp"], + deps = [ + "//folly:range", + "//folly/container:enumerate", + "//folly/executors/task_queue:priority_lifo_sem_mpmc_queue", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/test/BUILD.bazel new file mode 100644 index 00000000000..f3eda6257ed --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/test/BUILD.bazel @@ -0,0 +1,350 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "AsyncTest", + srcs = ["AsyncTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:async", + "//folly/executors:manual_executor", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "CodelTest", + srcs = ["CodelTest.cpp"], + deps = [ + "//folly/executors:codel", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "FiberIOExecutorTest", + srcs = ["FiberIOExecutorTest.cpp"], + deps = [ + "//folly/executors:fiber_io_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "executor_test", + srcs = ["ExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:inline_executor", + "//folly/executors:manual_executor", + "//folly/executors:queued_immediate_executor", + "//folly/futures:core", + "//folly/io/async:request_context", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "GlobalExecutorTest", + srcs = ["GlobalExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:global_executor", + "//folly/executors:io_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/executors:virtual_executor", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/synchronization:saturating_semaphore", + "//folly/system:hardware_concurrency", + ], +) + +cpp_unittest( + name = "GlobalCPUExecutorTest", + srcs = ["GlobalCPUExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:global_executor", + "//folly/executors:io_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "GlobalIOExecutorTest", + srcs = ["GlobalCPUExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:global_executor", + "//folly/executors:io_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "GlobalExecutorAssignmentTest", + srcs = ["GlobalExecutorAssignmentTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:singleton", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:global_executor", + "//folly/executors:inline_executor", + "//folly/executors:io_executor", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "SerialExecutorTest", + srcs = ["SerialExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly:scope_guard", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:inline_executor", + "//folly/executors:serial_executor", + "//folly/io/async:request_context", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "SequencedExecutorTest", + srcs = ["SequencedExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:serial_executor", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "StrandExecutorTest", + srcs = ["StrandExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:cancellation_token", + "//folly/executors:global_executor", + "//folly/executors:manual_executor", + "//folly/executors:strand_executor", + "//folly/io/async:request_context", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "ThreadedExecutorTest", + srcs = ["ThreadedExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly/executors:threaded_executor", + "//folly/futures:core", + "//folly/gen:base", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "ThreadPoolExecutorTest", + size = "medium", + srcs = ["ThreadPoolExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:c_portability", + "//folly:default_keep_alive_executor", + "//folly:exception", + "//folly/container:f14_hash", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:edf_thread_pool_executor", + "//folly/executors:future_executor", + "//folly/executors:io_thread_pool_executor", + "//folly/executors:thread_pool_executor", + "//folly/executors:virtual_executor", + "//folly/executors/task_queue:lifo_sem_mpmc_queue", + "//folly/executors/task_queue:unbounded_blocking_queue", + "//folly/executors/thread_factory:init_thread_factory", + "//folly/executors/thread_factory:priority_thread_factory", + "//folly/lang:keep", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:pthread", + "//folly/portability:sys_resource", + "//folly/synchronization:latch", + "//folly/synchronization/detail:spin", + "//folly/system:thread_id", + "@boost.thread", + ], +) + +cpp_unittest( + name = "TimedDrivableExecutorTest", + srcs = ["TimedDrivableExecutorTest.cpp"], + deps = [ + "//folly/executors:timed_drivable_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "TimekeeperScheduledExecutorTest", + srcs = ["TimekeeperScheduledExecutorTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/executors:inline_executor", + "//folly/executors:serial_executor", + "//folly/executors:threaded_executor", + "//folly/executors:timekeeper_scheduled_executor", + "//folly/futures:manual_timekeeper", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "ExecutorWithPriorityTest", + srcs = ["ExecutorWithPriorityTest.cpp"], + deps = [ + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:executor_with_priority", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "MeteredExecutorTest", + srcs = ["MeteredExecutorTest.cpp"], + # Mac Clang is stricter about not allowing you to use deprecated functions. + # std::shared_ptr::unique() was deprecated in C++17, so bring it back. + local_defines = ["_LIBCPP_ENABLE_CXX20_REMOVED_SHARED_PTR_UNIQUE"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:benchmark", + "//folly:synchronized", + "//folly/coro:blocking_wait", + "//folly/coro:task", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:metered_executor", + "//folly/init", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/synchronization:latch", + "//folly/synchronization:lifo_sem", + "//folly/test:deterministic_schedule", + ], +) + +cpp_library( + name = "IOThreadPoolExecutorBaseTestLib", + hdrs = [ + "IOThreadPoolExecutorBaseTestLib.h", + ], + deps = [ + "//folly:random", + "//folly/container:f14_hash", + "//folly/executors:io_thread_pool_executor", + "//folly/io/async:async_base", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "@fmt", + "@glog", + ], +) + +cpp_unittest( + name = "function_scheduler_test", + size = "medium", + srcs = ["FunctionSchedulerTest.cpp"], + deps = [ + "//folly:random", + "//folly/executors:function_scheduler", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "@boost.thread", + "@glog", + ], +) + +cpp_unittest( + name = "threaded_repeating_function_runner_test", + srcs = ["ThreadedRepeatingFunctionRunnerTest.cpp"], + deps = [ + "//folly/executors:threaded_repeating_function_runner", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/thread_factory/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/thread_factory/BUILD.bazel new file mode 100644 index 00000000000..bd2215344d3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/executors/thread_factory/BUILD.bazel @@ -0,0 +1,45 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "named_thread_factory", + hdrs = ["NamedThreadFactory.h"], + deps = [ + ":thread_factory", + "//folly:conv", + "//folly:range", + "//folly/system:thread_name", + ], +) + +cpp_library( + name = "priority_thread_factory", + srcs = ["PriorityThreadFactory.cpp"], + hdrs = ["PriorityThreadFactory.h"], + deps = [ + ":init_thread_factory", + "//folly:string", + "//folly/portability:sys_resource", + "//folly/portability:sys_time", + "//folly/system:thread_name", + "@glog", + ], +) + +cpp_library( + name = "init_thread_factory", + hdrs = ["InitThreadFactory.h"], + deps = [ + ":thread_factory", + "//folly:scope_guard", + ], +) + +cpp_library( + name = "thread_factory", + hdrs = ["ThreadFactory.h"], + deps = [ + "//folly:executor", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/BUILD.bazel new file mode 100644 index 00000000000..4acd008a3c6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/BUILD.bazel @@ -0,0 +1,73 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "elias_fano_coding", + hdrs = [ + "EliasFanoCoding.h", + ], + deps = [ + "//folly/compression/elias_fano:elias_fano_coding", + ], +) + +cpp_library( + name = "event_count", + hdrs = [ + "EventCount.h", + ], + deps = [ + "//folly/synchronization:event_count", + ], +) + +cpp_library( + name = "flat_combining_priority_queue", + hdrs = [ + "FlatCombiningPriorityQueue.h", + ], + deps = [ + "//folly/concurrency/container:flat_combining_priority_queue", + ], +) + +cpp_library( + name = "relaxed_concurrent_priority_queue", + hdrs = [ + "RelaxedConcurrentPriorityQueue.h", + ], + deps = [ + "//folly/concurrency/container:relaxed_concurrent_priority_queue", + ], +) + +cpp_library( + name = "function_scheduler", + hdrs = [ + "FunctionScheduler.h", + ], + deps = [ + "//folly/executors:function_scheduler", + ], +) + +cpp_library( + name = "test_util", + hdrs = [ + "TestUtil.h", + ], + deps = [ + "//folly/testing:test_util", + ], +) + +cpp_library( + name = "threaded_repeating_function_runner", + hdrs = [ + "ThreadedRepeatingFunctionRunner.h", + ], + deps = [ + "//folly/executors:threaded_repeating_function_runner", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/BUILD.bazel new file mode 100644 index 00000000000..22cbbde76b5 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/BUILD.bazel @@ -0,0 +1,187 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "channel", + hdrs = [ + "Channel.h", + "Channel-fwd.h", + ], + textual_hdrs = [ + "Channel-inl.h", + ], + deps = [ + "//folly/channels:channel", + ], +) + +cpp_library( + name = "channel_callback_handle", + hdrs = [ + "ChannelCallbackHandle.h", + ], + deps = [ + "//folly/channels:channel_callback_handle", + ], +) + +cpp_library( + name = "channel_processor", + hdrs = [ + "ChannelProcessor.h", + ], + textual_hdrs = [ + "ChannelProcessor-inl.h", + ], + deps = [ + "//folly/channels:channel_processor", + ], +) + +cpp_library( + name = "consume_channel", + hdrs = [ + "ConsumeChannel.h", + ], + textual_hdrs = [ + "ConsumeChannel-inl.h", + ], + deps = [ + "//folly/channels:consume_channel", + ], +) + +cpp_library( + name = "fanout_channel", + hdrs = [ + "FanoutChannel.h", + ], + textual_hdrs = [ + "FanoutChannel-inl.h", + ], + deps = [ + "//folly/channels:fanout_channel", + ], +) + +cpp_library( + name = "fanout_sender", + hdrs = [ + "FanoutSender.h", + ], + textual_hdrs = [ + "FanoutSender-inl.h", + ], + deps = [ + "//folly/channels:fanout_sender", + ], +) + +cpp_library( + name = "merge", + hdrs = [ + "Merge.h", + ], + textual_hdrs = [ + "Merge-inl.h", + ], + deps = [ + "//folly/channels:merge", + ], +) + +cpp_library( + name = "merge_channel", + hdrs = [ + "MergeChannel.h", + ], + textual_hdrs = [ + "MergeChannel-inl.h", + ], + deps = [ + "//folly/channels:merge_channel", + ], +) + +cpp_library( + name = "multiplex_channel", + hdrs = [ + "MultiplexChannel.h", + ], + textual_hdrs = [ + "MultiplexChannel-inl.h", + ], + deps = [ + "//folly/channels:multiplex_channel", + ], +) + +cpp_library( + name = "on_closed_exception", + hdrs = [ + "OnClosedException.h", + ], + deps = [ + "//folly/channels:on_closed_exception", + ], +) + +cpp_library( + name = "producer", + hdrs = [ + "Producer.h", + ], + textual_hdrs = [ + "Producer-inl.h", + ], + deps = [ + "//folly/channels:producer", + ], +) + +cpp_library( + name = "proxy_channel", + hdrs = [ + "ProxyChannel.h", + ], + textual_hdrs = [ + "ProxyChannel-inl.h", + ], + deps = [ + "//folly/channels:proxy_channel", + ], +) + +cpp_library( + name = "rate_limiter", + hdrs = [ + "RateLimiter.h", + ], + deps = [ + "//folly/channels:rate_limiter", + ], +) + +cpp_library( + name = "max_concurrent_rate_limiter", + hdrs = [ + "MaxConcurrentRateLimiter.h", + ], + deps = [ + "//folly/channels:max_concurrent_rate_limiter", + ], +) + +cpp_library( + name = "transform", + hdrs = [ + "Transform.h", + ], + textual_hdrs = [ + "Transform-inl.h", + ], + deps = [ + "//folly/channels:transform", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/detail/BUILD.bazel new file mode 100644 index 00000000000..44126f5a88e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/detail/BUILD.bazel @@ -0,0 +1,63 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_queue", + hdrs = [ + "AtomicQueue.h", + ], + deps = [ + "//folly/channels/detail:atomic_queue", + ], +) + +cpp_library( + name = "channel_bridge", + hdrs = [ + "ChannelBridge.h", + ], + deps = [ + "//folly/channels/detail:channel_bridge", + ], +) + +cpp_library( + name = "intrusive_ptr", + hdrs = [ + "IntrusivePtr.h", + ], + deps = [ + "//folly/channels/detail:intrusive_ptr", + ], +) + +cpp_library( + name = "multiplexer_traits", + hdrs = [ + "MultiplexerTraits.h", + ], + deps = [ + "//folly/channels/detail:multiplexer_traits", + ], +) + +cpp_library( + name = "pointer_variant", + hdrs = [ + "PointerVariant.h", + ], + deps = [ + "//folly/channels/detail:pointer_variant", + ], +) + +cpp_library( + name = "utility", + hdrs = [ + "Utility.h", + ], + deps = [ + "//folly/channels/detail:utility", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/test/BUILD.bazel new file mode 100644 index 00000000000..b8a14feb7bb --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/channels/test/BUILD.bazel @@ -0,0 +1,13 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "channel_test_util", + hdrs = [ + "ChannelTestUtil.h", + ], + deps = [ + "//folly/channels/test:channel_test_util", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/coro/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/coro/BUILD.bazel new file mode 100644 index 00000000000..312a68236cf --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/coro/BUILD.bazel @@ -0,0 +1,524 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_generator", + hdrs = [ + "AsyncGenerator.h", + ], + deps = [ + "//folly/coro:async_generator", + ], +) + +cpp_library( + name = "async_pipe", + hdrs = [ + "AsyncPipe.h", + ], + deps = [ + "//folly/coro:async_pipe", + ], +) + +cpp_library( + name = "async_scope", + hdrs = [ + "AsyncScope.h", + ], + deps = [ + "//folly/coro:async_scope", + ], +) + +cpp_library( + name = "async_stack", + hdrs = [ + "AsyncStack.h", + ], + deps = [ + "//folly/coro:async_stack", + ], +) + +cpp_library( + name = "baton", + hdrs = [ + "Baton.h", + ], + deps = [ + "//folly/coro:baton", + ], +) + +cpp_library( + name = "blocking_wait", + hdrs = [ + "BlockingWait.h", + ], + deps = [ + "//folly/coro:blocking_wait", + ], +) + +cpp_library( + name = "collect", + hdrs = [ + "Collect.h", + ], + textual_hdrs = [ + "Collect-inl.h", + ], + deps = [ + "//folly/coro:collect", + ], +) + +cpp_library( + name = "concat", + hdrs = [ + "Concat.h", + ], + textual_hdrs = [ + "Concat-inl.h", + ], + deps = [ + "//folly/coro:concat", + ], +) + +cpp_library( + name = "coroutine", + hdrs = [ + "Coroutine.h", + ], + deps = [ + "//folly/coro:coroutine", + ], +) + +cpp_library( + name = "current_executor", + hdrs = [ + "CurrentExecutor.h", + ], + deps = [ + "//folly/coro:current_executor", + ], +) + +cpp_library( + name = "detach_on_cancel", + hdrs = [ + "DetachOnCancel.h", + ], + deps = [ + "//folly/coro:detach_on_cancel", + ], +) + +cpp_library( + name = "detail_barrier", + hdrs = [ + "detail/Barrier.h", + ], + deps = [ + "//folly/coro:detail_barrier", + ], +) + +cpp_library( + name = "detail_barrier_task", + hdrs = [ + "detail/BarrierTask.h", + ], + deps = [ + "//folly/coro:detail_barrier_task", + ], +) + +cpp_library( + name = "detail_current_async_frame", + hdrs = [ + "detail/CurrentAsyncFrame.h", + ], + deps = [ + "//folly/coro:detail_current_async_frame", + ], +) + +cpp_library( + name = "detail_helpers", + hdrs = [ + "detail/Helpers.h", + ], + deps = [ + "//folly/coro:detail_helpers", + ], +) + +cpp_library( + name = "detail_malloc", + hdrs = [ + "detail/Malloc.h", + ], + deps = [ + "//folly/coro:detail_malloc", + ], +) + +cpp_library( + name = "detail_manual_lifetime", + hdrs = [ + "detail/ManualLifetime.h", + ], + deps = [ + "//folly/coro:detail_manual_lifetime", + ], +) + +cpp_library( + name = "detail_traits", + hdrs = [ + "detail/Traits.h", + ], + deps = [ + "//folly/coro:detail_traits", + ], +) + +cpp_library( + name = "filter", + hdrs = [ + "Filter.h", + ], + textual_hdrs = [ + "Filter-inl.h", + ], + deps = [ + "//folly/coro:filter", + ], +) + +cpp_library( + name = "future_util", + hdrs = [ + "FutureUtil.h", + ], + deps = [ + "//folly/coro:future_util", + ], +) + +cpp_library( + name = "generator", + hdrs = [ + "Generator.h", + ], + deps = [ + "//folly/coro:generator", + ], +) + +cpp_library( + name = "gmock_helpers", + hdrs = [ + "GmockHelpers.h", + ], + deps = [ + "//folly/coro:gmock_helpers", + ], +) + +cpp_library( + name = "gtest_helpers", + hdrs = [ + "GtestHelpers.h", + ], + deps = [ + "//folly/coro:gtest_helpers", + ], +) + +cpp_library( + name = "inline_task", + hdrs = [ + "detail/InlineTask.h", + ], + deps = [ + "//folly/coro:inline_task", + ], +) + +cpp_library( + name = "invoke", + hdrs = [ + "Invoke.h", + ], + deps = [ + "//folly/coro:invoke", + ], +) + +cpp_library( + name = "merge", + hdrs = [ + "Merge.h", + ], + textual_hdrs = [ + "Merge-inl.h", + ], + deps = [ + "//folly/coro:merge", + ], +) + +cpp_library( + name = "mutex", + hdrs = [ + "Mutex.h", + ], + deps = [ + "//folly/coro:mutex", + ], +) + +cpp_library( + name = "promise", + hdrs = [ + "Promise.h", + ], + deps = [ + "//folly/coro:promise", + ], +) + +cpp_library( + name = "result", + hdrs = [ + "Result.h", + ], + deps = [ + "//folly/coro:result", + ], +) + +cpp_library( + name = "retry", + hdrs = [ + "Retry.h", + ], + deps = [ + "//folly/coro:retry", + ], +) + +cpp_library( + name = "rust_adaptors", + hdrs = [ + "RustAdaptors.h", + ], + deps = [ + "//folly/coro:rust_adaptors", + ], +) + +cpp_library( + name = "scope_exit", + hdrs = [ + "ScopeExit.h", + ], + deps = [ + "//folly/coro:scope_exit", + ], +) + +cpp_library( + name = "shared_lock", + hdrs = [ + "SharedLock.h", + ], + deps = [ + "//folly/coro:shared_lock", + ], +) + +cpp_library( + name = "shared_mutex", + hdrs = [ + "SharedMutex.h", + ], + deps = [ + "//folly/coro:shared_mutex", + ], +) + +cpp_library( + name = "sleep", + hdrs = [ + "Sleep.h", + ], + textual_hdrs = [ + "Sleep-inl.h", + ], + deps = [ + "//folly/coro:sleep", + ], +) + +cpp_library( + name = "small_unbounded_queue", + hdrs = [ + "SmallUnboundedQueue.h", + ], + deps = [ + "//folly/coro:small_unbounded_queue", + ], +) + +cpp_library( + name = "task", + hdrs = [ + "Task.h", + ], + deps = [ + "//folly/coro:task", + ], +) + +cpp_library( + name = "timed_wait", + hdrs = [ + "TimedWait.h", + ], + deps = [ + "//folly/coro:timed_wait", + ], +) + +cpp_library( + name = "timeout", + hdrs = [ + "Timeout.h", + ], + textual_hdrs = [ + "Timeout-inl.h", + ], + deps = [ + "//folly/coro:timeout", + ], +) + +cpp_library( + name = "traits", + hdrs = [ + "Traits.h", + ], + deps = [ + "//folly/coro:traits", + ], +) + +cpp_library( + name = "transform", + hdrs = [ + "Transform.h", + ], + textual_hdrs = [ + "Transform-inl.h", + ], + deps = [ + "//folly/coro:transform", + ], +) + +cpp_library( + name = "unbounded_queue", + hdrs = [ + "UnboundedQueue.h", + ], + deps = [ + "//folly/coro:unbounded_queue", + ], +) + +cpp_library( + name = "via_if_async", + hdrs = [ + "ViaIfAsync.h", + ], + deps = [ + "//folly/coro:via_if_async", + ], +) + +cpp_library( + name = "with_async_stack", + hdrs = [ + "WithAsyncStack.h", + ], + deps = [ + "//folly/coro:with_async_stack", + ], +) + +cpp_library( + name = "with_cancellation", + hdrs = [ + "WithCancellation.h", + ], + deps = [ + "//folly/coro:with_cancellation", + ], +) + +cpp_library( + name = "bounded_queue", + hdrs = [ + "BoundedQueue.h", + ], + deps = [ + "//folly/coro:bounded_queue", + ], +) + +cpp_library( + name = "shared_promise", + hdrs = [ + "SharedPromise.h", + ], + deps = [ + "//folly/coro:shared_promise", + ], +) + +cpp_library( + name = "cleanup", + hdrs = [ + "Cleanup.h", + ], + deps = [ + "//folly/coro:cleanup", + ], +) + +cpp_library( + name = "auto_cleanup_fwd", + hdrs = [ + "AutoCleanup-fwd.h", + ], + deps = [ + "//folly/coro:auto_cleanup_fwd", + ], +) + +cpp_library( + name = "auto_cleanup", + hdrs = [ + "AutoCleanup.h", + ], + deps = [ + "//folly/coro:auto_cleanup", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/crypto/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/crypto/BUILD.bazel new file mode 100644 index 00000000000..a8eee07680b --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/crypto/BUILD.bazel @@ -0,0 +1,43 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "blake2xb", + hdrs = [ + "Blake2xb.h", + ], + deps = [ + "//folly/crypto:blake2xb", + ], +) + +cpp_library( + name = "lt_hash", + hdrs = [ + "LtHash.h", + ], + deps = [ + "//folly/crypto:lt_hash", + ], +) + +cpp_library( + name = "lt_hash_sse2", + hdrs = [ + "LtHash.h", + ], + deps = [ + "//folly/crypto:lt_hash_sse2", # @manual + ], +) + +cpp_library( + name = "lt_hash_avx2", + hdrs = [ + "LtHash.h", + ], + deps = [ + "//folly/crypto:lt_hash_avx2", # @manual + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/exception_tracer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/exception_tracer/BUILD.bazel new file mode 100644 index 00000000000..a37bc48bca6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/exception_tracer/BUILD.bazel @@ -0,0 +1,75 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "exception_abi", + hdrs = ["ExceptionAbi.h"], + deps = [ + "//folly/debugging/exception_tracer:exception_abi", + ], +) + +cpp_library( + name = "exception_counter", + hdrs = ["ExceptionCounterLib.h"], + deps = [ + "//folly/debugging/exception_tracer:exception_counter", + ], +) + +cpp_library( + name = "exception_tracer", + deps = [ + "//folly/debugging/exception_tracer", + ], +) + +cpp_library( + name = "exception_tracer_base", + hdrs = ["ExceptionTracer.h"], + deps = [ + "//folly/debugging/exception_tracer:exception_tracer_base", + ], +) + +cpp_library( + name = "exception_tracer_callbacks", + hdrs = ["ExceptionTracerLib.h"], + deps = [ + "//folly/debugging/exception_tracer:exception_tracer_callbacks", + ], +) + +cpp_library( + name = "stacktrace", + hdrs = ["StackTrace.h"], + deps = [ + "//folly/debugging/exception_tracer:stacktrace", + ], +) + +cpp_library( + name = "smart_exception_tracer_singleton", + hdrs = [ + "SmartExceptionTracerSingleton.h", + ], + deps = [ + "//folly/debugging/exception_tracer:smart_exception_tracer_singleton", + ], +) + +cpp_library( + name = "smart_exception_stack_trace_hooks", + deps = [ + "//folly/debugging/exception_tracer:smart_exception_stack_trace_hooks", + ], +) + +cpp_library( + name = "smart_exception_tracer", + hdrs = ["SmartExceptionTracer.h"], + deps = [ + "//folly/debugging/exception_tracer:smart_exception_tracer", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/BUILD.bazel new file mode 100644 index 00000000000..8b1ffd085ff --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/BUILD.bazel @@ -0,0 +1,13 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "flat_combining", + hdrs = [ + "FlatCombining.h", + ], + deps = [ + "//folly/synchronization:flat_combining", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/test/BUILD.bazel new file mode 100644 index 00000000000..dc87bb519c5 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/flat_combining/test/BUILD.bazel @@ -0,0 +1,23 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "flat_combining_examples", + hdrs = [ + "FlatCombiningExamples.h", + ], + deps = [ + "//folly/synchronization/test:flat_combining_examples", + ], +) + +cpp_library( + name = "flat_combining_test_helpers", + hdrs = [ + "FlatCombiningTestHelpers.h", + ], + deps = [ + "//folly/synchronization/test:flat_combining_test_helpers", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/BUILD.bazel new file mode 100644 index 00000000000..35184741c36 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/BUILD.bazel @@ -0,0 +1,169 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_base", + hdrs = [ + "AsyncBase.h", + ], + deps = [ + "//folly/io/async:async_base_class", + ], +) + +cpp_library( + name = "async_io", + hdrs = [ + "AsyncIO.h", + ], + deps = [ + "//folly/io/async:async_io", + ], +) + +cpp_library( + name = "liburing", + hdrs = [ + "Liburing.h", + ], + deps = [ + "//folly/io/async:liburing", + ], +) + +cpp_library( + name = "async_io_uring_socket", + hdrs = [ + "AsyncIoUringSocket.h", + "AsyncIoUringSocketFactory.h", + ], + deps = [ + "//folly/io/async:async_io_uring_socket", + ], +) + +cpp_library( + name = "simple_async_io", + hdrs = [ + "SimpleAsyncIO.h", + ], + deps = [ + "//folly/io/async:simple_async_io", + ], +) + +cpp_library( + name = "epoll", + hdrs = [ + "Epoll.h", + ], + deps = [ + "//folly/io/async:epoll", + ], +) + +cpp_library( + # @autodeps-skip + name = "epoll_backend", + hdrs = [ + "Epoll.h", + "EpollBackend.h", + ], + deps = [ + "//folly/io/async:epoll_backend", + ], +) + +cpp_library( + name = "event_base_poller", + hdrs = [ + "EventBasePoller.h", + ], + deps = [ + "//folly/io/async:event_base_poller", + ], +) + +cpp_library( + name = "mux_io_thread_pool_executor", + hdrs = [ + "MuxIOThreadPoolExecutor.h", + ], + deps = [ + "//folly/io/async:mux_io_thread_pool_executor", + ], +) + +cpp_library( + name = "io_uring", + hdrs = [ + "IoUring.h", + ], + deps = [ + "//folly/io/async:io_uring", + ], +) + +cpp_library( + name = "io_uring_backend", + hdrs = [ + "IoUringBackend.h", + "IoUringBase.h", + ], + deps = [ + "//folly/io/async:io_uring_backend", + ], +) + +cpp_library( + # @autodeps-skip + name = "io_uring_provided_buffer_ring", + hdrs = [ + "IoUringBase.h", + "IoUringProvidedBufferRing.h", + ], + deps = [ + "//folly/io/async:io_uring_provided_buffer_ring", + ], +) + +cpp_library( + name = "io_uring_event", + hdrs = [ + "IoUringEvent.h", + ], + deps = [ + "//folly/io/async:io_uring_event", + ], +) + +cpp_library( + name = "io_uring_event_base_local", + hdrs = [ + "IoUringEventBaseLocal.h", + ], + deps = [ + "//folly/io/async:io_uring_event_base_local", + ], +) + +cpp_library( + name = "fs_util", + hdrs = [ + "FsUtil.h", + ], + deps = [ + "//folly/io:fs_util", + ], +) + +cpp_library( + name = "huge_pages", + hdrs = [ + "HugePages.h", + ], + deps = [ + "//folly/io:huge_pages", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/test/BUILD.bazel new file mode 100644 index 00000000000..6ea89ae12e3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/io/test/BUILD.bazel @@ -0,0 +1,30 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "io_test_temp_file_util_lib", + hdrs = [ + "IoTestTempFileUtil.h", + ], + deps = [ + "//folly/io/async/test:io_test_temp_file_util_lib", + ], +) + +cpp_library( + name = "async_base_test_lib", + hdrs = [ + "AsyncBaseTestLib.h", + ], + deps = [ + "//folly/io/async/test:async_base_test_lib", + ], +) + +cpp_library( + name = "mux_io_thread_pool_executor_test_lib", + deps = [ + "//folly/io/async/test:mux_io_thread_pool_executor_test_lib", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/BUILD.bazel new file mode 100644 index 00000000000..cc9a3d98d31 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/BUILD.bazel @@ -0,0 +1,86 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "observable", + hdrs = [ + "Observable.h", + ], + textual_hdrs = [ + "Observable-inl.h", + ], + deps = [ + "//folly/observer:observable", + ], +) + +cpp_library( + name = "observer", + hdrs = [ + "Observer.h", + ], + textual_hdrs = [ + "Observer-inl.h", + "Observer-pre.h", + ], + deps = [ + "//folly/observer", + ], +) + +cpp_library( + name = "hazptr_observer", + hdrs = [ + "HazptrObserver.h", + ], + deps = [ + "//folly/observer:hazptr_observer", + ], +) + +cpp_library( + name = "read_mostly_tl_observer", + hdrs = [ + "ReadMostlyTLObserver.h", + ], + deps = [ + "//folly/observer:read_mostly_tl_observer", + ], +) + +cpp_library( + name = "core_cached_observer", + hdrs = [ + "CoreCachedObserver.h", + ], + deps = [ + "//folly/observer:core_cached_observer", + ], +) + +cpp_library( + name = "simple_observable", + hdrs = [ + "SimpleObservable.h", + ], + textual_hdrs = [ + "SimpleObservable-inl.h", + ], + deps = [ + "//folly/observer:simple_observable", + ], +) + +cpp_library( + name = "with_jitter", + hdrs = [ + "WithJitter.h", + ], + textual_hdrs = [ + "WithJitter-inl.h", + ], + deps = [ + "//folly/observer:with_jitter", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/detail/BUILD.bazel new file mode 100644 index 00000000000..a5684713515 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/observer/detail/BUILD.bazel @@ -0,0 +1,24 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "graph_cycle_detector", + hdrs = [ + "GraphCycleDetector.h", + ], + deps = [ + "//folly/observer/detail:graph_cycle_detector", + ], +) + +cpp_library( + name = "observer_manager", + hdrs = [ + "Core.h", + "ObserverManager.h", + ], + deps = [ + "//folly/observer/detail:observer_manager", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/settings/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/settings/BUILD.bazel new file mode 100644 index 00000000000..f6996d24697 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/settings/BUILD.bazel @@ -0,0 +1,34 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "settings", + hdrs = [ + "Settings.h", + "detail/SettingsImpl.h", + ], + deps = [ + "//folly/settings", + ], +) + +cpp_library( + name = "types", + hdrs = [ + "Types.h", + ], + deps = [ + "//folly/settings:types", + ], +) + +cpp_library( + name = "immutables", + hdrs = [ + "Immutables.h", + ], + deps = [ + "//folly/settings:immutables", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/BUILD.bazel new file mode 100644 index 00000000000..ba2c60c0368 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/BUILD.bazel @@ -0,0 +1,100 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "dwarf", + hdrs = [ + "Dwarf.h", + "DwarfImpl.h", + "DwarfLineNumberVM.h", + "DwarfSection.h", + "DwarfUtil.h", + ], + deps = [ + "//folly/debugging/symbolizer:dwarf", + ], +) + +cpp_library( + name = "elf", + hdrs = [ + "Elf.h", + ], + textual_hdrs = [ + "Elf-inl.h", + ], + deps = [ + "//folly/debugging/symbolizer:elf", + ], +) + +cpp_library( + name = "symbolized_frame", + hdrs = [ + "SymbolizedFrame.h", + ], + deps = [ + "//folly/debugging/symbolizer:symbolized_frame", + ], +) + +cpp_library( + name = "line_reader", + hdrs = [ + "LineReader.h", + ], + deps = [ + "//folly/debugging/symbolizer:line_reader", + ], +) + +cpp_library( + name = "stack_trace", + hdrs = [ + "StackTrace.h", + ], + deps = [ + "//folly/debugging/symbolizer:stack_trace", + ], +) + +cpp_library( + name = "elf_cache", + hdrs = [ + "ElfCache.h", + ], + deps = [ + "//folly/debugging/symbolizer:elf_cache", + ], +) + +cpp_library( + name = "symbolize_printer", + hdrs = [ + "SymbolizePrinter.h", + ], + deps = [ + "//folly/debugging/symbolizer:symbolize_printer", + ], +) + +cpp_library( + name = "symbolizer", + hdrs = [ + "Symbolizer.h", + ], + deps = [ + "//folly/debugging/symbolizer", + ], +) + +cpp_library( + name = "signal_handler", + hdrs = [ + "SignalHandler.h", + ], + deps = [ + "//folly/debugging/symbolizer:signal_handler", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/detail/BUILD.bazel new file mode 100644 index 00000000000..60a4f543974 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/symbolizer/detail/BUILD.bazel @@ -0,0 +1,13 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "debug", + hdrs = [ + "Debug.h", + ], + deps = [ + "//folly/debugging/symbolizer/detail:debug", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/test/BUILD.bazel new file mode 100644 index 00000000000..c22de672b64 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/experimental/test/BUILD.bazel @@ -0,0 +1,13 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "coding_test_utils", + hdrs = [ + "CodingTestUtils.h", + ], + deps = [ + "//folly/compression/test:coding_test_utils", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/BUILD.bazel new file mode 100644 index 00000000000..3d3497e6f55 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/BUILD.bazel @@ -0,0 +1,9 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "test_ext", + srcs = ["test_ext.cpp"], + hdrs = ["test_ext.h"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/buck2/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/buck2/BUILD.bazel new file mode 100644 index 00000000000..7541d20a6b2 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ext/buck2/BUILD.bazel @@ -0,0 +1,14 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "test_ext", + srcs = ["test_ext.cpp"], + deps = [ + "//folly/experimental/io:fs_util", + "//folly/ext:test_ext", + "//folly/json:dynamic", + "@boost.filesystem", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/aor/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/aor/BUILD.bazel new file mode 100644 index 00000000000..1222d0f7fc0 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/aor/BUILD.bazel @@ -0,0 +1,71 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "memcpy_aarch64", + srcs = [ + "memcpy-advsimd.S", + "memcpy-armv8.S", + "memcpy-mops.S", + "memcpy_sve.S", + "memmove-mops.S", + ], + hdrs = [ + "asmdefs.h", + ], + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], +) + +cpp_library( + name = "memcpy_aarch64-use", + srcs = [ + "memcpy-advsimd.S", + "memcpy-armv8.S", + "memcpy-mops.S", + "memcpy_sve.S", + "memmove-mops.S", + ], + hdrs = [ + "asmdefs.h", + ], + copts = ["-DFOLLY_MEMCPY_IS_MEMCPY"], + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], +) + +cpp_library( + name = "memset_aarch64", + srcs = [ + "memset-advsimd.S", + "memset-mops.S", + ], + hdrs = [ + "asmdefs.h", + ], + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], +) + +cpp_library( + name = "memset_aarch64-use", + srcs = [ + "memset-advsimd.S", + "memset-mops.S", + ], + hdrs = [ + "asmdefs.h", + ], + copts = ["-DFOLLY_MEMCPY_IS_MEMCPY"], + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:aarch64", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/BUILD.bazel new file mode 100644 index 00000000000..0e1853d83e0 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "farmhash", + srcs = ["farmhash.cpp"], + hdrs = ["farmhash.h"], + deps = [ + "//folly/portability:config", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/test/BUILD.bazel new file mode 100644 index 00000000000..b8d4b833d47 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/farmhash/test/BUILD.bazel @@ -0,0 +1,10 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "farmhash_test", + srcs = ["farmhash_test.cpp"], + deps = [ + "//folly/external/farmhash", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/fast-crc32/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/fast-crc32/BUILD.bazel new file mode 100644 index 00000000000..5ad4586a42a --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/fast-crc32/BUILD.bazel @@ -0,0 +1,77 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "avx512_crc32c_v8s3x4", + srcs = [ + "avx512_crc32c_v8s3x4.cpp", + ], + hdrs = [ + "avx512_crc32c_v8s3x4.h", + ], + copts = select({ + "@platforms//cpu:x86_64": [ + "-mavx512f", + "-mavx512vl", + "-mpclmul", + ], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "sse_crc32c_v8s3x3", + srcs = [ + "sse_crc32c_v8s3x3.cpp", + ], + hdrs = [ + "sse_crc32c_v8s3x3.h", + ], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "neon_crc32c_v3s4x2e_v2", + srcs = [ + "neon_crc32c_v3s4x2e_v2.cpp", + ], + hdrs = [ + "neon_crc32c_v3s4x2e_v2.h", + ], + copts = select({ + "@platforms//cpu:aarch64": [ + "-march=armv8-a+crypto+crc", + ], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + "//folly/system:aux_vector", + ], +) + +cpp_library( + name = "neon_eor3_crc32c_v8s2x4_s3", + srcs = [ + "neon_eor3_crc32c_v8s2x4_s3.cpp", + ], + hdrs = [ + "neon_eor3_crc32c_v8s2x4_s3.h", + ], + copts = select({ + "@platforms//cpu:aarch64": [ + "-march=armv8-a+crypto+crc", + ], + "//conditions:default": [], + }), + deps = [ + "//folly:portability", + "//folly/system:aux_vector", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/detail/BUILD.bazel new file mode 100644 index 00000000000..f8fdb87215d --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/detail/BUILD.bazel @@ -0,0 +1,13 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "range_sve2", + srcs = ["RangeSve2.cpp"], + hdrs = ["RangeSve2.h"], + deps = [ + "//folly:portability", + "//folly/detail:range_common", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/BUILD.bazel new file mode 100644 index 00000000000..06332fd5ea4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/BUILD.bazel @@ -0,0 +1,11 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "checksum", + srcs = ["Checksum.cpp"], + deps = [ + "//folly:portability", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/detail/BUILD.bazel new file mode 100644 index 00000000000..6e67feb8093 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/external/nvidia/hash/detail/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "crc32c_detail", + srcs = ["Crc32cDetail.cpp"], + hdrs = ["Crc32cCombineDetail.h"], + deps = [ + "//folly:portability", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/BUILD.bazel new file mode 100644 index 00000000000..92325f385ba --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/BUILD.bazel @@ -0,0 +1,353 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "add_tasks", + hdrs = [ + "AddTasks.h", + ], + textual_hdrs = [ + "AddTasks-inl.h", + ], + deps = [ + ":core", + "//folly:optional", + "//folly:try", + ], +) + +cpp_library( + name = "atomic_batch_dispatcher", + hdrs = [ + "AtomicBatchDispatcher.h", + ], + textual_hdrs = [ + "AtomicBatchDispatcher-inl.h", + ], + deps = [ + "//folly:c_portability", + "//folly:function", + "//folly:optional", + "//folly/fibers/detail:atomic_batch_dispatcher", + "//folly/futures:core", + ], +) + +cpp_library( + name = "batch_dispatcher", + hdrs = ["BatchDispatcher.h"], + deps = [ + "//folly:function", + "//folly/futures:core", + ], +) + +cpp_library( + name = "boost_context_compatibility", + hdrs = ["BoostContextCompatibility.h"], + deps = [ + "//folly:function", + "@boost.context", + "@glog", + ], +) + +cpp_library( + name = "core", + srcs = [ + "Baton.cpp", + "Fiber.cpp", + "FiberManager.cpp", + ], + hdrs = [ + "Baton.h", + "Fiber.h", + "FiberManagerInternal.h", + "FiberManagerInternal-inl.h", + "Promise.h", + ], + textual_hdrs = [ + "Promise-inl.h", + "Baton-inl.h", + "Fiber-inl.h", + ], + deps = [ + ":boost_context_compatibility", + ":guard_page_allocator", + ":loop_controller", + ":traits", + "//folly:atomic_linked_list", + "//folly:c_portability", + "//folly:constexpr_math", + "//folly:executor", + "//folly:function", + "//folly:intrusive_list", + "//folly:likely", + "//folly:memory", + "//folly:optional", + "//folly:portability", + "//folly:scope_guard", + "//folly:singleton_thread_local", + "//folly:try", + "//folly/coro:coroutine", + "//folly/detail:async_trace", + "//folly/detail:futex", + "//folly/detail:memory_idler", + "//folly/executors:execution_observer", + "//folly/functional:invoke", + "//folly/io/async:async_base", + "//folly/io/async:request_context", + "//folly/lang:thunk", + "//folly/memory:sanitize_address", + "//folly/portability:asm", + "//folly/portability:config", + "//folly/portability:pthread", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "//folly/synchronization:sanitize_thread", + "//folly/tracing:async_stack", + "@glog", + ], +) + +cpp_library( + name = "core_manager", + hdrs = [ + "FiberManager.h", + ], + textual_hdrs = [ + "FiberManager-inl.h", + ], + deps = [ + ":core", + "//folly/functional:invoke", + "//folly/futures:core", + ], +) + +cpp_library( + name = "event_base_loop_controller", + hdrs = [ + "EventBaseLoopController.h", + ], + textual_hdrs = [ + "EventBaseLoopController-inl.h", + ], + deps = [ + ":core", + ":executor_based_loop_controller", + "//folly:cancellation_token", + "//folly:memory", + "//folly/io/async:async_base", + ], +) + +cpp_library( + name = "executor_loop_controller", + hdrs = [ + "ExecutorLoopController.h", + ], + textual_hdrs = [ + "ExecutorLoopController-inl.h", + ], + deps = [ + ":core", + ":executor_based_loop_controller", + "//folly:executor", + "//folly:scope_guard", + "//folly/futures:core", + ], +) + +cpp_library( + name = "fiber_manager_map", + hdrs = [ + "FiberManagerMap.h", + ], + textual_hdrs = [ + "FiberManagerMap-inl.h", + ], + deps = [ + ":core", + ":event_base_loop_controller", + "//folly:function", + "//folly:scope_guard", + "//folly:singleton_thread_local", + "//folly:synchronized", + "//folly/container:f14_hash", + "//folly/io/async:async_base", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_library( + name = "fibers", + deps = [ + ":add_tasks", # @manual + ":atomic_batch_dispatcher", # @manual + ":batch_dispatcher", # @manual + ":batch_semaphore", # @manual + ":boost_context_compatibility", # @manual + ":core", # @manual + ":core_manager", # @manual + ":event_base_loop_controller", # @manual + ":fiber_manager_map", # @manual + ":for_each", # @manual + ":generic_baton", # @manual + ":guard_page_allocator", # @manual + ":loop_controller", # @manual + ":semaphore", # @manual + ":semaphore_base", # @manual + ":simple_loop_controller", # @manual + ":timed_mutex", # @manual + ":traits", # @manual + ":when_n", # @manual + ], +) + +cpp_library( + name = "for_each", + hdrs = [ + "ForEach.h", + ], + textual_hdrs = [ + "ForEach-inl.h", + ], + deps = [ + ":core", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "generic_baton", + hdrs = ["GenericBaton.h"], + deps = [ + ":core", + "//folly/synchronization:baton", + ], +) + +cpp_library( + name = "guard_page_allocator", + srcs = ["GuardPageAllocator.cpp"], + hdrs = ["GuardPageAllocator.h"], + linkopts = select({ + "@platforms//os:linux": ["-ldl"], + "//conditions:default": [], + }), + deps = [ + "//folly:singleton", + "//folly:spin_lock", + "//folly:synchronized", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "loop_controller", + hdrs = ["LoopController.h"], + deps = [ + "//folly/io/async:async_base_fwd", + ], +) + +cpp_library( + name = "executor_based_loop_controller", + hdrs = ["ExecutorBasedLoopController.h"], + deps = [ + ":loop_controller", + "//folly:executor", + ], +) + +cpp_library( + name = "semaphore", + srcs = ["Semaphore.cpp"], + hdrs = ["Semaphore.h"], + deps = [ + ":core", + "//folly:intrusive_list", + "//folly:synchronized", + "//folly/coro:task", + "//folly/coro:timeout", + "//folly/futures:core", + ], +) + +cpp_library( + name = "batch_semaphore", + srcs = ["BatchSemaphore.cpp"], + hdrs = ["BatchSemaphore.h"], + deps = [ + ":semaphore_base", + ], +) + +cpp_library( + name = "semaphore_base", + srcs = ["SemaphoreBase.cpp"], + hdrs = ["SemaphoreBase.h"], + deps = [ + ":core", + "//folly:intrusive_list", + "//folly:synchronized", + "//folly/coro:task", + "//folly/futures:core", + ], +) + +cpp_library( + name = "simple_loop_controller", + srcs = ["SimpleLoopController.cpp"], + hdrs = ["SimpleLoopController.h"], + deps = [ + ":core_manager", + ":loop_controller", + "//folly:function", + "//folly:likely", + "//folly/io/async:async_base", + ], +) + +cpp_library( + name = "timed_mutex", + hdrs = [ + "CallOnce.h", + "TimedMutex.h", + ], + textual_hdrs = [ + "TimedMutex-inl.h", + ], + deps = [ + ":generic_baton", + "//folly:intrusive_list", + "//folly:portability", + "//folly:spin_lock", + "//folly/synchronization:call_once", + ], +) + +cpp_library( + name = "traits", + hdrs = ["traits.h"], +) + +cpp_library( + name = "when_n", + hdrs = [ + "WhenN.h", + ], + textual_hdrs = [ + "WhenN-inl.h", + ], + deps = [ + ":core", + ":for_each", + "//folly:optional", + "//folly/functional:invoke", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/BUILD.bazel new file mode 100644 index 00000000000..ee0f0886f6e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/BUILD.bazel @@ -0,0 +1,123 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "wait_utils", + hdrs = [ + "WaitUtils.h", + ], + deps = [ + ":core", + ":fiber_manager", + "//folly/fibers:core", + "//folly/fibers:fiber_manager_map", + ], +) + +cpp_library( + name = "core", + srcs = ["Async.cpp"], + hdrs = [ + "Async.h", + ], + deps = [ + "//folly:traits", + "//folly:unit", + "//folly/fibers:core", + "//folly/functional:invoke", + "//folly/lang:customization_point", + "@glog", + ], +) + +cpp_library( + name = "collect", + hdrs = [ + "Collect.h", + ], + textual_hdrs = [ + "Collect-inl.h", + ], + deps = [ + ":baton", + ":core", + ":fiber_manager", + ":future", + "//folly:traits", + "//folly:try", + "//folly/fibers:core_manager", + "//folly/fibers:when_n", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "baton", + hdrs = ["Baton.h"], + deps = [ + ":core", + "//folly/fibers:core", + "@glog", + ], +) + +cpp_library( + name = "fiber_manager", + hdrs = [ + "FiberManager.h", + ], + deps = [ + ":core", + "//folly/fibers:core_manager", + ], +) + +cpp_library( + name = "future", + hdrs = [ + "Future.h", + ], + deps = [ + ":core", + "//folly/futures:core", + ], +) + +cpp_library( + name = "promise", + hdrs = [ + "Promise.h", + ], + deps = [ + ":core", + "//folly/fibers:core_manager", + "//folly/fibers:traits", + ], +) + +cpp_library( + name = "task", + hdrs = [ + "Task.h", + ], + deps = [ + ":core", + "//folly/coro:blocking_wait", + "//folly/coro:task", + ], +) + +cpp_library( + name = "stack_tracing", + hdrs = [ + "AsyncStack.h", + ], + deps = [ + ":core", + "//folly:c_portability", + "//folly:scope_guard", + "//folly/tracing:async_stack", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/test/BUILD.bazel new file mode 100644 index 00000000000..5eb58e32eac --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/async/test/BUILD.bazel @@ -0,0 +1,29 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_test", + srcs = ["AsyncTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/coro:blocking_wait", + "//folly/coro:sleep", + "//folly/fibers:core_manager", + "//folly/fibers:fiber_manager_map", + "//folly/fibers/async:baton", + "//folly/fibers/async:collect", + "//folly/fibers/async:core", + "//folly/fibers/async:fiber_manager", + "//folly/fibers/async:future", + "//folly/fibers/async:promise", + "//folly/fibers/async:stack_tracing", + "//folly/fibers/async:task", + "//folly/fibers/async:wait_utils", + "//folly/io/async:async_base", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/detail/BUILD.bazel new file mode 100644 index 00000000000..bb782aa1958 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/detail/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_batch_dispatcher", + srcs = ["AtomicBatchDispatcher.cpp"], + hdrs = ["AtomicBatchDispatcher.h"], + deps = [ + "@fmt", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/test/BUILD.bazel new file mode 100644 index 00000000000..6910ddb1a70 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/fibers/test/BUILD.bazel @@ -0,0 +1,66 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "fibers_test", +# srcs = ["FibersTest.cpp"], +# deps = [ +# "//folly:conv", +# "//folly:memory", +# "//folly:random", +# "//folly/coro:blocking_wait", +# "//folly/coro:gtest_helpers", +# "//folly/coro:timeout", +# "//folly/coro:with_cancellation", +# "//folly/executors:cpu_thread_pool_executor", +# "//folly/fibers:add_tasks", +# "//folly/fibers:atomic_batch_dispatcher", +# "//folly/fibers:batch_dispatcher", +# "//folly/fibers:batch_semaphore", +# "//folly/fibers:core_manager", +# "//folly/fibers:event_base_loop_controller", +# "//folly/fibers:executor_loop_controller", +# "//folly/fibers:fiber_manager_map", +# "//folly/fibers:generic_baton", +# "//folly/fibers:semaphore", +# "//folly/fibers:simple_loop_controller", +# "//folly/fibers:timed_mutex", +# "//folly/fibers:when_n", +# "//folly/futures:core", +# "//folly/io/async:scoped_event_base_thread", +# "//folly/portability:gtest", +# "//folly/tracing:async_stack", +# ], +# ) + +cc_binary( + name = "fibers_test_app", + srcs = ["FibersTestApp.cpp"], + deps = [ + "//folly:memory", + "//folly/fibers:core_manager", + "//folly/fibers:simple_loop_controller", + ], +) + +cc_binary( + name = "stack_overflow", + srcs = ["StackOverflow.cpp"], + copts = ["-Wno-infinite-recursion"], + deps = [ + "//folly/fibers:fiber_manager_map", + "//folly/init", + ], +) + +cpp_unittest( + name = "semaphore_test", + srcs = ["SemaphoreTest.cpp"], + deps = [ + "//folly/fibers:semaphore", + "//folly/portability:gtest", + "//folly/synchronization:relaxed_atomic", + "//folly/synchronization/detail:sleeper", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/BUILD.bazel new file mode 100644 index 00000000000..5b0ee1e3d27 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/BUILD.bazel @@ -0,0 +1,55 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "apply_tuple", + hdrs = ["ApplyTuple.h"], + deps = [ + ":invoke", + "//folly:traits", + "//folly:utility", + ], +) + +cpp_library( + name = "invoke", + hdrs = ["Invoke.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:portability", + "//folly:preprocessor", + "//folly:traits", + "//folly:utility", + "//folly/lang:customization_point", + "@boost.preprocessor", + ], +) + +cpp_library( + name = "partial", + hdrs = ["Partial.h"], + deps = [ + ":invoke", + "//folly:utility", + ], +) + +cpp_library( + name = "protocol", + hdrs = ["protocol.h"], + deps = [ + ":invoke", + ":traits", + "//folly:portability", + "//folly:traits", + ], +) + +cpp_library( + name = "traits", + hdrs = ["traits.h"], + deps = [ + "//folly:traits", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/test/BUILD.bazel new file mode 100644 index 00000000000..f115447a4f4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/functional/test/BUILD.bazel @@ -0,0 +1,50 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "apply_tuple_test", + srcs = ["ApplyTupleTest.cpp"], + deps = [ + "//folly:overload", + "//folly/functional:apply_tuple", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "invoke_test", + srcs = ["InvokeTest.cpp"], + deps = [ + "//folly:cpp_attributes", + "//folly/functional:invoke", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "partial_test", + srcs = ["PartialTest.cpp"], + deps = [ + "//folly:function", + "//folly/functional:partial", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "protocol_test", + srcs = ["protocol_test.cpp"], + deps = [ + "//folly:traits", + "//folly/functional:protocol", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "traits_test", + srcs = ["traits_test.cpp"], + deps = [ + "//folly/functional:traits", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/BUILD.bazel new file mode 100644 index 00000000000..f2fc22f1549 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/BUILD.bazel @@ -0,0 +1,141 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "barrier", + srcs = ["Barrier.cpp"], + hdrs = ["Barrier.h"], + deps = [ + ":core", + "//folly:scope_guard", + "//folly/lang:new", + "@glog", + ], +) + +cpp_library( + name = "core", + srcs = [ + "Future.cpp", + "HeapTimekeeper.cpp", + "Promise.cpp", + "ThreadWheelTimekeeper.cpp", + ], + hdrs = [ + "Future.h", + "Future-inl.h", + "Future-pre.h", + "HeapTimekeeper.h", + "Promise.h", + "Promise-inl.h", + "Retrying.h", + "ThreadWheelTimekeeper.h", + "WTCallback.h", + ], + deps = [ + ":portability", + "//folly:chrono", + "//folly:likely", + "//folly:optional", + "//folly:portability", + "//folly:random", + "//folly:scope_guard", + "//folly:singleton", + "//folly:traits", + "//folly:try", + "//folly:unit", + "//folly:utility", + "//folly/container:foreach", + "//folly/container:intrusive_heap", + "//folly/coro:traits", + "//folly/detail:async_trace", + "//folly/executors:drivable_executor", + "//folly/executors:executor_with_priority", + "//folly/executors:global_executor", + "//folly/executors:inline_executor", + "//folly/executors:queued_immediate_executor", + "//folly/executors:timed_drivable_executor", + "//folly/fibers:core", + "//folly/functional:invoke", + "//folly/futures/detail:core", + "//folly/futures/detail:types", + "//folly/io/async:async_base", + "//folly/lang:exception", + "//folly/lang:pretty", + "//folly/lang:safe_assert", + "//folly/portability:gflags", + "//folly/synchronization:distributed_mutex", + "//folly/synchronization:relaxed_atomic", + "//folly/synchronization:saturating_semaphore", + "//folly/synchronization:wait_options", + "//folly/system:thread_name", + ], +) + +cpp_library( + name = "future_splitter", + hdrs = ["FutureSplitter.h"], + deps = [ + ":core", + ":shared_promise", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "futures", + deps = [ + ":barrier", # @manual + ":core", # @manual + ":future_splitter", # @manual + ":shared_promise", # @manual + "//folly/executors:inline_executor", # @manual + "//folly/executors:manual_executor", # @manual + "//folly/executors:queued_immediate_executor", # @manual + "//folly/executors:scheduled_executor", # @manual + ], +) + +cpp_library( + name = "manual_timekeeper", + srcs = ["ManualTimekeeper.cpp"], + hdrs = ["ManualTimekeeper.h"], + deps = [ + "//folly:synchronized", + "//folly/futures:core", + "//folly/synchronization:atomic_util", + ], +) + +cpp_library( + name = "portability", + hdrs = ["Portability.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "shared_promise", + srcs = ["SharedPromise.cpp"], + hdrs = [ + "SharedPromise.h", + "SharedPromise-inl.h", + ], + deps = [ + ":core", + "//folly:portability", + "//folly/executors:inline_executor", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "cleanup", + hdrs = ["Cleanup.h"], + deps = [ + "//folly/futures:core", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/detail/BUILD.bazel new file mode 100644 index 00000000000..8691a87ab65 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/detail/BUILD.bazel @@ -0,0 +1,33 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "core", + srcs = [ + "Core.cpp", + ], + hdrs = [ + "Core.h", + "Types.h", + ], + deps = [ + "//folly:executor", + "//folly:function", + "//folly:optional", + "//folly:scope_guard", + "//folly:try", + "//folly:utility", + "//folly/io/async:request_context", + "//folly/lang:assume", + "//folly/lang:exception", + "//folly/synchronization:atomic_util", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "types", + hdrs = ["Types.h"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/test/BUILD.bazel new file mode 100644 index 00000000000..5b0e8b095f9 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/futures/test/BUILD.bazel @@ -0,0 +1,458 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "barrier_test", + srcs = ["BarrierTest.cpp"], + deps = [ + "//folly:random", + "//folly/futures:barrier", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "callback_lifetime_test", + srcs = ["CallbackLifetimeTest.cpp"], + deps = [ + ":test_executor", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "collect_test", + srcs = ["CollectTest.cpp"], + deps = [ + "//folly:default_keep_alive_executor", + "//folly:random", + "//folly:small_vector", + "//folly/executors:cpu_thread_pool_executor", + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "@boost.thread", + ], +) + +cpp_unittest( + name = "context_test", + srcs = ["ContextTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "core_test", + srcs = ["CoreTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/futures/detail:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "ensure_test", + srcs = ["EnsureTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "filter_test", + srcs = ["FilterTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "future_splitter_test", + srcs = ["FutureSplitterTest.cpp"], + deps = [ + "//folly/executors:manual_executor", + "//folly/futures:future_splitter", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "future_test", + srcs = ["FutureTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:executor", + "//folly:memory", + "//folly:unit", + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/json:dynamic", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "semi_future_test", + srcs = ["SemiFutureTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:executor", + "//folly:memory", + "//folly:unit", + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/io/async:async_base", + "//folly/json:dynamic", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "header_compile_test", + srcs = ["HeaderCompileTest.cpp"], + deps = [ + "//folly:try", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "interrupt_test", + srcs = ["InterruptTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + # labels = ["load-sensitive-timing-test"], + deps = [ + ":test_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "manual_timekeeper_test", + srcs = ["ManualTimekeeperTest.cpp"], + deps = [ + "//folly/futures:manual_timekeeper", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "map_test", + srcs = ["MapTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "non_copyable_lambda_test", + srcs = ["NonCopyableLambdaTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "poll_test", + srcs = ["PollTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "promise_test", + srcs = ["PromiseTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "reduce_test", + srcs = ["ReduceTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "retrying_test", + srcs = ["RetryingTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":test_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "//folly/portability:sys_resource", + ], +) + +cpp_unittest( + name = "self_destruct_test", + srcs = ["SelfDestructTest.cpp"], + deps = [ + "//folly/executors:inline_executor", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "shared_promise_test", + srcs = ["SharedPromiseTest.cpp"], + deps = [ + "//folly/futures:shared_promise", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "test_executor", + srcs = ["TestExecutor.cpp"], + hdrs = ["TestExecutor.h"], + deps = [ + "//folly:executor", + ], +) + +cpp_unittest( + name = "test_executor_test", + srcs = ["TestExecutorTest.cpp"], + deps = [ + ":test_executor", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "then_compile_test", + srcs = [ + "ThenCompileTest.cpp", + "ThenCompileTest.h", + ], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "then_test", + srcs = ["ThenTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "timekeeper_test", + srcs = ["TimekeeperTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:singleton", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "timekeeper_test_lib", + hdrs = ["TimekeeperTestLib.h"], + deps = [ + "//folly:default_keep_alive_executor", + "//folly:random", + "//folly:singleton", + "//folly/executors:global_executor", + "//folly/executors:manual_executor", + "//folly/executors:serial_executor", + "//folly/executors:virtual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "@fmt", + "@glog", + ], +) + +cpp_unittest( + name = "thread_wheel_timekeeper_test", + srcs = ["ThreadWheelTimekeeperTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":timekeeper_test_lib", + "//folly/futures:core", + ], +) + +cpp_unittest( + name = "heap_timekeeper_test", + srcs = ["HeapTimekeeperTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":timekeeper_test_lib", + "//folly/futures:core", + ], +) + +cpp_unittest( + name = "times_test", + srcs = ["TimesTest.cpp"], + deps = [ + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "unwrap_test", + srcs = ["UnwrapTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "via_test", + srcs = ["ViaTest.cpp"], + deps = [ + "//folly:mpmc_queue", + "//folly/executors:drivable_executor", + "//folly/executors:inline_executor", + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "wait_test", + srcs = ["WaitTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":test_executor", + "//folly/executors:inline_executor", + "//folly/futures:core", + "//folly/io/async:async_base", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "when_test", + srcs = ["WhenTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "while_do_test", + srcs = ["WhileDoTest.cpp"], + deps = [ + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "will_equal_test", + srcs = ["WillEqualTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "window_test", + srcs = ["WindowTest.cpp"], + deps = [ + "//folly:conv", + "//folly/executors:manual_executor", + "//folly/futures:core", + "//folly/portability:gtest", + "@boost.thread", + ], +) + +cpp_unittest( + name = "conversion_operator", + srcs = ["ConversionOperatorTest.cpp"], + deps = [ + "//folly/futures:core", + "//folly/portability:gtest", + ], +) + +# NOTE: This fails only in BCR CI. +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "cleanup_test", +# srcs = ["CleanupTest.cpp"], +# deps = [ +# "//folly/executors:cpu_thread_pool_executor", +# "//folly/executors:manual_executor", +# "//folly/futures:cleanup", +# "//folly/portability:gtest", +# ], +# ) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/BUILD.bazel new file mode 100644 index 00000000000..aff9aa43e82 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/BUILD.bazel @@ -0,0 +1,126 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "base", + hdrs = [ + "Base.h", + ], + textual_hdrs = [ + "Base-inl.h", + ], + deps = [ + ":core", + "//folly:conv", + "//folly:function", + "//folly:optional", + "//folly:portability", + "//folly:range", + "//folly:utility", + "//folly/container:access", + "//folly/container:f14_hash", + "//folly/functional:invoke", + "@range-v3", + ], +) + +cpp_library( + name = "combine", + hdrs = [ + "Combine.h", + ], + textual_hdrs = [ + "Combine-inl.h", + ], + deps = [":base"], +) + +cpp_library( + name = "core", + hdrs = [ + "Core.h", + ], + textual_hdrs = [ + "Core-inl.h", + ], + deps = ["//folly:portability"], +) + +cpp_library( + name = "file", + hdrs = [ + "File.h", + ], + textual_hdrs = [ + "File-inl.h", + ], + deps = [ + ":base", + ":string", + "//folly:exception", + "//folly:file", + "//folly/io:iobuf", + ], +) + +cpp_library( + name = "parallel", + hdrs = [ + "Parallel.h", + ], + textual_hdrs = [ + "Parallel-inl.h", + ], + deps = [ + ":base", + "//folly:mpmc_queue", + "//folly:scope_guard", + "//folly/synchronization:event_count", + ], +) + +cpp_library( + name = "parallel_map", + hdrs = [ + "ParallelMap.h", + ], + textual_hdrs = [ + "ParallelMap-inl.h", + ], + deps = [ + ":core", + "//folly:expected", + "//folly:mpmc_pipeline", + "//folly/functional:invoke", + "//folly/synchronization:event_count", + ], +) + +cpp_library( + name = "string", + hdrs = [ + "String.h", + ], + textual_hdrs = [ + "String-inl.h", + ], + deps = [ + ":base", + "//folly:conv", + "//folly:portability", + "//folly:range", + "//folly:string", + "//folly/io:iobuf", + ], +) + +cpp_library( + name = "istream", + hdrs = [ + "IStream.h", + ], + deps = [ + ":core", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/test/BUILD.bazel new file mode 100644 index 00000000000..f1521b0cbf3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/gen/test/BUILD.bazel @@ -0,0 +1,103 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "base_test", + srcs = ["BaseTest.cpp"], + # labels = ["serialize_test_cases"], + deps = [ + "//folly:fbvector", + "//folly:map_util", + "//folly:memory", + "//folly:string", + "//folly/gen:base", + "//folly/json:dynamic", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/testing:test_util", + "@glog", + ], +) + +cpp_unittest( + name = "combine_test", + srcs = ["CombineTest.cpp"], + deps = [ + "//folly:fbvector", + "//folly:range", + "//folly/gen:base", + "//folly/gen:combine", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "file_test", + srcs = ["FileTest.cpp"], + deps = [ + "//folly:file", + "//folly:range", + "//folly/container:array", + "//folly/gen:base", + "//folly/gen:file", + "//folly/portability:gtest", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "parallel_test", + srcs = ["ParallelTest.cpp"], + # labels = ["serialize"], + deps = [ + "//folly/gen:base", + "//folly/gen:parallel", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "parallel_map_test", + srcs = ["ParallelMapTest.cpp"], + deps = [ + "//folly:memory", + "//folly/gen:base", + "//folly/gen:parallel_map", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "string_test", + srcs = ["StringTest.cpp"], + deps = [ + "//folly/functional:apply_tuple", + "//folly/gen:string", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "istream_test", + srcs = ["IStreamTest.cpp"], + deps = [ + "//folly/gen:base", + "//folly/gen:istream", + "//folly/gen:string", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "util", + hdrs = ["Bench.h"], + deps = [ + "//folly:benchmark", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/BUILD.bazel new file mode 100644 index 00000000000..378eb011f3e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/BUILD.bazel @@ -0,0 +1,82 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "checksum", + srcs = ["Checksum.cpp"], + hdrs = ["Checksum.h"], + deps = [ + "//folly:cpu_id", + "//folly/detail:traponavx512", + "//folly/external/fast-crc32:avx512_crc32c_v8s3x4", + "//folly/external/fast-crc32:neon_crc32c_v3s4x2e_v2", + "//folly/external/fast-crc32:neon_eor3_crc32c_v8s2x4_s3", + "//folly/external/fast-crc32:sse_crc32c_v8s3x3", + "//folly/hash/detail:checksum_detail", + "@boost.crc", + ], +) + +cpp_library( + name = "farm_hash", + hdrs = ["FarmHash.h"], + deps = [ + "//folly/external/farmhash", + ], +) + +cpp_library( + name = "hash", + hdrs = ["Hash.h"], + deps = [ + ":murmur_hash", + ":spooky_hash_v1", + ":spooky_hash_v2", + "//folly:c_portability", + "//folly:portability", + "//folly:traits", + "//folly:utility", + "//folly/functional:apply_tuple", + "//folly/lang:bits", + ], +) + +cpp_library( + name = "spooky_hash_v1", + srcs = ["SpookyHashV1.cpp"], + hdrs = ["SpookyHashV1.h"], + deps = [ + "//folly:cpp_attributes", + ], +) + +cpp_library( + name = "spooky_hash_v2", + srcs = ["SpookyHashV2.cpp"], + hdrs = ["SpookyHashV2.h"], + deps = [ + "//folly:c_portability", + "//folly:cpp_attributes", + "//folly:portability", + "//folly/lang:c_string", + ], +) + +cpp_library( + name = "traits", + hdrs = ["traits.h"], + deps = [ + "//folly:traits", + ], +) + +cpp_library( + name = "murmur_hash", + hdrs = ["MurmurHash.h"], + deps = [ + "//folly:c_portability", + "//folly/lang:bits", + "//folly/portability:constexpr", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/detail/BUILD.bazel new file mode 100644 index 00000000000..788321a2697 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/detail/BUILD.bazel @@ -0,0 +1,21 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "checksum_detail", + srcs = [ + "ChecksumDetail.cpp", + "Crc32CombineDetail.cpp", + "Crc32cDetail.cpp", + ], + hdrs = ["ChecksumDetail.h"], + deps = [ + "//folly:bits", + "//folly:cpp_attributes", + "//folly:portability", + "//folly/external/nvidia/hash:checksum", # @manual + "//folly/external/nvidia/hash/detail:crc32c_detail", # @manual + "@boost.preprocessor", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/test/BUILD.bazel new file mode 100644 index 00000000000..1d6b3b22b29 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/hash/test/BUILD.bazel @@ -0,0 +1,83 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "checksum_test", + srcs = ["ChecksumTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:portability", + "//folly:random", + "//folly/external/fast-crc32:avx512_crc32c_v8s3x4", + "//folly/external/fast-crc32:neon_crc32c_v3s4x2e_v2", + "//folly/external/fast-crc32:neon_eor3_crc32c_v8s2x4_s3", + "//folly/external/fast-crc32:sse_crc32c_v8s3x3", + "//folly/hash", + "//folly/hash:checksum", + "//folly/hash/detail:checksum_detail", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@boost.crc", + ], +) + +cpp_unittest( + name = "farm_hash_test", + srcs = ["FarmHashTest.cpp"], + deps = [ + "//folly/hash:farm_hash", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "hash_test", + srcs = ["HashTest.cpp"], + deps = [ + "//folly:conv", + "//folly:map_util", + "//folly:random", + "//folly:range", + "//folly/hash", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "spooky_hash_v1_test", + srcs = ["SpookyHashV1Test.cpp"], + deps = [ + "//folly/hash:spooky_hash_v1", + "//folly/portability:gtest", + "//folly/portability:time", + "@glog", + ], +) + +cpp_unittest( + name = "spooky_hash_v2_test", + srcs = ["SpookyHashV2Test.cpp"], + deps = [ + "//folly/hash:spooky_hash_v2", + "//folly/portability:gtest", + "//folly/portability:time", + "@glog", + ], +) + +cpp_unittest( + name = "traits_test", + srcs = ["traits_test.cpp"], + deps = [ + "//folly/hash:traits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "murmur_hash_test", + srcs = ["MurmurHashTest.cpp"], + deps = [ + "//folly/hash:murmur_hash", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/BUILD.bazel new file mode 100644 index 00000000000..3778db70f6c --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/BUILD.bazel @@ -0,0 +1,29 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "init", + srcs = ["Init.cpp"], + hdrs = ["Init.h"], + deps = [ + ":phase", + "//folly:portability", + "//folly:singleton", + "//folly/logging:init", + "//folly/portability:config", + "//folly/portability:gflags", + "//folly/synchronization:hazptr_thread_pool_executor", + "@glog", + ] + select({ + "@platforms//os:linux": ["//folly/experimental/symbolizer:signal_handler"], + "@platforms//os:macos": ["//folly/experimental/symbolizer:signal_handler"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "phase", + srcs = ["Phase.cpp"], + hdrs = ["Phase.h"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/test/BUILD.bazel new file mode 100644 index 00000000000..fd414973fe1 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/init/test/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "phase_test", + srcs = ["PhaseTest.cpp"], + deps = [ + "//folly:singleton", + "//folly/init:phase", + "//folly/portability:gtest", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/BUILD.bazel new file mode 100644 index 00000000000..4306a9bdd74 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/BUILD.bazel @@ -0,0 +1,158 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "iobuf", + srcs = [ + "Cursor.cpp", + "IOBuf.cpp", + "IOBufIovecBuilder.cpp", + "IOBufQueue.cpp", + ], + hdrs = [ + "Cursor.h", + "IOBuf.h", + "IOBufIovecBuilder.h", + "IOBufQueue.h", + ], + textual_hdrs = [ + "Cursor-inl.h", + ], + deps = [ + "//folly:conv", + "//folly:fbstring", + "//folly:fbvector", + "//folly:function", + "//folly:likely", + "//folly:memory", + "//folly:portability", + "//folly:range", + "//folly:scope_guard", + "//folly/container:span", + "//folly/detail:iterators", + "//folly/hash:spooky_hash_v2", + "//folly/lang:align", + "//folly/lang:bits", + "//folly/lang:checked_math", + "//folly/lang:exception", + "//folly/lang:hint", + "//folly/lang:ordering", + "//folly/memory:malloc", + "//folly/memory:sanitize_address", + "//folly/portability:iovec", + "//folly/portability:sys_uio", + "//folly/synchronization:micro_spin_lock", + "@glog", + ], +) + +cpp_library( + name = "global_shutdown_socket_set", + srcs = ["GlobalShutdownSocketSet.cpp"], + hdrs = ["GlobalShutdownSocketSet.h"], + deps = [ + ":shutdown_socket_set", + "//folly:singleton", + "//folly/concurrency/memory:read_mostly_shared_ptr", + ], +) + +cpp_library( + name = "record_io", + srcs = [ + "RecordIO.cpp", + ], + hdrs = [ + "RecordIO.h", + ], + textual_hdrs = [ + "RecordIO-inl.h", + ], + deps = [ + ":iobuf", + "//folly:exception", + "//folly:file", + "//folly:file_util", + "//folly:memory", + "//folly:portability", + "//folly:range", + "//folly:scope_guard", + "//folly:string", + "//folly/detail:iterators", + "//folly/hash:spooky_hash_v2", + "//folly/portability:unistd", + "//folly/system:memory_mapping", + ], +) + +cpp_library( + name = "shutdown_socket_set", + srcs = ["ShutdownSocketSet.cpp"], + hdrs = ["ShutdownSocketSet.h"], + deps = [ + "//folly:file", + "//folly:file_util", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:sockets", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_library( + name = "typed_io_buf", + hdrs = ["TypedIOBuf.h"], + deps = [ + ":iobuf", + "//folly/memory:malloc", + ], +) + +cpp_library( + name = "socket_option_map", + srcs = [ + "SocketOptionMap.cpp", + "SocketOptionValue.cpp", + ], + hdrs = [ + "SocketOptionMap.h", + "SocketOptionValue.h", + ], + deps = [ + "//folly/net:network_socket", + "//folly/portability:sockets", + ], +) + +cpp_library( + name = "huge_pages", + srcs = ["HugePages.cpp"], + hdrs = ["HugePages.h"], + deps = [ + "//folly:conv", + "//folly:cpp_attributes", + "//folly:format", + "//folly:range", + "//folly:string", + "//folly/experimental/io:fs_util", + "//folly/gen:base", + "//folly/gen:file", + "//folly/gen:string", + "//folly/portability:unistd", + "@boost.regex", + "@boost.utility", + ], +) + +cpp_library( + name = "fs_util", + srcs = ["FsUtil.cpp"], + hdrs = ["FsUtil.h"], + deps = [ + "//folly:exception", + "//folly/portability:windows", + "@boost.filesystem", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/BUILD.bazel new file mode 100644 index 00000000000..08d5b614a26 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/BUILD.bazel @@ -0,0 +1,786 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_base_fwd", + hdrs = [ + "HHWheelTimer-fwd.h", + ], +) + +cpp_library( + name = "async_base", + srcs = [ + "AsyncTimeout.cpp", + "EventBase.cpp", + "EventBaseBackendBase.cpp", + "EventBaseLocal.cpp", + "EventHandler.cpp", + "HHWheelTimer.cpp", + "TimeoutManager.cpp", + "VirtualEventBase.cpp", + ], + hdrs = [ + "AsyncTimeout.h", + "AtomicNotificationQueue.h", + "EventBase.h", + "EventBaseAtomicNotificationQueue.h", + "EventBaseBackendBase.h", + "EventBaseLocal.h", + "EventHandler.h", + "HHWheelTimer.h", + "NotificationQueue.h", + "TimeoutManager.h", + "VirtualEventBase.h", + ], + textual_hdrs = [ + "AtomicNotificationQueue-inl.h", + "EventBaseAtomicNotificationQueue-inl.h", + ], + deps = [ + ":async_base_fwd", + ":delayed_destruction", + ":event_util", + ":request_context", + "//folly:chrono", + "//folly:exception", + "//folly:exception_string", + "//folly:executor", + "//folly:file_util", + "//folly:function", + "//folly:likely", + "//folly:map_util", + "//folly:memory", + "//folly:optional", + "//folly:portability", + "//folly:scope_guard", + "//folly:spin_lock", + "//folly:string", + "//folly:synchronized", + "//folly/container:bit_iterator", + "//folly/container:f14_hash", + "//folly/executors:drivable_executor", + "//folly/executors:execution_observer", + "//folly/executors:io_executor", + "//folly/executors:queue_observer", + "//folly/executors:scheduled_executor", + "//folly/executors:sequenced_executor", + "//folly/io:iobuf", + "//folly/lang:align", + "//folly/lang:assume", + "//folly/lang:bits", + "//folly/lang:thunk", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:config", + "//folly/portability:event", + "//folly/portability:fcntl", + "//folly/portability:iovec", + "//folly/portability:sockets", + "//folly/portability:unistd", + "//folly/synchronization:baton", + "//folly/synchronization:call_once", + "//folly/synchronization:event_count", + "//folly/system:pid", + "//folly/system:thread_id", + "//folly/system:thread_name", + "@boost.intrusive", + "@glog", + ], +) + +cpp_library( + name = "async_pipe", + srcs = ["AsyncPipe.cpp"], + hdrs = ["AsyncPipe.h"], + deps = [ + ":async_base", + ":async_socket_exception", + ":async_transport", + ":delayed_destruction", + "//folly:file_util", + "//folly:utility", + "//folly/detail:file_util_detail", + "//folly/io:iobuf", + ], +) + +cpp_library( + name = "async_signal_handler", + srcs = ["AsyncSignalHandler.cpp"], + hdrs = ["AsyncSignalHandler.h"], + deps = [ + ":async_base", + "//folly:conv", + "//folly/portability:event", + ], +) + +cpp_library( + name = "async_socket_transport", + srcs = ["AsyncSocketTransport.cpp"], + hdrs = ["AsyncSocketTransport.h"], + deps = [ + ":async_socket_exception", + ":async_transport", + "//folly:network_address", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/net:network_socket", + ], +) + +cpp_library( + name = "async_socket", + srcs = ["AsyncSocket.cpp"], + hdrs = ["AsyncSocket.h"], + deps = [ + ":async_base", + ":async_socket_exception", + ":async_socket_transport", + ":async_transport", + ":delayed_destruction", + "//folly:constructor_callback_list", + "//folly:exception", + "//folly:format", + "//folly:network_address", + "//folly:optional", + "//folly:portability", + "//folly:small_vector", + "//folly:string", + "//folly/detail:socket_fast_open", + "//folly/io:iobuf", + "//folly/io:shutdown_socket_set", + "//folly/io:socket_option_map", + "//folly/io/async/observer:async_socket_observer_container", + "//folly/lang:checked_math", + "//folly/net:net_ops_dispatcher", + "//folly/net:tcpinfo", + "//folly/net:tcpinfo_dispatcher", + "//folly/portability:fcntl", + "//folly/portability:sockets", + "//folly/portability:sys_mman", + "//folly/portability:sys_uio", + "//folly/portability:unistd", + "@boost.preprocessor", + ], +) + +cpp_library( + name = "async_socket_base", + hdrs = ["AsyncSocketBase.h"], + deps = [ + ":async_base", + "//folly:network_address", + ], +) + +cpp_library( + name = "async_socket_exception", + srcs = ["AsyncSocketException.cpp"], + hdrs = ["AsyncSocketException.h"], + deps = [ + "//folly:c_portability", + "//folly:format", + "//folly:range", + "//folly:string", + ], +) + +cpp_library( + name = "async_ssl_socket", + srcs = ["AsyncSSLSocket.cpp"], + hdrs = ["AsyncSSLSocket.h"], + deps = [ + ":async_base", + ":async_pipe", + ":async_socket", + ":certificate_identity_verifier", + ":ssl_context", + "//folly:format", + "//folly:indestructible", + "//folly:network_address", + "//folly:optional", + "//folly:spin_lock", + "//folly:string", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/io/async/ssl:basic_transport_certificate", + "//folly/io/async/ssl:openssl_utils", + "//folly/io/async/ssl:ssl_errors", + "//folly/io/async/ssl:tls_definitions", + "//folly/lang:bits", + "//folly/portability:openssl", + "//folly/portability:sockets", + "//folly/ssl:openssl_ptr_types", + "//folly/ssl:ssl_session", + "//folly/ssl:ssl_session_manager", + ], +) + +cpp_library( + name = "async_transport", + hdrs = ["AsyncTransport.h"], + deps = [ + ":async_base", + ":async_socket_base", + ":async_transport_certificate", + ":delayed_destruction", + ":write_flags", + "//folly:optional", + "//folly/io:iobuf", + "//folly/portability:openssl", + "//folly/portability:sys_uio", + "//folly/ssl:openssl_ptr_types", + ], +) + +cpp_library( + name = "async_transport_certificate", + hdrs = ["AsyncTransportCertificate.h"], + deps = [ + "//folly:optional", + ], +) + +cpp_library( + name = "certificate_identity_verifier", + hdrs = ["CertificateIdentityVerifier.h"], + deps = [ + ":async_transport_certificate", + "//folly:try", + "//folly:unit", + ], +) + +cpp_library( + name = "async_udp_server_socket", + hdrs = ["AsyncUDPServerSocket.h"], + deps = [ + ":async_base", + ":async_udp_socket", + "//folly:memory", + "//folly/io:iobuf", + ], +) + +cpp_library( + name = "async_udp_socket", + srcs = ["AsyncUDPSocket.cpp"], + hdrs = ["AsyncUDPSocket.h"], + deps = [ + ":async_base", + ":async_socket_base", + ":async_socket_exception", + "//folly:function", + "//folly:likely", + "//folly:network_address", + "//folly:scope_guard", + "//folly:small_vector", + "//folly:utility", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/net:net_ops", + "//folly/net:net_ops_dispatcher", + "//folly/net:network_socket", + "//folly/portability:fcntl", + "//folly/portability:sockets", + "//folly/portability:unistd", + "@boost.preprocessor", + ], +) + +cpp_library( + name = "decorated_async_transport_wrapper", + hdrs = [ + "DecoratedAsyncTransportWrapper.h", + "WriteChainAsyncTransportWrapper.h", + ], + deps = [ + ":async_transport", + "//folly/io:iobuf", + ], +) + +cpp_library( + name = "delayed_destruction", + srcs = [ + "DelayedDestruction.cpp", + ], + hdrs = [ + "DelayedDestruction.h", + "DelayedDestructionBase.h", + ], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "destructor_check", + hdrs = ["DestructorCheck.h"], +) + +cpp_library( + name = "event_base_manager", + srcs = ["EventBaseManager.cpp"], + hdrs = ["EventBaseManager.h"], + deps = [ + ":async_base", + "//folly:optional", + "//folly:thread_local", + ], +) + +cpp_library( + name = "event_base_thread", + srcs = ["EventBaseThread.cpp"], + hdrs = ["EventBaseThread.h"], + deps = [ + ":async_base", + ":scoped_event_base_thread", + "//folly:memory", + "//folly:range", + ], +) + +cpp_library( + name = "event_util", + hdrs = ["EventUtil.h"], + deps = [ + "//folly/portability:event", + ], +) + +cpp_library( + name = "request_context", + srcs = ["Request.cpp"], + hdrs = ["Request.h"], + deps = [ + "//folly:glog", + "//folly:shared_mutex", + "//folly:singleton_thread_local", + "//folly:synchronized", + "//folly/concurrency:process_local_unique_id", + "//folly/concurrency/container:single_writer_fixed_hash_map", + "//folly/container:f14_hash", + "//folly/detail:iterators", + "//folly/synchronization:hazptr", + "//folly/tracing:static_tracepoint", + ], +) + +cpp_library( + name = "scoped_event_base_thread", + srcs = ["ScopedEventBaseThread.cpp"], + hdrs = ["ScopedEventBaseThread.h"], + deps = [ + ":async_base", + ":event_base_manager", + "//folly:function", + "//folly:range", + "//folly/synchronization:baton", + "//folly/system:thread_name", + ], +) + +cpp_library( + name = "terminate_cancellation_token", + srcs = ["TerminateCancellationToken.cpp"], + hdrs = ["TerminateCancellationToken.h"], + deps = [ + ":async_signal_handler", + ":scoped_event_base_thread", + "//folly:cancellation_token", + "//folly:singleton", + ], +) + +cpp_library( + name = "server_socket", + srcs = ["AsyncServerSocket.cpp"], + hdrs = ["AsyncServerSocket.h"], + deps = [ + ":async_base", + ":async_socket_base", + ":delayed_destruction", + "//folly:exception_wrapper", + "//folly:file_util", + "//folly:glog", + "//folly:network_address", + "//folly:portability", + "//folly:string", + "//folly/detail:socket_fast_open", + "//folly/io:shutdown_socket_set", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/observer", + "//folly/portability:fcntl", + "//folly/portability:sockets", + "//folly/portability:unistd", + ], +) + +cpp_library( + name = "ssl_context", + srcs = ["SSLContext.cpp"], + hdrs = ["SSLContext.h"], + deps = [ + "//folly:format", + "//folly:function", + "//folly:memory", + "//folly:portability", + "//folly:random", + "//folly:range", + "//folly:shared_mutex", + "//folly:spin_lock", + "//folly:string", + "//folly/container:access", + "//folly/io/async/ssl:openssl_utils", + "//folly/portability:openssl", + "//folly/ssl:openssl_ptr_types", + "//folly/ssl:openssl_ticket_handler", + "//folly/ssl:password_collector", + "//folly/ssl:ssl_session_manager", + "//folly/system:thread_id", + "@glog", + ], +) + +cpp_library( + name = "ssl_options", + srcs = ["SSLOptions.cpp"], + hdrs = ["SSLOptions.h"], + deps = [ + ":ssl_context", + "//folly:format", + "//folly/container:array", + "@glog", + ], +) + +cpp_library( + name = "password_in_file", + srcs = ["PasswordInFile.cpp"], + hdrs = ["PasswordInFile.h"], + deps = [ + "//folly:file_util", + "//folly/portability:openssl", + "//folly/ssl:password_collector", + ], +) + +cpp_library( + name = "write_flags", + hdrs = ["WriteFlags.h"], +) + +cpp_library( + name = "timerfd", + srcs = [ + "STTimerFDTimeoutManager.cpp", + "TimerFD.cpp", + "TimerFDTimeoutManager.cpp", + ], + hdrs = [ + "STTimerFDTimeoutManager.h", + "TimerFD.h", + "TimerFDTimeoutManager.h", + ], + deps = [ + "//folly:file_util", + "//folly/io/async:async_base", + "//folly/io/async:delayed_destruction", + "//folly/io/async:event_util", + ], +) + +cpp_library( + name = "async_base_class", + srcs = ["AsyncBase.cpp"], + hdrs = ["AsyncBase.h"], + deps = [ + "//folly:exception", + "//folly:format", + "//folly:function", + "//folly:likely", + "//folly:portability", + "//folly:range", + "//folly:string", + "//folly/portability:filesystem", + "//folly/portability:sys_uio", + "//folly/portability:unistd", + "@boost.intrusive", + "@glog", + ], +) + +cpp_library( + name = "async_io", + srcs = ["AsyncIO.cpp"], + hdrs = ["AsyncIO.h"], + deps = [ + "//folly:exception", + "//folly:likely", + "//folly:small_vector", + "//folly:string", + "//folly/experimental/io:async_base", + "//folly/portability:unistd", + "@boost.intrusive", + "@fmt", + "@glog", + # TODO(kgk): Enable once @libaio is added to bcr. See: + # https://github.com/bazelbuild/bazel-central-registry/issues/3756 + # "@libaio", + ], +) + +cpp_library( + name = "liburing", + hdrs = ["Liburing.h"], + deps = select({ + "@platforms//os:linux": ["@liburing"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "async_io_uring_socket", + srcs = [ + "AsyncIoUringSocket.cpp", + ], + hdrs = [ + "AsyncIoUringSocket.h", + "AsyncIoUringSocketFactory.h", + ], + deps = [ + "//folly:conv", + "//folly:network_address", + "//folly:optional", + "//folly:small_vector", + "//folly/detail:socket_fast_open", + "//folly/futures:core", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:async_socket_exception", + "//folly/io/async:async_transport", + "//folly/io/async:delayed_destruction", + "//folly/io/async:io_uring_backend", + "//folly/io/async:io_uring_event_base_local", + "//folly/io/async:liburing", + "//folly/memory:malloc", + "//folly/net:net_ops_dispatcher", + "//folly/portability:sockets", + "//folly/portability:sys_uio", + "@boost.intrusive", + ], +) + +cpp_library( + name = "simple_async_io", + srcs = ["SimpleAsyncIO.cpp"], + hdrs = ["SimpleAsyncIO.h"], + deps = [ + "//folly:string", + "//folly:synchronized", + "//folly/coro:baton", + "//folly/coro:task", + "//folly/executors:global_executor", + "//folly/experimental/io:async_base", + "//folly/experimental/io:async_io", + "//folly/io/async:async_base", + "//folly/io/async:io_uring", + "//folly/io/async:liburing", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:sockets", + ], +) + +cpp_library( + name = "epoll", + hdrs = [ + "Epoll.h", + ], +) + +cpp_library( + name = "epoll_backend", + srcs = [ + "EpollBackend.cpp", + ], + hdrs = [ + "Epoll.h", + "EpollBackend.h", + ], + deps = [ + "//folly:file_util", + "//folly:intrusive_list", + "//folly:map_util", + "//folly:string", + "//folly/container:intrusive_heap", + "//folly/io/async:async_base", + ], +) + +cpp_library( + name = "event_base_poller", + srcs = ["EventBasePoller.cpp"], + hdrs = ["EventBasePoller.h"], + deps = [ + "//folly:file_util", + "//folly:function", + "//folly:range", + "//folly:string", + "//folly:synchronized", + "//folly/experimental/io:epoll", + "//folly/io/async:liburing", + "//folly/lang:align", + "//folly/portability:gflags", + "//folly/synchronization:baton", + "//folly/system:thread_name", + "@boost.conversion", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "mux_io_thread_pool_executor", + srcs = ["MuxIOThreadPoolExecutor.cpp"], + hdrs = ["MuxIOThreadPoolExecutor.h"], + deps = [ + "//folly:portability", + "//folly/concurrency:unbounded_queue", + "//folly/container:enumerate", + "//folly/executors:io_thread_pool_executor", + "//folly/executors:queue_observer", + "//folly/experimental/io:epoll_backend", + "//folly/experimental/io:event_base_poller", + "//folly/io/async:event_base_manager", + "//folly/lang:align", + "//folly/synchronization:baton", + "//folly/synchronization:latch", + "//folly/synchronization:relaxed_atomic", + "//folly/synchronization:throttled_lifo_sem", + "//folly/synchronization:wait_options", + "@fmt", + ], +) + +cpp_library( + name = "io_uring", + srcs = ["IoUring.cpp"], + hdrs = ["IoUring.h"], + deps = [ + ":async_base_class", + ":liburing", + "//folly:exception", + "//folly:likely", + "//folly:shared_mutex", + "//folly:string", + "//folly/portability:unistd", + "@boost.intrusive", + "@fmt", + "@glog", + ], +) + +cpp_library( + name = "io_uring_backend", + srcs = [ + "IoUringBackend.cpp", + ], + hdrs = [ + "IoUringBackend.h", + "IoUringBase.h", + ], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:cpp_attributes", + "//folly:demangle", + "//folly:exception_string", + "//folly:file_util", + "//folly:function", + "//folly:glog", + "//folly:likely", + "//folly:optional", + "//folly:range", + "//folly:small_vector", + "//folly:spin_lock", + "//folly:string", + "//folly/container:f14_hash", + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async:delayed_destruction", + "//folly/io/async:io_uring_provided_buffer_ring", + "//folly/io/async:liburing", + "//folly/lang:bits", + "//folly/portability:asm", + "//folly/portability:gflags", + "//folly/portability:sockets", + "//folly/portability:sys_mman", + "//folly/portability:sys_syscall", + "//folly/synchronization:call_once", + "//folly/tracing:static_tracepoint", + "@boost.intrusive", + "@glog", + ], +) + +cpp_library( + name = "io_uring_provided_buffer_ring", + srcs = [ + "IoUringProvidedBufferRing.cpp", + ], + hdrs = [ + "IoUringBase.h", + "IoUringProvidedBufferRing.h", + ], + deps = [ + "//folly:conv", + "//folly:exception_string", + "//folly:string", + "//folly/io:iobuf", + "//folly/io/async:delayed_destruction", + "//folly/io/async:liburing", + "//folly/portability:sys_mman", + "@boost.intrusive", + ], +) + +cpp_library( + name = "io_uring_event", + srcs = [ + "IoUringEvent.cpp", + ], + hdrs = [ + "IoUringEvent.h", + ], + deps = [ + "//folly:file", + "//folly/io/async:async_base", + "//folly/io/async:io_uring_backend", + "//folly/io/async:liburing", + ], +) + +cpp_library( + name = "io_uring_event_base_local", + srcs = [ + "IoUringEventBaseLocal.cpp", + ], + hdrs = [ + "IoUringEventBaseLocal.h", + ], + deps = [ + "//folly:singleton", + "//folly/io/async:async_base", + "//folly/io/async:io_uring_backend", + "//folly/io/async:io_uring_event", + "//folly/io/async:liburing", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/BUILD.bazel new file mode 100644 index 00000000000..ebaeedee954 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/BUILD.bazel @@ -0,0 +1,24 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_fd_socket", + srcs = ["AsyncFdSocket.cpp"], + hdrs = ["AsyncFdSocket.h"], + deps = [ + ":socket_fds", + "//folly/io/async:async_socket", + "@fmt", + ], +) + +cpp_library( + name = "socket_fds", + srcs = ["SocketFds.cpp"], + hdrs = ["SocketFds.h"], + deps = [ + "//folly:file", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/test/BUILD.bazel new file mode 100644 index 00000000000..9bcca1af91e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/fdsock/test/BUILD.bazel @@ -0,0 +1,17 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_fd_socket_test", + srcs = ["AsyncFdSocketTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/io/async/fdsock:async_fd_socket", + "//folly/io/async/test:async_socket_test_lib", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/observer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/observer/BUILD.bazel new file mode 100644 index 00000000000..07fbbd7cd04 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/observer/BUILD.bazel @@ -0,0 +1,23 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "async_socket_observer_interface", + hdrs = ["AsyncSocketObserverInterface.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:glog", + "//folly:optional", + "//folly/io/async:write_flags", + ], +) + +cpp_library( + name = "async_socket_observer_container", + hdrs = ["AsyncSocketObserverContainer.h"], + deps = [ + ":async_socket_observer_interface", + "//folly:observer_container", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/BUILD.bazel new file mode 100644 index 00000000000..39e045be84f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/BUILD.bazel @@ -0,0 +1,67 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "openssl", + deps = [ + "//folly/io/async/ssl:openssl_utils", # @manual + "//folly/io/async/ssl:ssl_errors", # @manual + ], +) + +cpp_library( + name = "basic_transport_certificate", + hdrs = ["BasicTransportCertificate.h"], + deps = [ + ":openssl_transport_certificate", + ], +) + +cpp_library( + name = "openssl_transport_certificate", + hdrs = ["OpenSSLTransportCertificate.h"], + deps = [ + "//folly/io/async:async_transport_certificate", + "//folly/portability:openssl", + "//folly/ssl:openssl_ptr_types", + ], +) + +cpp_library( + name = "openssl_utils", + srcs = ["OpenSSLUtils.cpp"], + hdrs = ["OpenSSLUtils.h"], + deps = [ + "//folly:range", + "//folly:scope_guard", + "//folly/io/async:async_socket_exception", + "//folly/net:network_socket", + "//folly/portability:openssl", + "//folly/portability:sockets", + "//folly/portability:unistd", + "//folly/ssl:openssl_ptr_types", + "//folly/ssl:ssl_session", + "//folly/ssl/detail:openssl_session", + "@glog", + ], +) + +cpp_library( + name = "ssl_errors", + srcs = ["SSLErrors.cpp"], + hdrs = ["SSLErrors.h"], + deps = [ + "//folly:range", + "//folly/io/async:async_socket_exception", + "//folly/portability:openssl", + ], +) + +cpp_library( + name = "tls_definitions", + hdrs = ["TLSDefinitions.h"], + deps = [ + "//folly/io:iobuf", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/test/BUILD.bazel new file mode 100644 index 00000000000..38a7c6fba21 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/ssl/test/BUILD.bazel @@ -0,0 +1,38 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "ssl_errors_test", + srcs = ["SSLErrorsTest.cpp"], + deps = [ + "//folly/io/async/ssl:ssl_errors", + "//folly/portability:gtest", + "//folly/portability:openssl", + ], +) + +cpp_unittest( + name = "basic_transport_certificate_test", + srcs = ["BasicTransportCertificateTest.cpp"], + data = [ + "//folly/io/async/test/certs:tests-cert.pem", + ], + deps = [ + "//folly:file_util", + "//folly/io/async/ssl:basic_transport_certificate", + "//folly/portability:gtest", + "//folly/ssl:openssl_cert_utils", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "openssl_utils_test", + srcs = ["OpenSSLUtilsTest.cpp"], + deps = [ + "//folly:string", + "//folly/io/async/ssl:openssl_utils", + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/ssl:openssl_ptr_types", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/BUILD.bazel new file mode 100644 index 00000000000..df2129bf8fd --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/BUILD.bazel @@ -0,0 +1,1176 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "test_ssl_server", + srcs = [ + "TestSSLServer.cpp", + ], + hdrs = [ + "TestSSLServer.h", + ], + data = [ + "//folly/io/async/test/certs:ca-cert.pem", + "//folly/io/async/test/certs:client_ca_cert.pem", + "//folly/io/async/test/certs:client_cert.pem", + "//folly/io/async/test/certs:client_chain.pem", + "//folly/io/async/test/certs:client_key.pem", + "//folly/io/async/test/certs:tests-cert.pem", + "//folly/io/async/test/certs:tests-key.pem", + ], + deps = [ + ":callback_state_enum", + "//folly:network_address", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:async_ssl_socket", + "//folly/io/async:async_transport", + "//folly/io/async:server_socket", + "//folly/io/async/ssl:ssl_errors", + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/portability:sockets", + "//folly/portability:unistd", + "//folly/testing:test_util", + ], +) + +cpp_library( + name = "tfo_util", + srcs = [ + "TFOUtil.cpp", + ], + hdrs = [ + "TFOUtil.h", + ], + deps = [ + "//folly/detail:socket_fast_open", + ], +) + +cpp_library( + name = "async_signal_handler_test_lib", + hdrs = [ + "AsyncSignalHandlerTestLib.h", + ], + deps = [ + ":util", + "//folly/io/async:async_base", + "//folly/io/async:async_signal_handler", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "async_pipe_test", + srcs = [ + "AsyncPipeTest.cpp", + ], + deps = [ + "//folly:memory", + "//folly/io/async:async_base", + "//folly/io/async:async_pipe", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "async_ssl_socket_test_lib", + hdrs = [ + "AsyncSSLSocketTest.h", + ], + deps = [ + ":test_ssl_server", + "//folly:exception_wrapper", + "//folly:network_address", + "//folly/fibers:fiber_manager_map", + "//folly/io:socket_option_map", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:async_ssl_socket", + "//folly/io/async:async_transport", + "//folly/io/async:server_socket", + "//folly/io/async/ssl:ssl_errors", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:pthread", + "//folly/portability:sockets", + "//folly/portability:string", + "//folly/portability:unistd", + "//folly/testing:test_util", + ], +) + +# NOTE: Test does not work with OSS distribution. +# cpp_unittest( +# name = "async_ssl_socket_test", +# srcs = [ +# "AsyncSSLSocketTest.cpp", +# "AsyncSSLSocketTest2.cpp", +# ], +# # labels = ["oss-broken"], +# data = [ +# "//folly/io/async/test/certs:ca-cert.pem", +# "//folly/io/async/test/certs:client_ca_cert.pem", +# "//folly/io/async/test/certs:client_cert.pem", +# "//folly/io/async/test/certs:client_key.pem", +# "//folly/io/async/test/certs:tests-cert.pem", +# "//folly/io/async/test/certs:tests-key.pem", +# ], +# linkopts = select({ +# "@platforms//os:linux": ["-ldl"], +# "//conditions:default": [], +# }), +# deps = [ +# ":async_ssl_socket_test_lib", # @manual +# ":blocking_socket", +# ":mocks", +# ":test_ssl_server", +# ":tfo_util", +# "//folly:exception_wrapper", +# "//folly:network_address", +# "//folly:string", +# "//folly/fibers:fiber_manager_map", +# "//folly/futures:core", +# "//folly/init", +# "//folly/io:iobuf", +# "//folly/io:socket_option_map", +# "//folly/io/async:async_base", +# "//folly/io/async:async_pipe", +# "//folly/io/async:async_socket", +# "//folly/io/async:async_ssl_socket", +# "//folly/io/async:async_transport", +# "//folly/io/async:event_base_thread", +# "//folly/io/async:scoped_event_base_thread", +# "//folly/io/async:server_socket", +# "//folly/io/async:ssl_context", +# "//folly/io/async:ssl_options", +# "//folly/io/async/ssl:basic_transport_certificate", +# "//folly/io/async/ssl:openssl_transport_certificate", +# "//folly/io/async/ssl:ssl_errors", +# "//folly/net:net_ops", +# "//folly/net:network_socket", +# "//folly/net/test:mock_net_ops_dispatcher", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "//folly/portability:openssl", +# "//folly/portability:pthread", +# "//folly/portability:sockets", +# "//folly/portability:string", +# "//folly/portability:unistd", +# "//folly/testing:test_util", +# "@openssl//:ssl", +# ], +# ) + +cpp_unittest( + name = "async_ssl_socket_write_test", + srcs = [ + "AsyncSSLSocketWriteTest.cpp", + ], + target_compatible_with = select({ + # MSG_MORE is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:async_ssl_socket", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "async_socket_exception_test", + srcs = [ + "AsyncSocketExceptionTest.cpp", + ], + deps = [ + "//folly:conv", + "//folly/io/async:async_socket_exception", + "//folly/io/async:ssl_context", + "//folly/io/async/ssl:ssl_errors", + "//folly/portability:gtest", + "//folly/portability:openssl", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "async_socket_observer_test", +# srcs = [ +# "AsyncSocketObserverTest.cpp", +# ], +# deps = [ +# ":async_socket_test_lib", +# ":mocks", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_library( + name = "async_socket_test_lib", + hdrs = [ + "AsyncSocketTest.h", + "AsyncSocketTest2.h", + ], + deps = [ + ":blocking_socket", + ":callback_state_enum", + ":conn_callback", + "//folly/io/async:async_socket", + "//folly/io/async:server_socket", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:sockets", + "//folly/synchronization:rw_spin_lock", + ], +) + +# Disabled because it takes longer than 15 minutes. +# cpp_unittest( +# name = "async_socket_test", +# size = "enormous", +# srcs = [ +# "AsyncSocketTest.cpp", +# "AsyncSocketTest2.cpp", +# ], +# linkopts = select({ +# "@platforms//os:windows": [], +# "//conditions:default": ["-lrt"], +# }), +# deps = [ +# ":async_socket_test_lib", # @manual +# ":blocking_socket", +# ":callback_state_enum", +# ":conn_callback", +# ":mocks", +# ":tfo_util", +# ":util", +# "//folly:exception_wrapper", +# "//folly:network_address", +# "//folly:random", +# "//folly/io:iobuf", +# "//folly/io:socket_option_map", +# "//folly/io/async:async_base", +# "//folly/io/async:async_socket", +# "//folly/io/async:scoped_event_base_thread", +# "//folly/io/async:server_socket", +# "//folly/net:net_ops", +# "//folly/net:network_socket", +# "//folly/net/test:mock_net_ops_dispatcher", +# "//folly/net/test:mock_tcpinfo_dispatcher", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "//folly/portability:sockets", +# "//folly/portability:unistd", +# "//folly/synchronization:baton", +# "//folly/synchronization:rw_spin_lock", +# "//folly/test:socket_address_test_helper", +# "//folly/testing:test_util", +# ], +# ) + +cpp_unittest( + name = "async_transport_test", + srcs = [ + "AsyncTransportTest.cpp", + ], + deps = [ + ":mocks", + "//folly/io/async:async_socket", + "//folly/io/async:async_transport", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "event_handler_test", + srcs = [ + "EventHandlerTest.cpp", + ], + target_compatible_with = select({ + # sys/eventfd.h is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly:mpmc_queue", + "//folly:scope_guard", + "//folly/io/async:async_base", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:sockets", + ], +) + +cpp_unittest( + name = "async_timeout_test", + srcs = ["AsyncTimeoutTest.cpp"], + deps = [ + "//folly/io/async:async_base", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "async_udp_socket_test", + srcs = ["AsyncUDPSocketTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly:network_address", + "//folly:string", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/io/async:async_base", + "//folly/io/async:async_udp_server_socket", + "//folly/io/async:async_udp_socket", + "//folly/net/test:mock_net_ops_dispatcher", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:sockets", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "async_udp_socket_gso_gro_test", + srcs = ["AsyncUDPSocketGSOGROTest.cpp"], + deps = [ + "//folly:conv", + "//folly:network_address", + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async:async_udp_server_socket", + "//folly/io/async:async_udp_socket", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "async_udp_socket_sendmmsg_test", + srcs = ["AsyncUDPSocketSendmmsgTest.cpp"], + deps = [ + "//folly:conv", + "//folly:network_address", + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async:async_udp_server_socket", + "//folly/io/async:async_udp_socket", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "decorated_async_transport_wrapper_test", + srcs = ["DecoratedAsyncTransportWrapperTest.cpp"], + deps = [ + "//folly/io/async:async_socket", + "//folly/io/async:async_transport", + "//folly/io/async:decorated_async_transport_wrapper", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "blocking_socket", + hdrs = ["BlockingSocket.h"], + deps = [ + "//folly:optional", + "//folly/io/async:async_socket", + "//folly/io/async:async_ssl_socket", + "//folly/io/async:ssl_context", + "//folly/net:network_socket", + ], +) + +cpp_library( + name = "callback_state_enum", + hdrs = [ + "CallbackStateEnum.h", + ], +) + +cpp_library( + name = "conn_callback", + hdrs = [ + "ConnCallback.h", + ], + deps = [ + ":callback_state_enum", + "//folly/io/async:async_socket", + ], +) + +cpp_unittest( + name = "delayed_destruction_base_test", + srcs = ["DelayedDestructionBaseTest.cpp"], + deps = [ + "//folly/io/async:delayed_destruction", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "delayed_destruction_test", + srcs = ["DelayedDestructionTest.cpp"], + deps = [ + "//folly/io/async:delayed_destruction", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "destructor_check_test", + srcs = ["DestructorCheckTest.cpp"], + deps = [ + "//folly:memory", + "//folly/io/async:destructor_check", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "event_base_benchmark", + srcs = ["EventBaseBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/io/async:async_base", + "//folly/portability:gflags", + ], +) + +cpp_library( + name = "event_base_test_lib", + hdrs = [ + "EventBaseTestLib.h", + ], + deps = [ + ":util", + "//folly:math", + "//folly:memory", + "//folly:scope_guard", + "//folly/futures:core", + "//folly/io/async:async_base", + "//folly/portability:gmock", + "//folly/portability:stdlib", + "//folly/portability:unistd", + "//folly/synchronization:baton", + "//folly/system:thread_id", + "//folly/system:thread_name", + ], +) + +# Disabled because this test is real-time timing dependent, and is therefore flaky. +# cpp_unittest( +# name = "event_base_test", +# srcs = ["EventBaseTest.cpp"], +# deps = [ +# ":async_signal_handler_test_lib", +# ":event_base_test_lib", +# "//folly/init", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "event_base_local_test", + srcs = ["EventBaseLocalTest.cpp"], + deps = [ + "//folly/io/async:async_base", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "event_base_thread_test", + srcs = ["EventBaseThreadTest.cpp"], + deps = [ + "//folly/io/async:event_base_manager", + "//folly/io/async:event_base_thread", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/system:thread_name", + ], +) + +# Disabled because this test is real-time timing dependent, and is therefore flaky. +# cpp_unittest( +# name = "hhwheel_timer_slow_test", +# size = "medium", +# srcs = ["HHWheelTimerSlowTests.cpp"], +# deps = [ +# ":util", +# "//folly:random", +# "//folly/io/async:async_base", +# "//folly/portability:gtest", +# ], +# ) + +# Disabled because this test is real-time timing dependent, and is therefore flaky. +# cpp_unittest( +# name = "hhwheel_timer_test", +# srcs = ["HHWheelTimerTest.cpp"], +# deps = [ +# ":util", +# "//folly/io/async:async_base", +# "//folly/portability:gtest", +# ], +# ) + +cpp_library( + name = "mocks", + hdrs = [ + "MockAsyncSSLSocket.h", + "MockAsyncSocket.h", + "MockAsyncSocketLegacyObserver.h", + "MockAsyncSocketObserver.h", + "MockAsyncTransport.h", + "MockAsyncUDPSocket.h", + "MockTimeoutManager.h", + ], + deps = [ + "//folly:memory", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:async_socket_exception", + "//folly/io/async:async_ssl_socket", + "//folly/io/async:async_transport", + "//folly/io/async:async_udp_socket", + "//folly/portability:gmock", + ], +) + +cpp_library( + name = "mock_server_socket", + hdrs = ["MockAsyncServerSocket.h"], + deps = [ + "//folly/io/async:async_base", + "//folly/io/async:server_socket", + "//folly/portability:gmock", + ], +) + +cpp_unittest( + name = "notification_queue_test", + srcs = ["NotificationQueueTest.cpp"], + deps = [ + "//folly/io/async:async_base", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "atomic_notification_queue_test", + srcs = ["AtomicNotificationQueueTest.cpp"], + deps = [ + "//folly/io/async:async_base", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "notification_queue_benchmark", + srcs = ["NotificationQueueBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/io/async:async_base", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "request_context_test", + srcs = [ + "RequestContextHelper.h", + "RequestContextTest.cpp", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:memory", + "//folly:singleton", + "//folly/container:enumerate", + "//folly/io/async:async_base", + "//folly/io/async:request_context", + "//folly/portability:gtest", + "//folly/synchronization:relaxed_atomic", + "//folly/system:thread_name", + "@boost.thread", + "@fmt", + ], +) + +cpp_library( + name = "scoped_bound_port", + srcs = ["ScopedBoundPort.cpp"], + hdrs = ["ScopedBoundPort.h"], + deps = [ + "//folly:memory", + "//folly:network_address", + "//folly/io/async:scoped_event_base_thread", + "//folly/io/async:server_socket", + ], +) + +cpp_unittest( + name = "scoped_event_base_thread_test", + srcs = ["ScopedEventBaseThreadTest.cpp"], + deps = [ + "//folly:optional", + "//folly/futures:core", + "//folly/io/async:event_base_manager", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/system:thread_name", + ], +) + +cpp_unittest( + name = "terminate_cancellation_token_test", + srcs = ["TerminateCancellationTokenTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/io/async:terminate_cancellation_token", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cc_binary( + name = "socket_client", + srcs = ["SocketClient.cpp"], + deps = [ + ":blocking_socket", + "//folly:exception_wrapper", + "//folly/portability:gflags", + ], +) + +cpp_unittest( + name = "ssl_session_test", + srcs = ["SSLSessionTest.cpp"], + data = [ + "//folly/io/async/test/certs:ca-cert.pem", + "//folly/io/async/test/certs:tests-cert.pem", + "//folly/io/async/test/certs:tests-key.pem", + ], + deps = [ + ":async_ssl_socket_test_lib", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/portability:sockets", + "//folly/ssl:ssl_session", + "//folly/ssl/detail:openssl_session", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "time_util_test", + srcs = ["TimeUtilTest.cpp"], + deps = [ + ":util", + "//folly/portability:gtest", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_unittest( + name = "ssl_context_test", + srcs = ["SSLContextTest.cpp"], + data = [ + "//folly/io/async/test/certs:client_chain.pem", + "//folly/io/async/test/certs:client_key.pem", + "//folly/io/async/test/certs:clienti_key.pem", + "//folly/io/async/test/certs:tests-cert.pem", + "//folly/io/async/test/certs:tests-key.pem", + ], + deps = [ + ":ssl_util", + "//folly:file_util", + "//folly/io/async:ssl_context", + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/ssl:openssl_cert_utils", + "//folly/ssl:openssl_key_utils", + "//folly/ssl:openssl_ptr_types", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "ssl_context_regression_test", + srcs = ["SSLContextRegressionTest.cpp"], + deps = [ + "//folly:file_util", + "//folly/io/async:ssl_context", + "//folly/portability:gtest", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "ssl_options_test", + srcs = ["SSLOptionsTest.cpp"], + deps = [ + ":ssl_util", + "//folly/io/async:ssl_context", + "//folly/io/async:ssl_options", + "//folly/portability:gtest", + "//folly/ssl:openssl_ptr_types", + ], +) + +cpp_library( + name = "ssl_util", + srcs = [ + "SSLUtil.cpp", + ], + hdrs = [ + "SSLUtil.h", + ], + deps = [ + "//folly/ssl:openssl_ptr_types", + ], +) + +# Disabled because this test is real-time timing dependent, and is therefore flaky. +# cpp_unittest( +# name = "timerfd_timeout_manager_test", +# srcs = ["TimerFDTimeoutManagerTest.cpp"], +# deps = [ +# "//folly/io/async:timerfd", +# "//folly/io/async/test:util", +# "//folly/portability:gtest", +# ], +# ) + +cpp_library( + name = "util", + srcs = [ + "SocketPair.cpp", + "TimeUtil.cpp", + ], + hdrs = [ + "SocketPair.h", + "TimeUtil.h", + "UndelayedDestruction.h", + "Util.h", + ], + deps = [ + "//folly:conv", + "//folly:portability", + "//folly:scope_guard", + "//folly:string", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:fcntl", + "//folly/portability:gtest", + "//folly/portability:sockets", + "//folly/portability:sys_types", + "//folly/portability:unistd", + "//folly/system:thread_id", + "//folly/test:test_utils", + "@glog", + ], +) + +cpp_unittest( + name = "write_chain_async_transport_wrapper_test", + srcs = ["WriteChainAsyncTransportWrapperTest.cpp"], + deps = [ + "//folly/io/async:async_transport", + "//folly/io/async:decorated_async_transport_wrapper", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "write_flags_test", + srcs = ["WriteFlagsTest.cpp"], + deps = [ + "//folly/io/async:async_transport", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "zero_copy_lib", + srcs = ["ZeroCopy.cpp"], + hdrs = ["ZeroCopy.h"], + deps = [ + "//folly:exception_wrapper", + "//folly:network_address", + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async:async_socket", + "//folly/io/async:server_socket", + ], +) + +# NOTE: This fails only in BCR CI. +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "zero_copy_test", +# srcs = ["ZeroCopyTest.cpp"], +# deps = [ +# ":zero_copy_lib", +# "//folly/portability:gtest", +# ], +# ) + +cc_binary( + name = "zero_copy_benchmark", + srcs = ["ZeroCopyBenchmark.cpp"], + deps = [ + ":zero_copy_lib", + "//folly:benchmark", + "//folly/portability:gflags", + ], +) + +# Disabled because it relies on real-time timing, so it is inherently flaky depending on CPU load. +# cpp_unittest( +# name = "hhwheel_timer_high_res_test", +# srcs = ["HHWheelTimerHighResTest.cpp"], +# deps = [ +# "//folly/io/async:async_base", +# "//folly/io/async:timerfd", +# "//folly/io/async/test:util", +# "//folly/portability:gtest", +# ], +# ) + +cc_binary( + name = "hhwheel_timer_high_res_benchmark", + srcs = ["HHWheelTimerHighResBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/io/async:timerfd", + "//folly/io/async/test:util", + ], +) + +# TODO(kgk): Enable once @libaio is added to bcr. See: +# https://github.com/bazelbuild/bazel-central-registry/issues/3756 +# cpp_unittest( +# name = "async_io_test", +# srcs = ["AsyncIOTest.cpp"], +# deps = [ +# "//folly/experimental/io:async_io", +# "//folly/experimental/io/test:async_base_test_lib", +# ], +# ) + +cpp_unittest( + name = "async_io_uring_socket_test", + srcs = ["AsyncIoUringSocketTest.cpp"], + target_compatible_with = select({ + # liburing is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly:file_util", + "//folly:subprocess", + "//folly/executors:global_executor", + "//folly/futures:core", + "//folly/io/async:async_base", + "//folly/io/async:async_io_uring_socket", + "//folly/io/async:async_socket", + "//folly/io/async:io_uring_backend", + "//folly/io/async:io_uring_event", + "//folly/io/async:server_socket", + "//folly/portability:gtest", + "//folly/system:shell", + "//folly/test:socket_address_test_helper", + ], +) + +# Disabled because it relies on real-time timing, so it is inherently flaky depending on CPU load. +# cpp_unittest( +# name = "epoll_backend_test", +# srcs = ["EpollBackendTest.cpp"], +# deps = [ +# "//folly/experimental/io:epoll_backend", +# "//folly/io/async/test:async_signal_handler_test_lib", +# "//folly/io/async/test:event_base_test_lib", +# ], +# ) + +# TODO(kgk): Enable once @libaio is added to bcr. See: +# https://github.com/bazelbuild/bazel-central-registry/issues/3756 +# cc_binary( +# name = "io_benchmark", +# srcs = ["IOBenchmark.cpp"], +# deps = [ +# "//folly:benchmark", +# "//folly:file_util", +# "//folly/experimental/io:async_io", +# "//folly/experimental/io/test:async_base_test_lib", +# "//folly/experimental/io/test:io_test_temp_file_util_lib", +# "//folly/io/async:io_uring", +# "//folly/portability:gflags", +# ], +# ) + +# TODO(kgk): Fix test. +# cc_binary( +# name = "io_uring_backend_bench", +# srcs = ["IoUringBackendBench.cpp"], +# deps = [ +# "//folly:benchmark", +# "//folly:file_util", +# "//folly/experimental/io:epoll_backend", +# "//folly/init", +# "//folly/io/async:async_base", +# "//folly/io/async:io_uring_backend", +# "//folly/io/async:scoped_event_base_thread", +# "//folly/portability:gflags", +# ], +# ) + +cpp_unittest( + name = "io_uring_backend_setup_test", + srcs = ["IoUringBackendSetupTest.cpp"], + target_compatible_with = select({ + # liburing is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly/io/async:io_uring_backend", + "//folly/portability:gtest", + ], +) + +# Disabled because this test is real-time timing dependent, and is therefore flaky. +# cpp_unittest( +# name = "io_uring_backend_test", +# srcs = ["IoUringBackendTest.cpp"], +# deps = [ +# "//folly:file_util", +# "//folly:function", +# "//folly:string", +# "//folly/experimental/io/test:io_test_temp_file_util_lib", +# "//folly/init", +# "//folly/io/async:async_base", +# "//folly/io/async:async_udp_server_socket", +# "//folly/io/async:async_udp_socket", +# "//folly/io/async:io_uring_backend", +# "//folly/io/async/test:async_signal_handler_test_lib", +# "//folly/io/async/test:event_base_test_lib", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "io_uring_event_base_local_test", + srcs = ["IoUringEventBaseLocalTest.cpp"], + target_compatible_with = select({ + # liburing is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly/futures:core", + "//folly/io/async:io_uring_backend", + "//folly/io/async:io_uring_event_base_local", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "io_uring_event_test", + srcs = ["IoUringEventTest.cpp"], + target_compatible_with = select({ + # liburing is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly/futures:core", + "//folly/io/async:async_base", + "//folly/io/async:io_uring_backend", + "//folly/io/async:io_uring_event", + "//folly/portability:gtest", + ], +) + +# NOTE: Test does not work with OSS distribution. +# cpp_unittest( +# name = "io_uring_test", +# srcs = ["IoUringTest.cpp"], +# # labels = ["oss-broken"], +# deps = [ +# "//folly/experimental/io/test:async_base_test_lib", +# "//folly/init", +# "//folly/io/async:io_uring", +# ], +# ) + +# TODO(kgk): Fix test. +# cc_binary( +# name = "registered_fd_benchmark", +# srcs = ["RegisteredFdBenchmark.cpp"], +# deps = [ +# "//folly:benchmark", +# "//folly:file_util", +# "//folly/io/async:async_base", +# "//folly/io/async:io_uring_backend", +# "//folly/portability:gflags", +# ], +# ) + +cpp_unittest( + name = "simple_async_io_test", + srcs = ["SimpleAsyncIOTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:file", + "//folly:random", + "//folly/coro:blocking_wait", + "//folly/coro:collect", + "//folly/experimental/io:simple_async_io", + "//folly/io:iobuf", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "@glog", + ], +) + +cpp_library( + name = "io_test_temp_file_util_lib", + srcs = ["IoTestTempFileUtil.cpp"], + hdrs = ["IoTestTempFileUtil.h"], + target_compatible_with = select({ + # parentDeathSignal() is only available on Linux, but this doesn't guard + # the call. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly:file_util", + "//folly:string", + "//folly/experimental/io:fs_util", + "//folly/testing:test_util", + "@glog", + ], +) + +cpp_library( + name = "async_base_test_lib", + srcs = ["AsyncBaseTestLib.cpp"], + hdrs = ["AsyncBaseTestLib.h"], + target_compatible_with = select({ + # O_DIRECT is only available on Linux. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly:scope_guard", + "//folly:string", + "//folly/experimental/io:async_base", + "//folly/experimental/io:fs_util", + "//folly/experimental/io/test:io_test_temp_file_util_lib", + "//folly/portability:gtest", + "//folly/portability:sockets", + "//folly/portability:unistd", + "//folly/test:test_utils", + "@glog", + ], +) + +cpp_library( + name = "mux_io_thread_pool_executor_test_lib", + srcs = ["MuxIOThreadPoolExecutorTest.cpp"], + deps = [ + "//folly/executors/test:IOThreadPoolExecutorBaseTestLib", + "//folly/experimental/io:epoll", + "//folly/experimental/io:mux_io_thread_pool_executor", + "//folly/portability:gtest", + "//folly/synchronization:latch", + ], +) + +cpp_unittest( + name = "mux_io_thread_pool_executor_test_epoll", + args = [ + "--folly_event_base_poller_backend=epoll", + "--folly_event_base_poller_epoll_rearm_inline=false", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":mux_io_thread_pool_executor_test_lib", # @manual + ], +) + +cpp_unittest( + name = "mux_io_thread_pool_executor_test_epoll_rearm_inline", + args = [ + "--folly_event_base_poller_backend=epoll", + "--folly_event_base_poller_epoll_rearm_inline=true", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":mux_io_thread_pool_executor_test_lib", # @manual + ], +) + +cpp_unittest( + name = "mux_io_thread_pool_executor_test_io_uring", + args = [ + "--folly_event_base_poller_backend=io_uring", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":mux_io_thread_pool_executor_test_lib", # @manual + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/certs/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/certs/BUILD.bazel new file mode 100644 index 00000000000..394f8b5cc23 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/async/test/certs/BUILD.bazel @@ -0,0 +1,3 @@ +package(default_visibility = ["//visibility:public"]) + +exports_files(glob(["*.pem"])) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/BUILD.bazel new file mode 100644 index 00000000000..8b3b672e6ad --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/BUILD.bazel @@ -0,0 +1,59 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "transport_callback_base", + hdrs = [ + "TransportCallbackBase.h", + ], + deps = [ + "//folly:portability", + "//folly/coro:baton", + "//folly/coro:task", + "//folly/io/async:async_transport", + "//folly/io/async/ssl:ssl_errors", + ], +) + +cpp_library( + name = "transport_callbacks", + hdrs = [ + "TransportCallbacks.h", + ], + deps = [ + ":transport_callback_base", + "//folly:network_address", + "//folly:range", + "//folly/coro:task", + "//folly/io:iobuf", + "//folly/io/async:async_socket", + "//folly/io/async:async_socket_exception", + ], +) + +cpp_library( + name = "socket", + srcs = [ + "ServerSocket.cpp", + "Transport.cpp", + ], + hdrs = [ + "ServerSocket.h", + "Transport.h", + ], + deps = [ + ":transport_callbacks", + "//folly:exception_wrapper", + "//folly:expected", + "//folly:network_address", + "//folly:portability", + "//folly:range", + "//folly/coro:baton", + "//folly/coro:task", + "//folly/io:iobuf", + "//folly/io/async:async_socket", + "//folly/io/async:async_socket_exception", + "//folly/io/async:server_socket", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/test/BUILD.bazel new file mode 100644 index 00000000000..2a422791dc9 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/coro/test/BUILD.bazel @@ -0,0 +1,18 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "transport_test", + srcs = [ + "TransportTest.cpp", + ], + deps = [ + "//folly:portability", + "//folly/coro:blocking_wait", + "//folly/coro:collect", + "//folly/io/async/test:async_socket_test_lib", + "//folly/io/async/test:mocks", + "//folly/io/async/test:scoped_bound_port", + "//folly/io/coro:socket", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/test/BUILD.bazel new file mode 100644 index 00000000000..fbe593baf5e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/test/BUILD.bazel @@ -0,0 +1,171 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cc_binary( + name = "iobuf_benchmark", + srcs = ["IOBufBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/io:iobuf", + ], +) + +cpp_unittest( + name = "iobuf_test", + srcs = ["IOBufTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:range", + "//folly/io:iobuf", + "//folly/io:typed_io_buf", + "//folly/memory:malloc", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "iobuf_cb_test", + srcs = ["IOBufCBTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/io:iobuf", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "iobuf_cursor_benchmark", + srcs = ["IOBufCursorBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:format", + "//folly:range", + "//folly/io:iobuf", + "//folly/lang:keep", + ], +) + +cpp_unittest( + name = "iobuf_cursor_test", + srcs = ["IOBufCursorTest.cpp"], + deps = [ + "//folly:format", + "//folly:range", + "//folly/io:iobuf", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "iobuf_network_bench", + srcs = ["NetworkBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/io:iobuf", + "//folly/portability:gflags", + ], +) + +cpp_unittest( + name = "iobuf_queue_test", + srcs = ["IOBufQueueTest.cpp"], + deps = [ + "//folly:range", + "//folly/io:iobuf", + "//folly/portability:gtest", + "@fmt", + ], +) + +cpp_unittest( + name = "iobuf_iovec_builder_test", + srcs = ["IOBufIovecBuilderTest.cpp"], + deps = [ + "//folly/io:iobuf", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "queueappender_benchmark", + srcs = ["QueueAppenderBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:format", + "//folly:range", + "//folly/io:iobuf", + ], +) + +cpp_unittest( + name = "record_io_test", + srcs = ["RecordIOTest.cpp"], + deps = [ + "//folly:conv", + "//folly:fbstring", + "//folly:random", + "//folly/io:iobuf", + "//folly/io:record_io", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/testing:test_util", + "@glog", + ], +) + +cpp_unittest( + name = "shutdown_socket_set_test", + srcs = ["ShutdownSocketSetTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/io:shutdown_socket_set", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "@glog", + ], +) + +cpp_unittest( + name = "socket_option_value_test", + srcs = ["SocketOptionValueTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly/io:socket_option_map", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "fs_util_test", + srcs = ["FsUtilTest.cpp"], + deps = [ + "//folly:string", + "//folly/experimental/io:fs_util", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/testing:test_util", + "@fmt", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/tool/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/tool/BUILD.bazel new file mode 100644 index 00000000000..196117626de --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/io/tool/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "huge_page_util", + srcs = ["HugePageUtil.cpp"], + deps = [ + "//folly:range", + "//folly/experimental/io:huge_pages", + "//folly/portability:gflags", + "//folly/system:memory_mapping", + "@fmt", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/BUILD.bazel new file mode 100644 index 00000000000..d2cea2578c8 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/BUILD.bazel @@ -0,0 +1,136 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "dynamic", + srcs = [ + "dynamic.cpp", + "json.cpp", + ], + hdrs = [ + "DynamicConverter.h", + "dynamic.h", + "json.h", + ], + textual_hdrs = [ + "dynamic-inl.h", + ], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:expected", + "//folly:format", + "//folly:function", + "//folly:json_pointer", + "//folly:likely", + "//folly:optional", + "//folly:portability", + "//folly:range", + "//folly:traits", + "//folly:unicode", + "//folly:utility", + "//folly/container:access", + "//folly/container:enumerate", + "//folly/container:f14_hash", + "//folly/detail:iterators", + "//folly/hash", + "//folly/lang:assume", + "//folly/lang:bits", + "//folly/lang:exception", + "//folly/portability:constexpr", + "@boost.algorithm", + "@boost.iterator", + "@glog", + ], +) + +cpp_library( + name = "json_pointer", + srcs = ["json_pointer.cpp"], + hdrs = ["json_pointer.h"], + deps = [ + "//folly:expected", + "//folly:range", + "//folly:string", + ], +) + +cpp_library( + name = "json_patch", + srcs = ["json_patch.cpp"], + hdrs = ["json_patch.h"], + deps = [ + "//folly:expected", + "//folly:json_pointer", + "//folly:optional", + "//folly/container:enumerate", + "//folly/json:dynamic", + "@glog", + ], +) + +cpp_library( + name = "json_schema", + srcs = ["JSONSchema.cpp"], + hdrs = ["JSONSchema.h"], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:exception_wrapper", + "//folly:memory", + "//folly:optional", + "//folly:range", + "//folly:singleton", + "//folly:string", + "//folly/json:dynamic", + "//folly/portability:math", + "@boost.algorithm", + "@boost.regex", + ], +) + +cpp_library( + name = "dynamic_parser", + srcs = ["DynamicParser.cpp"], + hdrs = [ + "DynamicParser.h", + ], + textual_hdrs = [ + "DynamicParser-inl.h", + ], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly/json:dynamic", + # for toPseudoJson(), since print_as_pseudo_json() is in json.cpp + "//folly:json", # @manual + "//folly:optional", + "//folly:scope_guard", + "//folly:traits", + "@boost.function_types", + "@boost.mpl", + "@glog", + ], +) + +cpp_library( + name = "json_mock_util", + hdrs = ["JsonMockUtil.h"], + deps = [ + "//folly/portability:gmock", + "//folly/test:json_test_util", + ], +) + +cpp_library( + name = "json_test_util", + srcs = ["JsonTestUtil.cpp"], + hdrs = ["JsonTestUtil.h"], + deps = [ + "//folly:conv", + "//folly:range", + "//folly/json:dynamic", + "//folly/lang:assume", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/BUILD.bazel new file mode 100644 index 00000000000..add8f652e62 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/BUILD.bazel @@ -0,0 +1,22 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "bser", + srcs = [ + "Dump.cpp", + "Load.cpp", + ], + hdrs = [ + "Bser.h", + ], + deps = [ + "//folly:c_portability", + "//folly:json", # @manual + "//folly:optional", + "//folly:string", + "//folly/io:iobuf", + "//folly/json:dynamic", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/test/BUILD.bazel new file mode 100644 index 00000000000..5626901c55e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/bser/test/BUILD.bazel @@ -0,0 +1,11 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "testbser", + srcs = ["BserTest.cpp"], + deps = [ + "//folly:string", + "//folly/json/bser", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/test/BUILD.bazel new file mode 100644 index 00000000000..4ac4af087bc --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/test/BUILD.bazel @@ -0,0 +1,115 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "dynamic_converter_test", + srcs = ["DynamicConverterTest.cpp"], + deps = [ + "//folly:expected", + "//folly:fbvector", + "//folly:optional", + "//folly/json:dynamic", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "dynamic_other_test", + srcs = ["DynamicOtherTest.cpp"], + deps = [ + "//folly/gen:base", + "//folly/json:dynamic", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "dynamic_test", + srcs = ["DynamicTest.cpp"], + deps = [ + "//folly:range", + "//folly/hash", + "//folly/json:dynamic", + "//folly/portability:gtest", + "//folly/test:comparison_operator_test_util", + "@glog", + ], +) + +cpp_unittest( + name = "json_other_test", + srcs = ["JsonOtherTest.cpp"], + deps = [ + "//folly/json:dynamic", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "json_patch_test", + srcs = ["json_patch_test.cpp"], + deps = [ + "//folly:json_patch", + "//folly:json_pointer", + "//folly/json:dynamic", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "json_test", + srcs = ["JsonTest.cpp"], + deps = [ + "//folly/json:dynamic", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "json_pointer_test", + srcs = ["json_pointer_test.cpp"], + deps = [ + "//folly:json_pointer", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "json_schema_test", + srcs = ["JSONSchemaTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/json:dynamic", + "//folly/json:json_schema", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "dynamic_parser_test", + srcs = ["DynamicParserTest.cpp"], + deps = [ + "//folly:optional", + "//folly/json:dynamic_parser", + "//folly/portability:gtest", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "json_test_util_test", + srcs = ["JsonTestUtilTest.cpp"], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/test:json_mock_util", + "//folly/test:json_test_util", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/tool/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/tool/BUILD.bazel new file mode 100644 index 00000000000..15be2a71457 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/json/tool/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "json_schema_tester", + srcs = ["JSONSchemaTester.cpp"], + deps = [ + "//folly/json:dynamic", + "//folly/json:json_schema", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/BUILD.bazel new file mode 100644 index 00000000000..831e8b59b1a --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/BUILD.bazel @@ -0,0 +1,280 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "access", + hdrs = ["Access.h"], + deps = [ + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "align", + hdrs = ["Align.h"], + deps = [ + "//folly:portability", + "//folly:traits", + ], +) + +cpp_library( + name = "aligned", + hdrs = ["Aligned.h"], + deps = [ + ":align", + "//folly:utility", + ], +) + +cpp_library( + name = "assume", + hdrs = ["Assume.h"], + deps = [ + ":hint", + "//folly:portability", + ], +) + +cpp_library( + name = "badge", + hdrs = ["Badge.h"], + deps = [ + "//folly:traits", + ], +) + +cpp_library( + name = "bits", + hdrs = ["Bits.h"], + deps = [ + ":assume", + ":c_string", + "//folly:constexpr_math", + "//folly:portability", + "//folly:traits", + "//folly:utility", + "//folly/portability:builtins", + ], +) + +cpp_library( + name = "bits_class", + hdrs = ["BitsClass.h"], + deps = [ + "//folly:portability", + "//folly:range", + "//folly/lang:bits", + "@glog", + ], +) + +cpp_library( + name = "builtin", + hdrs = ["Builtin.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "c_array", + hdrs = ["CArray.h"], +) + +cpp_library( + name = "c_string", + srcs = ["CString.cpp"], + hdrs = ["CString.h"], + deps = [ + "//folly:c_portability", + "//folly:cpp_attributes", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "cast", + hdrs = ["Cast.h"], + deps = [ + ":safe_assert", + "//folly:portability", + "//folly:traits", + ], +) + +cpp_library( + name = "checked_math", + hdrs = ["CheckedMath.h"], + deps = [ + "//folly:c_portability", + "//folly:likely", + ], +) + +cpp_library( + name = "customization_point", + hdrs = ["CustomizationPoint.h"], + deps = [ + ":static_const", + "//folly:portability", + ], +) + +cpp_library( + name = "exception", + srcs = ["Exception.cpp"], + hdrs = ["Exception.h"], + linkopts = select({ + "//conditions:default": [], + "@platforms//os:macos": ["-lc++abi"], + }), + deps = [ + ":assume", + ":new", + ":safe_assert", + ":thunk", + ":type_info", + "//folly:c_portability", + "//folly:cpp_attributes", + "//folly:likely", + "//folly:portability", + "//folly:traits", + "//folly:utility", + "@fmt", + ], +) + +cpp_library( + name = "extern", + hdrs = ["Extern.h"], +) + +cpp_library( + name = "keep", + hdrs = ["Keep.h"], + deps = [ + "//folly:c_portability", + ], +) + +cpp_library( + name = "hint", + hdrs = [ + "Hint.h", + "Hint-inl.h", + ], + deps = [ + ":safe_assert", + "//folly:portability", + "//folly:traits", + ], +) + +cpp_library( + name = "new", + hdrs = ["New.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:portability", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "ordering", + hdrs = ["Ordering.h"], + deps = [ + ":exception", + ], +) + +cpp_library( + name = "propagate_const", + hdrs = ["PropagateConst.h"], + deps = [ + "//folly:traits", + "//folly:utility", + ], +) + +cpp_library( + name = "rvalue_reference_wrapper", + hdrs = ["RValueReferenceWrapper.h"], +) + +cpp_library( + name = "safe_assert", + srcs = ["SafeAssert.cpp"], + hdrs = ["SafeAssert.h"], + deps = [ + ":c_array", + ":to_ascii", + "//folly:cpp_attributes", + "//folly:portability", + "//folly:preprocessor", + "//folly/detail:file_util_detail", + "//folly/portability:sys_types", + "//folly/portability:windows", + ], +) + +cpp_library( + name = "static_const", + hdrs = ["StaticConst.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "thunk", + hdrs = ["Thunk.h"], + deps = [ + ":new", + "//folly:utility", + ], +) + +cpp_library( + name = "to_ascii", + srcs = ["ToAscii.cpp"], + hdrs = ["ToAscii.h"], + deps = [ + ":align", + ":c_array", + "//folly:constexpr_math", + "//folly:likely", + "//folly:portability", + "//folly:utility", + "//folly/portability:builtins", + ], +) + +cpp_library( + name = "type_info", + hdrs = ["TypeInfo.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:portability", + ], +) + +cpp_library( + name = "pretty", + hdrs = ["Pretty.h"], + deps = [ + ":c_array", + "//folly:portability", + ], +) + +cpp_library( + name = "uncaught_exceptions", + srcs = ["UncaughtExceptions.cpp"], + hdrs = ["UncaughtExceptions.h"], + deps = [ + ":exception", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/test/BUILD.bazel new file mode 100644 index 00000000000..3e885010298 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/lang/test/BUILD.bazel @@ -0,0 +1,236 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "align_test", + srcs = ["AlignTest.cpp"], + deps = [ + "//folly/lang:align", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "aligned_test", + srcs = ["AlignedTest.cpp"], + deps = [ + "//folly/lang:align", + "//folly/lang:aligned", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "badge_test", + srcs = ["BadgeTest.cpp"], + deps = [ + "//folly/lang:badge", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "bits_benchmark", + srcs = ["BitsBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:cpp_attributes", + "//folly:random", + "//folly/lang:assume", + "//folly/lang:bits", + ], +) + +cc_binary( + name = "bits_class_benchmark", + srcs = ["BitsClassBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/lang:bits_class", + "@glog", + ], +) + +cpp_unittest( + name = "bits_class_test", + srcs = ["BitsClassTest.cpp"], + deps = [ + "//folly/lang:bits_class", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "bits_test", + srcs = ["BitsTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly/lang:bits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "c_string_test", + srcs = ["CStringTest.cpp"], + deps = [ + "//folly/lang:c_string", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "cast_test", + srcs = ["CastTest.cpp"], + deps = [ + "//folly:utility", + "//folly/lang:cast", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "checked_math_test", + srcs = ["CheckedMathTest.cpp"], + deps = [ + "//folly/lang:checked_math", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "exception_bench", + srcs = ["ExceptionBench.cpp"], + deps = [ + "//folly:benchmark", + "//folly/lang:exception", + "//folly/lang:keep", + ], +) + +cpp_unittest( + name = "exception_test", + srcs = ["ExceptionTest.cpp"], + deps = [ + "//folly:portability", + "//folly/lang:align", + "//folly/lang:exception", + "//folly/lang:keep", + "//folly/lang:pretty", + "//folly/portability:gtest", + "@fmt", + ], +) + +cpp_unittest( + name = "extern_test", + srcs = ["ExternTest.cpp"], + deps = [ + "//folly/lang:extern", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "hint_test", + srcs = ["HintTest.cpp"], + deps = [ + "//folly/lang:hint", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "new_test", + srcs = ["NewTest.cpp"], + deps = [ + "//folly/lang:align", + "//folly/lang:new", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "ordering_test", + srcs = ["OrderingTest.cpp"], + deps = [ + "//folly/lang:ordering", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "propagate_const_test", + srcs = ["PropagateConstTest.cpp"], + deps = [ + "//folly/lang:propagate_const", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "rvalue_reference_wrapper_test", + srcs = ["RValueReferenceWrapperTest.cpp"], + deps = [ + "//folly/lang:rvalue_reference_wrapper", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "safe_assert_test", + srcs = ["SafeAssertTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:conv", + "//folly/lang:keep", + "//folly/lang:safe_assert", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "thunk_test", + srcs = ["ThunkTest.cpp"], + deps = [ + "//folly:traits", + "//folly/lang:thunk", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "to_ascii_test", + srcs = ["ToAsciiTest.cpp"], + deps = [ + "//folly/lang:to_ascii", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "type_info_test", + srcs = ["TypeInfoTest.cpp"], + deps = [ + "//folly/lang:type_info", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "pretty_test", + srcs = ["PrettyTest.cpp"], + deps = [ + "//folly/lang:pretty", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/BUILD.bazel new file mode 100644 index 00000000000..bee2a9b1cb3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/BUILD.bazel @@ -0,0 +1,206 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +# "logging" is the core of the logging library +# If you want to log messages from your code, this is the library you should +# depend on. +cpp_library( + name = "logging", + srcs = [ + "AsyncFileWriter.cpp", + "AsyncLogWriter.cpp", + "CustomLogFormatter.cpp", + "FileWriterFactory.cpp", + "GlogStyleFormatter.cpp", + "ImmediateFileWriter.cpp", + "LogCategory.cpp", + "LogCategoryConfig.cpp", + "LogConfig.cpp", + "LogMessage.cpp", + "LogStream.cpp", + "LogStreamProcessor.cpp", + "Logger.cpp", + "LoggerDB.cpp", + "ObjectToString.cpp", + "StandardLogHandler.cpp", + "StandardLogHandlerFactory.cpp", + "StreamHandlerFactory.cpp", + "xlog.cpp", + ], + hdrs = [ + "AsyncFileWriter.h", + "AsyncLogWriter.h", + "CustomLogFormatter.h", + "FileWriterFactory.h", + "GlogStyleFormatter.h", + "ImmediateFileWriter.h", + "LogCategory.h", + "LogCategoryConfig.h", + "LogConfig.h", + "LogFormatter.h", + "LogMessage.h", + "LogStream.h", + "LogStreamProcessor.h", + "LogWriter.h", + "Logger.h", + "LoggerDB.h", + "ObjectToString.h", + "StandardLogHandler.h", + "StandardLogHandlerFactory.h", + "StreamHandlerFactory.h", + "xlog.h", + ], + deps = [ + ":log_handler", + ":log_level", + ":log_name", + ":rate_limiter", + "//folly:c_portability", + "//folly:constexpr_math", + "//folly:conv", + "//folly:cpp_attributes", + "//folly:demangle", + "//folly:exception", + "//folly:exception_string", + "//folly:file", + "//folly:file_util", + "//folly:format", + "//folly:likely", + "//folly:map_util", + "//folly:optional", + "//folly:portability", + "//folly:range", + "//folly:scope_guard", + "//folly:string", + "//folly:synchronized", + "//folly/detail:static_singleton_manager", + "//folly/lang:exception", + "//folly/lang:type_info", + "//folly/portability:fcntl", + "//folly/portability:pthread", + "//folly/portability:time", + "//folly/portability:unistd", + "//folly/system:at_fork", + "//folly/system:thread_id", + "//folly/system:thread_name", + "@fmt", + ], +) + +# "init" contains code needed to configure the logging library. +# The main initialization code in your program should normally depend +# on this to initialize the logging library. +cpp_library( + name = "init", + srcs = [ + "Init.cpp", + "LogConfigParser.cpp", + ], + hdrs = [ + "Init.h", + "LogConfigParser.h", + ], + deps = [ + ":init_weak", # @manual + ":log_name", + ":logging", + "//folly:c_portability", + "//folly:conv", + "//folly:range", + "//folly:string", + "//folly/json:dynamic", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "init_weak", + srcs = [ + "InitWeak.cpp", + ], + deps = [ + "//folly:c_portability", + ], +) + +cpp_library( + name = "file_handler_factory", + srcs = ["FileHandlerFactory.cpp"], + hdrs = ["FileHandlerFactory.h"], + deps = [ + ":log_handler", + ":logging", + ], +) + +cpp_library( + name = "log_handler", + srcs = [ + "LogHandlerConfig.cpp", + ], + hdrs = [ + "LogHandler.h", + "LogHandlerConfig.h", + "LogHandlerFactory.h", + ], + deps = [ + ":log_level", + "//folly:cpp_attributes", + "//folly:optional", + "//folly:range", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "log_level", + srcs = ["LogLevel.cpp"], + hdrs = ["LogLevel.h"], + deps = [ + "//folly:conv", + "//folly:portability", + "//folly:range", + ], +) + +cpp_library( + name = "log_name", + srcs = ["LogName.cpp"], + hdrs = ["LogName.h"], + deps = [ + "//folly:range", + ], +) + +cpp_library( + name = "rate_limiter", + srcs = ["RateLimiter.cpp"], + hdrs = ["RateLimiter.h"], + deps = [ + "//folly:chrono", + ], +) + +cpp_library( + name = "glog_bridge", + srcs = ["BridgeFromGoogleLogging.cpp"], + hdrs = ["BridgeFromGoogleLogging.h"], + deps = [ + ":logging", + "//folly:utility", + "@glog", + ], +) + +cpp_library( + name = "auto_timer", + hdrs = ["AutoTimer.h"], + deps = [ + "//folly:conv", + "//folly:optional", + "//folly:string", + "@fmt", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/test/BUILD.bazel new file mode 100644 index 00000000000..4dd1cc94057 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/logging/test/BUILD.bazel @@ -0,0 +1,364 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_file_writer_test", + srcs = ["AsyncFileWriterTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly:exception", + "//folly:file", + "//folly:file_util", + "//folly:string", + "//folly:synchronized", + "//folly/futures:core", + "//folly/init", + "//folly/lang:safe_assert", + "//folly/logging", + "//folly/logging:init", + "//folly/portability:config", + "//folly/portability:gflags", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/system:thread_id", + "//folly/system:thread_name", + "//folly/test:test_utils", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "async_log_writer_test", + srcs = ["AsyncLogWriterTest.cpp"], + deps = [ + "//folly/logging", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "config_parser_test", + srcs = ["ConfigParserTest.cpp"], + deps = [ + ":config_helpers", + "//folly:string", + "//folly/json:dynamic", + "//folly/logging", + "//folly/logging:init", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "config_update_test", + srcs = ["ConfigUpdateTest.cpp"], + deps = [ + ":config_helpers", + ":test_handler", + "//folly/json:dynamic", + "//folly/logging", + "//folly/logging:init", + "//folly/logging:log_handler", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "file_handler_factory_test", + srcs = ["FileHandlerFactoryTest.cpp"], + deps = [ + "//folly:exception", + "//folly/logging", + "//folly/logging:file_handler_factory", + "//folly/portability:gtest", + "//folly/test:test_utils", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "custom_log_formatter_test", + srcs = ["CustomLogFormatterTest.cpp"], + deps = [ + "//folly:format", + "//folly/init", + "//folly/logging", + "//folly/portability:gtest", + "//folly/portability:stdlib", + "@fmt", + ], +) + +cpp_unittest( + name = "glog_formatter_test", + srcs = ["GlogFormatterTest.cpp"], + deps = [ + "//folly:format", + "//folly/init", + "//folly/logging", + "//folly/portability:gtest", + "//folly/portability:stdlib", + "//folly/system:thread_name", + "@fmt", + ], +) + +cpp_unittest( + name = "immediate_file_writer_test", + srcs = ["ImmediateFileWriterTest.cpp"], + deps = [ + "//folly:conv", + "//folly:exception", + "//folly:file_util", + "//folly/logging", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "init_test", + srcs = ["InitTest.cpp"], + deps = [ + ":config_helpers", + "//folly/logging", + "//folly/logging:init", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "log_category_test", + srcs = ["LogCategoryTest.cpp"], + deps = [ + ":test_handler", + "//folly:conv", + "//folly/logging", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "logger_db_test", + srcs = ["LoggerDBTest.cpp"], + deps = [ + ":test_handler", + "//folly/logging", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "logger_test", + srcs = ["LoggerTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":test_handler", + "//folly/logging", + "//folly/logging:log_handler", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/test:test_utils", + "@fmt", + ], +) + +cpp_unittest( + name = "log_level_test", + srcs = ["LogLevelTest.cpp"], + deps = [ + "//folly:conv", + "//folly:random", + "//folly/logging:log_level", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "log_message_test", + srcs = ["LogMessageTest.cpp"], + deps = [ + "//folly:string", + "//folly/logging", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "log_name_test", + srcs = ["LogNameTest.cpp"], + deps = [ + "//folly/logging:log_name", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "log_stream_test", + srcs = ["LogStreamTest.cpp"], + deps = [ + "//folly/logging", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "rate_limiter_test", + srcs = ["RateLimiterTest.cpp"], + deps = [ + "//folly:conv", + "//folly/logging:rate_limiter", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "standard_log_handler_test", + srcs = ["StandardLogHandlerTest.cpp"], + deps = [ + "//folly:conv", + "//folly/logging", + "//folly/logging:log_handler", + "//folly/logging:log_level", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "config_helpers", + srcs = ["ConfigHelpers.cpp"], + hdrs = ["ConfigHelpers.h"], + deps = [ + "//folly:string", + "//folly/logging", + "//folly/logging:init", + "//folly/logging:log_handler", + ], +) + +cpp_unittest( + name = "sync_level_test", + srcs = ["SyncLevelTest.cpp"], + deps = [ + "//folly/logging", + "//folly/logging:init", + "//folly/logging:log_handler", + "//folly/test:test_utils", + ], +) + +cpp_library( + name = "test_handler", + srcs = ["TestLogHandler.cpp"], + hdrs = ["TestLogHandler.h"], + deps = [ + "//folly:map_util", + "//folly/logging", + "//folly/logging:log_handler", + ], +) + +cpp_library( + name = "xlog_test_lib", + srcs = [ + "XlogFile1.cpp", + "XlogFile2.cpp", + ], + hdrs = [ + "XlogHeader1.h", + "XlogHeader2.h", + ], + deps = [ + "//folly:range", + "//folly/logging", + ], +) + +cc_binary( + name = "xlog_bench", + srcs = ["XlogBench.cpp"], + deps = [ + "//folly:benchmark", + "//folly/init", + "//folly/logging", + "//folly/logging:init", + "//folly/logging:log_handler", + "//folly/portability:gflags", + "@boost.preprocessor", + "@boost.thread", + ], +) + +# This test fails for some reason when run with @folly as an external repo. +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "xlog_test", +# srcs = ["XlogTest.cpp"], +# deps = [ +# ":test_handler", +# ":xlog_test_lib", +# "//folly/logging", +# "//folly/logging:init", +# "//folly/logging:log_handler", +# "//folly/portability:constexpr", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "//folly/test:test_utils", +# ], +# ) + +cpp_unittest( + name = "standard_log_handler_factory_test", + srcs = ["StandardLogHandlerFactoryTest.cpp"], + deps = [ + "//folly/logging", + "//folly/logging:init", + "//folly/logging:log_handler", + "//folly/portability:gmock", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "bridge_from_google_logging_test", + srcs = ["BridgeFromGoogleLoggingTest.cpp"], + deps = [ + ":test_handler", + "//folly/logging", + "//folly/logging:glog_bridge", + "//folly/logging:init", + "//folly/logging:log_handler", + "//folly/portability:gtest", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "auto_timer_test", + srcs = ["AutoTimerTest.cpp"], + deps = [ + "//folly/logging:auto_timer", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/BUILD.bazel new file mode 100644 index 00000000000..895ec112a13 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/BUILD.bazel @@ -0,0 +1,177 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "arena", + hdrs = [ + "Arena.h", + ], + textual_hdrs = [ + "Arena-inl.h", + ], + deps = [ + ":malloc", + "//folly:conv", + "//folly:likely", + "//folly:memory", + "//folly/lang:align", + "//folly/lang:checked_math", + "//folly/lang:exception", + "//folly/lang:safe_assert", + "@boost.intrusive", + ], +) + +cpp_library( + name = "mallctl_helper", + srcs = ["MallctlHelper.cpp"], + hdrs = ["MallctlHelper.h"], + deps = [ + ":malloc", + "//folly:format", + "//folly:string", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "malloc", + hdrs = ["Malloc.h"], + deps = [ + "//folly:portability", + "//folly/lang:bits", + "//folly/lang:exception", + "//folly/memory/detail:malloc_impl", + "//folly/portability:malloc", + ], +) + +cpp_library( + name = "memory_resource", + hdrs = ["MemoryResource.h"], +) + +cpp_library( + name = "not_null", + srcs = [], + hdrs = [ + "not_null.h", + ], + textual_hdrs = [ + "not_null-inl.h", + ], + deps = [ + "//folly:memory", + "//folly:portability", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "reentrant_allocator", + srcs = ["ReentrantAllocator.cpp"], + hdrs = ["ReentrantAllocator.h"], + deps = [ + "//folly:portability", + "//folly/lang:bits", + "//folly/lang:safe_assert", + "//folly/portability:sys_mman", + ], +) + +cpp_library( + name = "sanitize_address", + srcs = ["SanitizeAddress.cpp"], + hdrs = ["SanitizeAddress.h"], + deps = [ + "//folly:portability", + "//folly/lang:extern", + ], +) + +cpp_library( + name = "sanitize_leak", + srcs = ["SanitizeLeak.cpp"], + hdrs = ["SanitizeLeak.h"], + deps = [ + "//folly:portability", + "//folly/lang:extern", + ], +) + +cpp_library( + name = "thread_cached_arena", + srcs = ["ThreadCachedArena.cpp"], + hdrs = ["ThreadCachedArena.h"], + deps = [ + "//folly:likely", + "//folly:synchronized", + "//folly:thread_local", + "//folly/memory:arena", + ], +) + +cpp_library( + name = "uninitialized_memory_hacks", + hdrs = ["UninitializedMemoryHacks.h"], +) + +cpp_library( + name = "jemalloc_nodump_allocator", + srcs = ["JemallocNodumpAllocator.cpp"], + hdrs = ["JemallocNodumpAllocator.h"], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:string", + "//folly/memory:malloc", + "//folly/portability:config", + "//folly/portability:malloc", + "//folly/portability:sys_mman", + "@glog", + ], +) + +cpp_library( + name = "jemalloc_huge_page_allocator", + srcs = ["JemallocHugePageAllocator.cpp"], + hdrs = ["JemallocHugePageAllocator.h"], + deps = [ + "//folly:c_portability", + "//folly/memory:malloc", + "//folly/portability:malloc", + "//folly/portability:string", + "//folly/portability:sys_mman", + "//folly/portability:sys_types", + "@glog", + ], +) + +# Disable jemalloc tests. +#cpp_unittest( +# name = "jemalloc_huge_page_allocator_test", +# srcs = ["JemallocHugePageAllocatorTest.cpp"], +# hdrs = [], +# allocator = "jemalloc", +# labels = ["oss-broken"], +# deps = [ +# "//folly/container:f14_hash", +# "//folly/memory:jemalloc_huge_page_allocator", +# "//folly/memory:malloc", +# "//folly/portability:gtest", +# ], +#) +# +#cpp_unittest( +# name = "jemalloc_nodump_allocator_test", +# srcs = ["JemallocNodumpAllocatorTest.cpp"], +# hdrs = [], +# allocator = "jemalloc", +# deps = [ +# "//folly/io:iobuf", +# "//folly/memory:jemalloc_nodump_allocator", +# "//folly/memory:malloc", +# "//folly/portability:gtest", +# ], +#) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/detail/BUILD.bazel new file mode 100644 index 00000000000..c8a722d1db6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/detail/BUILD.bazel @@ -0,0 +1,10 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "malloc_impl", + srcs = ["MallocImpl.cpp"], + hdrs = ["MallocImpl.h"], + deps = ["//folly:portability"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/test/BUILD.bazel new file mode 100644 index 00000000000..b82c47d979e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/memory/test/BUILD.bazel @@ -0,0 +1,125 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "arena_test", + srcs = ["ArenaTest.cpp"], + deps = [ + "//folly:memory", + "//folly:random", + "//folly/memory:arena", + "//folly/memory:mallctl_helper", + "//folly/memory:malloc", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "mallctl_helper_test", + srcs = ["MallctlHelperTest.cpp"], + deps = [ + "//folly:c_portability", + "//folly/init", + "//folly/memory:mallctl_helper", + "//folly/memory:malloc", + "//folly/portability:gtest", + "//folly/portability:sys_types", + ], +) + +cpp_unittest( + name = "malloc_test", + srcs = ["MallocTest.cpp"], + deps = [ + "//folly/memory:malloc", + "//folly/portability:gtest", + "//folly/portability:malloc", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "memory_resource_test", + srcs = ["MemoryResourceTest.cpp"], + deps = [ + "//folly/memory:memory_resource", + "//folly/portability:gtest", + ], +) + +# NOTE: Test does not work with OSS distribution. +# cpp_unittest( +# name = "not_null_test", +# srcs = [ +# "not_null_test.cpp", +# ], +# # target_compatible_with = ["fbcode//opensource/macros:broken-in-oss"], +# deps = [ +# "//folly/memory:not_null", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "reentrant_allocator_test", + srcs = ["ReentrantAllocatorTest.cpp"], + deps = [ + "//folly:utility", + "//folly/functional:invoke", + "//folly/memory:reentrant_allocator", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "sanitize_address_test", + srcs = ["SanitizeAddressTest.cpp"], + deps = [ + "//folly/lang:new", + "//folly/memory:sanitize_address", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "sanitize_leak_test", + srcs = ["SanitizeLeakTest.cpp"], + deps = [ + "//folly/memory:sanitize_leak", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "thread_cached_arena_test", + srcs = ["ThreadCachedArenaTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:memory", + "//folly:range", + "//folly/lang:align", + "//folly/memory:thread_cached_arena", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "uninitialized_memory_hacks_test", + srcs = [ + "UninitializedMemoryHacksODR.cpp", + "UninitializedMemoryHacksTest.cpp", + ], + target_compatible_with = select({ + # Test relies on char_traits, which isn't available on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:random", + "//folly/memory:uninitialized_memory_hacks", + "//folly/portability:gtest", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/BUILD.bazel new file mode 100644 index 00000000000..580288ccd0f --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/BUILD.bazel @@ -0,0 +1,68 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "net_ops", + srcs = ["NetOps.cpp"], + hdrs = ["NetOps.h"], + deps = [ + ":network_socket", + "//folly:c_portability", + "//folly:portability", + "//folly:scope_guard", + "//folly:utility", + "//folly/net/detail:socket_file_descriptor_map", + "//folly/portability:iovec", + "//folly/portability:sys_types", + "//folly/portability:time", + "//folly/portability:windows", + ], +) + +cpp_library( + name = "net_ops_dispatcher", + srcs = ["NetOpsDispatcher.cpp"], + hdrs = ["NetOpsDispatcher.h"], + deps = [ + ":net_ops", + ], +) + +cpp_library( + name = "network_socket", + hdrs = ["NetworkSocket.h"], + deps = [ + "//folly/net/detail:socket_file_descriptor_map", + "//folly/portability:windows", + ], +) + +cpp_library( + name = "tcpinfo", + srcs = ["TcpInfo.cpp"], + hdrs = [ + "TcpInfo.h", + "TcpInfoTypes.h", + ], + deps = [ + ":net_ops_dispatcher", + ":network_socket", + "//folly:expected", + "//folly:optional", + "//folly:string", + "//folly/portability:sockets", + "@glog", + ], +) + +cpp_library( + name = "tcpinfo_dispatcher", + srcs = ["TcpInfoDispatcher.cpp"], + hdrs = ["TcpInfoDispatcher.h"], + deps = [ + ":net_ops_dispatcher", + ":tcpinfo", + "//folly:expected", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/BUILD.bazel new file mode 100644 index 00000000000..7d41f2336e0 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "socket_file_descriptor_map", + srcs = ["SocketFileDescriptorMap.cpp"], + hdrs = ["SocketFileDescriptorMap.h"], + deps = [ + "//folly/portability:windows", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/test/BUILD.bazel new file mode 100644 index 00000000000..d2e8eb4b3b9 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/detail/test/BUILD.bazel @@ -0,0 +1,15 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "socket_file_descriptor_map_test", + srcs = ["SocketFileDescriptorMapTest.cpp"], + deps = [ + "//folly:portability", + "//folly/net/detail:socket_file_descriptor_map", + "//folly/portability:fcntl", + "//folly/portability:gtest", + "//folly/portability:sockets", + "//folly/portability:unistd", + "//folly/portability:windows", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/test/BUILD.bazel new file mode 100644 index 00000000000..50f1c849b55 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/net/test/BUILD.bazel @@ -0,0 +1,67 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "mock_net_ops_dispatcher", + hdrs = [ + "MockNetOpsDispatcher.h", + ], + deps = [ + "//folly/net:net_ops_dispatcher", + "//folly/portability:gmock", + ], +) + +cpp_library( + name = "mock_tcpinfo_dispatcher", + hdrs = [ + "MockTcpInfoDispatcher.h", + ], + deps = [ + "//folly/net:tcpinfo_dispatcher", + "//folly/portability:gmock", + ], +) + +cpp_unittest( + name = "net_ops_test", + srcs = ["NetOpsTest.cpp"], + deps = [ + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "tcpinfo_test", + srcs = ["TcpInfoTest.cpp"], + deps = [ + ":tcpinfo_test_util", + "//folly/net:tcpinfo", + "//folly/net/test:mock_net_ops_dispatcher", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "tcpinfo_test_util", + hdrs = [ + "TcpInfoTestUtil.h", + ], + target_compatible_with = select({ + # Linux only. + "@platforms//os:linux": [], + "//conditions:default": ["@platforms//:incompatible"], + }), + deps = [ + "//folly/net:tcpinfo", + "//folly/net/test:mock_net_ops_dispatcher", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/BUILD.bazel new file mode 100644 index 00000000000..f2f71879680 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/BUILD.bazel @@ -0,0 +1,110 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "observable", + hdrs = [ + "Observable.h", + ], + textual_hdrs = [ + "Observable-inl.h", + ], + deps = [ + "//folly/observer", + "//folly/synchronization:baton", + ], +) + +cpp_library( + name = "observer", + hdrs = [ + "Observer.h", + ], + textual_hdrs = [ + "Observer-inl.h", + "Observer-pre.h", + ], + deps = [ + "//folly:shared_mutex", + "//folly:synchronized", + "//folly:thread_local", + "//folly/experimental/observer/detail:observer_manager", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "hazptr_observer", + hdrs = [ + "HazptrObserver.h", + ], + deps = [ + "//folly:synchronized", + "//folly/experimental/observer/detail:observer_manager", + "//folly/observer", + "//folly/synchronization:hazptr", + ], +) + +cpp_library( + name = "read_mostly_tl_observer", + hdrs = [ + "ReadMostlyTLObserver.h", + ], + deps = [ + "//folly/concurrency/memory:read_mostly_shared_ptr", + "//folly/experimental/observer/detail:observer_manager", + "//folly/observer", + ], +) + +cpp_library( + name = "core_cached_observer", + hdrs = [ + "CoreCachedObserver.h", + ], + deps = [ + "//folly/concurrency:core_cached_shared_ptr", + "//folly/experimental/observer/detail:observer_manager", + "//folly/observer", + ], +) + +cpp_library( + name = "simple_observable", + hdrs = [ + "SimpleObservable.h", + ], + textual_hdrs = [ + "SimpleObservable-inl.h", + ], + deps = [ + "//folly:function", + "//folly:synchronized", + "//folly/observer", + "//folly/observer:observable", + "//folly/synchronization:delayed_init", + ], +) + +cpp_library( + name = "with_jitter", + hdrs = [ + "WithJitter.h", + ], + textual_hdrs = [ + "WithJitter-inl.h", + ], + deps = [ + "//folly:default_keep_alive_executor", + "//folly:random", + "//folly:synchronized", + "//folly/executors:global_executor", + "//folly/futures:core", + "//folly/observer", + "//folly/observer:observable", + "@fmt", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/detail/BUILD.bazel new file mode 100644 index 00000000000..643ea21b393 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/observer/detail/BUILD.bazel @@ -0,0 +1,41 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "graph_cycle_detector", + hdrs = ["GraphCycleDetector.h"], + deps = [ + "@glog", + ], +) + +cpp_library( + name = "observer_manager", + srcs = [ + "Core.cpp", + "ObserverManager.cpp", + ], + hdrs = [ + "Core.h", + "ObserverManager.h", + ], + deps = [ + "//folly:exception_string", + "//folly:format", + "//folly:function", + "//folly:portability", + "//folly:range", + "//folly:singleton", + "//folly:synchronized", + "//folly/concurrency:unbounded_queue", + "//folly/experimental/observer/detail:graph_cycle_detector", + "//folly/fibers:core_manager", + "//folly/functional:invoke", + "//folly/futures:core", + "//folly/portability:gflags", + "//folly/synchronization:sanitize_thread", + "//folly/system:thread_name", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/poly/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/poly/BUILD.bazel new file mode 100644 index 00000000000..52f114e2062 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/poly/BUILD.bazel @@ -0,0 +1,14 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "basic_interfaces", + hdrs = [ + "Nullable.h", + "Regular.h", + ], + deps = [ + "//folly:poly", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/BUILD.bazel new file mode 100755 index 00000000000..ea9777e3360 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/BUILD.bazel @@ -0,0 +1,399 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "asm", + hdrs = ["Asm.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "atomic", + hdrs = ["Atomic.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "builtins", + srcs = ["Builtins.cpp"], + hdrs = ["Builtins.h"], + deps = [ + ":windows", + "//folly:portability", + ], +) + +cpp_library( + name = "config", + hdrs = ["Config.h"], + deps = [ + "//folly:config", + ], +) + +cpp_library( + name = "constexpr", + hdrs = ["Constexpr.h"], + deps = [ + "//folly:c_portability", + "//folly:portability", + ], +) + +cpp_library( + name = "dirent", + srcs = ["Dirent.cpp"], + hdrs = ["Dirent.h"], + deps = [ + ":windows", + ], +) + +cpp_library( + name = "event", + hdrs = ["Event.h"], + deps = [ + ":fcntl", + ":windows", + "//folly/net/detail:socket_file_descriptor_map", + "@libevent//:event_core", + ], +) + +cpp_library( + name = "fcntl", + srcs = ["Fcntl.cpp"], + hdrs = ["Fcntl.h"], + deps = [ + ":sockets", + ":sys_stat", + ":windows", + "//folly:portability", + ], +) + +cpp_library( + name = "filesystem", + srcs = ["Filesystem.cpp"], + hdrs = ["Filesystem.h"], +) + +cpp_library( + name = "fmt_compile", + hdrs = ["FmtCompile.h"], + deps = [ + "@fmt", + ], +) + +cpp_library( + name = "gflags", + hdrs = ["GFlags.h"], + deps = [ + ":config", + "@gflags", + ], +) + +cpp_library( + name = "gmock", + hdrs = ["GMock.h"], + deps = [ + ":unistd", + ":windows", + "//folly:portability", + "@googletest//:gtest", + ], +) + +cpp_library( + name = "gtest", + hdrs = ["GTest.h"], + deps = [ + ":unistd", + ":windows", + "//folly:portability", + "@googletest//:gtest", + ], +) + +cpp_library( + name = "iovec", + hdrs = ["IOVec.h"], +) + +cpp_library( + name = "libgen", + srcs = ["Libgen.cpp"], + hdrs = ["Libgen.h"], +) + +cpp_library( + name = "libunwind", + hdrs = ["Libunwind.h"], + deps = select({ + "//folly:use_libunwind_setting": ["@libunwind"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "malloc", + srcs = ["Malloc.cpp"], + hdrs = ["Malloc.h"], + deps = [ + ":config", + "//folly:c_portability", + ], +) + +cpp_library( + name = "math", + hdrs = ["Math.h"], +) + +cpp_library( + # @shim + name = "memory", + hdrs = ["Memory.h"], + deps = ["//folly:memory"], +) + +cpp_library( + name = "openat2", + srcs = ["openat2.c"], + hdrs = ["openat2.h"], + deps = [ + "//folly:config", + ], +) + +cpp_library( + name = "openssl", + srcs = ["OpenSSL.cpp"], + hdrs = ["OpenSSL.h"], + deps = [ + ":windows", + "//folly:portability", + "@openssl//:crypto", + "@openssl//:ssl", + ], +) + +cpp_library( + name = "sched", + srcs = ["Sched.cpp"], + hdrs = ["Sched.h"], + deps = [ + "//folly:portability", + ], +) + +cpp_library( + name = "pthread", + srcs = ["PThread.cpp"], + hdrs = ["PThread.h"], + linkopts = select({ + "@platforms//os:windows": [], + "//conditions:default": ["-pthread"], + }), + deps = [ + ":config", + ":sched", + ":time", + ":windows", + "//folly:portability", + "//folly/lang:assume", + "@boost.core", + "@boost.thread", + ], +) + +cpp_library( + name = "sockets", + srcs = ["Sockets.cpp"], + hdrs = ["Sockets.h"], + deps = [ + "//folly:portability", + "//folly:scope_guard", + "//folly/net:net_ops", + "//folly/net:network_socket", + "//folly/net/detail:socket_file_descriptor_map", + ], +) + +cpp_library( + name = "source_location", + hdrs = ["SourceLocation.h"], + deps = [ + "@fmt", + ], +) + +cpp_library( + name = "stdio", + srcs = ["Stdio.cpp"], + hdrs = ["Stdio.h"], + deps = [ + ":unistd", + "//folly:scope_guard", + ], +) + +cpp_library( + name = "stdlib", + srcs = ["Stdlib.cpp"], + hdrs = ["Stdlib.h"], + deps = [ + ":config", + ":fcntl", + ":sys_stat", + ":windows", + "//folly:c_portability", + ], +) + +cpp_library( + name = "string", + srcs = ["String.cpp"], + hdrs = ["String.h"], + deps = [":config"], +) + +cpp_library( + name = "sys_file", + srcs = ["SysFile.cpp"], + hdrs = ["SysFile.h"], + deps = [ + ":windows", + ], +) + +cpp_library( + name = "sys_membarrier", + srcs = ["SysMembarrier.cpp"], + hdrs = ["SysMembarrier.h"], + deps = [ + ":sys_syscall", + "//folly:portability", + ], +) + +cpp_library( + name = "sys_mman", + srcs = ["SysMman.cpp"], + hdrs = [ + "SysMman.h", + ], + linkopts = select({ + "@platforms//os:linux": ["-lrt"], + "//conditions:default": [], + }), + deps = [ + ":windows", + "//folly:portability", + ], +) + +cpp_library( + name = "sys_resource", + srcs = ["SysResource.cpp"], + hdrs = ["SysResource.h"], + deps = [ + ":sys_time", + ":windows", + ], +) + +cpp_library( + name = "sys_stat", + srcs = ["SysStat.cpp"], + hdrs = ["SysStat.h"], + deps = [ + ":sys_types", + ":windows", + "//folly:c_portability", + ], +) + +cpp_library( + name = "sys_syscall", + hdrs = ["SysSyscall.h"], + deps = [ + "//folly:c_portability", + "//folly:portability", + ], +) + +cpp_library( + name = "sys_time", + srcs = ["SysTime.cpp"], + hdrs = ["SysTime.h"], + deps = [":windows"], +) + +cpp_library( + name = "sys_types", + hdrs = ["SysTypes.h"], +) + +cpp_library( + name = "sys_uio", + srcs = ["SysUio.cpp"], + hdrs = ["SysUio.h"], + deps = [ + ":config", + ":iovec", + ":sockets", + ":sys_file", + ":sys_types", + ":unistd", + "//folly:scope_guard", + ], +) + +cpp_library( + name = "syslog", + hdrs = ["Syslog.h"], +) + +cpp_library( + name = "time", + srcs = ["Time.cpp"], + hdrs = ["Time.h"], + linkopts = select({ + "@platforms//os:linux": ["-lrt"], + "//conditions:default": [], + }), + deps = [ + ":config", + ":windows", + "//folly:c_portability", + "//folly:likely", + "//folly:utility", + ], +) + +cpp_library( + name = "unistd", + srcs = ["Unistd.cpp"], + hdrs = ["Unistd.h"], + deps = [ + ":sockets", + ":sys_types", + ":windows", + "//folly:portability", + "//folly:scope_guard", + "//folly/net/detail:socket_file_descriptor_map", + ], +) + +cpp_library( + name = "windows", + hdrs = ["Windows.h"], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/test/BUILD.bazel new file mode 100644 index 00000000000..9256580b51a --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/portability/test/BUILD.bazel @@ -0,0 +1,79 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "constexpr_test", + srcs = ["ConstexprTest.cpp"], + deps = [ + "//folly/portability:constexpr", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "fcntl_test", + srcs = ["FcntlTest.cpp"], + deps = [ + "//folly/portability:fcntl", + "//folly/portability:unistd", + ], +) + +cpp_unittest( + name = "filesystem_test", + srcs = ["FilesystemTest.cpp"], + deps = [ + "//folly/portability:filesystem", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "libgen_test", + srcs = ["LibgenTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/portability:gtest", + "//folly/portability:libgen", + ], +) + +cpp_unittest( + name = "openssl_portability_test", + srcs = ["OpenSSLPortabilityTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/ssl:openssl_ptr_types", + ], +) + +cpp_unittest( + name = "pthread_test", + srcs = ["PThreadTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/portability:pthread", + ], +) + +cpp_unittest( + name = "time_test", + srcs = ["TimeTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/portability:time", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "unistd_test", + srcs = ["UnistdTest.cpp"], + deps = [ + "//folly/portability:unistd", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/BUILD.bazel new file mode 100644 index 00000000000..644aa5a00ca --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/BUILD.bazel @@ -0,0 +1,74 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "settings", + srcs = [ + "Settings.cpp", + ], + hdrs = [ + "Settings.h", + "detail/SettingsImpl.h", + ], + deps = [ + ":immutables", + ":types", + "//folly:conv", + "//folly:function", + "//folly:likely", + "//folly:optional", + "//folly:range", + "//folly:shared_mutex", + "//folly:synchronized", + "//folly:thread_local", + "//folly:utility", + "//folly/concurrency:singleton_relaxed_counter", + "//folly/container:f14_hash", + "//folly/lang:aligned", + ], +) + +cpp_library( + name = "observer", + hdrs = [ + "Observer.h", + ], + deps = [ + ":settings", + "//folly/observer", + "//folly/observer:simple_observable", + ], +) + +cpp_library( + name = "types", + srcs = [ + "Types.cpp", + ], + hdrs = [ + "Types.h", + ], + deps = [ + "//folly:conv", + "//folly:expected", + "//folly:range", + "//folly:unit", + "//folly:utility", + ], +) + +cpp_library( + name = "immutables", + srcs = [ + "Immutables.cpp", + ], + hdrs = [ + "Immutables.h", + ], + deps = [ + "//folly:indestructible", + "//folly:synchronized", + "//folly/container:f14_hash", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/test/BUILD.bazel new file mode 100644 index 00000000000..36c685f5f69 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/settings/test/BUILD.bazel @@ -0,0 +1,59 @@ +load("//bzl:cpp_library.bzl", "cpp_library") +# load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "settings_test", +# srcs = [ +# "SettingsTest.cpp", +# ], +# deps = [ +# ":a", +# ":b", +# "//folly:format", +# "//folly:string", +# "//folly/experimental/observer/detail:observer_manager", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "//folly/settings", +# "//folly/settings:observer", +# "//folly/synchronization/test:barrier", +# "@fmt", +# ], +# ) + +cpp_library( + name = "a", + srcs = [ + "a.cpp", + ], + hdrs = [ + "a.h", + ], + target_compatible_with = select({ + # FOLLY_SETTING_DEFINE does not work on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/settings", + ], +) + +cpp_library( + name = "b", + srcs = [ + "b.cpp", + ], + hdrs = [ + "b.h", + ], + target_compatible_with = select({ + # FOLLY_SETTING_DEFINE does not work on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/settings", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/BUILD.bazel new file mode 100644 index 00000000000..cf82dc471ff --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/BUILD.bazel @@ -0,0 +1,94 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "openssl_ptr_types", + hdrs = ["OpenSSLPtrTypes.h"], + deps = [ + "//folly:memory", + "//folly/portability:openssl", + "@glog", + ], +) + +cpp_library( + name = "openssl_hash", + srcs = ["OpenSSLHash.cpp"], + hdrs = ["OpenSSLHash.h"], + deps = [ + ":openssl_ptr_types", + "//folly:exception", + "//folly:format", + "//folly:range", + "//folly/io:iobuf", + "//folly/portability:openssl", + ], +) + +cpp_library( + name = "openssl_cert_utils", + srcs = ["OpenSSLCertUtils.cpp"], + hdrs = ["OpenSSLCertUtils.h"], + deps = [ + ":openssl_ptr_types", + "//folly:file_util", + "//folly:optional", + "//folly:scope_guard", + "//folly:string", + "//folly/io:iobuf", + "//folly/portability:openssl", + ], +) + +cpp_library( + name = "openssl_version_finder", + hdrs = ["OpenSSLVersionFinder.h"], + deps = [ + "//folly/portability:openssl", + ], +) + +cpp_library( + name = "openssl_ticket_handler", + hdrs = ["OpenSSLTicketHandler.h"], + deps = [ + "//folly/portability:openssl", + ], +) + +cpp_library( + name = "ssl_session", + hdrs = ["SSLSession.h"], +) + +cpp_library( + name = "ssl_session_manager", + srcs = ["SSLSessionManager.cpp"], + hdrs = ["SSLSessionManager.h"], + deps = [ + ":openssl_ptr_types", + ":ssl_session", + "//folly:overload", + "//folly/portability:openssl", + "//folly/ssl/detail:openssl_session", + ], +) + +cpp_library( + name = "password_collector", + srcs = ["PasswordCollector.cpp"], + hdrs = ["PasswordCollector.h"], +) + +cpp_library( + name = "openssl_key_utils", + srcs = ["OpenSSLKeyUtils.cpp"], + hdrs = ["OpenSSLKeyUtils.h"], + deps = [ + ":openssl_ptr_types", + ":password_collector", + "//folly:range", + "//folly/portability:openssl", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/detail/BUILD.bazel new file mode 100644 index 00000000000..cb08b03ccf4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/detail/BUILD.bazel @@ -0,0 +1,16 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "openssl_session", + srcs = ["OpenSSLSession.cpp"], + hdrs = ["OpenSSLSession.h"], + deps = [ + "//folly:shared_mutex", + "//folly:synchronized", + "//folly/portability:openssl", + "//folly/ssl:openssl_ptr_types", + "//folly/ssl:ssl_session", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/test/BUILD.bazel new file mode 100644 index 00000000000..8842bf00abe --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/ssl/test/BUILD.bazel @@ -0,0 +1,60 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "openssl_hash_test", + srcs = ["OpenSSLHashTest.cpp"], + deps = [ + "//folly/io:iobuf", + "//folly/portability:gtest", + "//folly/ssl:openssl_hash", + ], +) + +cpp_unittest( + name = "openssl_cert_utils_test", + srcs = ["OpenSSLCertUtilsTest.cpp"], + data = [ + "//folly/io/async/test/certs:ca-cert.pem", + "//folly/io/async/test/certs:tests-cert.pem", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:format", + "//folly:range", + "//folly:string", + "//folly/container:enumerate", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/portability:time", + "//folly/ssl:openssl_cert_utils", + "//folly/ssl:openssl_ptr_types", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "ssl_session_manager_test", + srcs = ["SSLSessionManagerTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/portability:openssl", + "//folly/ssl:openssl_ptr_types", + "//folly/ssl:ssl_session_manager", + "//folly/ssl/detail:openssl_session", + ], +) + +cpp_unittest( + name = "openssl_key_utils_test", + srcs = ["OpenSSLKeyUtilsTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/ssl:openssl_key_utils", + "//folly/ssl:password_collector", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/BUILD.bazel new file mode 100644 index 00000000000..404a24a7afd --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/BUILD.bazel @@ -0,0 +1,145 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "bucketed_time_series", + hdrs = [ + "BucketedTimeSeries.h", + ], + textual_hdrs = [ + "BucketedTimeSeries-inl.h", + ], + deps = [ + "//folly:likely", + "//folly/stats/detail:bucket", + "@glog", + ], +) + +cpp_library( + name = "histogram", + hdrs = [ + "Histogram.h", + ], + textual_hdrs = [ + "Histogram-inl.h", + ], + deps = [ + "//folly:c_portability", + "//folly:conv", + "//folly:traits", + "//folly/lang:exception", + "//folly/stats/detail:bucket", + "@glog", + ], +) + +cpp_library( + name = "streaming_stats", + hdrs = [ + "StreamingStats.h", + ], + deps = [ + "//folly/lang:exception", + ], +) + +cpp_library( + name = "multi_level_time_series", + hdrs = [ + "MultiLevelTimeSeries.h", + ], + textual_hdrs = [ + "MultiLevelTimeSeries-inl.h", + ], + deps = [ + ":bucketed_time_series", + "//folly:constexpr_math", + "//folly:string", + "@glog", + ], +) + +cpp_library( + name = "quantile_estimator", + srcs = [ + "QuantileEstimator.cpp", + ], + hdrs = [ + "QuantileEstimator.h", + ], + textual_hdrs = [ + "QuantileEstimator-inl.h", + ], + deps = [ + ":tdigest", + "//folly/stats/detail:buffered_stat", + ], +) + +cpp_library( + name = "quantile_histogram", + hdrs = [ + "QuantileHistogram.h", + ], + textual_hdrs = [ + "QuantileHistogram-inl.h", + ], + deps = [ + ":digest_builder", + "//folly:conv", + "//folly:glog", + "//folly:likely", + "//folly:range", + "//folly:shared_mutex", + "//folly/lang:align", + ], +) + +cpp_library( + name = "tdigest", + srcs = [ + "TDigest.cpp", + ], + hdrs = [ + "TDigest.h", + ], + deps = [ + "//folly:range", + "//folly:utility", + "//folly/stats/detail:double_radix_sort", + "@glog", + ], +) + +cpp_library( + name = "digest_builder", + srcs = [], + hdrs = [ + "DigestBuilder.h", + ], + textual_hdrs = [ + "DigestBuilder-inl.h", + ], + deps = [ + "//folly:memory", + "//folly:spin_lock", + "//folly/concurrency:cache_locality", + "//folly/lang:bits", + ], +) + +cpp_library( + name = "timeseries_histogram", + hdrs = [ + "TimeseriesHistogram.h", + ], + textual_hdrs = [ + "TimeseriesHistogram-inl.h", + ], + deps = [ + ":histogram", + ":multi_level_time_series", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/BUILD.bazel new file mode 100644 index 00000000000..01e18519953 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/BUILD.bazel @@ -0,0 +1,50 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "bucket", + hdrs = ["Bucket.h"], + deps = [ + "//folly:constexpr_math", + ], +) + +cpp_library( + name = "buffered_stat", + srcs = [], + hdrs = [ + "BufferedStat.h", + ], + textual_hdrs = [ + "BufferedStat-inl.h", + ], + deps = [ + ":sliding_window", + "//folly:shared_mutex", + "//folly/stats:digest_builder", + ], +) + +cpp_library( + name = "sliding_window", + hdrs = [ + "SlidingWindow.h", + ], + textual_hdrs = [ + "SlidingWindow-inl.h", + ], + deps = [ + "//folly:function", + ], +) + +cpp_library( + name = "double_radix_sort", + srcs = [ + "DoubleRadixSort.cpp", + ], + hdrs = [ + "DoubleRadixSort.h", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/test/BUILD.bazel new file mode 100644 index 00000000000..5c87b3ecbc3 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/detail/test/BUILD.bazel @@ -0,0 +1,11 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "double_radix_sort_test", + srcs = ["DoubleRadixSortTest.cpp"], + deps = [ + "//folly:random", + "//folly/portability:gtest", + "//folly/stats/detail:double_radix_sort", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/test/BUILD.bazel new file mode 100644 index 00000000000..412bbfc37fd --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/stats/test/BUILD.bazel @@ -0,0 +1,108 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "buffered_stat_test", + srcs = ["BufferedStatTest.cpp"], + deps = [ + "//folly:range", + "//folly/portability:gtest", + "//folly/stats/detail:buffered_stat", + ], +) + +cpp_unittest( + name = "digest_builder_test", + srcs = ["DigestBuilderTest.cpp"], + deps = [ + "//folly:range", + "//folly/portability:gtest", + "//folly/stats:digest_builder", + ], +) + +cpp_unittest( + name = "histogram_test", + srcs = ["HistogramTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/stats:histogram", + ], +) + +cpp_unittest( + name = "streaming_stats_test", + srcs = ["StreamingStatsTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/portability:gtest", + "//folly/stats:streaming_stats", + ], +) + +cpp_unittest( + name = "quantile_estimator_test", + srcs = ["QuantileEstimatorTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/stats:quantile_estimator", + ], +) + +cpp_unittest( + name = "quantile_histogram_test", + srcs = ["QuantileHistogramTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:range", + "//folly/portability:gtest", + "//folly/stats:quantile_histogram", + ], +) + +cpp_unittest( + name = "sliding_window_test", + srcs = ["SlidingWindowTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/stats/detail:sliding_window", + ], +) + +cpp_unittest( + name = "tdigest_test", + srcs = ["TDigestTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/stats:tdigest", + ], +) + +cpp_unittest( + name = "time_series_test", + srcs = ["TimeSeriesTest.cpp"], + deps = [ + "//folly/container:foreach", + "//folly/portability:gtest", + "//folly/stats:bucketed_time_series", + "//folly/stats:multi_level_time_series", + "//folly/stats/detail:bucket", + "@glog", + ], +) + +cpp_unittest( + name = "timeseries_histogram_test", + srcs = ["TimeseriesHistogramTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/stats:timeseries_histogram", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/BUILD.bazel new file mode 100644 index 00000000000..03a9a4e9cc4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/BUILD.bazel @@ -0,0 +1,405 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "asymmetric_thread_fence", + srcs = ["AsymmetricThreadFence.cpp"], + hdrs = ["AsymmetricThreadFence.h"], + deps = [ + ":relaxed_atomic", + "//folly:exception", + "//folly:indestructible", + "//folly/portability:asm", + "//folly/portability:sys_membarrier", + "//folly/portability:sys_mman", + ], +) + +cpp_library( + name = "atomic_ref", + hdrs = ["AtomicRef.h"], + deps = [ + "//folly:traits", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "atomic_util", + hdrs = [ + "AtomicUtil.h", + ], + textual_hdrs = [ + "AtomicUtil-inl.h", + ], + deps = [ + "//folly:constexpr_math", + "//folly:likely", + "//folly:portability", + "//folly:traits", + ], +) + +cpp_library( + name = "atomic_notification", + srcs = [ + "AtomicNotification.cpp", + ], + hdrs = [ + "AtomicNotification.h", + ], + textual_hdrs = [ + "AtomicNotification-inl.h", + ], + deps = [ + ":parking_lot", + "//folly:portability", + "//folly/detail:futex", + ], +) + +cpp_library( + name = "atomic_struct", + hdrs = ["AtomicStruct.h"], + deps = [ + "//folly:constexpr_math", + "//folly:traits", + "//folly/synchronization/detail:atomic_utils", + ], +) + +cpp_library( + name = "baton", + hdrs = ["Baton.h"], + deps = [ + ":atomic_util", + ":wait_options", + "//folly:likely", + "//folly/detail:async_trace", + "//folly/detail:futex", + "//folly/detail:memory_idler", + "//folly/portability:asm", + "//folly/synchronization/detail:spin", + ], +) + +cpp_library( + name = "call_once", + hdrs = ["CallOnce.h"], + deps = [ + "//folly:likely", + "//folly:micro_lock", + "//folly:portability", + "//folly:shared_mutex", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "distributed_mutex", + srcs = [ + "DistributedMutex.cpp", + ], + hdrs = [ + "DistributedMutex.h", + ], + textual_hdrs = [ + "DistributedMutex-inl.h", + ], + deps = [ + ":atomic_notification", + ":atomic_util", + ":lock", + "//folly:constexpr_math", + "//folly:function", + "//folly:likely", + "//folly:optional", + "//folly:portability", + "//folly:scope_guard", + "//folly:utility", + "//folly/chrono:hardware", + "//folly/detail:futex", + "//folly/functional:invoke", + "//folly/lang:align", + "//folly/lang:bits", + "//folly/lang:exception", + "//folly/portability:asm", + "//folly/synchronization/detail:inline_function_ref", + "//folly/synchronization/detail:sleeper", + "@glog", + ], +) + +cpp_library( + name = "hazptr", + srcs = [ + "Hazptr.cpp", + "HazptrDomain.cpp", + ], + hdrs = [ + "Hazptr.h", + "Hazptr-fwd.h", + "HazptrDomain.h", + "HazptrHolder.h", + "HazptrObj.h", + "HazptrObjLinked.h", + "HazptrRec.h", + "HazptrThrLocal.h", + ], + deps = [ + ":asymmetric_thread_fence", + "//folly:c_portability", + "//folly:executor", + "//folly:indestructible", + "//folly:memory", + "//folly:portability", + "//folly:scope_guard", + "//folly:singleton_thread_local", + "//folly:traits", + "//folly/concurrency:cache_locality", + "//folly/container:f14_hash", + "//folly/executors:inline_executor", + "//folly/portability:config", + "//folly/portability:gflags", + "//folly/synchronization/detail:hazptr_utils", + "@glog", + ], +) + +cpp_library( + name = "hazptr_thread_pool_executor", + srcs = ["HazptrThreadPoolExecutor.cpp"], + hdrs = [ + "HazptrThreadPoolExecutor.h", + ], + deps = [ + ":hazptr", + "//folly:singleton", + "//folly/executors:cpu_thread_pool_executor", + ], +) + +cpp_library( + name = "latch", + hdrs = ["Latch.h"], + deps = [ + ":saturating_semaphore", + "//folly:c_portability", + "//folly:likely", + "//folly/lang:exception", + ], +) + +cpp_library( + name = "lifo_sem", + hdrs = ["LifoSem.h"], + deps = [ + ":atomic_struct", + ":saturating_semaphore", + "//folly:c_portability", + "//folly:indexed_mem_pool", + "//folly:likely", + "//folly:portability", + "//folly:traits", + "//folly/detail:static_singleton_manager", + "//folly/lang:aligned", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "lock", + hdrs = ["Lock.h"], + deps = [ + "//folly:portability", + "//folly:traits", + "//folly/functional:invoke", + "//folly/lang:exception", + "//folly/lang:hint", + ], +) + +cpp_library( + name = "micro_spin_lock", + hdrs = ["MicroSpinLock.h"], + deps = [ + ":sanitize_thread", + "//folly:portability", + "//folly/lang:align", + "//folly/synchronization/detail:sleeper", + ], +) + +cpp_library( + name = "native_semaphore", + hdrs = ["NativeSemaphore.h"], + deps = [ + "//folly:utility", + "//folly/lang:exception", + "//folly/portability:windows", + ], +) + +cpp_library( + name = "pico_spin_lock", + hdrs = ["PicoSpinLock.h"], + deps = [ + ":atomic_ref", + ":atomic_util", + ":sanitize_thread", + "//folly:portability", + "//folly/lang:safe_assert", + "//folly/synchronization/detail:sleeper", + ], +) + +cpp_library( + name = "parking_lot", + srcs = [ + "ParkingLot.cpp", + ], + hdrs = ["ParkingLot.h"], + deps = [ + "//folly:hash", + "//folly:indestructible", + "//folly:portability", + "//folly:unit", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "rcu", + srcs = [ + "Rcu.cpp", + ], + hdrs = [ + "Rcu.h", + ], + deps = [ + "//folly:function", + "//folly:indestructible", + "//folly:optional", + "//folly/detail:static_singleton_manager", + "//folly/detail:turn_sequencer", + "//folly/executors:queued_immediate_executor", + "//folly/synchronization/detail:rcu-detail", + ], +) + +cpp_library( + name = "rw_spin_lock", + hdrs = ["RWSpinLock.h"], + deps = [ + ":lock", + "//folly:likely", + "//folly:portability", + "//folly/portability:asm", + ], +) + +cpp_library( + name = "relaxed_atomic", + hdrs = ["RelaxedAtomic.h"], +) + +cpp_library( + name = "sanitize_thread", + srcs = [ + "SanitizeThread.cpp", + ], + hdrs = ["SanitizeThread.h"], + deps = [ + "//folly:portability", + "//folly/lang:extern", + ], +) + +cpp_library( + name = "saturating_semaphore", + hdrs = ["SaturatingSemaphore.h"], + deps = [ + ":atomic_util", + ":wait_options", + "//folly:likely", + "//folly/detail:futex", + "//folly/detail:memory_idler", + "//folly/portability:asm", + "//folly/synchronization/detail:spin", + "@glog", + ], +) + +cpp_library( + name = "small_locks", + hdrs = ["SmallLocks.h"], + deps = [ + ":micro_spin_lock", + ":pico_spin_lock", + "//folly:micro_lock", + "//folly:portability", + ], +) + +cpp_library( + name = "wait_options", + srcs = ["WaitOptions.cpp"], + hdrs = ["WaitOptions.h"], + deps = [ + "//folly:c_portability", + "//folly:portability", + ], +) + +cpp_library( + name = "delayed_init", + hdrs = ["DelayedInit.h"], + deps = [ + ":call_once", + "//folly/lang:safe_assert", + ], +) + +cpp_library( + name = "throttled_lifo_sem", + hdrs = [ + "ThrottledLifoSem.h", + ], + deps = [ + ":distributed_mutex", + ":saturating_semaphore", + ":wait_options", + "//folly:glog", + "//folly:intrusive_list", + "//folly:optional", + "//folly/lang:align", + "//folly/synchronization/detail:spin", + ], +) + +cpp_library( + name = "flat_combining", + hdrs = ["FlatCombining.h"], + deps = [ + "//folly:function", + "//folly:indexed_mem_pool", + "//folly:portability", + "//folly/concurrency:cache_locality", + "//folly/synchronization:saturating_semaphore", + "//folly/system:thread_name", + ], +) + +cpp_library( + name = "event_count", + hdrs = ["EventCount.h"], + deps = [ + "//folly:likely", + "//folly/detail:futex", + "//folly/lang:bits", + "//folly/portability:sys_time", + "//folly/portability:unistd", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/BUILD.bazel new file mode 100644 index 00000000000..083a1cebc8b --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/BUILD.bazel @@ -0,0 +1,93 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "atomic_utils", + hdrs = ["AtomicUtils.h"], + deps = [ + "//folly/lang:assume", + ], +) + +cpp_library( + name = "hazptr_utils", + hdrs = [ + "HazptrUtils.h", + ], + deps = [ + ":sleeper", + "//folly:portability", + "@glog", + ], +) + +cpp_library( + name = "rcu-detail", + hdrs = [ + "ThreadCachedLists.h", + "ThreadCachedReaders.h", + "ThreadCachedTag.h", + ], + deps = [ + "//folly:function", + "//folly:synchronized", + "//folly:thread_local", + "//folly/synchronization:asymmetric_thread_fence", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_library( + name = "sleeper", + srcs = ["Sleeper.cpp"], + hdrs = ["Sleeper.h"], + deps = [ + "//folly:portability", + "//folly/portability:asm", + ], +) + +cpp_library( + name = "spin", + hdrs = ["Spin.h"], + deps = [ + "//folly/portability:asm", + "//folly/synchronization:wait_options", + ], +) + +cpp_library( + name = "inline_function_ref", + hdrs = [ + "InlineFunctionRef.h", + "//folly:function", + "//folly:traits", + "//folly:utility", + "//folly/functional:invoke", + ], +) + +cpp_library( + name = "hardware", + #srcs = [ + # # Use source-specific flags so that these flags aren't applied to this + # # rules headers when they're compiled as a module, as they don't contain + # # any code that requires RTM and they'd conflict when imported by + # # dependents that don't also set it. + # ( + # "Hardware.cpp", + # ["-mrtm"], + # ), + #], + srcs = ["Hardware.cpp"], + hdrs = ["Hardware.h"], + deps = [ + "//folly:cpp_attributes", + "//folly:portability", + "//folly/lang:assume", + "//folly/lang:exception", + "@boost.preprocessor", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/test/BUILD.bazel new file mode 100644 index 00000000000..8231213c7b2 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/detail/test/BUILD.bazel @@ -0,0 +1,24 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "inline_function_ref_test", + srcs = [ + "InlineFunctionRefTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization/detail:inline_function_ref", + ], +) + +cpp_unittest( + name = "hardware_test", + srcs = [ + "HardwareTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization/detail:hardware", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/example/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/example/BUILD.bazel new file mode 100644 index 00000000000..5bdcd157430 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/example/BUILD.bazel @@ -0,0 +1,27 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "hazptr_lock_free_lifo", + hdrs = ["HazptrLockFreeLIFO.h"], + deps = [ + "//folly/synchronization:hazptr", + ], +) + +cpp_library( + name = "hazptr_swmr_set", + hdrs = ["HazptrSWMRSet.h"], + deps = [ + "//folly/synchronization:hazptr", + ], +) + +cpp_library( + name = "hazptr_wide_cas", + hdrs = ["HazptrWideCAS.h"], + deps = [ + "//folly/synchronization:hazptr", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/test/BUILD.bazel new file mode 100644 index 00000000000..5fc01cb9d7b --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/synchronization/test/BUILD.bazel @@ -0,0 +1,438 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "atomic_notification_test", + srcs = [ + "AtomicNotificationTest.cpp", + ], + deps = [ + "//folly:optional", + "//folly/portability:gtest", + "//folly/synchronization:atomic_notification", + ], +) + +cpp_unittest( + name = "atomic_ref_test", + srcs = ["AtomicRefTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:atomic_ref", + ], +) + +cpp_unittest( + name = "atomic_struct_test", + srcs = ["AtomicStructTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:atomic_struct", + ], +) + +cpp_unittest( + name = "atomic_util_test", + srcs = ["AtomicUtilTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:benchmark", + "//folly:portability", + "//folly:utility", + "//folly/functional:invoke", + "//folly/portability:gtest", + "//folly/synchronization:atomic_ref", + "//folly/synchronization:atomic_util", + ], +) + +cpp_library( + name = "barrier", + hdrs = ["Barrier.h"], +) + +cpp_unittest( + name = "barrier_test", + srcs = ["BarrierTest.cpp"], + deps = [ + ":barrier", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "baton_test", + srcs = ["BatonTest.cpp"], + deps = [ + ":baton_test_helpers", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/test:deterministic_schedule", + ], +) + +cpp_library( + name = "baton_test_helpers", + hdrs = ["BatonTestHelpers.h"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/test:deterministic_schedule", + ], +) + +cc_binary( + name = "call_once_benchmark", + srcs = ["CallOnceBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/synchronization:call_once", + "@glog", + ], +) + +cpp_unittest( + name = "call_once_test", + srcs = ["CallOnceTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:traits", + "//folly/portability:gtest", + "//folly/synchronization:call_once", + ], +) + +cpp_unittest( + name = "delayed_init_test", + srcs = ["DelayedInitTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":barrier", + "//folly/portability:gtest", + "//folly/synchronization:delayed_init", + "@fmt", + ], +) + +cpp_unittest( + name = "distributed_mutex_test", + size = "large", + srcs = [ + "DistributedMutexTest.cpp", + ], + deps = [ + "//folly:map_util", + "//folly:synchronized", + "//folly/container:array", + "//folly/container:foreach", + "//folly/lang:customization_point", + "//folly/lang:keep", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/synchronization:distributed_mutex", + "//folly/test:deterministic_schedule", + "//folly/test:test_utils", + ], +) + +cpp_unittest( + name = "hazptr_test", + srcs = ["HazptrTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":barrier", + "//folly:singleton", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization:hazptr", + "//folly/synchronization:hazptr_thread_pool_executor", + "//folly/synchronization/example:hazptr_lock_free_lifo", + "//folly/synchronization/example:hazptr_swmr_set", + "//folly/synchronization/example:hazptr_wide_cas", + "//folly/test:deterministic_schedule", + ], +) + +cpp_unittest( + name = "latch_test", + srcs = ["LatchTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:latch", + ], +) + +cpp_unittest( + name = "lifo_sem_test", + srcs = ["LifoSemTests.cpp"], + deps = [ + "//folly:random", + "//folly/portability:asm", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization:lifo_sem", + "//folly/synchronization:native_semaphore", + "//folly/test:deterministic_schedule", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "lock_test", +# srcs = ["LockTest.cpp"], +# deps = [ +# "//folly/portability:gtest", +# "//folly/synchronization:lock", +# ], +# ) + +cpp_unittest( + name = "native_semaphore_test", + srcs = ["NativeSemaphoreTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:native_semaphore", + ], +) + +cc_binary( + name = "parking_lot_benchmark", + srcs = ["ParkingLotBenchmark.cpp"], + deps = [ + ":barrier", + "//folly:benchmark", + "//folly/detail:futex", + "//folly/synchronization:baton", + "//folly/synchronization:parking_lot", + ], +) + +cpp_unittest( + name = "parking_lot_test", + srcs = ["ParkingLotTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/synchronization:parking_lot", + ], +) + +cc_binary( + name = "rcu_bench", + srcs = ["RcuBench.cpp"], + deps = [ + "//folly:benchmark", + "//folly/synchronization:rcu", + ], +) + +cpp_unittest( + name = "rcu_test", + srcs = ["RcuTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:random", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization:rcu", + "//folly/synchronization:relaxed_atomic", + "@glog", + ], +) + +cpp_unittest( + name = "relaxed_atomic_test", + srcs = ["RelaxedAtomicTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:atomic_util", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_unittest( + name = "rw_spin_lock_test", + srcs = ["RWSpinLockTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/synchronization:rw_spin_lock", + "@glog", + ], +) + +cpp_unittest( + name = "saturating_semaphore_test", + srcs = ["SaturatingSemaphoreTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization:saturating_semaphore", + "//folly/test:deterministic_schedule", + ], +) + +cpp_library( + name = "semaphore", + hdrs = ["Semaphore.h"], + deps = [ + "//folly:optional", + "//folly:scope_guard", + "//folly/lang:exception", + "@boost.intrusive", + ], +) + +cpp_unittest( + name = "semaphore_test", + srcs = ["SemaphoreTest.cpp"], + deps = [ + ":barrier", + ":semaphore", + "//folly:traits", + "//folly/portability:gtest", + "//folly/portability:sys_mman", + "//folly/synchronization:latch", + "@glog", + ], +) + +cpp_unittest( + name = "small_locks_test", + srcs = ["SmallLocksTest.cpp"], + deps = [ + "//folly:random", + "//folly/portability:asm", + "//folly/portability:gflags", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:pthread", + "//folly/portability:unistd", + "//folly/synchronization:small_locks", + "//folly/test:test_utils", + "@glog", + ], +) + +cpp_library( + name = "thread_cached_epoch_bench_util", + hdrs = ["ThreadCachedEpochBench.h"], + deps = [ + "//folly:benchmark", + "//folly/synchronization/detail:rcu-detail", + ], +) + +cc_binary( + name = "thread_cached_readers_bench", + srcs = ["ThreadCachedReadersBench.cpp"], + deps = [ + ":thread_cached_epoch_bench_util", + "//folly:benchmark", + "//folly/synchronization/detail:rcu-detail", + ], +) + +cpp_unittest( + name = "thread_cached_readers_test", + srcs = ["ThreadCachedReadersTest.cpp"], + deps = [ + "//folly:thread_local", + "//folly/portability:gtest", + "//folly/synchronization/detail:rcu-detail", + ], +) + +cpp_unittest( + name = "throttled_lifo_sem_test", + srcs = [ + "ThrottledLifoSemTest.cpp", + ], + deps = [ + "//folly:benchmark", + "//folly:random", + "//folly/portability:gtest", + "//folly/synchronization:saturating_semaphore", + "//folly/synchronization:throttled_lifo_sem", + ], +) + +cpp_library( + name = "flat_combining_examples", + hdrs = ["FlatCombiningExamples.h"], + deps = [ + "//folly/synchronization:baton", + "//folly/synchronization:flat_combining", + ], +) + +cpp_library( + name = "flat_combining_test_helpers", + hdrs = ["FlatCombiningTestHelpers.h"], + deps = [ + "//folly:benchmark", + "//folly/synchronization/test:flat_combining_examples", + "@glog", + ], +) + +cpp_unittest( + name = "flat_combining_benchmark", + srcs = ["FlatCombiningBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/portability:gtest", + "//folly/synchronization/test:flat_combining_test_helpers", + "@glog", + ], +) + +cpp_unittest( + name = "flat_combining_test", + srcs = ["FlatCombiningTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/synchronization/test:flat_combining_test_helpers", + "@glog", + ], +) + +cpp_unittest( + name = "event_count_test", + srcs = ["EventCountTest.cpp"], + deps = [ + "//folly:random", + "//folly/portability:gtest", + "//folly/synchronization:event_count", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/BUILD.bazel new file mode 100644 index 00000000000..34a47ba7200 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/BUILD.bazel @@ -0,0 +1,125 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "at_fork", + srcs = ["AtFork.cpp"], + hdrs = ["AtFork.h"], + deps = [ + "//folly:function", + "//folly:scope_guard", + "//folly/lang:exception", + "//folly/portability:pthread", + "//folly/portability:sys_types", + "//folly/synchronization:sanitize_thread", + ], +) + +cpp_library( + name = "aux_vector", + hdrs = ["AuxVector.h"], + deps = [ + "//folly:portability", + "//folly:preprocessor", + ], +) + +cpp_library( + name = "env_util", + srcs = ["EnvUtil.cpp"], + hdrs = ["EnvUtil.h"], + deps = [ + "//folly:c_portability", + "//folly:memory", + "//folly:string", + "//folly/portability:stdlib", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "hardware_concurrency", + srcs = ["HardwareConcurrency.cpp"], + hdrs = [ + "HardwareConcurrency.h", + ], + deps = [ + "//folly/portability:sched", + ], +) + +cpp_library( + name = "memory_mapping", + srcs = ["MemoryMapping.cpp"], + hdrs = ["MemoryMapping.h"], + deps = [ + "//folly:file", + "//folly:portability", + "//folly:range", + "//folly/portability:gflags", + "//folly/portability:sys_mman", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "@fmt", + "@glog", + ] + select({ + "@platforms//os:linux": ["//folly/experimental/io:huge_pages"], + "//conditions:default": [], + }), +) + +cpp_library( + name = "pid", + srcs = ["Pid.cpp"], + hdrs = ["Pid.h"], + deps = [ + ":at_fork", + "//folly/portability:sys_types", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_library( + name = "shell", + srcs = ["Shell.cpp"], + hdrs = ["Shell.h"], + deps = [ + "//folly:conv", + "//folly:format", + "//folly:range", + ], +) + +cpp_library( + name = "thread_id", + srcs = ["ThreadId.cpp"], + hdrs = ["ThreadId.h"], + deps = [ + ":at_fork", + "//folly:likely", + "//folly/portability:pthread", + "//folly/portability:sys_syscall", + "//folly/portability:unistd", + "//folly/portability:windows", + "//folly/synchronization:relaxed_atomic", + ], +) + +cpp_library( + name = "thread_name", + srcs = ["ThreadName.cpp"], + hdrs = ["ThreadName.h"], + deps = [ + "//folly:optional", + "//folly:portability", + "//folly:range", + "//folly:scope_guard", + "//folly:traits", + "//folly/portability:config", + "//folly/portability:pthread", + "//folly/portability:windows", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/test/BUILD.bazel new file mode 100644 index 00000000000..c12eba48ec8 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/system/test/BUILD.bazel @@ -0,0 +1,109 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "at_fork_test", + srcs = ["AtForkTest.cpp"], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/system:at_fork", + "@glog", + ], +) + +cpp_unittest( + name = "aux_vector_test", + srcs = ["AuxVectorTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/system:aux_vector", + ], +) + +cc_binary( + name = "env_util_subprocess", + srcs = ["EnvUtilSubprocess.cpp"], +) + +cpp_unittest( + name = "env_util_test", + srcs = ["EnvUtilTest.cpp"], + args = [ + "--env_util_subprocess_binary=$(rootpath :env_util_subprocess)", + ], + data = [":env_util_subprocess"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":env_util_subprocess", + "//folly:memory", + "//folly:subprocess", + "//folly/container:array", + "//folly/portability:fcntl", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/portability:stdlib", + "//folly/system:env_util", + "@boost.algorithm", + "@glog", + ], +) + +cpp_unittest( + name = "pid_test", + srcs = ["PidTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/system:pid", + "@glog", + ], +) + +cpp_unittest( + name = "memory_mapping_test", + srcs = ["MemoryMappingTest.cpp"], + deps = [ + "//folly:file_util", + "//folly:random", + "//folly/portability:gtest", + "//folly/portability:sys_mman", + "//folly/system:memory_mapping", + "@glog", + ], +) + +cpp_unittest( + name = "shell_test", + srcs = ["ShellTest.cpp"], + deps = [ + "//folly/portability:gtest", + "//folly/system:shell", + "@glog", + ], +) + +cpp_unittest( + name = "thread_id_test", + srcs = ["ThreadIdTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/system:thread_id", + ], +) + +cpp_unittest( + name = "thread_name_test", + srcs = ["ThreadNameTest.cpp"], + deps = [ + "//folly:scope_guard", + "//folly/portability:gtest", + "//folly/synchronization:baton", + "//folly/system:thread_name", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/BUILD.bazel new file mode 100644 index 00000000000..015f2bace8a --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/BUILD.bazel @@ -0,0 +1,1496 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +package(default_visibility = ["//visibility:public"]) + +cpp_unittest( + name = "ahm_int_stress_test", + srcs = ["AHMIntStressTest.cpp"], + deps = [ + "//folly:atomic_hash_map", + "//folly:memory", + "//folly:scope_guard", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "unicode_test", + srcs = ["UnicodeTest.cpp"], + deps = [ + "//folly:range", + "//folly:unicode", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "arena_smart_ptr_test", + srcs = ["ArenaSmartPtrTest.cpp"], + deps = [ + "//folly:memory", + "//folly/memory:arena", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "ascii_case_insensitive_test", + srcs = ["AsciiCaseInsensitiveTest.cpp"], + deps = [ + "//folly:range", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "base64_test", + srcs = ["base64_test.cpp"], + deps = [ + "//folly:base64", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "concurrent_bit_set_test", + srcs = ["ConcurrentBitSetTest.cpp"], + deps = [ + "//folly:concurrent_bit_set", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "buffered_atomic_test", + srcs = ["BufferedAtomicTest.cpp"], + deps = [ + ":deterministic_schedule", + "//folly:singleton_thread_local", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "atomic_hash_array_test", + srcs = ["AtomicHashArrayTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:atomic_hash_array", + "//folly:conv", + "//folly:memory", + "//folly/hash", + "//folly/portability:gtest", + "//folly/portability:string", + "//folly/portability:sys_mman", + ], +) + +cpp_unittest( + name = "atomic_hash_map_test", + size = "medium", + srcs = ["AtomicHashMapTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:atomic_hash_map", + "//folly:benchmark", + "//folly:conv", + "//folly/portability:atomic", + "//folly/portability:gtest", + "//folly/portability:sys_time", + "@glog", + ], +) + +cpp_unittest( + name = "atomic_linked_list_test", + srcs = ["AtomicLinkedListTest.cpp"], + deps = [ + "//folly:atomic_linked_list", + "//folly:utility", + "//folly/portability:gtest", + "//folly/synchronization/test:barrier", + ], +) + +cpp_unittest( + name = "atomic_unordered_map_test", + srcs = ["AtomicUnorderedMapTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":deterministic_schedule", + "//folly:atomic_unordered_map", + "//folly:benchmark", + "//folly/portability:gflags", + "//folly/portability:gtest", + ], +) + +# NOTE: Parsing the output of the perf command seems to not be working as expected in this test. +# cpp_unittest( +# name = "benchmark_test", +# srcs = ["BenchmarkTest.cpp"], +# deps = [ +# ":test_utils", +# "//folly:benchmark", +# "//folly/detail:perf_scoped", +# "//folly/portability:gflags", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "cancellation_token_test", + srcs = ["CancellationTokenTest.cpp"], + deps = [ + "//folly:cancellation_token", + "//folly:optional", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "chrono_test", + srcs = ["ChronoTest.cpp"], + deps = [ + "//folly:chrono", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "clock_gettime_wrappers_test", + srcs = ["ClockGettimeWrappersTest.cpp"], + deps = [ + ":test_utils", + "//folly:clock_gettime_wrappers", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "concurrent_lazy_test", + srcs = ["ConcurrentLazyTest.cpp"], + deps = [ + "//folly:concurrent_lazy", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "concurrent_skip_list_test", + size = "medium", + srcs = ["ConcurrentSkipListTest.cpp"], + deps = [ + "//folly:concurrent_skip_list", + "//folly:memory", + "//folly:string", + "//folly/container:foreach", + "//folly/memory:arena", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "constexpr_math_test", + srcs = ["ConstexprMathTest.cpp"], + deps = [ + "//folly:constexpr_math", + "//folly/lang:bits", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "constructor_callback_list_test", + srcs = ["ConstructorCallbackListTest.cpp"], + deps = [ + "//folly:constructor_callback_list", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "conv_benchmark", + srcs = ["ConvBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:conv", + "//folly:cpp_attributes", + "//folly/container:foreach", + "//folly/lang:to_ascii", + "@boost.conversion", + ], +) + +cpp_unittest( + name = "conv_test", + srcs = ["ConvTest.cpp"], + deps = [ + "//folly:conv", + "//folly:random", + "//folly/container:foreach", + "//folly/portability:gtest", + "@fmt", + "@glog", + ], +) + +cpp_unittest( + name = "cpu_id_test", + srcs = ["CpuIdTest.cpp"], + deps = [ + "//folly:cpu_id", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "demangle_test", + srcs = ["DemangleTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:demangle", + "//folly/lang:pretty", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "deterministic_schedule", + srcs = [ + "BufferedAtomic.cpp", + "DeterministicSchedule.cpp", + ], + hdrs = [ + "BufferedAtomic.h", + "DeterministicSchedule.h", + ], + deps = [ + "//folly:random", + "//folly:scope_guard", + "//folly:singleton_thread_local", + "//folly/concurrency:cache_locality", + "//folly/detail:futex", + "//folly/lang:customization_point", + "//folly/synchronization:atomic_notification", + "//folly/synchronization/detail:atomic_utils", + "//folly/synchronization/test:semaphore", + "@glog", + ], +) + +cpp_unittest( + name = "deterministic_schedule_test", + srcs = ["DeterministicScheduleTest.cpp"], + deps = [ + ":deterministic_schedule", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization:atomic_util", + ], +) + +cpp_unittest( + name = "discriminated_ptr_test", + srcs = ["DiscriminatedPtrTest.cpp"], + deps = [ + "//folly:discriminated_ptr", + "//folly/portability:gtest", + ], +) + +# This test depends only on :dynamic. Tests which require other +# dependencies should be added to dynamic_other_test. + +cpp_unittest( + name = "endian_test", + srcs = ["EndianTest.cpp"], + deps = [ + "//folly/lang:bits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "exception_string_test", + srcs = ["ExceptionStringTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:exception_string", + "//folly:portability", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "exception_test", + srcs = ["ExceptionTest.cpp"], + deps = [ + "//folly:exception", + "//folly/portability:gtest", + "//folly/testing:test_util", + ], +) + +cpp_unittest( + name = "exception_wrapper_test", + srcs = ["ExceptionWrapperTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly:exception_wrapper", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "executor_test", + srcs = ["ExecutorTest.cpp"], + deps = [ + "//folly:executor", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "expected_coroutines_test", + srcs = ["ExpectedCoroutinesTest.cpp"], + deps = [ + "//folly:expected", + "//folly:portability", + "//folly:scope_guard", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "expected_test", + srcs = ["ExpectedTest.cpp"], + deps = [ + "//folly:expected", + "//folly/lang:keep", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "fbstring_test", + srcs = ["FBStringTest.cpp"], + deps = [ + ":test_utils", + "//folly:conv", + "//folly:fbstring", + "//folly:portability", + "//folly:random", + "//folly:utility", + "//folly/container:foreach", + "//folly/portability:gtest", + "@boost.algorithm", + "@glog", + ], +) + +cpp_library( + name = "fbvector_test_util", + srcs = [ + "FBVectorTestUtil.cpp", + ], + hdrs = [ + "FBVectorTestUtil.h", + ], + deps = [ + "//folly:fbstring", + "//folly:random", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "file_test", + srcs = ["FileTest.cpp"], + deps = [ + "//folly:file", + "//folly:string", + "//folly/portability:fcntl", + "//folly/portability:filesystem", + "//folly/portability:gtest", + "@fmt", + "@glog", + ], +) + +cpp_unittest( + name = "file_lock_test", + srcs = ["FileLockTest.cpp"], + env = { + "FOLLY_FILE_LOCK_TEST_HELPER": "$(rootpath :file_test_lock_helper)", + }, + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":file_test_lock_helper", + "//folly:file", + "//folly:string", + "//folly:subprocess", + "//folly/experimental/io:fs_util", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/testing:test_util", + "@boost.thread", + "@glog", + ], +) + +cc_binary( + name = "file_test_lock_helper", + srcs = ["FileTestLockHelper.cpp"], + deps = [ + "//folly:file", + "//folly/portability:gflags", + "@glog", + ], +) + +cpp_unittest( + name = "file_util_test", + srcs = ["FileUtilTest.cpp"], + linkopts = select({ + "@platforms//os:linux": ["-ldl"], + "//conditions:default": [], + }), + deps = [ + "//folly:exception", + "//folly:file", + "//folly:file_util", + "//folly:range", + "//folly:string", + "//folly/detail:file_util_detail", + "//folly/detail:file_util_vector_detail", + "//folly/portability:gtest", + "//folly/testing:test_util", + "@glog", + ], +) + +cpp_unittest( + name = "fingerprint_test", + srcs = ["FingerprintTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:fingerprint", + "//folly/detail:slow_fingerprint", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "fixed_string_test", + srcs = ["FixedStringTest.cpp"], + deps = [ + "//folly:fixed_string", + "//folly:range", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "fmt_utility_test", + srcs = ["FmtUtilityTest.cpp"], + deps = [ + "//folly:fmt_utility", + ], +) + +# This test depends only on :format. Tests for user-defined formatters +# should be added to format_other_test. +cpp_unittest( + name = "format_test", + srcs = ["FormatTest.cpp"], + deps = [ + "//folly:format", + "//folly:utility", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "format_other_test", + srcs = ["FormatOtherTest.cpp"], + deps = [ + "//folly:fbvector", + "//folly:file_util", + "//folly:format", + "//folly:portability", + "//folly:small_vector", + "//folly/json:dynamic", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "function_ref_test", + srcs = ["FunctionRefTest.cpp"], + deps = [ + "//folly:function", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "function_test", + srcs = ["FunctionTest.cpp"], + deps = [ + "//folly:function", + "//folly:memory", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "futex_test", + srcs = ["FutexTest.cpp"], + deps = [ + ":deterministic_schedule", + "//folly:chrono", + "//folly/detail:futex", + "//folly/portability:gtest", + "//folly/portability:time", + "@glog", + ], +) + +cpp_unittest( + name = "group_varint_test", + srcs = ["GroupVarintTest.cpp"], + deps = [ + "//folly:group_varint", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "group_varint_test_ssse3", + srcs = ["GroupVarintTest.cpp"], + copts = ["-mssse3"], + target_compatible_with = ["@platforms//cpu:x86_64"], + deps = [ + "//folly:group_varint", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "indestructible_test", + srcs = ["IndestructibleTest.cpp"], + deps = [ + "//folly:indestructible", + "//folly:memory", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "indexed_mem_pool_test", + srcs = ["IndexedMemPoolTest.cpp"], + deps = [ + ":deterministic_schedule", + "//folly:indexed_mem_pool", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:unistd", + ], +) + +cpp_unittest( + name = "ip_address_test", + srcs = ["IPAddressTest.cpp"], + deps = [ + "//folly:network_address", + "//folly:string", + "//folly/container:bit_iterator", + "//folly/detail:ip_address_source", + "//folly/lang:bits", + "//folly/portability:gmock", + "//folly/portability:gtest", + "@fmt", + ], +) + +cpp_unittest( + name = "iterators_test", + srcs = ["IteratorsTest.cpp"], + deps = [ + "//folly/container:array", + "//folly/detail:iterators", + "//folly/portability:gtest", + "//folly/portability:sys_types", + ], +) + +# This test depends only on :json. Tests which require other +# dependencies should be added to json_other_test. + +cpp_unittest( + name = "lazy_test", + srcs = ["LazyTest.cpp"], + deps = [ + "//folly:lazy", + "//folly/portability:gtest", + ], +) + +cc_binary( + name = "glog_benchmark", + srcs = ["GLogBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:glog", + ], +) + +cpp_unittest( + name = "glog_test", + srcs = ["GLogTest.cpp"], + deps = [ + "//folly:glog", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "mac_address_test", + srcs = ["MacAddressTest.cpp"], + deps = [ + "//folly:network_address", + "//folly/portability:gtest", + "@fmt", + ], +) + +cc_binary( + name = "math_benchmark", + srcs = ["MathBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:math", + ], +) + +cpp_unittest( + name = "math_test", + srcs = ["MathTest.cpp"], + deps = [ + "//folly:math", + "//folly:portability", + "//folly/functional:invoke", + "//folly/portability:gtest", + "@glog", + ], +) + +# Test MaybeManagedPtr with default settings and on c++17 and c++20. +# We test c++17 and c++20 explicitly since c++20 can synthesize `operator!=` whereas c++17 cannot. +cpp_unittest( + name = "maybe_managed_ptr_test", + srcs = ["MaybeManagedPtrTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:maybe_managed_ptr", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "maybe_managed_ptr_test_c++17", + srcs = ["MaybeManagedPtrTest.cpp"], + copts = [ + "-std=c++17", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:maybe_managed_ptr", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "maybe_managed_ptr_test_c++20", + srcs = ["MaybeManagedPtrTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:maybe_managed_ptr", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "memset_test", + srcs = [ + "MemsetTest.cpp", + ], + deps = [ + "//folly:memset", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "memcpy_test", + srcs = ["MemcpyTest.cpp"], + deps = [ + "//folly:memcpy", + "//folly:portability", + "//folly/portability:gtest", + "//folly/portability:sys_types", + ], +) + +cc_binary( + name = "memcpy_benchmark", + srcs = ["MemcpyBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:memcpy", + "//folly/portability:unistd", + ], +) + +cpp_unittest( + name = "memcpy_use_test", + srcs = ["MemcpyUseTest.cpp"], + linkstatic = True, + deps = [ + "//folly:memcpy-use", # @manual + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "memory_test", + srcs = ["MemoryTest.cpp"], + deps = [ + "//folly:constexpr_math", + "//folly:memory", + "//folly:string", + "//folly/lang:keep", + "//folly/memory:arena", + "//folly/portability:asm", + "//folly/portability:gmock", + "//folly/portability:gtest", + "@glog", + ], +) + +cc_binary( + name = "memory_idler_benchmark", + srcs = ["MemoryIdlerBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly/detail:memory_idler", + ], +) + +cpp_unittest( + name = "memory_idler_test", + srcs = ["MemoryIdlerTest.cpp"], + deps = [ + "//folly/detail:memory_idler", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/synchronization:baton", + ], +) + +cpp_unittest( + name = "move_wrapper_test", + srcs = ["MoveWrapperTest.cpp"], + deps = [ + "//folly:move_wrapper", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "mpmc_pipeline_test", + srcs = ["MPMCPipelineTest.cpp"], + deps = [ + "//folly:conv", + "//folly:mpmc_pipeline", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "mpmc_queue_test", + size = "medium", + srcs = ["MPMCQueueTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":deterministic_schedule", + "//folly:format", + "//folly:memory", + "//folly:mpmc_queue", + "//folly:stop_watch", + "//folly/portability:gtest", + "//folly/portability:sys_resource", + "//folly/portability:sys_time", + "//folly/portability:unistd", + "@boost.intrusive", + "@boost.thread", + ], +) + +cpp_library( + name = "observer_container_test_util", + hdrs = ["ObserverContainerTestUtil.h"], + deps = [ + "//folly:function", + "//folly:optional", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "observer_container_test", +# srcs = ["ObserverContainerTest.cpp"], +# # Prevents error due to masking name ObserverContainer. +# copts = ["-fpermissive"], +# deps = [ +# ":observer_container_test_util", +# "//folly:observer_container", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# ], +# ) + +cpp_unittest( + name = "optional_test", + srcs = ["OptionalTest.cpp"], + deps = [ + "//folly:optional", + "//folly:portability", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "optional_coroutines_test", + srcs = ["OptionalCoroutinesTest.cpp"], + deps = [ + "//folly:optional", + "//folly:portability", + "//folly:scope_guard", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "replaceable_test", + srcs = ["ReplaceableTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:replaceable", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "overload_test", + srcs = ["OverloadTest.cpp"], + deps = [ + "//folly:discriminated_ptr", + "//folly:overload", + "//folly/portability:gtest", + "@boost.variant", + ], +) + +cpp_unittest( + name = "packed_sync_ptr_test", + srcs = ["PackedSyncPtrTest.cpp"], + deps = [ + "//folly:packed_sync_ptr", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "padded_test", + srcs = ["PaddedTest.cpp"], + deps = [ + "//folly:padded", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "poly_test", + srcs = ["PolyTest.cpp"], + deps = [ + "//folly:conv", + "//folly:poly", + "//folly/poly:basic_interfaces", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "portability_test", + srcs = ["PortabilityTest.cpp"], + deps = [ + "//folly:portability", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "producer_consumer_queue_test", + srcs = ["ProducerConsumerQueueTest.cpp"], + deps = [ + "//folly:producer_consumer_queue", + "//folly/portability:gtest", + "@glog", + ], +) + +cc_binary( + name = "random_benchmark", + srcs = ["RandomBenchmark.cpp"], + deps = [ + "//folly:benchmark", + "//folly:random", + "//folly/container:foreach", + "@glog", + ], +) + +cpp_unittest( + name = "random_test", + srcs = ["RandomTest.cpp"], + deps = [ + "//folly:random", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "range_test", + srcs = ["RangeTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:cpp_attributes", + "//folly:memory", + "//folly:range", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/portability:sys_mman", + "//folly/portability:unistd", + "@boost.algorithm", + "@boost.range", + "@range-v3", + ], +) + +cpp_unittest( + name = "scope_guard_test", + srcs = ["ScopeGuardTest.cpp"], + deps = [ + "//folly:scope_guard", + "//folly/lang:keep", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "shared_mutex_test", + size = "medium", + srcs = ["SharedMutexTest.cpp"], + target_compatible_with = select({ + # Macs ship with older Clang versions that might not support alignas. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":deterministic_schedule", + ":test_utils", + "//folly:benchmark", + "//folly:mpmc_queue", + "//folly:shared_mutex", + "//folly/fibers:core", + "//folly/fibers:timed_mutex", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/synchronization:rw_spin_lock", + "@boost.thread", + ], +) + +# TODO(kgk): Fix test. +# cpp_unittest( +# name = "singleton_test", +# srcs = ["SingletonTest.cpp"], +# deps = [ +# ":singleton_test_structs", +# ":test_utils", +# "//folly:singleton", +# "//folly/io/async:async_base", +# "//folly/portability:gmock", +# "//folly/portability:gtest", +# "@boost.thread", +# "@glog", +# ], +# ) + +cpp_unittest( + name = "singleton_test_global", + srcs = ["SingletonTestGlobal.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":singleton_test_structs", + "//folly:benchmark", + "//folly:singleton", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "singleton_test_structs", + srcs = ["SingletonTestStructs.cpp"], + hdrs = ["SingletonTestStructs.h"], + deps = [ + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "socket_address_test", + srcs = ["SocketAddressTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":socket_address_test_helper", + "//folly:network_address", + "//folly:string", + "//folly/container:array", + "//folly/portability:gtest", + "//folly/portability:sockets", + "//folly/testing:test_util", + ], +) + +cpp_library( + name = "socket_address_test_helper", + srcs = ["SocketAddressTestHelper.cpp"], + hdrs = ["SocketAddressTestHelper.h"], + deps = [ + "//folly/portability:sockets", + ], +) + +cpp_unittest( + name = "spin_lock_test", + srcs = ["SpinLockTest.cpp"], + deps = [ + "//folly:random", + "//folly:spin_lock", + "//folly:utility", + "//folly/portability:asm", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "string_test", + srcs = ["StringTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":test_utils", + "//folly:fbvector", + "//folly:string", + "//folly/container:array", + "//folly/portability:gmock", + "//folly/portability:gtest", + "@boost.regex", + "@glog", + ], +) + +cpp_unittest( + name = "subprocess_test", + srcs = ["SubprocessTest.cpp"], + data = [ + ":subprocess_test_parent_death_helper", + ], + deps = [ + ":subprocess_test_parent_death_helper", # @manual + "//folly:exception", + "//folly:file_util", + "//folly:format", + "//folly:string", + "//folly:subprocess", + "//folly/experimental/io:fs_util", + "//folly/gen:base", + "//folly/gen:file", + "//folly/gen:string", + "//folly/portability:gtest", + "//folly/portability:unistd", + "//folly/testing:test_util", + "@boost.container", + "@glog", + ], +) + +cc_binary( + name = "subprocess_test_parent_death_helper", + srcs = ["SubprocessTestParentDeathHelper.cpp"], + target_compatible_with = select({ + # parentDeathSignal() is only available on Linux, but this doesn't guard + # the call. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:conv", + "//folly:subprocess", + "//folly/portability:gflags", + "//folly/portability:unistd", + "@glog", + ], +) + +cpp_unittest( + name = "synchronized_test", + srcs = ["SynchronizedTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":synchronized_test_lib", + "//folly:function", + "//folly:portability", + "//folly:scope_guard", + "//folly:shared_mutex", + "//folly:spin_lock", + "//folly:synchronized", + "//folly/portability:gtest", + "//folly/synchronization:distributed_mutex", + "//folly/synchronization:rw_spin_lock", + ], +) + +cpp_unittest( + name = "synchronized_ptr_test", + srcs = ["SynchronizedPtrTest.cpp"], + deps = [ + "//folly:optional", + "//folly:replaceable", + "//folly:synchronized_ptr", + "//folly/portability:gtest", + "//folly/synchronization:rw_spin_lock", + ], +) + +cpp_library( + name = "synchronized_test_lib", + hdrs = [ + "SynchronizedTestLib.h", + "SynchronizedTestLib-inl.h", + ], + deps = [ + "//folly:random", + "//folly:synchronized", + "//folly/container:foreach", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_library( + name = "test_utils", + hdrs = ["TestUtils.h"], + deps = [ + "//folly:conv", + "//folly:exception_string", + "//folly:fbstring", + "//folly:fixed_string", + "//folly:range", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "thread_cached_int_test", + srcs = ["ThreadCachedIntTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:thread_cached_int", + "//folly/container:foreach", + "//folly/hash", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/system:thread_id", + "@glog", + ], +) + +cc_binary( + name = "thread_local_benchmark", + srcs = ["ThreadLocalBenchmark.cpp"], + target_compatible_with = select({ + # Macs ship with older Clang versions that might not support jthread. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:benchmark", + "//folly:thread_local", + "//folly/lang:keep", + "//folly/portability:gflags", + "//folly/synchronization:latch", + "@boost.thread", + "@glog", + ], +) + +cpp_unittest( + name = "timeout_queue_test", + srcs = ["TimeoutQueueTest.cpp"], + deps = [ + "//folly:timeout_queue", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "token_bucket_test", + srcs = [ + "TokenBucketTest.cpp", + "TokenBucketTest.h", + ], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + "//folly:string", + "//folly:token_bucket", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "traits_test", + srcs = ["TraitsTest.cpp"], + deps = [ + "//folly:cpp_attributes", + "//folly:scope_guard", + "//folly:traits", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "try_test", + srcs = ["TryTest.cpp"], + deps = [ + "//folly:traits", + "//folly:try", + "//folly/lang:exception", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_unittest( + name = "unit_test", + srcs = ["UnitTest.cpp"], + deps = [ + "//folly:unit", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "uri_test", + srcs = ["UriTest.cpp"], + deps = [ + "//folly:uri", + "//folly/portability:gtest", + "@boost.algorithm", + "@glog", + ], +) + +cpp_unittest( + name = "utf8_string_test", + srcs = ["UTF8StringTest.cpp"], + deps = [ + ":test_utils", + "//folly:range", + "//folly:utf8_string", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "utility_test", + srcs = ["UtilityTest.cpp"], + deps = [ + "//folly:utility", + "//folly/lang:keep", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "varint_test", + srcs = ["VarintTest.cpp"], + deps = [ + "//folly:benchmark", + "//folly:random", + "//folly:varint", + "//folly/portability:gtest", + "@glog", + ], +) + +cpp_library( + name = "json_mock_util", + hdrs = [ + "JsonMockUtil.h", + ], + deps = [ + "//folly/json:json_mock_util", + ], +) + +cpp_library( + name = "json_test_util", + hdrs = [ + "JsonTestUtil.h", + ], + deps = [ + "//folly/json:json_test_util", + ], +) + +cpp_unittest( + name = "test_utils_test", + srcs = ["TestUtilsTest.cpp"], + target_compatible_with = select({ + # TODO: fails on Mac. + "@platforms//os:macos": ["@platforms//:incompatible"], + "//conditions:default": [], + }), + deps = [ + ":test_utils", + "//folly/portability:gmock", + "//folly/portability:gtest", + ], +) + +cpp_library( + name = "comparison_operator_test_util", + hdrs = ["ComparisonOperatorTestUtil.h"], + deps = [ + "//folly/portability:gtest", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/common/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/common/BUILD.bazel new file mode 100644 index 00000000000..ed7e9130092 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/common/BUILD.bazel @@ -0,0 +1,23 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "test_main", + deps = [ + ":test_main_lib", + ], +) + +cpp_library( + name = "test_main_lib", + srcs = ["TestMain.cpp"], + deps = [ + "//folly:portability", + "//folly/init", + "//folly/portability:gflags", + "//folly/portability:gtest", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/stl_tests/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/stl_tests/BUILD.bazel new file mode 100644 index 00000000000..2c9981186a6 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/test/stl_tests/BUILD.bazel @@ -0,0 +1,19 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "stl_vector_test", + size = "enormous", + srcs = ["StlVectorTest.cpp"], + deps = [ + "//folly:conv", + "//folly:fbvector", + "//folly:portability", + "//folly:scope_guard", + "//folly/chrono:hardware", + "//folly/lang:pretty", + "//folly/portability:gflags", + "//folly/portability:gtest", + "//folly/test:test_utils", + "@boost.preprocessor", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/BUILD.bazel new file mode 100644 index 00000000000..a11eea7b610 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/BUILD.bazel @@ -0,0 +1,25 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "test_util", + srcs = ["TestUtil.cpp"], + hdrs = ["TestUtil.h"], + deps = [ + "//folly:exception", + "//folly:file", + "//folly:file_util", + "//folly:memory", + "//folly:range", + "//folly:scope_guard", + "//folly:string", + "//folly/experimental/io:fs_util", + "//folly/ext:test_ext", + "//folly/ext/buck2:test_ext", + "//folly/portability:fcntl", + "@bazel_tools//tools/cpp/runfiles", + "@boost.regex", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/test/BUILD.bazel new file mode 100644 index 00000000000..38161007854 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/testing/test/BUILD.bazel @@ -0,0 +1,16 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "test_util_test", + srcs = ["TestUtilTest.cpp"], + deps = [ + "//folly:memory", + "//folly/portability:fcntl", + "//folly/portability:gtest", + "//folly/portability:stdlib", + "//folly/portability:unistd", + "//folly/testing:test_util", + "@boost.algorithm", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tool/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tool/BUILD.bazel new file mode 100644 index 00000000000..46284cdaa4c --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tool/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") + +package(default_visibility = ["//visibility:public"]) + +cc_binary( + name = "benchmark_compare", + srcs = ["BenchmarkCompare.cpp"], + deps = [ + "//folly:benchmark", + "//folly:file_util", + "//folly/init", + "//folly/json:dynamic", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/BUILD.bazel new file mode 100644 index 00000000000..c3f28d78b0a --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/BUILD.bazel @@ -0,0 +1,47 @@ +load("//bzl:cpp_library.bzl", "cpp_library") + +package(default_visibility = ["//visibility:public"]) + +cpp_library( + name = "static_tracepoint", + hdrs = [ + "StaticTracepoint.h", + "StaticTracepoint-ELF.h", + ], + deps = [ + "//folly:c_portability", + ], +) + +cpp_library( + name = "scoped_trace_section", + hdrs = [ + "ScopedTraceSection.h", + ], +) + +cpp_library( + name = "async_stack", + srcs = [ + "AsyncStack.cpp", + ], + hdrs = [ + "AsyncStack.h", + ], + textual_hdrs = [ + "AsyncStack-inl.h", + ], + deps = [ + "//folly:c_portability", + "//folly:cpp_attributes", + "//folly:function", + "//folly:indestructible", + "//folly:likely", + "//folly:portability", + "//folly:synchronized", + "//folly/coro:coroutine", + "//folly/lang:hint", + "//folly/portability:pthread", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/test/BUILD.bazel b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/test/BUILD.bazel new file mode 100644 index 00000000000..181ab2babe0 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/overlay/folly/tracing/test/BUILD.bazel @@ -0,0 +1,12 @@ +load("//bzl:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "async_stack_test", + srcs = ["AsyncStackTest.cpp"], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//folly/tracing:async_stack", + "@glog", + ], +) diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_fd_socket_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_fd_socket_test.patch new file mode 100644 index 00000000000..e5406abd6bc --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_fd_socket_test.patch @@ -0,0 +1,13 @@ +diff --git a/folly/io/async/fdsock/test/AsyncFdSocketTest.cpp b/folly/io/async/fdsock/test/AsyncFdSocketTest.cpp +index 197e012e8..c03994f2b 100644 +--- a/folly/io/async/fdsock/test/AsyncFdSocketTest.cpp ++++ b/folly/io/async/fdsock/test/AsyncFdSocketTest.cpp +@@ -245,7 +245,7 @@ TEST_F(AsyncFdSocketTest, MultiPartSend) { + } + rcb_.verifyData(data.data(), data.size()); + rcb_.clearData(); +- EXPECT_EQ(numSendParts, sendSock.numWrites_); ++ EXPECT_GE(sendSock.numWrites_, numSendParts); + + // There are no more data or FDs + evb_.loopOnce(EVLOOP_NONBLOCK); diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_udp_socket_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_udp_socket_test.patch new file mode 100644 index 00000000000..7a16b88bc91 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_async_udp_socket_test.patch @@ -0,0 +1,57 @@ +diff --git a/folly/io/async/test/AsyncUDPSocketTest.cpp b/folly/io/async/test/AsyncUDPSocketTest.cpp +index 632873c8c..1d71c9bf1 100644 +--- a/folly/io/async/test/AsyncUDPSocketTest.cpp ++++ b/folly/io/async/test/AsyncUDPSocketTest.cpp +@@ -130,7 +130,10 @@ class UDPServer { + acceptors_.emplace_back( + &evb, i, changePortForWrites_, socket_->address()); + +- std::thread t([&]() { evb.loopForever(); }); ++ // Store a pointer to evb so the capture below does not capture the local reference, which ++ // will point to the last evb instead of the intended instance. ++ auto* evbPtr = &evb; ++ std::thread t([evbPtr]() { evbPtr->loopForever(); }); + + evb.waitUntilRunning(); + +@@ -146,16 +149,25 @@ class UDPServer { + + void shutdown() { + CHECK(evb_->isInEventBaseThread()); ++ if (!socket_) { ++ return; ++ } ++ socket_->pauseAccepting(); + socket_->close(); +- socket_.reset(); + + for (auto& evb : evbs_) { ++ evb.runInEventBaseThreadAndWait([] { ++ // barrier: ensures prior queued callbacks execute before we terminate ++ }); + evb.terminateLoopSoon(); + } + + for (auto& t : threads_) { + t.join(); + } ++ ++ threads_.clear(); ++ socket_.reset(); + } + + void pauseAccepting() { socket_->pauseAccepting(); } +@@ -470,8 +482,11 @@ class AsyncSocketIntegrationTest : public Test { + + void TearDown() override { + // Shutdown server +- sevb.runInEventBaseThread([&]() { +- server->shutdown(); ++ sevb.runInEventBaseThreadAndWait([&]() { ++ if (server) { ++ server->shutdown(); ++ server.reset(); // destroy on sevb thread ++ } + sevb.terminateLoopSoon(); + }); + diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_basic_transport_certificate_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_basic_transport_certificate_test.patch new file mode 100644 index 00000000000..48f633afe18 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_basic_transport_certificate_test.patch @@ -0,0 +1,13 @@ +diff --git a/folly/io/async/ssl/test/BasicTransportCertificateTest.cpp b/folly/io/async/ssl/test/BasicTransportCertificateTest.cpp +index b4c608e51..a38818ce3 100644 +--- a/folly/io/async/ssl/test/BasicTransportCertificateTest.cpp ++++ b/folly/io/async/ssl/test/BasicTransportCertificateTest.cpp +@@ -25,7 +25,7 @@ using namespace folly; + using namespace folly::ssl; + using folly::test::find_resource; + +-const char* kTestCerts = "folly/io/async/ssl/test/tests-cert.pem"; ++const char* kTestCerts = "folly/io/async/test/certs/tests-cert.pem"; + + TEST(BasicTransportCertificateTest, TestCerts) { + auto path = find_resource(kTestCerts); diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_exception_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_exception_test.patch new file mode 100644 index 00000000000..922e8b3dbf5 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_exception_test.patch @@ -0,0 +1,33 @@ +diff --git a/folly/lang/test/ExceptionTest.cpp b/folly/lang/test/ExceptionTest.cpp +index 84dee13b1..060ee1a11 100644 +--- a/folly/lang/test/ExceptionTest.cpp ++++ b/folly/lang/test/ExceptionTest.cpp +@@ -426,17 +426,17 @@ TEST_F(ExceptionTest, exception_shared_string) { + EXPECT_STREQ(c, folly::exception_shared_string(std::string(c)).what()); + } + +-#if FOLLY_CPLUSPLUS >= 202002 +- +-TEST_F(ExceptionTest, exception_shared_string_literal) { +- using namespace folly::string_literals; +- auto s0 = folly::exception_shared_string("hello, world!"_litv); +- auto s1 = s0; +- auto s2 = s1; +- EXPECT_STREQ("hello, world!", s2.what()); +-} +- +-#endif ++// #if FOLLY_CPLUSPLUS >= 202002 ++// ++// TEST_F(ExceptionTest, exception_shared_string_literal) { ++// using namespace folly::string_literals; ++// auto s0 = folly::exception_shared_string("hello, world!"_litv); ++// auto s1 = s0; ++// auto s2 = s1; ++// EXPECT_STREQ("hello, world!", s2.what()); ++// } ++// ++// #endif + // example of how to do the in-place formatting efficiently + struct format_param_fn { + template diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_flat_combining_benchmark_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_flat_combining_benchmark_test.patch new file mode 100644 index 00000000000..612ec9bf4f4 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_flat_combining_benchmark_test.patch @@ -0,0 +1,13 @@ +diff --git a/folly/synchronization/test/FlatCombiningBenchmark.cpp b/folly/synchronization/test/FlatCombiningBenchmark.cpp +index f3263c85a..771414f4f 100644 +--- a/folly/synchronization/test/FlatCombiningBenchmark.cpp ++++ b/folly/synchronization/test/FlatCombiningBenchmark.cpp +@@ -22,6 +22,8 @@ + + using namespace folly::test; + ++#include ++ + // use option --benchmark to run folly::Benchmark + // use option --direct to run direct benchmark measurements + DEFINE_bool(direct, false, "run direct measurement"); diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_hasptr_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_hasptr_test.patch new file mode 100644 index 00000000000..6217c79fb76 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_hasptr_test.patch @@ -0,0 +1,13 @@ +diff --git a/folly/synchronization/test/HazptrTest.cpp b/folly/synchronization/test/HazptrTest.cpp +index b28e01cd2..b31b1fa15 100644 +--- a/folly/synchronization/test/HazptrTest.cpp ++++ b/folly/synchronization/test/HazptrTest.cpp +@@ -34,6 +34,8 @@ DEFINE_int64(num_reps, 10, "Number of test reps"); + DEFINE_int32(num_threads, 6, "Number of threads"); + DEFINE_int64(num_ops, 1003, "Number of ops or pairs of ops per rep"); + ++#include ++ + using folly::default_hazptr_domain; + using folly::hazard_pointer; + using folly::hazard_pointer_clean_up; diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_io_uring_backend_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_io_uring_backend_test.patch new file mode 100644 index 00000000000..126ea4a0723 --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_io_uring_backend_test.patch @@ -0,0 +1,49 @@ +diff --git a/folly/io/async/test/IoUringBackendTest.cpp b/folly/io/async/test/IoUringBackendTest.cpp +index 75cd85ff4..f32f566f9 100644 +--- a/folly/io/async/test/IoUringBackendTest.cpp ++++ b/folly/io/async/test/IoUringBackendTest.cpp +@@ -710,7 +710,7 @@ TEST(IoUringBackend, Rename) { + auto newPath = dirPath / newName; + + int fd = folly::fileops::open( +- oldPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC); ++ oldPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0600); + CHECK_GE(fd, 0); + + SCOPE_EXIT { +@@ -747,7 +747,7 @@ TEST(IoUringBackend, RenameDstExists) { + + { + int oldFd = folly::fileops::open( +- oldPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC); ++ oldPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0600); + CHECK_GE(oldFd, 0); + folly::fileops::close(oldFd); + } +@@ -758,7 +758,7 @@ TEST(IoUringBackend, RenameDstExists) { + + { + int newFd = folly::fileops::open( +- newPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC); ++ newPath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0600); + CHECK_GE(newFd, 0); + folly::fileops::close(newFd); + } +@@ -817,7 +817,7 @@ TEST(IoUringBackend, Statx) { + dirPath.string().c_str(), O_DIRECTORY | O_RDONLY, 0666); + CHECK_GE(dfd, 0); + int fd = folly::fileops::open( +- filePath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC); ++ filePath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0600); + CHECK_GE(fd, 0); + + SCOPE_EXIT { +@@ -850,7 +850,7 @@ TEST(IoUringBackend, StatxAbsolute) { + auto filePath = dirPath / path; + + int fd = folly::fileops::open( +- filePath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC); ++ filePath.string().c_str(), O_CREAT | O_WRONLY | O_TRUNC, 0600); + CHECK_GE(fd, 0); + + SCOPE_EXIT { diff --git a/modules/folly/2025.01.13.00.bcr.5/patches/fix_shared_mutex_test.patch b/modules/folly/2025.01.13.00.bcr.5/patches/fix_shared_mutex_test.patch new file mode 100644 index 00000000000..eafb4f2c85e --- /dev/null +++ b/modules/folly/2025.01.13.00.bcr.5/patches/fix_shared_mutex_test.patch @@ -0,0 +1,44 @@ +diff --git a/folly/test/SharedMutexTest.cpp b/folly/test/SharedMutexTest.cpp +index 1e172c186..c6b4f9e84 100644 +--- a/folly/test/SharedMutexTest.cpp ++++ b/folly/test/SharedMutexTest.cpp +@@ -344,9 +344,9 @@ void runFailingTryTimeoutTest() { + lock.unlock(); + + for (int p = 0; p < 8; ++p) { +- typename std::shared_lock holder1(lock); +- typename std::shared_lock holder2(lock); +- typename std::shared_lock holder3(lock); ++ typename std::shared_lock holder1(lock); ++ typename std::shared_lock holder2(lock); ++ typename std::shared_lock holder3(lock); + EXPECT_FALSE(lock.try_lock_for(nanoseconds(1 << p))); + } + } +@@ -555,7 +555,7 @@ struct PosixMutex { + template