From cfc16e7720286eae61850b4856a85d7b8eae51f2 Mon Sep 17 00:00:00 2001 From: Facebook Community Bot Date: Fri, 26 Apr 2024 10:55:42 -0700 Subject: [PATCH] Re-sync with internal repository (#338) The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging. Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com> --- buck2 | 67 ++++ quic/BUCK | 43 +++ quic/BUILD_MODE.bzl | 55 +++ quic/api/BUCK | 130 +++++++ quic/api/test/BUCK | 237 ++++++++++++ quic/client/BUCK | 119 ++++++ quic/client/connector/BUCK | 31 ++ quic/client/test/BUCK | 68 ++++ quic/codec/BUCK | 200 ++++++++++ quic/codec/test/BUCK | 212 +++++++++++ quic/common/BUCK | 184 +++++++++ quic/common/events/BUCK | 76 ++++ quic/common/events/test/BUCK | 55 +++ quic/common/test/BUCK | 193 ++++++++++ quic/common/testutil/BUCK | 15 + quic/common/third-party/BUCK | 10 + quic/common/udpsocket/BUCK | 68 ++++ quic/common/udpsocket/test/BUCK | 55 +++ quic/congestion_control/BUCK | 348 ++++++++++++++++++ quic/congestion_control/test/BUCK | 217 +++++++++++ quic/congestion_control/third_party/BUCK | 10 + quic/defs.bzl | 308 ++++++++++++++++ quic/dsr/BUCK | 25 ++ quic/dsr/backend/BUCK | 31 ++ quic/dsr/backend/test/BUCK | 33 ++ quic/dsr/frontend/BUCK | 74 ++++ quic/dsr/frontend/test/BUCK | 79 ++++ quic/dsr/test/BUCK | 27 ++ quic/facebook/backbone_monitoring/BUCK | 42 +++ quic/facebook/backbone_monitoring/test/BUCK | 34 ++ quic/facebook/benchmarks/BUCK | 41 +++ quic/facebook/fingerprint/BUCK | 17 + quic/facebook/fingerprint/test/BUCK | 11 + quic/facebook/fuzzers/BUCK | 165 +++++++++ quic/facebook/jump_start/BUCK | 77 ++++ quic/facebook/jump_start/js/BUCK | 121 ++++++ quic/facebook/jump_start/test/BUCK | 69 ++++ quic/facebook/mbed/BUCK | 96 +++++ quic/facebook/mbed/test/BUCK | 64 ++++ quic/facebook/mu/connection/BUCK | 13 + quic/facebook/mu/sample/BUCK | 16 + quic/facebook/tools/quicperf/BUCK | 155 ++++++++ quic/facebook/utils/BUCK | 20 + quic/facebook/utils/test/BUCK | 19 + quic/fizz/client/handshake/BUCK | 57 +++ quic/fizz/client/handshake/test/BUCK | 57 +++ quic/fizz/client/test/BUCK | 58 +++ quic/fizz/handshake/BUCK | 41 +++ quic/fizz/handshake/test/BUCK | 46 +++ quic/fizz/server/handshake/BUCK | 46 +++ quic/flowcontrol/BUCK | 20 + quic/flowcontrol/test/BUCK | 17 + quic/handshake/BUCK | 62 ++++ quic/handshake/test/BUCK | 17 + quic/happyeyeballs/BUCK | 27 ++ quic/logging/BUCK | 71 ++++ quic/logging/test/BUCK | 32 ++ quic/loss/BUCK | 31 ++ quic/loss/test/BUCK | 33 ++ quic/observer/BUCK | 35 ++ quic/observer/test/BUCK | 16 + quic/samples/echo/BUCK | 52 +++ quic/server/BUCK | 112 ++++++ quic/server/async_tran/BUCK | 26 ++ quic/server/async_tran/test/BUCK | 26 ++ quic/server/handshake/BUCK | 122 ++++++ quic/server/handshake/test/BUCK | 103 ++++++ quic/server/state/BUCK | 61 +++ quic/server/test/BUCK | 146 ++++++++ quic/server/third-party/BUCK | 8 + quic/somerge_defs.bzl | 192 ++++++++++ quic/state/BUCK | 339 +++++++++++++++++ quic/state/stream/BUCK | 25 ++ quic/state/stream/test/BUCK | 37 ++ quic/state/test/BUCK | 187 ++++++++++ quic/tools/tperf/BUCK | 83 +++++ quic/tools/tperf/test/BUCK | 15 + quic/xsk/BUCK | 62 ++++ shim/.buckconfig | 0 shim/.gitignore | 5 + shim/BUCK | 5 + shim/README.md | 4 + shim/buck2/buck_rust_binary.bzl | 13 + shim/buck2/proto_defs.bzl | 13 + shim/build_defs/cpp_library.bzl | 10 + shim/build_defs/custom_unittest.bzl | 9 + shim/build_defs/export_files.bzl | 10 + shim/build_defs/lib/python_common.bzl | 14 + shim/build_defs/native_rules.bzl | 22 ++ shim/build_defs/ocaml_binary.bzl | 10 + shim/build_defs/platform_utils.bzl | 11 + shim/build_defs/python_binary.bzl | 12 + shim/build_defs/rust_binary.bzl | 10 + shim/build_defs/rust_library.bzl | 10 + shim/build_defs/rust_unittest.bzl | 10 + shim/common/ocaml/interop/defs.bzl | 3 + shim/grpc_fb/codegen/buck_macros.bzl | 10 + shim/shims.bzl | 250 +++++++++++++ shim/target_determinator/macros/ci.bzl | 26 ++ shim/third-party/macros/rust_third_party.bzl | 11 + shim/third-party/ocaml/BUCK | 7 + shim/third-party/proto/BUCK | 21 ++ shim/third-party/proto/defs.bzl | 105 ++++++ shim/third-party/proto/releases.bzl | 46 +++ shim/third-party/proto/update.py | 99 +++++ shim/third-party/rust/.gitignore | 31 ++ shim/third-party/rust/Cargo.toml | 225 +++++++++++ shim/third-party/rust/defs.bzl | 7 + .../third-party/rust/fixups/ahash/fixups.toml | 1 + .../rust/fixups/anyhow/fixups.toml | 1 + .../rust/fixups/async-trait/fixups.toml | 1 + .../rust/fixups/atomic/fixups.toml | 2 + .../rust/fixups/axum-core/fixups.toml | 1 + shim/third-party/rust/fixups/axum/fixups.toml | 1 + .../rust/fixups/backtrace/fixups.toml | 1 + .../rust/fixups/blake3/fixups.toml | 81 ++++ .../rust/fixups/bumpalo/fixups.toml | 1 + .../rust/fixups/bzip2-sys/fixups.toml | 1 + shim/third-party/rust/fixups/clap/fixups.toml | 1 + .../rust/fixups/clap_builder/fixups.toml | 1 + .../rust/fixups/clap_derive/fixups.toml | 1 + .../fixups/core-foundation-sys/fixups.toml | 1 + .../rust/fixups/crc32fast/fixups.toml | 1 + .../rust/fixups/criterion/fixups.toml | 1 + .../rust/fixups/crossbeam-epoch/fixups.toml | 2 + .../rust/fixups/crossbeam-queue/fixups.toml | 2 + .../rust/fixups/crossbeam-utils/fixups.toml | 2 + .../rust/fixups/crunchy/fixups.toml | 2 + .../fixups/darwin-libproc-sys/fixups.toml | 1 + .../rust/fixups/debugserver-types/fixups.toml | 2 + .../rust/fixups/erased-serde/fixups.toml | 1 + .../rust/fixups/fs-err/fixups.toml | 2 + shim/third-party/rust/fixups/fs4/fixups.toml | 1 + .../rust/fixups/futures-channel/fixups.toml | 2 + .../rust/fixups/futures-core/fixups.toml | 2 + .../rust/fixups/futures-task/fixups.toml | 2 + .../rust/fixups/futures-util/fixups.toml | 2 + .../rust/fixups/generic-array/fixups.toml | 1 + .../rust/fixups/getrandom/fixups.toml | 1 + .../rust/fixups/httparse/fixups.toml | 1 + .../third-party/rust/fixups/hyper/fixups.toml | 5 + .../rust/fixups/indexmap/fixups.toml | 2 + .../rust/fixups/io-lifetimes/fixups.toml | 1 + .../rust/fixups/jemalloc-sys/fixups.toml | 1 + .../rust/fixups/lalrpop/fixups.toml | 1 + .../rust/fixups/lexical-core/fixups.toml | 2 + shim/third-party/rust/fixups/libc/fixups.toml | 2 + shim/third-party/rust/fixups/libm/fixups.toml | 1 + .../rust/fixups/libsqlite3-sys/fixups.toml | 19 + .../rust/fixups/lock_api/fixups.toml | 3 + shim/third-party/rust/fixups/log/fixups.toml | 2 + .../rust/fixups/memchr/fixups.toml | 1 + .../rust/fixups/memoffset/fixups.toml | 1 + shim/third-party/rust/fixups/mio/fixups.toml | 1 + .../rust/fixups/native-tls/fixups.toml | 1 + shim/third-party/rust/fixups/nix/fixups.toml | 2 + shim/third-party/rust/fixups/nom/fixups.toml | 1 + .../third-party/rust/fixups/ntapi/fixups.toml | 1 + .../rust/fixups/num-bigint/fixups.toml | 5 + .../rust/fixups/num-integer/fixups.toml | 2 + .../rust/fixups/num-traits/fixups.toml | 2 + .../rust/fixups/parking_lot/fixups.toml | 2 + .../rust/fixups/parking_lot_core/fixups.toml | 2 + .../third-party/rust/fixups/paste/fixups.toml | 1 + shim/third-party/rust/fixups/pest/fixups.toml | 1 + .../fixups/pin-project-internal/fixups.toml | 1 + .../rust/fixups/platforms/fixups.toml | 26 ++ .../rust/fixups/prettyplease/fixups.toml | 2 + .../fixups/proc-macro-error-attr/fixups.toml | 1 + .../rust/fixups/proc-macro-error/fixups.toml | 1 + .../rust/fixups/proc-macro-hack/fixups.toml | 1 + .../rust/fixups/proc-macro2/fixups.toml | 2 + .../rust/fixups/prost-build/fixups.toml | 7 + .../rust/fixups/pulldown-cmark/fixups.toml | 1 + .../third-party/rust/fixups/quote/fixups.toml | 1 + .../rust/fixups/radium/fixups.toml | 1 + .../rust/fixups/rayon-core/fixups.toml | 1 + .../rust/fixups/ref-cast/fixups.toml | 1 + .../rust/fixups/reqwest/fixups.toml | 1 + shim/third-party/rust/fixups/ring/fixups.toml | 162 ++++++++ .../ring_core_generated/prefix_symbols.h | 119 ++++++ .../ring_core_generated/prefix_symbols_asm.h | 236 ++++++++++++ .../prefix_symbols_nasm.inc | 236 ++++++++++++ .../rust/fixups/rustix/fixups.toml | 2 + .../rust/fixups/rustls/fixups.toml | 1 + .../rust/fixups/rustversion/fixups.toml | 2 + .../third-party/rust/fixups/serde/fixups.toml | 1 + .../rust/fixups/serde_derive/fixups.toml | 3 + .../rust/fixups/serde_json/fixups.toml | 1 + .../rust/fixups/signal-hook/fixups.toml | 1 + shim/third-party/rust/fixups/slab/fixups.toml | 1 + shim/third-party/rust/fixups/slog/fixups.toml | 1 + shim/third-party/rust/fixups/syn/fixups.toml | 1 + .../rust/fixups/sys-info/fixups.toml | 19 + .../rust/fixups/sysinfo/fixups.toml | 11 + .../rust/fixups/tempfile/fixups.toml | 2 + .../rust/fixups/terminfo/fixups.toml | 2 + .../rust/fixups/termwiz/fixups.toml | 2 + .../rust/fixups/test-case/fixups.toml | 1 + .../rust/fixups/thiserror/fixups.toml | 1 + .../rust/fixups/tiny-keccak/fixups.toml | 1 + .../rust/fixups/tokio-stream/fixups.toml | 2 + .../rust/fixups/tokio-util/fixups.toml | 1 + .../third-party/rust/fixups/tokio/fixups.toml | 8 + .../third-party/rust/fixups/tonic/fixups.toml | 1 + .../fixups/tracing-subscriber/fixups.toml | 2 + .../rust/fixups/trybuild/fixups.toml | 2 + .../rust/fixups/typenum/fixups.toml | 4 + .../rust/fixups/unicase/fixups.toml | 1 + .../winapi-x86_64-pc-windows-gnu/fixups.toml | 9 + .../rust/fixups/winapi/fixups.toml | 4 + .../rust/fixups/windows-targets/fixups.toml | 3 + .../windows_aarch64_gnullvm/fixups.toml | 8 + .../fixups/windows_x86_64_gnu/fixups.toml | 8 + .../fixups/windows_x86_64_gnullvm/fixups.toml | 8 + .../fixups/windows_x86_64_msvc/fixups.toml | 8 + .../rust/fixups/winreg/fixups.toml | 1 + .../rust/fixups/zerocopy/fixups.toml | 1 + .../rust/fixups/zstd-safe/fixups.toml | 1 + .../rust/fixups/zstd-sys/fixups.toml | 114 ++++++ shim/third-party/rust/reindeer.toml | 29 ++ shim/third-party/rust/top/main.rs | 8 + .../build_defs/audit_dependencies_test.bzl | 10 + shim/tools/build_defs/buck2/is_buck2.bzl | 9 + .../build_defs/default_platform_defs.bzl | 1 + shim/tools/build_defs/glob_defs.bzl | 8 + .../executorch/kernels/optimized/lib_defs.bzl | 142 +++++++ .../optimized/op_registration_util.bzl | 131 +++++++ 228 files changed, 8763 insertions(+) create mode 100755 buck2 create mode 100644 quic/BUCK create mode 100644 quic/BUILD_MODE.bzl create mode 100644 quic/api/BUCK create mode 100644 quic/api/test/BUCK create mode 100644 quic/client/BUCK create mode 100644 quic/client/connector/BUCK create mode 100644 quic/client/test/BUCK create mode 100644 quic/codec/BUCK create mode 100644 quic/codec/test/BUCK create mode 100644 quic/common/BUCK create mode 100644 quic/common/events/BUCK create mode 100644 quic/common/events/test/BUCK create mode 100644 quic/common/test/BUCK create mode 100644 quic/common/testutil/BUCK create mode 100644 quic/common/third-party/BUCK create mode 100644 quic/common/udpsocket/BUCK create mode 100644 quic/common/udpsocket/test/BUCK create mode 100644 quic/congestion_control/BUCK create mode 100644 quic/congestion_control/test/BUCK create mode 100644 quic/congestion_control/third_party/BUCK create mode 100644 quic/defs.bzl create mode 100644 quic/dsr/BUCK create mode 100644 quic/dsr/backend/BUCK create mode 100644 quic/dsr/backend/test/BUCK create mode 100644 quic/dsr/frontend/BUCK create mode 100644 quic/dsr/frontend/test/BUCK create mode 100644 quic/dsr/test/BUCK create mode 100644 quic/facebook/backbone_monitoring/BUCK create mode 100644 quic/facebook/backbone_monitoring/test/BUCK create mode 100644 quic/facebook/benchmarks/BUCK create mode 100644 quic/facebook/fingerprint/BUCK create mode 100644 quic/facebook/fingerprint/test/BUCK create mode 100644 quic/facebook/fuzzers/BUCK create mode 100644 quic/facebook/jump_start/BUCK create mode 100644 quic/facebook/jump_start/js/BUCK create mode 100644 quic/facebook/jump_start/test/BUCK create mode 100644 quic/facebook/mbed/BUCK create mode 100644 quic/facebook/mbed/test/BUCK create mode 100644 quic/facebook/mu/connection/BUCK create mode 100644 quic/facebook/mu/sample/BUCK create mode 100644 quic/facebook/tools/quicperf/BUCK create mode 100644 quic/facebook/utils/BUCK create mode 100644 quic/facebook/utils/test/BUCK create mode 100644 quic/fizz/client/handshake/BUCK create mode 100644 quic/fizz/client/handshake/test/BUCK create mode 100644 quic/fizz/client/test/BUCK create mode 100644 quic/fizz/handshake/BUCK create mode 100644 quic/fizz/handshake/test/BUCK create mode 100644 quic/fizz/server/handshake/BUCK create mode 100644 quic/flowcontrol/BUCK create mode 100644 quic/flowcontrol/test/BUCK create mode 100644 quic/handshake/BUCK create mode 100644 quic/handshake/test/BUCK create mode 100644 quic/happyeyeballs/BUCK create mode 100644 quic/logging/BUCK create mode 100644 quic/logging/test/BUCK create mode 100644 quic/loss/BUCK create mode 100644 quic/loss/test/BUCK create mode 100644 quic/observer/BUCK create mode 100644 quic/observer/test/BUCK create mode 100644 quic/samples/echo/BUCK create mode 100644 quic/server/BUCK create mode 100644 quic/server/async_tran/BUCK create mode 100644 quic/server/async_tran/test/BUCK create mode 100644 quic/server/handshake/BUCK create mode 100644 quic/server/handshake/test/BUCK create mode 100644 quic/server/state/BUCK create mode 100644 quic/server/test/BUCK create mode 100644 quic/server/third-party/BUCK create mode 100644 quic/somerge_defs.bzl create mode 100644 quic/state/BUCK create mode 100644 quic/state/stream/BUCK create mode 100644 quic/state/stream/test/BUCK create mode 100644 quic/state/test/BUCK create mode 100644 quic/tools/tperf/BUCK create mode 100644 quic/tools/tperf/test/BUCK create mode 100644 quic/xsk/BUCK create mode 100644 shim/.buckconfig create mode 100644 shim/.gitignore create mode 100644 shim/BUCK create mode 100644 shim/README.md create mode 100644 shim/buck2/buck_rust_binary.bzl create mode 100644 shim/buck2/proto_defs.bzl create mode 100644 shim/build_defs/cpp_library.bzl create mode 100644 shim/build_defs/custom_unittest.bzl create mode 100644 shim/build_defs/export_files.bzl create mode 100644 shim/build_defs/lib/python_common.bzl create mode 100644 shim/build_defs/native_rules.bzl create mode 100644 shim/build_defs/ocaml_binary.bzl create mode 100644 shim/build_defs/platform_utils.bzl create mode 100644 shim/build_defs/python_binary.bzl create mode 100644 shim/build_defs/rust_binary.bzl create mode 100644 shim/build_defs/rust_library.bzl create mode 100644 shim/build_defs/rust_unittest.bzl create mode 100644 shim/common/ocaml/interop/defs.bzl create mode 100644 shim/grpc_fb/codegen/buck_macros.bzl create mode 100644 shim/shims.bzl create mode 100644 shim/target_determinator/macros/ci.bzl create mode 100644 shim/third-party/macros/rust_third_party.bzl create mode 100644 shim/third-party/ocaml/BUCK create mode 100644 shim/third-party/proto/BUCK create mode 100644 shim/third-party/proto/defs.bzl create mode 100644 shim/third-party/proto/releases.bzl create mode 100755 shim/third-party/proto/update.py create mode 100644 shim/third-party/rust/.gitignore create mode 100644 shim/third-party/rust/Cargo.toml create mode 100644 shim/third-party/rust/defs.bzl create mode 100644 shim/third-party/rust/fixups/ahash/fixups.toml create mode 100644 shim/third-party/rust/fixups/anyhow/fixups.toml create mode 100644 shim/third-party/rust/fixups/async-trait/fixups.toml create mode 100644 shim/third-party/rust/fixups/atomic/fixups.toml create mode 100644 shim/third-party/rust/fixups/axum-core/fixups.toml create mode 100644 shim/third-party/rust/fixups/axum/fixups.toml create mode 100644 shim/third-party/rust/fixups/backtrace/fixups.toml create mode 100644 shim/third-party/rust/fixups/blake3/fixups.toml create mode 100644 shim/third-party/rust/fixups/bumpalo/fixups.toml create mode 100644 shim/third-party/rust/fixups/bzip2-sys/fixups.toml create mode 100644 shim/third-party/rust/fixups/clap/fixups.toml create mode 100644 shim/third-party/rust/fixups/clap_builder/fixups.toml create mode 100644 shim/third-party/rust/fixups/clap_derive/fixups.toml create mode 100644 shim/third-party/rust/fixups/core-foundation-sys/fixups.toml create mode 100644 shim/third-party/rust/fixups/crc32fast/fixups.toml create mode 100644 shim/third-party/rust/fixups/criterion/fixups.toml create mode 100644 shim/third-party/rust/fixups/crossbeam-epoch/fixups.toml create mode 100644 shim/third-party/rust/fixups/crossbeam-queue/fixups.toml create mode 100644 shim/third-party/rust/fixups/crossbeam-utils/fixups.toml create mode 100644 shim/third-party/rust/fixups/crunchy/fixups.toml create mode 100644 shim/third-party/rust/fixups/darwin-libproc-sys/fixups.toml create mode 100644 shim/third-party/rust/fixups/debugserver-types/fixups.toml create mode 100644 shim/third-party/rust/fixups/erased-serde/fixups.toml create mode 100644 shim/third-party/rust/fixups/fs-err/fixups.toml create mode 100644 shim/third-party/rust/fixups/fs4/fixups.toml create mode 100644 shim/third-party/rust/fixups/futures-channel/fixups.toml create mode 100644 shim/third-party/rust/fixups/futures-core/fixups.toml create mode 100644 shim/third-party/rust/fixups/futures-task/fixups.toml create mode 100644 shim/third-party/rust/fixups/futures-util/fixups.toml create mode 100644 shim/third-party/rust/fixups/generic-array/fixups.toml create mode 100644 shim/third-party/rust/fixups/getrandom/fixups.toml create mode 100644 shim/third-party/rust/fixups/httparse/fixups.toml create mode 100644 shim/third-party/rust/fixups/hyper/fixups.toml create mode 100644 shim/third-party/rust/fixups/indexmap/fixups.toml create mode 100644 shim/third-party/rust/fixups/io-lifetimes/fixups.toml create mode 100644 shim/third-party/rust/fixups/jemalloc-sys/fixups.toml create mode 100644 shim/third-party/rust/fixups/lalrpop/fixups.toml create mode 100644 shim/third-party/rust/fixups/lexical-core/fixups.toml create mode 100644 shim/third-party/rust/fixups/libc/fixups.toml create mode 100644 shim/third-party/rust/fixups/libm/fixups.toml create mode 100644 shim/third-party/rust/fixups/libsqlite3-sys/fixups.toml create mode 100644 shim/third-party/rust/fixups/lock_api/fixups.toml create mode 100644 shim/third-party/rust/fixups/log/fixups.toml create mode 100644 shim/third-party/rust/fixups/memchr/fixups.toml create mode 100644 shim/third-party/rust/fixups/memoffset/fixups.toml create mode 100644 shim/third-party/rust/fixups/mio/fixups.toml create mode 100644 shim/third-party/rust/fixups/native-tls/fixups.toml create mode 100644 shim/third-party/rust/fixups/nix/fixups.toml create mode 100644 shim/third-party/rust/fixups/nom/fixups.toml create mode 100644 shim/third-party/rust/fixups/ntapi/fixups.toml create mode 100644 shim/third-party/rust/fixups/num-bigint/fixups.toml create mode 100644 shim/third-party/rust/fixups/num-integer/fixups.toml create mode 100644 shim/third-party/rust/fixups/num-traits/fixups.toml create mode 100644 shim/third-party/rust/fixups/parking_lot/fixups.toml create mode 100644 shim/third-party/rust/fixups/parking_lot_core/fixups.toml create mode 100644 shim/third-party/rust/fixups/paste/fixups.toml create mode 100644 shim/third-party/rust/fixups/pest/fixups.toml create mode 100644 shim/third-party/rust/fixups/pin-project-internal/fixups.toml create mode 100644 shim/third-party/rust/fixups/platforms/fixups.toml create mode 100644 shim/third-party/rust/fixups/prettyplease/fixups.toml create mode 100644 shim/third-party/rust/fixups/proc-macro-error-attr/fixups.toml create mode 100644 shim/third-party/rust/fixups/proc-macro-error/fixups.toml create mode 100644 shim/third-party/rust/fixups/proc-macro-hack/fixups.toml create mode 100644 shim/third-party/rust/fixups/proc-macro2/fixups.toml create mode 100644 shim/third-party/rust/fixups/prost-build/fixups.toml create mode 100644 shim/third-party/rust/fixups/pulldown-cmark/fixups.toml create mode 100644 shim/third-party/rust/fixups/quote/fixups.toml create mode 100644 shim/third-party/rust/fixups/radium/fixups.toml create mode 100644 shim/third-party/rust/fixups/rayon-core/fixups.toml create mode 100644 shim/third-party/rust/fixups/ref-cast/fixups.toml create mode 100644 shim/third-party/rust/fixups/reqwest/fixups.toml create mode 100644 shim/third-party/rust/fixups/ring/fixups.toml create mode 100644 shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols.h create mode 100644 shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_asm.h create mode 100644 shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_nasm.inc create mode 100644 shim/third-party/rust/fixups/rustix/fixups.toml create mode 100644 shim/third-party/rust/fixups/rustls/fixups.toml create mode 100644 shim/third-party/rust/fixups/rustversion/fixups.toml create mode 100644 shim/third-party/rust/fixups/serde/fixups.toml create mode 100644 shim/third-party/rust/fixups/serde_derive/fixups.toml create mode 100644 shim/third-party/rust/fixups/serde_json/fixups.toml create mode 100644 shim/third-party/rust/fixups/signal-hook/fixups.toml create mode 100644 shim/third-party/rust/fixups/slab/fixups.toml create mode 100644 shim/third-party/rust/fixups/slog/fixups.toml create mode 100644 shim/third-party/rust/fixups/syn/fixups.toml create mode 100644 shim/third-party/rust/fixups/sys-info/fixups.toml create mode 100644 shim/third-party/rust/fixups/sysinfo/fixups.toml create mode 100644 shim/third-party/rust/fixups/tempfile/fixups.toml create mode 100644 shim/third-party/rust/fixups/terminfo/fixups.toml create mode 100644 shim/third-party/rust/fixups/termwiz/fixups.toml create mode 100644 shim/third-party/rust/fixups/test-case/fixups.toml create mode 100644 shim/third-party/rust/fixups/thiserror/fixups.toml create mode 100644 shim/third-party/rust/fixups/tiny-keccak/fixups.toml create mode 100644 shim/third-party/rust/fixups/tokio-stream/fixups.toml create mode 100644 shim/third-party/rust/fixups/tokio-util/fixups.toml create mode 100644 shim/third-party/rust/fixups/tokio/fixups.toml create mode 100644 shim/third-party/rust/fixups/tonic/fixups.toml create mode 100644 shim/third-party/rust/fixups/tracing-subscriber/fixups.toml create mode 100644 shim/third-party/rust/fixups/trybuild/fixups.toml create mode 100644 shim/third-party/rust/fixups/typenum/fixups.toml create mode 100644 shim/third-party/rust/fixups/unicase/fixups.toml create mode 100644 shim/third-party/rust/fixups/winapi-x86_64-pc-windows-gnu/fixups.toml create mode 100644 shim/third-party/rust/fixups/winapi/fixups.toml create mode 100644 shim/third-party/rust/fixups/windows-targets/fixups.toml create mode 100644 shim/third-party/rust/fixups/windows_aarch64_gnullvm/fixups.toml create mode 100644 shim/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml create mode 100644 shim/third-party/rust/fixups/windows_x86_64_gnullvm/fixups.toml create mode 100644 shim/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml create mode 100644 shim/third-party/rust/fixups/winreg/fixups.toml create mode 100644 shim/third-party/rust/fixups/zerocopy/fixups.toml create mode 100644 shim/third-party/rust/fixups/zstd-safe/fixups.toml create mode 100644 shim/third-party/rust/fixups/zstd-sys/fixups.toml create mode 100644 shim/third-party/rust/reindeer.toml create mode 100644 shim/third-party/rust/top/main.rs create mode 100644 shim/tools/build_defs/audit_dependencies_test.bzl create mode 100644 shim/tools/build_defs/buck2/is_buck2.bzl create mode 100644 shim/tools/build_defs/default_platform_defs.bzl create mode 100644 shim/tools/build_defs/glob_defs.bzl create mode 100644 shim/xplat/executorch/kernels/optimized/lib_defs.bzl create mode 100644 shim/xplat/executorch/kernels/optimized/op_registration_util.bzl diff --git a/buck2 b/buck2 new file mode 100755 index 000000000..123c0ac4f --- /dev/null +++ b/buck2 @@ -0,0 +1,67 @@ +#!/usr/bin/env dotslash + +{ + "name": "buck2", + "platforms": { + "macos-aarch64": { + "size": 23110012, + "hash": "blake3", + "digest": "2e534798cfa67c02357b9edc410ea0b65984af42aecab22f077f8b8b69b635ed", + "format": "zst", + "path": "buck2-aarch64-apple-darwin", + "providers": [ + { + "url": "https://github.com/facebook/buck2/releases/download/2024-04-15/buck2-aarch64-apple-darwin.zst" + } + ] + }, + "linux-aarch64": { + "size": 25625575, + "hash": "blake3", + "digest": "9b87f3af61a3aeaa78051c780c7c2ed5a19d5bffdabd2386a7a5925af3da9069", + "format": "zst", + "path": "buck2-aarch64-unknown-linux-musl", + "providers": [ + { + "url": "https://github.com/facebook/buck2/releases/download/2024-04-15/buck2-aarch64-unknown-linux-musl.zst" + } + ] + }, + "macos-x86_64": { + "size": 25044637, + "hash": "blake3", + "digest": "aaf132b70d317c7e3e8573de5f73783c8325a96badd539805bf56dcaf0e0a285", + "format": "zst", + "path": "buck2-x86_64-apple-darwin", + "providers": [ + { + "url": "https://github.com/facebook/buck2/releases/download/2024-04-15/buck2-x86_64-apple-darwin.zst" + } + ] + }, + "windows-x86_64": { + "size": 20557271, + "hash": "blake3", + "digest": "a750d714cedca0369f62ae3e6c6cd3bf6d8c65f2f79d53f5dce10e27fcc1c9a5", + "format": "zst", + "path": "buck2-x86_64-pc-windows-msvc.exe", + "providers": [ + { + "url": "https://github.com/facebook/buck2/releases/download/2024-04-15/buck2-x86_64-pc-windows-msvc.exe.zst" + } + ] + }, + "linux-x86_64": { + "size": 26368190, + "hash": "blake3", + "digest": "486cb1458f356863331cdeacb2491afb60e3d78e4fda33adb4112dfca7dc63dd", + "format": "zst", + "path": "buck2-x86_64-unknown-linux-musl", + "providers": [ + { + "url": "https://github.com/facebook/buck2/releases/download/2024-04-15/buck2-x86_64-unknown-linux-musl.zst" + } + ] + } + } +} diff --git a/quic/BUCK b/quic/BUCK new file mode 100644 index 000000000..25ca14404 --- /dev/null +++ b/quic/BUCK @@ -0,0 +1,43 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "constants", + srcs = [ + "QuicConstants.cpp", + ], + headers = [ + "QuicConstants.h", + ], + deps = [ + "//folly/lang:assume", + ], + exported_deps = [ + "//folly/chrono:clock", + "//folly/io:iobuf", + "//quic/common/third-party:better_enums", + ], +) + +mvfst_cpp_library( + name = "exception", + srcs = [ + "QuicException.cpp", + ], + headers = [ + "QuicException.h", + ], + deps = [ + "//fizz/record:record", + ], + exported_deps = [ + ":constants", + "//folly:optional", + "//folly:range", + "//quic/common:variant", + ], + external_deps = [ + "glog", + ], +) diff --git a/quic/BUILD_MODE.bzl b/quic/BUILD_MODE.bzl new file mode 100644 index 000000000..58c5327af --- /dev/null +++ b/quic/BUILD_MODE.bzl @@ -0,0 +1,55 @@ +# Copyright 2017 Facebook + +""" build mode definitions for quic """ + +load("@fbcode//:BUILD_MODE.bzl", get_parent_modes = "get_empty_modes") +load("@fbcode_macros//build_defs:create_build_mode.bzl", "extend_build_modes") + +_extra_cflags = [ +] + +_common_flags = [ + "-Wextra-semi", + "-Wformat", + "-Wformat-security", + "-Wunused-function", + "-Wunused-parameter", + "-Wunused-variable", + "-Wsign-compare", + "-Wtype-limits", + "-Wunused-value", + # TODO this seems to break trunk (https://fb.workplace.com/groups/askbuck/permalink/4366767820038466/) + # Re-enable after investigating the issue + # "-Wno-module-import-in-extern-c", +] + +_extra_clang_flags = _common_flags + [ + "-Wconstant-conversion", + # Default value for clang (3.4) is 256, change it to GCC's default value + # (https://fburl.com/23278774). + "-ftemplate-depth=900", + "-Wmismatched-tags", + # Only check shadowing with Clang: gcc complains about constructor + # argument shadowing + "-Wshadow", + "-Wunused-exception-parameter", + "-Wheader-hygiene", + "-Wall", + "-Wextra", +] + +_extra_gcc_flags = _common_flags + [ + "-Wall", +] + +_modes = extend_build_modes( + get_parent_modes(), + c_flags = _extra_cflags, + clang_flags = _extra_clang_flags, + gcc_flags = _extra_gcc_flags, + cxx_modular_headers = True, +) + +def get_modes(): + """ Return modes for this file """ + return _modes diff --git a/quic/api/BUCK b/quic/api/BUCK new file mode 100644 index 000000000..2d6e781c5 --- /dev/null +++ b/quic/api/BUCK @@ -0,0 +1,130 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "quic_batch_writer", + srcs = [ + "QuicBatchWriter.cpp", + "QuicBatchWriterFactory.cpp", + "QuicGsoBatchWriters.cpp", + ], + headers = [ + "QuicBatchWriter.h", + "QuicBatchWriterFactory.h", + "QuicGsoBatchWriters.h", + ], + exported_deps = [ + "//folly:network_address", + "//folly:portability", + "//folly/io:iobuf", + "//quic:constants", + "//quic/common/events:eventbase", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "transport", + srcs = [ + "IoBufQuicBatch.cpp", + "QuicPacketScheduler.cpp", + "QuicTransportBase.cpp", + "QuicTransportFunctions.cpp", + ], + headers = [ + "IoBufQuicBatch.h", + "QuicPacketScheduler.h", + "QuicSocket.h", + "QuicTransportBase.h", + "QuicTransportFunctions.h", + ], + deps = [ + ":loop_detector_callback", + "//folly:chrono", + "//folly:scope_guard", + "//quic/common:socket_util", + "//quic/common:time_util", + "//quic/congestion_control:pacer", + "//quic/happyeyeballs:happyeyeballs", + "//quic/logging:qlogger_constants", + "//quic/loss:loss", + "//quic/state:ack_frequency_functions", + "//quic/state:ack_handler", + "//quic/state:pacing_functions", + "//quic/state:simple_frame_functions", + "//quic/state/stream:stream", + ], + exported_deps = [ + ":quic_batch_writer", + "//folly:exception_wrapper", + "//folly:expected", + "//folly:maybe_managed_ptr", + "//folly:optional", + "//folly:portability", + "//folly/io:iobuf", + "//folly/io/async:async_transport_certificate", + "//folly/lang:assume", + "//quic:constants", + "//quic:exception", + "//quic/client:state_and_handshake", + "//quic/codec:codec", + "//quic/codec:pktbuilder", + "//quic/codec:pktrebuilder", + "//quic/codec:types", + "//quic/common:looper", + "//quic/common:network_data", + "//quic/common:small_collections", + "//quic/common/events:eventbase", + "//quic/common/events:quic_timer", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/congestion_control:bandwidth", + "//quic/congestion_control:congestion_controller_factory", + "//quic/congestion_control:copa", + "//quic/congestion_control:cubic", + "//quic/congestion_control:newreno", + "//quic/flowcontrol:flow_control", + "//quic/handshake:transport_parameters", + "//quic/observer:socket_observer_container", + "//quic/observer:socket_observer_types", + "//quic/state:quic_connection_stats", + "//quic/state:quic_priority_queue", + "//quic/state:quic_state_machine", + "//quic/state:quic_stream_utilities", + "//quic/state:retransmission_policy", + "//quic/state:state_functions", + "//quic/state:stats_callback", + "//quic/state:stream_functions", + ], + exported_external_deps = [ + "boost", + ], +) + +mvfst_cpp_library( + name = "loop_detector_callback", + headers = ["LoopDetectorCallback.h"], + exported_deps = [ + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "stream_async_transport", + srcs = [ + "QuicStreamAsyncTransport.cpp", + ], + headers = [ + "QuicStreamAsyncTransport.h", + ], + deps = [ + "//folly/io:iobuf", + "//quic/common/events:folly_eventbase", + ], + exported_deps = [ + ":transport", + "//folly/io/async:async_transport", + "//quic/common/events:eventbase", + ], +) diff --git a/quic/api/test/BUCK b/quic/api/test/BUCK new file mode 100644 index 000000000..67b5ebd97 --- /dev/null +++ b/quic/api/test/BUCK @@ -0,0 +1,237 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "MockQuicSocket.h", + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic:exception", + "//quic/api:loop_detector_callback", + "//quic/api:transport", + "//quic/codec:types", + "//quic/common:network_data", + "//quic/common/events:folly_eventbase", + "//quic/common/events:quic_timer", + "//quic/dsr:types", + "//quic/server:server", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "QuicSocketTest", + srcs = [ + "QuicSocketTest.cpp", + ], + deps = [ + ":mocks", + "//quic/api:transport", + ], +) + +cpp_unittest( + name = "QuicTransportTest", + srcs = [ + "QuicTransportTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + ":test_quic_transport", + "//folly:random", + "//folly/io:iobuf", + "//quic:constants", + "//quic/api:transport", + "//quic/common:buf_util", + "//quic/common/events:highres_quic_timer", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/congestion_control:static_cwnd_congestion_controller", + "//quic/dsr:types", + "//quic/dsr/test:mocks", + "//quic/handshake/test:mocks", + "//quic/logging/test:mocks", + "//quic/server/state:server", + "//quic/state:stream_functions", + "//quic/state/stream:stream", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "QuicTransportBaseTest", + srcs = [ + "QuicTransportBaseTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api:transport", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:datagram_handler", + "//quic/state:quic_stream_utilities", + "//quic/state:stream_functions", + "//quic/state/stream:stream", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "QuicTransportFunctionsTest", + srcs = [ + "QuicTransportFunctionsTest.cpp", + ], + deps = [ + ":mocks", + "//quic/api:transport", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/logging:file_qlogger", + "//quic/logging:qlogger_constants", + "//quic/server/state:server", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "QuicPacketSchedulerTest", + srcs = [ + "QuicPacketSchedulerTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//folly/portability:gtest", + "//quic/api:transport", + "//quic/client:state_and_handshake", + "//quic/codec:pktbuilder", + "//quic/codec/test:mocks", + "//quic/common/test:test_utils", + "//quic/dsr:types", + "//quic/dsr/test:mocks", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:stream_functions", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "IoBufQuicBatchTest", + srcs = [ + "IoBufQuicBatchTest.cpp", + ], + deps = [ + "//quic/api:transport", + "//quic/client:state_and_handshake", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "QuicBatchWriterTest", + srcs = [ + "QuicBatchWriterTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//quic/api:quic_batch_writer", + "//quic/common/events:folly_eventbase", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + ], +) + +cpp_unittest( + name = "QuicStreamAsyncTransportTest", + srcs = [ + "QuicStreamAsyncTransportTest.cpp", + ], + deps = [ + ":mocks", + "//folly:move_wrapper", + "//folly/container:f14_hash", + "//folly/futures:core", + "//folly/io/async/test:mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api:stream_async_transport", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + "//quic/server/test:mocks", + ], +) + +cpp_unittest( + name = "QuicTypedTransportTest", + srcs = [ + "QuicTypedTransportTest.cpp", + ], + supports_static_listing = False, + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + ":quic_typed_transport_test_util", + "//quic/codec:types", + "//quic/congestion_control:static_cwnd_congestion_controller", + "//quic/fizz/client/test:quic_client_transport_test_util", + "//quic/server/test:quic_server_transport_test_util", + "//quic/state:ack_event", + "//quic/state:outstanding_packet", + "//quic/state/test:mocks", + ], +) + +mvfst_cpp_library( + name = "quic_typed_transport_test_util", + headers = [ + "QuicTypedTransportTestUtil.h", + ], + exported_deps = [ + "//quic/api:transport", + "//quic/common/test:test_packet_builders", + "//quic/common/test:test_utils", + "//quic/state:quic_state_machine", + "//quic/state:state_functions", + ], +) + +mvfst_cpp_library( + name = "test_quic_transport", + headers = [ + "TestQuicTransport.h", + ], + exported_deps = [ + "//quic/api:transport", + "//quic/common/test:test_utils", + "//quic/dsr/frontend:write_functions", + "//quic/fizz/server/handshake:fizz_server_handshake", + ], +) diff --git a/quic/client/BUCK b/quic/client/BUCK new file mode 100644 index 000000000..379484843 --- /dev/null +++ b/quic/client/BUCK @@ -0,0 +1,119 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "client", + srcs = [ + "QuicClientTransport.cpp", + ], + headers = [ + "QuicClientTransport.h", + ], + deps = [ + ":client_extension", + "//folly/portability:sockets", + "//quic:constants", + "//quic/api:loop_detector_callback", + "//quic/flowcontrol:flow_control", + "//quic/handshake:handshake", + "//quic/happyeyeballs:happyeyeballs", + "//quic/logging:qlogger_constants", + "//quic/loss:loss", + "//quic/state:ack_handler", + "//quic/state:datagram_handler", + "//quic/state:pacing_functions", + "//quic/state:simple_frame_functions", + "//quic/state/stream:stream", + ], + exported_deps = [ + ":state_and_handshake", + "//folly:network_address", + "//folly:random", + "//folly/io:socket_option_map", + "//folly/net:net_ops", + "//quic/api:transport", + "//quic/common:buf_accessor", + "//quic/common:buf_util", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/state:quic_connection_stats", + ], +) + +mvfst_cpp_library( + name = "state_and_handshake", + srcs = [ + "handshake/ClientHandshake.cpp", + "state/ClientStateMachine.cpp", + ], + headers = [ + "handshake/ClientHandshake.h", + "handshake/ClientHandshakeFactory.h", + "state/ClientStateMachine.h", + ], + deps = [ + ":cached_server_tp", + ":client_extension", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common:time_util", + "//quic/congestion_control:congestion_controller_factory", + "//quic/loss:loss", + "//quic/state:quic_stream_utilities", + "//quic/state:stream_functions", + ], + exported_deps = [ + "//folly:exception_wrapper", + "//folly/io:iobuf", + "//folly/io/async:delayed_destruction", + "//quic:constants", + "//quic:exception", + "//quic/common:network_data", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/congestion_control:cubic", + "//quic/flowcontrol:flow_control", + "//quic/handshake:aead", + "//quic/handshake:handshake", + "//quic/handshake:transport_parameters", + "//quic/state:quic_state_machine", + "//quic/state:state_functions", + ], +) + +mvfst_cpp_library( + name = "client_extension", + headers = [ + "handshake/ClientTransportParametersExtension.h", + ], + exported_deps = [ + "//quic/handshake:transport_parameters", + ], +) + +mvfst_cpp_library( + name = "cached_server_tp", + headers = [ + "handshake/CachedServerTransportParameters.h", + ], + exported_deps = [ + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "client_async_transport", + srcs = [ + "QuicClientAsyncTransport.cpp", + ], + headers = [ + "QuicClientAsyncTransport.h", + ], + deps = [ + "//folly:conv", + "//folly/experimental/symbolizer:symbolizer", + ], + exported_deps = [ + "//quic/api:stream_async_transport", + "//quic/client:client", + ], +) diff --git a/quic/client/connector/BUCK b/quic/client/connector/BUCK new file mode 100644 index 000000000..3158360f8 --- /dev/null +++ b/quic/client/connector/BUCK @@ -0,0 +1,31 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "connector", + srcs = [ + "QuicConnector.cpp", + ], + headers = [ + "QuicConnector.h", + ], + deps = [ + "//folly/io/async:async_ssl_socket", + "//folly/io/async:async_udp_socket", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:congestion_controller_factory", + "//quic/fizz/client/handshake:fizz_client_handshake", + ], + exported_deps = [ + "//fizz/client:async_fizz_client", + "//folly/io:socket_option_map", + "//quic/api:loop_detector_callback", + "//quic/api:transport", + "//quic/client:client", + "//quic/common:time_util", + "//quic/common/events:folly_eventbase", + "//quic/fizz/client/handshake:psk_cache", + "//quic/logging:qlogger", + ], +) diff --git a/quic/client/test/BUCK b/quic/client/test/BUCK new file mode 100644 index 000000000..66e7af8bc --- /dev/null +++ b/quic/client/test/BUCK @@ -0,0 +1,68 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/client:cached_server_tp", + "//quic/client:client", + "//quic/client:state_and_handshake", + "//quic/client/connector:connector", + "//quic/common/events:folly_eventbase", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/handshake:handshake", + "//quic/handshake:transport_parameters", + ], +) + +cpp_unittest( + name = "ClientStateMachineTest", + srcs = [ + "ClientStateMachineTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//quic/api:transport", + "//quic/api/test:mocks", + "//quic/client:cached_server_tp", + "//quic/client:state_and_handshake", + "//quic/common/events:folly_eventbase", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/handshake:handshake", + "//quic/handshake:transport_parameters", + ], +) + +cpp_unittest( + name = "QuicConnectorTest", + srcs = [ + "QuicConnectorTest.cpp", + ], + deps = [ + ":mocks", + "//quic/client/connector:connector", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + ], +) + +mvfst_cpp_library( + name = "QuicClientTransportMock", + headers = [ + "QuicClientTransportMock.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/client:client", + ], +) diff --git a/quic/codec/BUCK b/quic/codec/BUCK new file mode 100644 index 000000000..b5cdeb103 --- /dev/null +++ b/quic/codec/BUCK @@ -0,0 +1,200 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "types", + srcs = [ + "DefaultConnectionIdAlgo.cpp", + "QuicConnectionId.cpp", + "QuicInteger.cpp", + "Types.cpp", + ], + headers = [ + "ConnectionIdAlgo.h", + "DefaultConnectionIdAlgo.h", + "QuicConnectionId.h", + "QuicInteger.h", + "Types.h", + ], + deps = [ + "//folly:random", + ], + exported_deps = [ + ":packet_number", + "//folly:conv", + "//folly:expected", + "//folly:network_address", + "//folly:optional", + "//folly:string", + "//folly/hash:hash", + "//folly/io:iobuf", + "//folly/lang:bits", + "//quic:constants", + "//quic:exception", + "//quic/common:buf_util", + "//quic/common:circular_deque", + "//quic/common:interval_set", + "//quic/common:network_data", + "//quic/common:small_collections", + "//quic/common:variant", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "packet_number", + srcs = [ + "PacketNumber.cpp", + ], + headers = [ + "PacketNumber.h", + ], + deps = [ + "//folly:conv", + "//folly/lang:bits", + "//quic:constants", + "//quic:exception", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "packet_number_cipher", + srcs = [ + "PacketNumberCipher.cpp", + ], + deps = [ + ":decode", + ":types", + ], + exported_deps = [ + "//folly:optional", + "//folly/io:iobuf", + "//quic/common:buf_util", + ], +) + +mvfst_cpp_library( + name = "decode", + srcs = [ + "Decode.cpp", + ], + headers = [ + "Decode.h", + ], + compiler_flags = [ + "-fstrict-aliasing", + ], + deps = [ + "//folly:string", + "//quic:exception", + ], + exported_deps = [ + ":packet_number", + ":types", + "//folly/io:iobuf", + "//quic:constants", + "//quic/state:transport_settings", + ], +) + +mvfst_cpp_library( + name = "pktbuilder", + srcs = [ + "QuicPacketBuilder.cpp", + ], + headers = [ + "QuicPacketBuilder.h", + ], + compiler_flags = [ + "-fstrict-aliasing", + ], + deps = [ + "//folly:random", + ], + exported_deps = [ + ":packet_number", + ":types", + "//folly:portability", + "//quic/common:buf_accessor", + "//quic/common:buf_util", + "//quic/handshake:handshake", + ], +) + +mvfst_cpp_library( + name = "pktrebuilder", + srcs = [ + "QuicPacketRebuilder.cpp", + ], + headers = [ + "QuicPacketRebuilder.h", + ], + deps = [ + ":codec", + "//quic/flowcontrol:flow_control", + "//quic/state:simple_frame_functions", + "//quic/state:state_functions", + "//quic/state:stream_functions", + ], + exported_deps = [ + ":pktbuilder", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "header_codec", + srcs = [ + "QuicHeaderCodec.cpp", + ], + headers = [ + "QuicHeaderCodec.h", + ], + deps = [ + ":decode", + "//quic:exception", + ], + exported_deps = [ + ":packet_number", + ":types", + "//folly:optional", + ], +) + +mvfst_cpp_library( + name = "codec", + srcs = [ + "QuicReadCodec.cpp", + "QuicWriteCodec.cpp", + ], + headers = [ + "QuicReadCodec.h", + "QuicWriteCodec.h", + ], + deps = [ + "//folly/io:iobuf", + "//quic:exception", + ], + exported_deps = [ + ":decode", + ":packet_number", + ":packet_number_cipher", + ":pktbuilder", + ":types", + "//folly:optional", + "//quic:constants", + "//quic/common:buf_util", + "//quic/common:circular_deque", + "//quic/common:interval_set", + "//quic/handshake:aead", + "//quic/state:ack_states", + "//quic/state:stats_callback", + "//quic/state:transport_settings", + ], +) diff --git a/quic/codec/test/BUCK b/quic/codec/test/BUCK new file mode 100644 index 000000000..81a2f21b8 --- /dev/null +++ b/quic/codec/test/BUCK @@ -0,0 +1,212 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/codec:pktbuilder", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "QuicHeaderCodec", + srcs = [ + "QuicHeaderCodecTest.cpp", + ], + deps = [ + "//folly:optional", + "//folly/portability:gtest", + "//quic:exception", + "//quic/codec:header_codec", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "QuicReadCodecTests", + srcs = [ + "QuicReadCodecTest.cpp", + ], + deps = [ + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic:exception", + "//quic/codec:codec", + "//quic/common/test:test_utils", + "//quic/fizz/handshake:fizz_handshake", + ], +) + +cpp_unittest( + name = "QuicWriteCodecTests", + srcs = [ + "QuicWriteCodecTest.cpp", + ], + compiler_flags = [ + "-ftemplate-backtrace-limit=0", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//folly:random", + "//folly/io:iobuf", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic:constants", + "//quic:exception", + "//quic/codec:codec", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common:buf_util", + "//quic/common:circular_deque", + "//quic/common/test:test_utils", + "//quic/state:transport_settings", + ], +) + +cpp_unittest( + name = "TypesTests", + srcs = [ + "TypesTest.cpp", + ], + deps = [ + "//folly:string", + "//folly/container:array", + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic:exception", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "PacketNumberTest", + srcs = [ + "PacketNumberTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//folly/portability:gtest", + "//quic/codec:packet_number", + "//quic/codec:types", + ], +) + +cpp_unittest( + name = "DecodeTests", + srcs = [ + "DecodeTest.cpp", + ], + deps = [ + "//folly:random", + "//folly/container:array", + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic/codec:codec", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "DefaultConnectionIdAlgoTest", + srcs = [ + "DefaultConnectionIdAlgoTest.cpp", + ], + deps = [ + "//folly:random", + "//folly/portability:gtest", + "//quic/codec:types", + ], +) + +cpp_unittest( + name = "QuicConnectionIdTest", + srcs = [ + "QuicConnectionIdTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/codec:types", + ], +) + +cpp_unittest( + name = "QuicPacketBuilderTest", + srcs = [ + "QuicPacketBuilderTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//folly:random", + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic/codec:codec", + "//quic/codec:pktbuilder", + "//quic/codec:types", + "//quic/common/test:test_utils", + "//quic/fizz/handshake:fizz_handshake", + "//quic/handshake:handshake", + ], +) + +cpp_unittest( + name = "QuicPacketRebuilderTest", + srcs = [ + "QuicPacketRebuilderTest.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gtest", + "//quic/codec:codec", + "//quic/codec:pktbuilder", + "//quic/codec:pktrebuilder", + "//quic/common/test:test_utils", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:quic_state_machine", + "//quic/state:state_functions", + "//quic/state:stream_functions", + "//quic/state/stream:stream", + ], +) + +cpp_unittest( + name = "QuicIntegerTest", + srcs = [ + "QuicIntegerTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//folly:expected", + "//folly:optional", + "//folly:string", + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic:exception", + "//quic/codec:types", + ], +) + +cpp_unittest( + name = "server_connection_id_params_test", + srcs = [ + "ServerConnectionIdParamsTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/codec:types", + ], +) diff --git a/quic/common/BUCK b/quic/common/BUCK new file mode 100644 index 000000000..ba8b0d423 --- /dev/null +++ b/quic/common/BUCK @@ -0,0 +1,184 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "interval_set", + headers = [ + "IntervalSet.h", + "IntervalSet-inl.h", + ], + exported_deps = [ + "//folly:likely", + "//folly:optional", + ], +) + +mvfst_cpp_library( + name = "looper", + srcs = [ + "FunctionLooper.cpp", + ], + headers = [ + "FunctionLooper.h", + ], + deps = [ + "//folly:scope_guard", + ], + exported_deps = [ + "//folly:function", + "//folly:optional", + "//folly/io/async:delayed_destruction", + "//quic:constants", + "//quic/common/events:eventbase", + "//quic/common/events:quic_timer", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "variant", + headers = [ + "Variant.h", + ], + exported_deps = [ + ], +) + +mvfst_cpp_library( + name = "buf_accessor", + srcs = [ + "BufAccessor.cpp", + ], + headers = [ + "BufAccessor.h", + ], + exported_deps = [ + "//folly/io:iobuf", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "buf_util", + srcs = [ + "BufUtil.cpp", + ], + headers = [ + "BufUtil.h", + ], + exported_deps = [ + "//folly/io:iobuf", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "enum_array", + headers = [ + "EnumArray.h", + ], + exported_deps = [ + "//folly:portability", + ], + exported_external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "socket_util", + headers = [ + "SocketUtil.h", + ], + exported_deps = [ + "//folly/io:socket_option_map", + "//folly/net:net_ops", + ], +) + +mvfst_cpp_library( + name = "small_collections", + headers = [ + "SmallCollections.h", + ], + exported_deps = [ + "//folly:small_vector", + "//folly/container:heap_vector_types", + ], +) + +mvfst_cpp_library( + name = "circular_deque", + headers = [ + "CircularDeque.h", + "CircularDeque-inl.h", + ], + exported_deps = [ + "//folly:likely", + "//folly:portability", + "//folly:scope_guard", + "//folly/memory:malloc", + ], + exported_external_deps = [ + "boost", + "glog", + ], +) + +mvfst_cpp_library( + name = "network_data", + headers = [ + "NetworkData.h", + ], + exported_deps = [ + ":time_points", + "//folly:optional", + "//folly/io:iobuf", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "time_points", + headers = [ + "TimePoints.h", + ], + exported_deps = [ + "//folly:optional", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "time_util", + headers = [ + "TimeUtil.h", + ], + exported_deps = [ + "//folly:traits", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "transport_knobs", + srcs = [ + "TransportKnobs.cpp", + ], + headers = [ + "TransportKnobs.h", + ], + deps = [ + "//folly/json:dynamic", + "//quic:constants", + ], + exported_deps = [ + "//folly:optional", + ], + external_deps = [ + "glog", + ], +) diff --git a/quic/common/events/BUCK b/quic/common/events/BUCK new file mode 100644 index 000000000..a43d8a9cb --- /dev/null +++ b/quic/common/events/BUCK @@ -0,0 +1,76 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "eventbase", + headers = [ + "QuicEventBase.h", + ], + exported_deps = [ + "//folly:function", + "//folly:glog", + ], +) + +mvfst_cpp_library( + name = "quic_timer", + srcs = [ + ], + headers = [ + "QuicTimer.h", + ], + exported_deps = [ + ":eventbase", + "//folly/io/async:delayed_destruction", + ], +) + +mvfst_cpp_library( + name = "folly_eventbase", + srcs = [ + "FollyQuicEventBase.cpp", + ], + headers = [ + "FollyQuicEventBase.h", + ], + exported_deps = [ + ":eventbase", + "//folly/io/async:async_base", + "//folly/io/async:async_base_fwd", + ], +) + +mvfst_cpp_library( + name = "highres_quic_timer", + srcs = [ + "HighResQuicTimer.cpp", + ], + headers = [ + "HighResQuicTimer.h", + ], + exported_deps = [ + ":quic_timer", + "//folly/experimental:timerfd", + "//folly/io/async:async_base", + ], +) + +mvfst_cpp_library( + name = "libev_eventbase", + srcs = [ + "LibevQuicEventBase.cpp", + ], + headers = [ + "LibevQuicEventBase.h", + ], + exported_deps = [ + ":eventbase", + ":quic_timer", + "//folly:glog", + "//folly:intrusive_list", + ], + exported_external_deps = [ + "libev", + ], +) diff --git a/quic/common/events/test/BUCK b/quic/common/events/test/BUCK new file mode 100644 index 000000000..a209755b0 --- /dev/null +++ b/quic/common/events/test/BUCK @@ -0,0 +1,55 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "QuicEventBaseTestBase", + headers = [ + "QuicEventBaseTestBase.h", + ], + exported_deps = [ + "//folly/portability:gtest", + "//quic/common/events:eventbase", + ], +) + +cpp_unittest( + name = "FollyQuicEventBaseTest", + srcs = [ + "FollyQuicEventBaseTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":QuicEventBaseTestBase", + "//folly/portability:gtest", + "//quic/common/events:folly_eventbase", + ], +) + +cpp_unittest( + name = "LibevQuicEventBaseTest", + srcs = [ + "LibevQuicEventBaseTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":QuicEventBaseTestBase", + "//folly/portability:gtest", + "//quic/common/events:libev_eventbase", + ], + external_deps = [ + "libev", + ], +) + +mvfst_cpp_library( + name = "QuicEventBaseMock", + headers = [ + "QuicEventBaseMock.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/common/events:eventbase", + ], +) diff --git a/quic/common/test/BUCK b/quic/common/test/BUCK new file mode 100644 index 000000000..56db138df --- /dev/null +++ b/quic/common/test/BUCK @@ -0,0 +1,193 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "IntervalSetTest", + srcs = [ + "IntervalSetTest.cpp", + ], + deps = [ + "//quic/common:interval_set", + ], +) + +cpp_unittest( + name = "FunctionLooperTest", + srcs = [ + "FunctionLooperTest.cpp", + ], + deps = [ + "//quic/common:looper", + "//quic/common/events:folly_eventbase", + "//quic/common/events:highres_quic_timer", + ], +) + +cpp_unittest( + name = "VariantTest", + srcs = [ + "VariantTest.cpp", + ], + deps = [ + "//quic/common:variant", + ], +) + +cpp_unittest( + name = "BufAccessorTest", + srcs = [ + "BufAccessorTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/common:buf_accessor", + ], +) + +cpp_unittest( + name = "BufUtilTest", + srcs = [ + "BufUtilTest.cpp", + ], + deps = [ + "//folly:string", + "//folly/io:iobuf", + "//quic/common:buf_util", + ], +) + +mvfst_cpp_library( + name = "test_client_utils", + headers = [ + "TestClientUtils.h", + ], + exported_deps = [ + "//fizz/protocol:certificate_verifier", + ], +) + +mvfst_cpp_library( + name = "test_packet_builders", + srcs = [ + "TestPacketBuilders.cpp", + ], + headers = [ + "TestPacketBuilders.h", + ], + deps = [ + "//quic/state:state_functions", + ], + exported_deps = [ + "//quic/api:quic_batch_writer", + "//quic/codec:pktbuilder", + "//quic/codec:types", + "//quic/state:ack_states", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "test_utils", + srcs = [ + "TestUtils.cpp", + ], + headers = [ + "TestUtils.h", + ], + deps = [ + "//fizz/crypto/test:TestUtil", + "//fizz/protocol:openssl_certificate", + "//fizz/protocol/clock/test:mock_clock", + "//fizz/protocol/test:mocks", + "//quic/api:transport", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/server/handshake:stateless_reset_generator", + "//quic/state:ack_event", + "//quic/state:loss_state", + "//quic/state:outstanding_packet", + "//quic/state/stream:stream", + ], + exported_deps = [ + ":test_packet_builders", + "//fizz/client:fizz_client_context", + "//fizz/server:fizz_server_context", + "//quic/api:quic_batch_writer", + "//quic/codec:pktbuilder", + "//quic/codec:types", + "//quic/common:buf_util", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/client/handshake:psk_cache", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/handshake/test:mocks", + "//quic/logging:file_qlogger", + "//quic/server/state:server", + "//quic/state:ack_states", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "TimeUtilTest", + srcs = [ + "TimeUtilTest.cpp", + ], + deps = [ + "//quic/common:time_util", + ], +) + +cpp_unittest( + name = "TransportKnobsTest", + srcs = [ + "TransportKnobsTest.cpp", + ], + deps = [ + "//folly:format", + "//folly/portability:gtest", + "//quic:constants", + "//quic/common:transport_knobs", + ], +) + +cpp_unittest( + name = "CircularDequeTest", + srcs = [ + "CircularDequeTest.cpp", + ], + deps = [ + ":test_utils", + "//folly:random", + "//quic/common:circular_deque", + ], +) + +cpp_benchmark( + name = "CircularDequeBench", + srcs = [ + "CircularDequeBench.cpp", + ], + headers = [], + deps = [ + "//folly:benchmark", + "//quic/common:circular_deque", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "SocketUtilTest", + srcs = [ + "SocketUtilTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//folly/portability:gtest", + "//quic/common:socket_util", + "//quic/common/events:folly_eventbase", + "//quic/common/udpsocket:folly_async_udp_socket", + ], +) diff --git a/quic/common/testutil/BUCK b/quic/common/testutil/BUCK new file mode 100644 index 000000000..c29ed3042 --- /dev/null +++ b/quic/common/testutil/BUCK @@ -0,0 +1,15 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mock_async_udp_socket", + headers = [ + "MockAsyncUDPSocket.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/common/events:folly_eventbase", + "//quic/common/udpsocket:folly_async_udp_socket", + ], +) diff --git a/quic/common/third-party/BUCK b/quic/common/third-party/BUCK new file mode 100644 index 000000000..217554b1f --- /dev/null +++ b/quic/common/third-party/BUCK @@ -0,0 +1,10 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "better_enums", + headers = [ + "enum.h", + ], +) diff --git a/quic/common/udpsocket/BUCK b/quic/common/udpsocket/BUCK new file mode 100644 index 000000000..d7a56f615 --- /dev/null +++ b/quic/common/udpsocket/BUCK @@ -0,0 +1,68 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "quic_async_udp_socket", + srcs = [ + "QuicAsyncUDPSocket.cpp", + ], + headers = [ + "QuicAsyncUDPSocket.h", + ], + exported_deps = [ + "//folly:network_address", + "//folly:range", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/io/async:async_socket_exception", + "//folly/portability:sockets", + "//quic/common:network_data", + "//quic/common/events:eventbase", + ], +) + +mvfst_cpp_library( + name = "quic_async_udp_socket_impl", + srcs = [ + "QuicAsyncUDPSocketImpl.cpp", + ], + headers = [ + "QuicAsyncUDPSocketImpl.h", + ], + exported_deps = [ + ":quic_async_udp_socket", + ], +) + +mvfst_cpp_library( + name = "folly_async_udp_socket", + srcs = [ + "FollyQuicAsyncUDPSocket.cpp", + ], + headers = [ + "FollyQuicAsyncUDPSocket.h", + ], + exported_deps = [ + ":quic_async_udp_socket_impl", + "//folly/io/async:async_udp_socket", + "//folly/net:network_socket", + "//quic/common:network_data", + "//quic/common/events:folly_eventbase", + ], +) + +mvfst_cpp_library( + name = "libev_async_udp_socket", + srcs = [ + "LibevQuicAsyncUDPSocket.cpp", + ], + headers = [ + "LibevQuicAsyncUDPSocket.h", + ], + exported_deps = [ + ":quic_async_udp_socket_impl", + "//quic/common:network_data", + "//quic/common/events:libev_eventbase", + ], +) diff --git a/quic/common/udpsocket/test/BUCK b/quic/common/udpsocket/test/BUCK new file mode 100644 index 000000000..d66524750 --- /dev/null +++ b/quic/common/udpsocket/test/BUCK @@ -0,0 +1,55 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "QuicAsyncUDPSocketMock", + headers = [ + "QuicAsyncUDPSocketMock.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/common/udpsocket:quic_async_udp_socket", + ], +) + +mvfst_cpp_library( + name = "QuicAsyncUDPSocketTestBase", + headers = [ + "QuicAsyncUDPSocketTestBase.h", + ], + exported_deps = [ + ":QuicAsyncUDPSocketMock", + "//folly/portability:gtest", + ], +) + +cpp_unittest( + name = "FollyQuicAsyncUDPSocketTest", + srcs = [ + "FollyQuicAsyncUDPSocketTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":QuicAsyncUDPSocketTestBase", + "//folly/portability:gtest", + "//quic/common/udpsocket:folly_async_udp_socket", + ], +) + +cpp_unittest( + name = "LibevQuicAsyncUDPSocketTest", + srcs = [ + "LibevQuicAsyncUDPSocketTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":QuicAsyncUDPSocketTestBase", + "//folly/portability:gtest", + "//quic/common/udpsocket:libev_async_udp_socket", + ], + external_deps = [ + "libev", + ], +) diff --git a/quic/congestion_control/BUCK b/quic/congestion_control/BUCK new file mode 100644 index 000000000..c8fef0901 --- /dev/null +++ b/quic/congestion_control/BUCK @@ -0,0 +1,348 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "bandwidth", + srcs = [ + "Bandwidth.cpp", + ], + headers = [ + "Bandwidth.h", + ], + deps = [ + "//folly:conv", + ], +) + +mvfst_cpp_library( + name = "congestion_controller", + headers = [ + "CongestionController.h", + ], + exported_deps = [ + ":bandwidth", + "//quic:constants", + "//quic/state:outstanding_packet", + "//quic/state:packet_event", + ], +) + +mvfst_cpp_library( + name = "congestion_control_functions", + srcs = [ + "CongestionControlFunctions.cpp", + ], + headers = [ + "CongestionControlFunctions.h", + ], + deps = [ + "//quic:constants", + "//quic/common:time_util", + ], + exported_deps = [ + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "congestion_controller_factory", + srcs = [ + "CongestionControllerFactory.cpp", + ], + headers = [ + "CongestionControllerFactory.h", + ], + deps = [ + ":bbr", + ":bbr2", + ":bbr_bandwidth_sampler", + ":bbr_rtt_sampler", + ":copa", + ":copa2", + ":cubic", + ":newreno", + ":static_cwnd_congestion_controller", + ], + exported_deps = [ + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "static_cwnd_congestion_controller", + srcs = [ + "StaticCwndCongestionController.cpp", + ], + headers = [ + "StaticCwndCongestionController.h", + ], + deps = [ + ":congestion_control_functions", + ], + exported_deps = [ + ":congestion_controller", + "//quic/state:ack_event", + "//quic/state:transport_settings", + ], +) + +mvfst_cpp_library( + name = "server_congestion_controller_factory", + srcs = [ + "ServerCongestionControllerFactory.cpp", + ], + headers = [ + "ServerCongestionControllerFactory.h", + ], + deps = [ + ":bbr", + ":bbr2", + ":bbr_bandwidth_sampler", + ":bbr_rtt_sampler", + ":bbr_testing", + ":copa", + ":copa2", + ":cubic", + ":newreno", + ":static_cwnd_congestion_controller", + ], + exported_deps = [ + ":congestion_controller_factory", + ], +) + +mvfst_cpp_library( + name = "cubic", + srcs = [ + "QuicCubic.cpp", + ], + headers = [ + "QuicCubic.h", + ], + deps = [ + "//folly:chrono", + "//quic/logging:qlogger_constants", + "//quic/state:state_functions", + ], + exported_deps = [ + ":congestion_control_functions", + ":congestion_controller", + "//quic:exception", + "//quic/state:ack_event", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "newreno", + srcs = [ + "NewReno.cpp", + ], + headers = [ + "NewReno.h", + ], + deps = [ + ":congestion_control_functions", + "//quic/logging:qlogger_constants", + ], + exported_deps = [ + ":congestion_controller", + "//quic:exception", + "//quic/state:ack_event", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "copa", + srcs = [ + "Copa.cpp", + ], + headers = [ + "Copa.h", + ], + deps = [ + ":congestion_control_functions", + "//quic/common:time_util", + "//quic/logging:qlogger_constants", + ], + exported_deps = [ + ":congestion_controller", + "//folly:optional", + "//quic:exception", + "//quic/congestion_control/third_party:chromium_windowed_filter", + "//quic/state:ack_event", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "copa2", + srcs = [ + "Copa2.cpp", + ], + headers = [ + "Copa2.h", + ], + deps = [ + ":congestion_control_functions", + "//quic/logging:qlogger_constants", + ], + exported_deps = [ + ":congestion_controller", + "//quic/congestion_control/third_party:chromium_windowed_filter", + "//quic/state:ack_event", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "bbr", + srcs = [ + "Bbr.cpp", + ], + headers = [ + "Bbr.h", + ], + deps = [ + ":congestion_control_functions", + "//folly:random", + "//quic:constants", + "//quic/common:time_util", + "//quic/logging:qlogger_constants", + "//quic/state:ack_frequency_functions", + ], + exported_deps = [ + ":bandwidth", + ":congestion_controller", + "//quic/congestion_control/third_party:chromium_windowed_filter", + "//quic/state:quic_state_machine", + "//quic/state:transport_settings", + ], +) + +mvfst_cpp_library( + name = "bbr2", + srcs = [ + "Bbr2.cpp", + ], + headers = [ + "Bbr2.h", + ], + deps = [ + ":congestion_control_functions", + ], + exported_deps = [ + ":bandwidth", + ":congestion_controller", + "//quic/congestion_control/third_party:chromium_windowed_filter", + "//quic/state:quic_state_machine", + "//quic/state:transport_settings", + ], +) + +mvfst_cpp_library( + name = "bbr_rtt_sampler", + srcs = [ + "BbrRttSampler.cpp", + ], + headers = [ + "BbrRttSampler.h", + ], + exported_deps = [ + ":bbr", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "bbr_bandwidth_sampler", + srcs = [ + "BbrBandwidthSampler.cpp", + ], + headers = [ + "BbrBandwidthSampler.h", + ], + deps = [ + "//quic/logging:qlogger_constants", + ], + exported_deps = [ + ":bbr", + "//quic/congestion_control/third_party:chromium_windowed_filter", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "bbr_testing", + srcs = [ + "BbrTesting.cpp", + ], + headers = [ + "BbrTesting.h", + ], + exported_deps = [ + ":bbr", + ], +) + +mvfst_cpp_library( + name = "pacer", + srcs = [ + "TokenlessPacer.cpp", + ], + headers = [ + "Pacer.h", + "TokenlessPacer.h", + ], + deps = [ + ":congestion_control_functions", + ], + exported_deps = [ + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "packet_processor", + headers = [ + "PacketProcessor.h", + ], + exported_deps = [ + ":congestion_controller", + "//folly/io:socket_option_map", + "//quic/state:outstanding_packet", + "//quic/state:packet_event", + ], +) + +mvfst_cpp_library( + name = "simulated_tbf", + srcs = [ + "SimulatedTBF.cpp", + ], + headers = [ + "SimulatedTBF.h", + ], + deps = [ + "//quic:exception", + ], + exported_deps = [ + "//folly:token_bucket", + "//quic:constants", + ], + exported_external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "throttling_signal_provider", + headers = [ + "ThrottlingSignalProvider.h", + ], + exported_deps = [ + "//folly:optional", + ], +) diff --git a/quic/congestion_control/test/BUCK b/quic/congestion_control/test/BUCK new file mode 100644 index 000000000..72abfe072 --- /dev/null +++ b/quic/congestion_control/test/BUCK @@ -0,0 +1,217 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/congestion_control:bbr", + ], +) + +mvfst_cpp_library( + name = "TestingCubic", + headers = [ + "TestingCubic.h", + ], + exported_deps = [ + "//quic/congestion_control:cubic", + ], +) + +cpp_unittest( + name = "CongestionControlFunctionsTest", + srcs = [ + "CongestionControlFunctionsTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic:constants", + "//quic/congestion_control:congestion_control_functions", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "CubicStateTest", + srcs = [ + "CubicStateTest.cpp", + ], + deps = [ + ":TestingCubic", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + ], +) + +cpp_unittest( + name = "CubicTest", + srcs = [ + "CubicHystartTest.cpp", + "CubicRecoveryTest.cpp", + "CubicSteadyTest.cpp", + "CubicTest.cpp", + ], + deps = [ + ":TestingCubic", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:cubic", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "NewRenoTest", + srcs = [ + "NewRenoTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:newreno", + "//quic/fizz/server/handshake:fizz_server_handshake", + ], +) + +cpp_unittest( + name = "CopaTest", + srcs = [ + "CopaTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:copa", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "BbrTest", + srcs = [ + "BbrTest.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr", + "//quic/congestion_control:bbr_bandwidth_sampler", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "BbrRttSamplerTest", + srcs = [ + "BbrRttSamplerTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/congestion_control:bbr_rtt_sampler", + ], +) + +cpp_unittest( + name = "BbrBandwidthSamplerTest", + srcs = [ + "BbrBandwidthSamplerTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr_bandwidth_sampler", + ], +) + +cpp_unittest( + name = "BandwidthTest", + srcs = [ + "BandwidthTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/congestion_control:bandwidth", + ], +) + +cpp_unittest( + name = "PacerTest", + srcs = [ + "PacerTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/congestion_control:pacer", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "StaticCwndCongestionControllerTest", + srcs = [ + "StaticCwndCongestionControllerTest.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr", + "//quic/congestion_control:static_cwnd_congestion_controller", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "SimulatedTBFTest", + srcs = [ + "SimulatedTBFTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic:exception", + "//quic/congestion_control:simulated_tbf", + ], +) + +cpp_unittest( + name = "ThrottlingSignalProviderTest", + srcs = [ + "ThrottlingSignalProviderTest.cpp", + ], + deps = [ + "//quic/api:transport", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr", + "//quic/congestion_control:bbr_bandwidth_sampler", + "//quic/congestion_control:simulated_tbf", + "//quic/congestion_control:throttling_signal_provider", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "Bbr2Test", + srcs = [ + "Bbr2Test.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr2", + "//quic/state/test:mocks", + ], +) diff --git a/quic/congestion_control/third_party/BUCK b/quic/congestion_control/third_party/BUCK new file mode 100644 index 000000000..e4d701e3d --- /dev/null +++ b/quic/congestion_control/third_party/BUCK @@ -0,0 +1,10 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "chromium_windowed_filter", + headers = [ + "windowed_filter.h", + ], +) diff --git a/quic/defs.bzl b/quic/defs.bzl new file mode 100644 index 000000000..46d46f4d7 --- /dev/null +++ b/quic/defs.bzl @@ -0,0 +1,308 @@ +""" +[mvfst] + use_libev = {False|[True]} +""" + +load("@fbcode_macros//build_defs:autodeps_rule.bzl", "autodeps_rule") +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") +load("@fbsource//tools/build_defs:buckconfig.bzl", "read_bool") +load( + "@fbsource//tools/build_defs:default_platform_defs.bzl", + "ANDROID", + "APPLE", + "CXX", + "FBCODE", + "IOS", + "MACOSX", + "WATCHOS", + "WINDOWS", +) +load("@fbsource//tools/build_defs:fb_xplat_cxx_binary.bzl", "fb_xplat_cxx_binary") +load("@fbsource//tools/build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") +load("@fbsource//tools/build_defs:fb_xplat_cxx_test.bzl", "fb_xplat_cxx_test") +load("@fbsource//tools/build_defs:fbsource_utils.bzl", "is_arvr_mode") +load("@fbsource//xplat/pfh/Infra_Networking_Core:DEFS.bzl", "Infra_Networking_Core") + +CXXFLAGS = [ + "-frtti", + "-fexceptions", + "-Wno-nullability-completeness", + "-Wno-implicit-fallthrough", +] + +FBANDROID_CXXFLAGS = [ + "-ffunction-sections", + "-Wno-nullability-completeness", + "-fstack-protector-strong", +] + +FBOBJC_CXXFLAGS = [ + "-Wno-global-constructors", + "-fstack-protector-strong", +] + +WINDOWS_MSVC_CXXFLAGS = [ + "/EHs", + "/D_ENABLE_EXTENDED_ALIGNED_STORAGE", +] + +WINDOWS_CLANG_CXX_FLAGS = [ + "-Wno-deprecated-declarations", + "-Wno-microsoft-cast", + "-Wno-missing-braces", + "-Wno-unused-function", + "-Wno-undef", + "-DBOOST_HAS_THREADS", + "-D_ENABLE_EXTENDED_ALIGNED_STORAGE", +] + +DEFAULT_APPLE_SDKS = (IOS, MACOSX, WATCHOS) +DEFAULT_PLATFORMS = (CXX, ANDROID, APPLE, FBCODE, WINDOWS) + +def _compute_include_directories(): + base_path = native.package_name() + if base_path == "xplat/quic": + return [".."] + quic_path = base_path[6:] + return ["/".join(len(quic_path.split("/")) * [".."])] + +def use_libev(): + return read_bool("mvfst", "use_libev", False) + +def mvfst_cpp_library(name, autodeps_skip = False, **kwargs): + preprocessor_flags = kwargs.pop("preprocessor_flags", []) + exported_deps = kwargs.pop("exported_deps", []) + mvfst_mobile_exported_deps = kwargs.pop("mvfst_mobile_exported_deps", []) + mvfst_non_mobile_exported_deps = kwargs.pop("mvfst_non_mobile_exported_deps", []) + exported_external_deps = kwargs.pop("exported_external_deps", []) + if use_libev(): + preprocessor_flags += ["-DMVFST_USE_LIBEV"] + exported_external_deps += mvfst_mobile_exported_deps + else: + exported_deps += mvfst_non_mobile_exported_deps + + kwargs["preprocessor_flags"] = preprocessor_flags + kwargs["exported_deps"] = exported_deps + kwargs["exported_external_deps"] = exported_external_deps + cpp_library(name = name, autodeps_skip = True, **kwargs) + + if not autodeps_skip: + autodeps_rule( + name = name, + type = "mvfst_cpp_library", + attrs = kwargs, + ) + +def mvfst_cxx_library( + name, + srcs = (), + headers = (), + exported_headers = (), + raw_headers = (), + deps = (), + exported_deps = (), + force_static = False, + apple_sdks = None, + platforms = None, + enable_static_variant = True, + labels = (), + fbandroid_labels = (), + fbobjc_labels = (), + header_namespace = "", + **kwargs): + """Translate a simpler declartion into the more complete library target""" + + # Set default platform settings. `()` means empty, whereas None + # means default + if apple_sdks == None: + apple_sdks = DEFAULT_APPLE_SDKS + if platforms == None: + platforms = DEFAULT_PLATFORMS + + # We use gflags on fbcode platforms, which don't mix well when mixing static + # and dynamic linking. + if not is_arvr_mode(): + force_static = select({ + "DEFAULT": force_static, + "ovr_config//runtime:fbcode": False, + }) + + exported_preprocessor_flags = kwargs.pop("exported_preprocessor_flags", []) + mvfst_mobile_exported_deps = kwargs.pop("mvfst_mobile_exported_deps", []) + mvfst_non_mobile_exported_deps = kwargs.pop("mvfst_non_mobile_exported_deps", []) + if use_libev(): + exported_preprocessor_flags += ["-DMVFST_USE_LIBEV"] + exported_deps = list(exported_deps) + mvfst_mobile_exported_deps + else: + exported_deps = list(exported_deps) + mvfst_non_mobile_exported_deps + + fb_xplat_cxx_library( + name = name, + srcs = srcs, + header_namespace = header_namespace, + headers = headers, + exported_headers = exported_headers, + raw_headers = raw_headers, + public_include_directories = _compute_include_directories(), + deps = deps, + exported_deps = exported_deps, + force_static = force_static, + apple_sdks = apple_sdks, + platforms = platforms, + enable_static_variant = enable_static_variant, + labels = list(labels), + fbandroid_labels = list(fbandroid_labels), + fbobjc_labels = list(fbobjc_labels), + compiler_flags = kwargs.pop("compiler_flags", []) + CXXFLAGS, + exported_preprocessor_flags = exported_preprocessor_flags, + windows_compiler_flags = kwargs.pop("windows_compiler_flags", []) + CXXFLAGS + WINDOWS_CLANG_CXX_FLAGS, + fbobjc_compiler_flags = kwargs.pop("fbobjc_compiler_flags", []) + + FBOBJC_CXXFLAGS, + fbcode_compiler_flags_override = kwargs.pop("fbcode_compiler_flags", []), + fbandroid_compiler_flags = kwargs.pop("fbandroid_compiler_flags", []) + + FBANDROID_CXXFLAGS, + windows_msvc_compiler_flags_override = kwargs.pop("windows_msvc_compiler_flags_override", WINDOWS_MSVC_CXXFLAGS), + windows_preferred_linkage = "static", + visibility = kwargs.pop("visibility", ["PUBLIC"]), + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + feature = Infra_Networking_Core, + **kwargs + ) + +def mvfst_cxx_test( + name, + srcs, + raw_headers = [], + deps = []): + fb_xplat_cxx_test( + name = name, + srcs = srcs, + raw_headers = raw_headers, + include_directories = [ + "..", + ], + deps = deps, + platforms = (CXX,), + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + ) + +def mvfst_cxx_binary( + name, + srcs, + raw_headers = [], + deps = [], + **kwargs): + fb_xplat_cxx_binary( + name = name, + srcs = srcs, + raw_headers = raw_headers, + compiler_flags = kwargs.pop("compiler_flags", []) + CXXFLAGS, + include_directories = [ + "..", + ], + deps = deps, + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + platforms = (CXX,), + ) + +def mu_cxx_library( + name, + srcs = (), + headers = (), + exported_headers = (), + raw_headers = (), + deps = (), + exported_deps = (), + force_static = False, + apple_sdks = None, + platforms = None, + enable_static_variant = True, + labels = (), + fbandroid_labels = (), + fbobjc_labels = (), + header_namespace = "", + **kwargs): + """Translate a simpler declartion into the more complete library target""" + + # Set default platform settings. `()` means empty, whereas None + # means default + if apple_sdks == None: + apple_sdks = DEFAULT_APPLE_SDKS + if platforms == None: + platforms = DEFAULT_PLATFORMS + + # We use gflags on fbcode platforms, which don't mix well when mixing static + # and dynamic linking. + if not is_arvr_mode(): + force_static = select({ + "DEFAULT": force_static, + "ovr_config//runtime:fbcode": False, + }) + + fb_xplat_cxx_library( + name = name, + srcs = srcs, + header_namespace = header_namespace, + headers = headers, + exported_headers = exported_headers, + raw_headers = raw_headers, + public_include_directories = _compute_include_directories(), + deps = deps, + exported_deps = exported_deps, + force_static = force_static, + apple_sdks = apple_sdks, + platforms = platforms, + enable_static_variant = enable_static_variant, + labels = list(labels), + fbandroid_labels = list(fbandroid_labels), + fbobjc_labels = list(fbobjc_labels), + compiler_flags = kwargs.pop("compiler_flags", []) + CXXFLAGS, + windows_compiler_flags = kwargs.pop("windows_compiler_flags", []) + CXXFLAGS + WINDOWS_CLANG_CXX_FLAGS, + fbobjc_compiler_flags = kwargs.pop("fbobjc_compiler_flags", []) + + FBOBJC_CXXFLAGS, + fbcode_compiler_flags_override = kwargs.pop("fbcode_compiler_flags", []), + fbandroid_compiler_flags = kwargs.pop("fbandroid_compiler_flags", []) + + FBANDROID_CXXFLAGS, + windows_msvc_compiler_flags_override = kwargs.pop("windows_msvc_compiler_flags_override", WINDOWS_MSVC_CXXFLAGS), + windows_preferred_linkage = "static", + visibility = kwargs.pop("visibility", ["PUBLIC"]), + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + feature = Infra_Networking_Core, + **kwargs + ) + +def mu_cxx_test( + name, + srcs, + raw_headers = [], + deps = []): + fb_xplat_cxx_test( + name = name, + srcs = srcs, + raw_headers = raw_headers, + include_directories = [ + "..", + ], + deps = deps, + platforms = (CXX,), + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + ) + +def mu_cxx_binary( + name, + srcs, + raw_headers = [], + deps = [], + **kwargs): + fb_xplat_cxx_binary( + name = name, + srcs = srcs, + raw_headers = raw_headers, + compiler_flags = kwargs.pop("compiler_flags", []) + CXXFLAGS, + include_directories = [ + "..", + ], + deps = deps, + contacts = ["oncall+traffic_protocols@xmail.facebook.com"], + platforms = (CXX,), + ) diff --git a/quic/dsr/BUCK b/quic/dsr/BUCK new file mode 100644 index 000000000..ce61853e7 --- /dev/null +++ b/quic/dsr/BUCK @@ -0,0 +1,25 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "types", + srcs = [ + "Types.cpp", + ], + headers = [ + "Types.h", + ], + exported_deps = [ + "//folly:network_address", + "//folly:optional", + "//quic/codec:types", + "//quic/server/state:server", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "dsr_packetization_request_sender", + headers = ["DSRPacketizationRequestSender.h"], +) diff --git a/quic/dsr/backend/BUCK b/quic/dsr/backend/BUCK new file mode 100644 index 000000000..8cd6d8703 --- /dev/null +++ b/quic/dsr/backend/BUCK @@ -0,0 +1,31 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "dsr_packetizer", + srcs = ["DSRPacketizer.cpp"], + headers = ["DSRPacketizer.h"], + deps = [ + "//quic/api:quic_batch_writer", + ], + exported_deps = [ + "//fizz/crypto/aead:aead", + "//fizz/protocol:factory", + "//fizz/protocol:openssl_factory", + "//fizz/protocol:protocol", + "//fizz/record:record", + "//folly:hash", + "//folly:network_address", + "//folly/container:evicting_cache_map", + "//folly/io/async:async_udp_socket", + "//quic/api:transport", + "//quic/codec:packet_number_cipher", + "//quic/codec:pktbuilder", + "//quic/codec:types", + "//quic/dsr:types", + "//quic/fizz/handshake:fizz_handshake", + "//quic/handshake:aead", + "//quic/xsk:xsk_container", + ], +) diff --git a/quic/dsr/backend/test/BUCK b/quic/dsr/backend/test/BUCK new file mode 100644 index 000000000..6c1f80ed6 --- /dev/null +++ b/quic/dsr/backend/test/BUCK @@ -0,0 +1,33 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "test_utils", + headers = [ + "TestUtils.h", + ], + exported_deps = [ + "//quic/dsr:types", + "//quic/dsr/backend:dsr_packetizer", + ], +) + +cpp_unittest( + name = "dsr_packetizer_test", + srcs = [ + "DSRPacketizerTest.cpp", + ], + deps = [ + ":test_utils", + "//folly/portability:gtest", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/dsr/backend:dsr_packetizer", + "//quic/dsr/frontend:write_functions", + "//quic/dsr/test:test_common", + ], +) diff --git a/quic/dsr/frontend/BUCK b/quic/dsr/frontend/BUCK new file mode 100644 index 000000000..909983bca --- /dev/null +++ b/quic/dsr/frontend/BUCK @@ -0,0 +1,74 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "write_codec", + srcs = [ + "WriteCodec.cpp", + ], + headers = [ + "WriteCodec.h", + ], + deps = [ + "//folly:optional", + ], + exported_deps = [ + ":packet_builder", + "//quic/dsr:types", + ], +) + +mvfst_cpp_library( + name = "packet_builder", + headers = [ + "PacketBuilder.h", + ], + exported_deps = [ + "//quic/codec:packet_number", + "//quic/codec:types", + "//quic/dsr:types", + ], +) + +mvfst_cpp_library( + name = "scheduler", + srcs = [ + "Scheduler.cpp", + ], + headers = [ + "Scheduler.h", + ], + deps = [ + ":write_codec", + "//quic/flowcontrol:flow_control", + "//quic/state:state_functions", + "//quic/state:stream_functions", + ], + exported_deps = [ + ":packet_builder", + "//quic/server/state:server", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "write_functions", + srcs = [ + "WriteFunctions.cpp", + ], + headers = [ + "WriteFunctions.h", + ], + deps = [ + "//folly:scope_guard", + ], + exported_deps = [ + ":scheduler", + "//quic/api:transport", + "//quic/codec:types", + "//quic/dsr:dsr_packetization_request_sender", + "//quic/handshake:aead", + "//quic/server/state:server", + ], +) diff --git a/quic/dsr/frontend/test/BUCK b/quic/dsr/frontend/test/BUCK new file mode 100644 index 000000000..d5718e17f --- /dev/null +++ b/quic/dsr/frontend/test/BUCK @@ -0,0 +1,79 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/dsr/frontend:packet_builder", + ], +) + +cpp_unittest( + name = "write_codec_test", + srcs = [ + "WriteCodecTest.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gtest", + "//quic:constants", + "//quic/common/test:test_utils", + "//quic/dsr/frontend:write_codec", + "//quic/dsr/test:test_common", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/handshake/test:mocks", + "//quic/server/state:server", + ], +) + +cpp_unittest( + name = "packet_builder_test", + srcs = [ + "PacketBuilderTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/dsr:types", + "//quic/dsr/frontend:packet_builder", + "//quic/dsr/test:test_common", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/handshake/test:mocks", + "//quic/server/state:server", + ], +) + +cpp_unittest( + name = "scheduler_test", + srcs = [ + "SchedulerTest.cpp", + ], + deps = [ + ":mocks", + "//folly/portability:gtest", + "//quic/dsr/frontend:scheduler", + "//quic/dsr/test:mocks", + "//quic/dsr/test:test_common", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + ], +) + +cpp_unittest( + name = "write_functions_test", + srcs = [ + "WriteFunctionsTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/dsr/frontend:write_functions", + "//quic/dsr/test:test_common", + "//quic/state/test:mocks", + ], +) diff --git a/quic/dsr/test/BUCK b/quic/dsr/test/BUCK new file mode 100644 index 000000000..1bffccf93 --- /dev/null +++ b/quic/dsr/test/BUCK @@ -0,0 +1,27 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/dsr:dsr_packetization_request_sender", + ], +) + +mvfst_cpp_library( + name = "test_common", + headers = ["TestCommon.h"], + exported_deps = [ + ":mocks", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/dsr/frontend:scheduler", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + ], +) diff --git a/quic/facebook/backbone_monitoring/BUCK b/quic/facebook/backbone_monitoring/BUCK new file mode 100644 index 000000000..c5caf1299 --- /dev/null +++ b/quic/facebook/backbone_monitoring/BUCK @@ -0,0 +1,42 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "ttld_marker", + srcs = [ + "TTLdMarker.cpp", + ], + headers = [ + "TTLdMarker.h", + ], + deps = [ + "//common/stats:thread_cached_service_data", + ], + exported_deps = [ + "//quic/api:transport", + "//quic/congestion_control:packet_processor", + ], +) + +mvfst_cpp_library( + name = "retransmits_scuba_reporter", + srcs = [ + "RetransmitsScubaReporter.cpp", + ], + headers = [ + "RetransmitsScubaReporter.h", + ], + deps = [ + "//common/base:build_info", + "//common/fbwhoami:fb_who_am_i", + "//common/network:util", + "//common/stats:thread_cached_service_data", + "//configerator/distribution/common:ProcessNameUtils", + "//justknobs:justknobs", + ], + exported_deps = [ + "//dsi/logger/configs/TcpRetransmitsAggregatorLoggerConfig:logger", + "//quic/api:transport", + ], +) diff --git a/quic/facebook/backbone_monitoring/test/BUCK b/quic/facebook/backbone_monitoring/test/BUCK new file mode 100644 index 000000000..01b4488af --- /dev/null +++ b/quic/facebook/backbone_monitoring/test/BUCK @@ -0,0 +1,34 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "TTLdMarkerTest", + srcs = [ + "TTLdMarkerTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/facebook/backbone_monitoring:ttld_marker", + ], +) + +cpp_unittest( + name = "RetransmitsScubaReporterTest", + srcs = [ + "RetransmitsScubaReporterTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/facebook/backbone_monitoring:retransmits_scuba_reporter", + ], +) diff --git a/quic/facebook/benchmarks/BUCK b/quic/facebook/benchmarks/BUCK new file mode 100644 index 000000000..2fe7cb62f --- /dev/null +++ b/quic/facebook/benchmarks/BUCK @@ -0,0 +1,41 @@ +load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark") + +oncall("traffic_protocols") + +cpp_benchmark( + name = "QuicInteger", + srcs = [ + "QuicIntegerBenchmark.cpp", + ], + deps = [ + "//common/init:init", + "//folly:benchmark", + "//folly/io:iobuf", + "//folly/lang:bits", + "//quic/codec:types", + ], +) + +cpp_benchmark( + name = "mvfst_benchmark", + srcs = ["MvfstBenchmark.cpp"], + headers = [], + deps = [ + "//folly:benchmark", + "//folly/experimental/coro:baton", + "//folly/experimental/coro:blocking_wait", + "//folly/experimental/coro:generator", + "//folly/init:init", + "//quic:constants", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + ], + external_deps = [ + "glog", + ], +) diff --git a/quic/facebook/fingerprint/BUCK b/quic/facebook/fingerprint/BUCK new file mode 100644 index 000000000..e030d55e4 --- /dev/null +++ b/quic/facebook/fingerprint/BUCK @@ -0,0 +1,17 @@ +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") + +cpp_library( + name = "quicfingerprint", + srcs = [ + "QuicFingerprint.cpp", + ], + headers = [ + "QuicFingerprint.h", + ], + deps = [ + ], + exported_deps = [ + "//proxygen/lib/http/session:quic_protocol_info", + "//quic/handshake:transport_parameters", + ], +) diff --git a/quic/facebook/fingerprint/test/BUCK b/quic/facebook/fingerprint/test/BUCK new file mode 100644 index 000000000..dc795f11f --- /dev/null +++ b/quic/facebook/fingerprint/test/BUCK @@ -0,0 +1,11 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +cpp_unittest( + name = "fingerprint_test", + srcs = ["QuicFingerprintTest.cpp"], + deps = [ + "//quic/codec:types", + "//quic/facebook/fingerprint:quicfingerprint", + "//quic/handshake:transport_parameters", + ], +) diff --git a/quic/facebook/fuzzers/BUCK b/quic/facebook/fuzzers/BUCK new file mode 100644 index 000000000..1d5bd301b --- /dev/null +++ b/quic/facebook/fuzzers/BUCK @@ -0,0 +1,165 @@ +load("@fbsource//xplat/security/lionhead:defs.bzl", "EXTERNAL_USERS", "Metadata", "Severity") +load("//security/lionhead/harnesses:defs.bzl", "cpp_lionhead_harness") + +oncall("traffic_protocols") + +cpp_lionhead_harness( + name = "mvfst_ParseFrameFuzzer", + srcs = ["ParseFrameFuzzer.cpp"], + ftest_name = ("mvfst", "ParseFrameFuzz"), + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_HIGH_PRI_TASK, + severity_service_takeover = Severity.FILE_HIGH_PRI_TASK, + ), + deps = [ + "fbsource//xplat/security/lionhead/utils/lib_ftest:lib", + "//folly/io:iobuf", + "//quic/codec:decode", + ], +) + +cpp_lionhead_harness( + name = "QuicReadCodecFuzzer", + srcs = ["QuicReadCodecFuzzer.cpp"], + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_HIGH_PRI_TASK, + severity_service_takeover = Severity.FILE_HIGH_PRI_TASK, + ), + deps = [ + "fbsource//xplat/security/lionhead:utils", + "//folly:singleton", + "//folly/init:init", + "//folly/io:iobuf", + "//quic/codec:codec", + ], +) + +cpp_lionhead_harness( + name = "QuicInitPacketTokenExtractorFuzzer", + srcs = ["QuicInitPacketTokenExtractorFuzzer.cpp"], + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_HIGH_PRI_TASK, + severity_service_takeover = Severity.FILE_HIGH_PRI_TASK, + ), + deps = [ + "fbsource//xplat/security/lionhead:utils", + "//folly:singleton", + "//folly/init:init", + "//folly/io:iobuf", + "//quic/facebook/utils:mvfst_quic_utils", + ], +) + +cpp_lionhead_harness( + name = "QuicHeaderCodecFuzzer", + srcs = ["QuicHeaderCodecFuzzer.cpp"], + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_HIGH_PRI_TASK, + severity_service_takeover = Severity.FILE_HIGH_PRI_TASK, + ), + deps = [ + "fbsource//xplat/security/lionhead:utils", + "//folly:singleton", + "//folly/init:init", + "//folly/io:iobuf", + "//quic/codec:header_codec", + ], +) + +cpp_lionhead_harness( + name = "mvfst_read_codec", + srcs = [ + "QuicReadCodecFuzzer.cpp", + ], + context_task = "T131981406", #TODO: This is a template task. Please create your own copy and insert meaningful context for this fuzzer. Otherwise, security engineers will not know how to handle security issues found by this harness. + disable_afl = True, + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_SECURITY_SEV, + severity_service_takeover = Severity.FILE_SECURITY_SEV, + ), + deps = [ + "fbsource//xplat/security/lionhead:utils", + "//folly:singleton", + "//folly/init:init", + "//folly/io:iobuf", + "//quic/codec:codec", + ], +) + +cpp_lionhead_harness( + name = "mvfst_server_transport", + srcs = [ + "ServerTransportFuzzer.cpp", + ], + context_task = "T131981406", #TODO: This is a template task. Please create your own copy and insert meaningful context for this fuzzer. Otherwise, security engineers will not know how to handle security issues found by this harness. + disable_afl = True, + ftest_name = ("QuicServerTransport", "basic_fuzzer"), + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_SECURITY_SEV, + severity_service_takeover = Severity.FILE_SECURITY_SEV, + ), + deps = [ + "fbsource//xplat/security/lionhead/utils/lib_ftest:lib", + "//fizz/crypto/aead/test:mocks", + "//fizz/facebook/fuzzer:fuzz_factory", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/handshake/test:mocks", + "//quic/server:server", + "//quic/server/state:server", + ], +) + +cpp_lionhead_harness( + name = "mvfst_server_transport_example_input", + srcs = [ + "ServerTransportFuzzer.cpp", + ], + context_task = "T131981406", #TODO: This is a template task. Please create your own copy and insert meaningful context for this fuzzer. Otherwise, security engineers will not know how to handle security issues found by this harness. + disable_afl = True, + ftest_name = ("QuicServerTransport", "example_based_fuzzer"), + metadata = Metadata( + exposure = EXTERNAL_USERS, + project = "oncall_traffic_protocols", + severity_denial_of_service = Severity.FILE_SECURITY_SEV, + severity_service_takeover = Severity.FILE_SECURITY_SEV, + ), + deps = [ + "fbsource//xplat/security/lionhead/utils/lib_ftest:lib", + "//fizz/crypto/aead/test:mocks", + "//fizz/facebook/fuzzer:fuzz_factory", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/codec:decode", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/handshake/test:mocks", + "//quic/server:server", + "//quic/server/state:server", + ], +) diff --git a/quic/facebook/jump_start/BUCK b/quic/facebook/jump_start/BUCK new file mode 100644 index 000000000..fb33a1ff2 --- /dev/null +++ b/quic/facebook/jump_start/BUCK @@ -0,0 +1,77 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "jump_starter", + srcs = [ + "JumpStarter.cpp", + ], + headers = [ + "JumpStarter.h", + ], + deps = [ + "//justknobs:justknobs", + "//quic/api:transport", + "//quic/congestion_control:bbr", + "//quic/congestion_control:bbr_bandwidth_sampler", + "//quic/congestion_control:bbr_rtt_sampler", + "//quic/congestion_control:cubic", + ], + exported_deps = [ + "//folly:cpp_attributes", + "//folly:network_address", + "//folly:optional", + "//folly:synchronized", + "//quic/congestion_control:congestion_controller_factory", + "//quic/state:quic_connection_stats", + ], +) + +mvfst_cpp_library( + name = "jump_starter_update_observer", + headers = [ + "JumpStarterUpdateObserver.h", + ], + exported_deps = [ + ":jump_starter", + "//quic/api:transport", + "//quic/observer:socket_observer_types", + ], +) + +mvfst_cpp_library( + name = "localized_jump_starter", + srcs = [ + "LocalizedJumpStarter.cpp", + ], + headers = [ + "LocalizedJumpStarter.h", + ], + modular_headers = False, + deps = [ + "//common/network:dc_info", + "//common/network:util", + "//common/stats:macros", + "//common/stats:thread_cached_service_data", + "//fb303:service_data", + ], + exported_deps = [ + ":jump_starter", + ], +) + +mvfst_cpp_library( + name = "file_qlogger_util", + srcs = [ + "FileQLoggerUtil.cpp", + ], + headers = [ + "FileQLoggerUtil.h", + ], + deps = [ + "//common/strings:string_util", + "//folly/portability:filesystem", + "//quic/logging:file_qlogger", + ], +) diff --git a/quic/facebook/jump_start/js/BUCK b/quic/facebook/jump_start/js/BUCK new file mode 100644 index 000000000..5ae86630d --- /dev/null +++ b/quic/facebook/jump_start/js/BUCK @@ -0,0 +1,121 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "client_stats", + srcs = [ + "ClientStats.cpp", + ], + headers = [ + "ClientStats.h", + ], + exported_deps = [ + "//quic:exception", + "//quic/client:client", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "client", + srcs = [ + "client.cpp", + ], + headers = [ + "client.h", + ], + deps = [ + "//proxygen/httpserver/samples/hq:fizz_context", + ], + exported_deps = [ + ":client_stats", + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/io/async:async_base", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:gflags", + "//folly/stats:histogram", + "//proxygen/lib/http:synchronized_quic_lrucache", + "//quic:constants", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + "//quic/common/events:highres_quic_timer", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/facebook/jump_start:localized_jump_starter", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/logging:file_qlogger", + "//quic/server:accept_observer", + "//quic/server:server", + ], + exported_external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "server", + srcs = [ + "server.cpp", + ], + headers = [ + "server.h", + ], + deps = [ + "//proxygen/httpserver/samples/hq:fizz_context", + ], + exported_deps = [ + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/io/async:async_base", + "//folly/portability:gflags", + "//folly/stats:histogram", + "//quic:constants", + "//quic/client:client", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/facebook/jump_start:jump_starter_update_observer", + "//quic/facebook/jump_start:localized_jump_starter", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/observer:socket_observer_types", + "//quic/server:accept_observer", + "//quic/server:server", + ], + exported_external_deps = [ + "glog", + ], +) + +cpp_binary( + name = "js", + srcs = [ + "main.cpp", + ], + headers = [ + ], + deps = [ + ":client", + ":server", + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/io/async:async_base", + "//folly/portability:gflags", + "//folly/stats:histogram", + "//quic:constants", + "//quic/client:client", + "//quic/common/test:test_utils", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + ], + external_deps = [ + "glog", + ], +) diff --git a/quic/facebook/jump_start/test/BUCK b/quic/facebook/jump_start/test/BUCK new file mode 100644 index 000000000..b05bfc760 --- /dev/null +++ b/quic/facebook/jump_start/test/BUCK @@ -0,0 +1,69 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "JumpStarterTest", + srcs = [ + "JumpStarterTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/api/test:test_quic_transport", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/congestion_control:cubic", + "//quic/facebook/jump_start:jump_starter", + "//quic/state:quic_state_machine", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "LocalizedJumpStarterTest", + srcs = [ + "LocalizedJumpStarterTest.cpp", + ], + deps = [ + "//common/network:util", + "//folly/portability:gtest", + "//quic/facebook/jump_start:localized_jump_starter", + "//quic/state:quic_state_machine", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "JumpStarterUpdateObserverTest", + srcs = [ + "JumpStarterUpdateObserverTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/api/test:test_quic_transport", + "//quic/common/events:folly_eventbase", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/facebook/jump_start:jump_starter_update_observer", + "//quic/state:quic_state_machine", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "FileQloggerUtilTest", + srcs = [ + "FileQloggerUtilTest.cpp", + ], + deps = [ + "//folly:file", + "//folly:format", + "//folly/portability:filesystem", + "//quic/facebook/jump_start:file_qlogger_util", + "//quic/logging:file_qlogger", + ], +) diff --git a/quic/facebook/mbed/BUCK b/quic/facebook/mbed/BUCK new file mode 100644 index 000000000..26a8beb71 --- /dev/null +++ b/quic/facebook/mbed/BUCK @@ -0,0 +1,96 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbsource//tools/build_defs:fb_xplat_cxx_library.bzl", "fb_xplat_cxx_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mbed_aead", + srcs = ["MbedAead.cpp"], + headers = [ + "MbedAead.h", + ], + exported_deps = [ + "fbsource//xplat/mobilenetwork/third-party/mbedtls:tls", # @manual + "//fizz/crypto/aead:cryptoutil", + "//quic/handshake:aead", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "mbed_packetnum_cipher", + srcs = [ + "MbedPacketNumCipher.cpp", + ], + headers = [ + "MbedPacketNumCipher.h", + ], + exported_deps = [ + "fbsource//xplat/mobilenetwork/third-party/mbedtls:tls", # @manual + ":mbed_aead", + "//quic/codec:packet_number_cipher", + ], +) + +mvfst_cpp_library( + name = "mbed_handshake", + srcs = [ + "MbedCryptoFactory.cpp", + ], + headers = [ + "MbedCryptoFactory.h", + ], + deps = [ + ":mbed_packetnum_cipher", + ], + exported_deps = [ + "fbsource//xplat/mobilenetwork/third-party/mbedtls:tls", # @manual + ":mbed_aead", + "//quic/handshake:handshake", + ], + external_deps = [ + "glog", + ], +) + +fb_xplat_cxx_library( + name = "mbed_client_handshake", + srcs = [ + "MbedClientHandshake.cpp", + ], + header_namespace = "quic/facebook/mbed", + exported_headers = [ + "MbedClientHandshake.h", + ], + compatible_with = ["ovr_config//os:linux"], + compiler_flags = ["-Wno-c++98-compat-pedantic"], + visibility = ["PUBLIC"], + deps = [ + "fbsource//xplat/mobilenetwork/third-party/mbedtls:tls", # @manual + ":mbed_handshake", + "//quic/client:cached_server_tp", + "//quic/client:client_extension", + "//quic/client:state_and_handshake", + "//quic/handshake:transport_parameters", + ], + exported_deps = [ + "fbsource//xplat/mobilenetwork:quiccommon", + "fbsource//xplat/mobilenetwork:tls_mbed", # @manual + ], +) + +fb_xplat_cxx_library( + name = "mbed_client_handshake_factory", + srcs = ["MbedClientHandshakeFactory.cpp"], + header_namespace = "quic/facebook/mbed", + exported_headers = ["MbedClientHandshakeFactory.h"], + compatible_with = ["ovr_config//os:linux"], + compiler_flags = ["-Wno-c++98-compat-pedantic"], + visibility = ["PUBLIC"], + deps = [ + ":mbed_client_handshake", + "//quic/client:state_and_handshake", + ], +) diff --git a/quic/facebook/mbed/test/BUCK b/quic/facebook/mbed/test/BUCK new file mode 100644 index 000000000..e74d6a7c1 --- /dev/null +++ b/quic/facebook/mbed/test/BUCK @@ -0,0 +1,64 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") +load("@fbsource//tools/build_defs:fb_xplat_cxx_test.bzl", "fb_xplat_cxx_test") +load("@fbsource//tools/build_defs:platform_defs.bzl", "CXX") + +oncall("traffic_protocols") + +cpp_unittest( + name = "aead", + srcs = ["Aead.cpp"], + supports_static_listing = False, + deps = [ + "//fizz/crypto/aead/test:test_util", + "//folly/portability:gtest", + "//quic/facebook/mbed:mbed_aead", + ], +) + +cpp_unittest( + name = "packetnum_cipher", + srcs = ["PacketNumCipher.cpp"], + supports_static_listing = False, + deps = [ + "//folly:random", + "//folly:string", + "//folly/portability:gtest", + "//quic/facebook/mbed:mbed_packetnum_cipher", + ], +) + +cpp_unittest( + name = "crypto_factory", + srcs = ["CryptoFactory.cpp"], + deps = [ + "//fizz/crypto/aead/test:test_util", + "//folly/portability:gtest", + "//quic/facebook/mbed:mbed_handshake", + "//quic/fizz/handshake:fizz_handshake", + ], +) + +fb_xplat_cxx_test( + name = "mbed_client_handshake", + srcs = ["MbedClientHandshake.cpp"], + headers = [], + header_namespace = "", + compatible_with = ["ovr_config//os:linux"], + compiler_flags = ["-Wno-c++98-compat-pedantic"], + platforms = [CXX], + deps = [ + "//fizz/crypto/aead/test:test_util", + "//fizz/record:record", + "//folly/executors:manual_executor", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/facebook/mbed:mbed_client_handshake", + "//quic/facebook/mbed:mbed_client_handshake_factory", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/handshake:server_extension", + "//quic/server/state:server", + ], +) diff --git a/quic/facebook/mu/connection/BUCK b/quic/facebook/mu/connection/BUCK new file mode 100644 index 000000000..2e4e8b08a --- /dev/null +++ b/quic/facebook/mu/connection/BUCK @@ -0,0 +1,13 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mu_connection", + srcs = [ + "MuConnection.cpp", + ], + headers = [ + "MuConnection.h", + ], +) diff --git a/quic/facebook/mu/sample/BUCK b/quic/facebook/mu/sample/BUCK new file mode 100644 index 000000000..f661d4a58 --- /dev/null +++ b/quic/facebook/mu/sample/BUCK @@ -0,0 +1,16 @@ +load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") + +oncall("traffic_protocols") + +cpp_binary( + name = "mu_sample", + srcs = [ + "MuSample.cpp", + ], + headers = [ + "MuSample.h", + ], + deps = [ + "//quic/facebook/mu/connection:mu_connection", + ], +) diff --git a/quic/facebook/tools/quicperf/BUCK b/quic/facebook/tools/quicperf/BUCK new file mode 100644 index 000000000..18c733b6d --- /dev/null +++ b/quic/facebook/tools/quicperf/BUCK @@ -0,0 +1,155 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") +load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native") + +oncall("traffic_protocols") + +cpp_binary( + name = "quicperf_client", + srcs = [ + "QuicPerfClient.cpp", + "QuicPerfCommonCmdFlags.cpp", + ], + headers = [ + "QuicPerfCommonCmdFlags.h", + ], + deps = [ + ":mns_client", + ":mvfst_client", # @manual + ":quicperf_client_funcs", + ":quicperf_utils", + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/portability:gflags", + "//quic:constants", + ], + external_deps = [ + "glog", + ], +) + +fb_native.configured_alias( + name = "quicperf_mobile_client", + actual = ":quicperf_client", + platform = "fbsource//xplat/mobilenetwork/platform:mvfst-mobile", +) + +cpp_binary( + name = "quicperf_server", + srcs = [ + "QuicPerfCommonCmdFlags.cpp", + "QuicPerfServer.cpp", + ], + headers = [ + "QuicPerfCommonCmdFlags.h", + ], + deps = [ + ":mvfst_quicperf_server", # @manual + ":quicperf_utils", + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/portability:gflags", + "//quic:constants", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "mvfst_quicperf_server", + srcs = [ + "MvfstQuicPerfServer.cpp", + ], + headers = [ + "MvfstQuicPerfServer.h", + ], + deps = [ + "//folly/io:iobuf", + "//quic/common/test:test_utils", + "//quic/congestion_control:server_congestion_controller_factory", + ], + exported_deps = [ + "//quic/server:accept_observer", + "//quic/server:server", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "mns_client", + srcs = [ + "MNSQuicPerfClient.cpp", + ], + headers = [ + "MNSQuicPerfClient.h", + ], + deps = [ + "//folly/lang:bits", + ], + exported_deps = [ + "fbsource//xplat/mobilenetwork:dnsresolver", + "fbsource//xplat/mobilenetwork:http_client", # @manual + ":quicperf_client_funcs", + ":quicperf_utils", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "mvfst_client", + srcs = [ + "MvfstQuicPerfClient.cpp", + ], + headers = [ + "MvfstQuicPerfClient.h", + ], + deps = [ + "//quic/common/events:highres_quic_timer", + "//quic/common/test:test_client_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + ], + exported_deps = [ + ":quicperf_client_funcs", + ":quicperf_utils", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "quicperf_client_funcs", + srcs = [ + "QuicPerfClientFunc.cpp", + ], + headers = [ + "QuicPerfClientFunc.h", + ], + exported_deps = [ + ":quicperf_utils", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "quicperf_utils", + headers = [ + "QuicPerfUtils.h", + ], + exported_deps = [ + "//folly:string", + "//folly/portability:time", + "//folly/stats:tdigest", + "//quic:constants", + ], +) diff --git a/quic/facebook/utils/BUCK b/quic/facebook/utils/BUCK new file mode 100644 index 000000000..6bba6b1d6 --- /dev/null +++ b/quic/facebook/utils/BUCK @@ -0,0 +1,20 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mvfst_quic_utils", + srcs = [ + "QuicPacketUtils.cpp", + ], + headers = [ + "QuicPacketUtils.h", + ], + deps = [ + "//quic/codec:codec", + ], + exported_deps = [ + "//folly/io:iobuf", + "//quic/codec:types", + ], +) diff --git a/quic/facebook/utils/test/BUCK b/quic/facebook/utils/test/BUCK new file mode 100644 index 000000000..c8cb40ce8 --- /dev/null +++ b/quic/facebook/utils/test/BUCK @@ -0,0 +1,19 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "QuicPacketUtilsTest", + srcs = [ + "QuicPacketUtilsTest.cpp", + ], + deps = [ + "//folly/io:iobuf", + "//folly/portability:gtest", + "//quic:exception", + "//quic/codec:codec", + "//quic/common/test:test_utils", + "//quic/facebook/utils:mvfst_quic_utils", + "//quic/fizz/handshake:fizz_handshake", + ], +) diff --git a/quic/fizz/client/handshake/BUCK b/quic/fizz/client/handshake/BUCK new file mode 100644 index 000000000..be16a1785 --- /dev/null +++ b/quic/fizz/client/handshake/BUCK @@ -0,0 +1,57 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "fizz_client_handshake", + srcs = [ + "FizzClientHandshake.cpp", + "FizzClientQuicHandshakeContext.cpp", + ], + headers = [ + "FizzClientExtensions.h", + "FizzClientHandshake.h", + "FizzClientQuicHandshakeContext.h", + ], + deps = [ + "//fizz/client:early_data_rejection", + "//fizz/client:ech_policy", + "//fizz/crypto/aead:evpcipher", + "//fizz/protocol:exporter", + "//fizz/protocol:protocol", + "//quic/codec:pktbuilder", + ], + exported_deps = [ + ":psk_cache", + "//fizz/client:client_extensions", + "//fizz/client:fizz_client_context", + "//fizz/client:protocol", + "//fizz/protocol:default_certificate_verifier", + "//quic/client:client_extension", + "//quic/client:state_and_handshake", + "//quic/fizz/handshake:fizz_handshake", + ], +) + +mvfst_cpp_library( + name = "psk_cache", + headers = [ + "QuicPskCache.h", + ], + exported_deps = [ + "//fizz/client:psk_cache", + "//folly:optional", + "//quic/client:cached_server_tp", + ], +) + +mvfst_cpp_library( + name = "token_cache", + headers = [ + "QuicTokenCache.h", + ], + exported_deps = [ + "//folly:optional", + "//folly:string", + ], +) diff --git a/quic/fizz/client/handshake/test/BUCK b/quic/fizz/client/handshake/test/BUCK new file mode 100644 index 000000000..b6e61118b --- /dev/null +++ b/quic/fizz/client/handshake/test/BUCK @@ -0,0 +1,57 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "fizz_client_handshake_test", + srcs = [ + "FizzClientHandshakeTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + ":mock_psk_cache", + "//fizz/client/test:mocks", + "//fizz/crypto/test:TestUtil", + "//fizz/protocol/clock/test:mock_clock", + "//fizz/protocol/ech:decrypter", + "//fizz/protocol/test:mocks", + "//fizz/server:protocol", + "//fizz/server/test:mocks", + "//folly:fbstring", + "//folly/io/async:scoped_event_base_thread", + "//folly/io/async:ssl_context", + "//folly/io/async/test:mocks", + "//quic/client:client_extension", + "//quic/client:state_and_handshake", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/handshake:fizz_handshake", + "//quic/state:quic_state_machine", + "//quic/state:stream_functions", + ], +) + +cpp_unittest( + name = "FizzClientExtensionsTest", + srcs = [ + "FizzClientExtensionsTest.cpp", + ], + deps = [ + "//fizz/protocol/test:test_messages", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + ], +) + +mvfst_cpp_library( + name = "mock_psk_cache", + headers = [ + "MockQuicPskCache.h", + ], + exported_deps = [ + "//folly:optional", + "//folly/portability:gmock", + "//quic/fizz/client/handshake:psk_cache", + ], +) diff --git a/quic/fizz/client/test/BUCK b/quic/fizz/client/test/BUCK new file mode 100644 index 000000000..4e393615c --- /dev/null +++ b/quic/fizz/client/test/BUCK @@ -0,0 +1,58 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "quic_client_transport_test_util", + headers = [ + "QuicClientTransportTestUtil.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api:transport", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "QuicClientTransportTest", + srcs = [ + "QuicClientTransportTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":quic_client_transport_test_util", + "//fizz/crypto/aead/test:mocks", + "//fizz/protocol/clock/test:mock_clock", + "//folly/futures:core", + "//folly/io:iobuf", + "//folly/io:socket_option_map", + "//folly/io/async:scoped_event_base_thread", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic:constants", + "//quic/common/events:folly_eventbase", + "//quic/common/events:highres_quic_timer", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:congestion_controller_factory", + "//quic/fizz/client/handshake/test:mock_psk_cache", + "//quic/fizz/handshake:fizz_handshake", + "//quic/handshake:transport_parameters", + "//quic/handshake/test:mocks", + "//quic/happyeyeballs:happyeyeballs", + "//quic/logging:file_qlogger", + "//quic/logging/test:mocks", + "//quic/samples/echo:echo_handler", + "//quic/server:server", + ], +) diff --git a/quic/fizz/handshake/BUCK b/quic/fizz/handshake/BUCK new file mode 100644 index 000000000..c7c80241c --- /dev/null +++ b/quic/fizz/handshake/BUCK @@ -0,0 +1,41 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "fizz_handshake", + srcs = [ + "FizzBridge.cpp", + "FizzCryptoFactory.cpp", + "FizzPacketNumberCipher.cpp", + "FizzRetryIntegrityTagGenerator.cpp", + "QuicFizzFactory.cpp", + ], + headers = [ + "FizzBridge.h", + "FizzCryptoFactory.h", + "FizzPacketNumberCipher.h", + "FizzRetryIntegrityTagGenerator.h", + "FizzTransportParameters.h", + "QuicFizzFactory.h", + ], + deps = [ + "//fizz/crypto:utils", + "//fizz/crypto/aead:evpcipher", + ], + exported_deps = [ + "//fizz/crypto/aead:aead", + "//fizz/protocol:openssl_factory", + "//fizz/protocol:types", + "//fizz/record:record", + "//folly/ssl:openssl_ptr_types", + "//quic:constants", + "//quic/codec:packet_number_cipher", + "//quic/codec:types", + "//quic/common:buf_util", + "//quic/handshake:aead", + "//quic/handshake:handshake", + "//quic/handshake:retry_integrity_tag_generator", + "//quic/handshake:transport_parameters", + ], +) diff --git a/quic/fizz/handshake/test/BUCK b/quic/fizz/handshake/test/BUCK new file mode 100644 index 000000000..c5ebaab0d --- /dev/null +++ b/quic/fizz/handshake/test/BUCK @@ -0,0 +1,46 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "FizzTransportParametersTest", + srcs = [ + "FizzTransportParametersTest.cpp", + ], + deps = [ + "//fizz/record/test:extension_tests_base", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/fizz/handshake:fizz_handshake", + ], +) + +cpp_unittest( + name = "FizzCryptoFactoryTest", + srcs = [ + "FizzCryptoFactoryTest.cpp", + ], + deps = [ + "//fizz/crypto/aead/test:mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/common/test:test_utils", + "//quic/fizz/handshake:fizz_handshake", + "//quic/handshake/test:mocks", + ], +) + +cpp_unittest( + name = "FizzPacketNumberCipherTest", + srcs = [ + "FizzPacketNumberCipherTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//fizz/record:record", + "//folly:string", + "//folly/portability:gtest", + "//quic/fizz/handshake:fizz_handshake", + ], +) diff --git a/quic/fizz/server/handshake/BUCK b/quic/fizz/server/handshake/BUCK new file mode 100644 index 000000000..130ce2567 --- /dev/null +++ b/quic/fizz/server/handshake/BUCK @@ -0,0 +1,46 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "fizz_server_handshake", + srcs = [ + "FizzServerHandshake.cpp", + "FizzServerQuicHandshakeContext.cpp", + ], + headers = [ + "FizzServerHandshake.h", + "FizzServerQuicHandshakeContext.h", + ], + deps = [ + ":handshake_app_token", + "//fizz/protocol:protocol", + "//quic/server/state:server", + ], + exported_deps = [ + "//fizz/server:fizz_server_context", + "//fizz/server:protocol", + "//quic/common:circular_deque", + "//quic/fizz/handshake:fizz_handshake", + "//quic/server/handshake:server_handshake", + ], +) + +mvfst_cpp_library( + name = "handshake_app_token", + srcs = [ + "AppToken.cpp", + ], + headers = [ + "AppToken.h", + ], + deps = [ + "//fizz/server:protocol", + "//quic/fizz/handshake:fizz_handshake", + ], + exported_deps = [ + "//fizz/record:record", + "//folly:optional", + "//quic/server/handshake:app_token", + ], +) diff --git a/quic/flowcontrol/BUCK b/quic/flowcontrol/BUCK new file mode 100644 index 000000000..1bbd4af1d --- /dev/null +++ b/quic/flowcontrol/BUCK @@ -0,0 +1,20 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "flow_control", + srcs = [ + "QuicFlowController.cpp", + ], + headers = ["QuicFlowController.h"], + deps = [ + "//quic:constants", + "//quic:exception", + "//quic/logging:qlogger", + ], + exported_deps = [ + "//quic/codec:types", + "//quic/state:quic_state_machine", + ], +) diff --git a/quic/flowcontrol/test/BUCK b/quic/flowcontrol/test/BUCK new file mode 100644 index 000000000..5b69437cb --- /dev/null +++ b/quic/flowcontrol/test/BUCK @@ -0,0 +1,17 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "QuicFlowControlTest", + srcs = [ + "QuicFlowControlTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//quic/client:state_and_handshake", + "//quic/common/test:test_utils", + "//quic/flowcontrol:flow_control", + "//quic/state/test:mocks", + ], +) diff --git a/quic/handshake/BUCK b/quic/handshake/BUCK new file mode 100644 index 000000000..4bcae6d13 --- /dev/null +++ b/quic/handshake/BUCK @@ -0,0 +1,62 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "aead", + headers = [ + "Aead.h", + ], + exported_deps = [ + "//folly:optional", + "//folly/io:iobuf", + ], +) + +mvfst_cpp_library( + name = "handshake", + srcs = [ + "CryptoFactory.cpp", + "HandshakeLayer.cpp", + ], + headers = [ + "CryptoFactory.h", + "HandshakeLayer.h", + ], + exported_deps = [ + ":aead", + "//quic:constants", + "//quic/codec:packet_number_cipher", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "transport_parameters", + srcs = [ + "TransportParameters.cpp", + ], + headers = [ + "TransportParameters.h", + ], + deps = [ + "//quic/common:buf_util", + "//quic/state:quic_state_machine", + ], + exported_deps = [ + "//quic:constants", + "//quic:exception", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "retry_integrity_tag_generator", + headers = [ + "RetryIntegrityTagGenerator.h", + ], + exported_deps = [ + "//folly/io:iobuf", + "//quic:constants", + ], +) diff --git a/quic/handshake/test/BUCK b/quic/handshake/test/BUCK new file mode 100644 index 000000000..3df9bd814 --- /dev/null +++ b/quic/handshake/test/BUCK @@ -0,0 +1,17 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/codec:packet_number_cipher", + "//quic/fizz/handshake:fizz_handshake", + "//quic/handshake:aead", + "//quic/handshake:handshake", + ], +) diff --git a/quic/happyeyeballs/BUCK b/quic/happyeyeballs/BUCK new file mode 100644 index 000000000..f24eb62e1 --- /dev/null +++ b/quic/happyeyeballs/BUCK @@ -0,0 +1,27 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "happyeyeballs", + srcs = [ + "QuicHappyEyeballsFunctions.cpp", + ], + headers = [ + "QuicHappyEyeballsFunctions.h", + ], + deps = [ + "//common/network:mvfst_hooks", # @manual + "//folly:network_address", + "//folly/portability:sockets", + "//quic/common:socket_util", + "//quic/state:quic_state_machine", + ], + exported_deps = [ + "//folly/io:socket_option_map", + "//folly/net:net_ops", + "//quic/client:state_and_handshake", + "//quic/common/events:eventbase", + "//quic/common/udpsocket:quic_async_udp_socket", + ], +) diff --git a/quic/logging/BUCK b/quic/logging/BUCK new file mode 100644 index 000000000..f601492b5 --- /dev/null +++ b/quic/logging/BUCK @@ -0,0 +1,71 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "qlogger_constants", + srcs = [ + "QLoggerConstants.cpp", + ], + headers = [ + "QLoggerConstants.h", + ], + exported_deps = [ + "//folly:string", + "//quic:constants", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "qlogger", + srcs = [ + "QLogger.cpp", + ], + headers = [ + "QLogger.h", + ], + exported_deps = [ + ":qlogger_constants", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "base_qlogger", + srcs = [ + "BaseQLogger.cpp", + "QLoggerTypes.cpp", + ], + headers = [ + "BaseQLogger.h", + "QLoggerTypes.h", + ], + deps = [ + "//quic:exception", + ], + exported_deps = [ + ":qlogger", + ":qlogger_constants", + "//folly/json:dynamic", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "file_qlogger", + srcs = [ + "FileQLogger.cpp", + ], + headers = [ + "FileQLogger.h", + ], + exported_deps = [ + ":base_qlogger", + ":qlogger_constants", + "//folly/compression:compression", + "//folly/json:dynamic", + "//folly/logging:logging", + "//quic/codec:types", + ], +) diff --git a/quic/logging/test/BUCK b/quic/logging/test/BUCK new file mode 100644 index 000000000..ea1c2af1e --- /dev/null +++ b/quic/logging/test/BUCK @@ -0,0 +1,32 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/logging:qlogger", + ], +) + +cpp_unittest( + name = "QLoggerTest", + srcs = [ + "QLoggerTest.cpp", + ], + deps = [ + "//folly:file_util", + "//folly:random", + "//folly/json:dynamic", + "//folly/portability:filesystem", + "//quic/common/test:test_utils", + "//quic/congestion_control:bbr", + "//quic/logging:file_qlogger", + "//quic/logging:qlogger", + ], +) diff --git a/quic/loss/BUCK b/quic/loss/BUCK new file mode 100644 index 000000000..faf35676e --- /dev/null +++ b/quic/loss/BUCK @@ -0,0 +1,31 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "loss", + srcs = [ + "QuicLossFunctions.cpp", + ], + headers = [ + "QuicLossFunctions.h", + ], + deps = [ + "//folly:small_vector", + "//quic/state:stream_functions", + ], + exported_deps = [ + "//folly:chrono", + "//folly:optional", + "//quic:constants", + "//quic/codec:types", + "//quic/common:time_util", + "//quic/congestion_control:congestion_controller", + "//quic/flowcontrol:flow_control", + "//quic/logging:qlogger_constants", + "//quic/observer:socket_observer_types", + "//quic/state:quic_state_machine", + "//quic/state:simple_frame_functions", + "//quic/state:state_functions", + ], +) diff --git a/quic/loss/test/BUCK b/quic/loss/test/BUCK new file mode 100644 index 000000000..e6bbfd92d --- /dev/null +++ b/quic/loss/test/BUCK @@ -0,0 +1,33 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "QuicLossFunctionsTest", + srcs = [ + "QuicLossFunctionsTest.cpp", + ], + supports_static_listing = False, + deps = [ + "//folly/io/async/test:mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api:transport", + "//quic/api/test:mocks", + "//quic/client:state_and_handshake", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/dsr:types", + "//quic/dsr/test:mocks", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/logging/test:mocks", + "//quic/loss:loss", + "//quic/server/state:server", + "//quic/state:ack_event", + "//quic/state/stream:stream", + "//quic/state/test:mocks", + ], +) diff --git a/quic/observer/BUCK b/quic/observer/BUCK new file mode 100644 index 000000000..d76a70fd8 --- /dev/null +++ b/quic/observer/BUCK @@ -0,0 +1,35 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "socket_observer_container", + headers = ["SocketObserverContainer.h"], + exported_deps = [ + ":socket_observer_interface", + "//folly:observer_container", + ], +) + +mvfst_cpp_library( + name = "socket_observer_interface", + srcs = [ + "SocketObserverInterface.cpp", + ], + headers = ["SocketObserverInterface.h"], + exported_deps = [ + "//quic:exception", + "//quic/common:small_collections", + "//quic/state:ack_event", + "//quic/state:outstanding_packet", + "//quic/state:quic_stream_utilities", + ], +) + +mvfst_cpp_library( + name = "socket_observer_types", + headers = ["SocketObserverTypes.h"], + exported_deps = [ + ":socket_observer_container", + ], +) diff --git a/quic/observer/test/BUCK b/quic/observer/test/BUCK new file mode 100644 index 000000000..786a4ae4e --- /dev/null +++ b/quic/observer/test/BUCK @@ -0,0 +1,16 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "SocketObserverInterfaceTest", + srcs = [ + "SocketObserverInterfaceTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//quic/common/test:test_packet_builders", + "//quic/common/test:test_utils", + "//quic/observer:socket_observer_interface", + ], +) diff --git a/quic/samples/echo/BUCK b/quic/samples/echo/BUCK new file mode 100644 index 000000000..8452a5532 --- /dev/null +++ b/quic/samples/echo/BUCK @@ -0,0 +1,52 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "echo_handler", + headers = [ + "EchoClient.h", + "EchoHandler.h", + "EchoServer.h", + "EchoTransportServer.h", + "LogQuicStats.h", + ], + exported_deps = [ + "//folly:synchronized", + "//folly/fibers:core", + "//folly/io/async:scoped_event_base_thread", + "//quic:constants", + "//quic:exception", + "//quic/api:transport", + "//quic/client:client", + "//quic/codec:types", + "//quic/common:buf_util", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + "//quic/state:stats_callback", + ], + exported_external_deps = [ + "glog", + ], +) + +cpp_binary( + name = "echo", + srcs = [ + "main.cpp", + ], + deps = [ + ":echo_handler", + "//fizz/crypto:utils", + "//folly/init:init", + "//folly/portability:gflags", + ], + external_deps = [ + "glog", + ], +) diff --git a/quic/server/BUCK b/quic/server/BUCK new file mode 100644 index 000000000..1e7251db4 --- /dev/null +++ b/quic/server/BUCK @@ -0,0 +1,112 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "accept_observer", + headers = [ + "AcceptObserver.h", + ], +) + +mvfst_cpp_library( + name = "server", + srcs = [ + "QuicServer.cpp", + "QuicServerBackendIoUring.cpp", + "QuicServerPacketRouter.cpp", + "QuicServerTransport.cpp", + "QuicServerWorker.cpp", + ], + headers = [ + "QuicReusePortUDPSocketFactory.h", + "QuicServer.h", + "QuicServerPacketRouter.h", + "QuicServerTransport.h", + "QuicServerTransportFactory.h", + "QuicServerWorker.h", + "QuicSharedUDPSocketFactory.h", + "QuicUDPSocketFactory.h", + ], + deps = [ + "fbsource//third-party/fmt:fmt", + ":accept_observer", + "//common/network:mvfst_hooks", # @manual + "//folly:conv", + "//folly:optional", + "//folly/chrono:conv", + "//folly/experimental/io:io_uring_backend", + "//folly/io:iobuf", + "//folly/io/async:event_base_manager", + "//folly/portability:gflags", + "//folly/system:thread_id", + "//quic/codec:header_codec", + "//quic/common:socket_util", + "//quic/congestion_control:bbr", + "//quic/congestion_control:copa", + "//quic/dsr/frontend:write_functions", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/handshake:app_token", + "//quic/server/handshake:default_app_token_validator", + "//quic/server/handshake:stateless_reset_generator", + "//quic/server/handshake:token_generator", + "//quic/server/third-party:siphash", + "//quic/state:transport_settings_functions", + ], + exported_deps = [ + ":rate_limiter", + "//fizz/record:record", + "//fizz/server:fizz_server_context", + "//folly:random", + "//folly:small_vector", + "//folly:thread_local", + "//folly/container:evicting_cache_map", + "//folly/container:f14_hash", + "//folly/io:socket_option_map", + "//folly/io/async:async_base", + "//folly/io/async:async_transport_certificate", + "//folly/io/async:async_udp_socket", + "//folly/io/async:scoped_event_base_thread", + "//quic:constants", + "//quic/api:transport", + "//quic/codec:types", + "//quic/common:buf_accessor", + "//quic/common:transport_knobs", + "//quic/common/events:folly_eventbase", + "//quic/common/events:highres_quic_timer", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:congestion_controller_factory", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/server/handshake:server_extension", + "//quic/server/state:server", + "//quic/server/state:server_connection_id_rejector", + "//quic/state:quic_connection_stats", + "//quic/state:stats_callback", + ], +) + +mvfst_cpp_library( + name = "rate_limiter", + srcs = ["SlidingWindowRateLimiter.cpp"], + headers = [ + "RateLimiter.h", + "SlidingWindowRateLimiter.h", + ], + exported_deps = [ + "//folly:optional", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "quic_handshake_socket_holder", + srcs = [], + headers = [ + "QuicHandshakeSocketHolder.h", + ], + exported_deps = [ + ":server", + "//quic/api:transport", + ], +) diff --git a/quic/server/async_tran/BUCK b/quic/server/async_tran/BUCK new file mode 100644 index 000000000..2c8db9360 --- /dev/null +++ b/quic/server/async_tran/BUCK @@ -0,0 +1,26 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "server_async_transport", + srcs = [ + "QuicAsyncTransportAcceptor.cpp", + "QuicAsyncTransportServer.cpp", + "QuicServerAsyncTransport.cpp", + ], + headers = [ + "QuicAsyncTransportAcceptor.h", + "QuicAsyncTransportServer.h", + "QuicServerAsyncTransport.h", + ], + deps = [ + "//folly:conv", + ], + exported_deps = [ + "//folly/io/async:async_transport", + "//folly/io/async:scoped_event_base_thread", + "//quic/api:stream_async_transport", + "//quic/server:server", + ], +) diff --git a/quic/server/async_tran/test/BUCK b/quic/server/async_tran/test/BUCK new file mode 100644 index 000000000..5f5d58706 --- /dev/null +++ b/quic/server/async_tran/test/BUCK @@ -0,0 +1,26 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "QuicAsyncTransportServerTest", + srcs = [ + "QuicAsyncTransportServerTest.cpp", + ], + deps = [ + "//folly/futures:core", + "//folly/io/async:async_transport", + "//folly/io/async/test:mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/client:client_async_transport", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + "//quic/server/async_tran:server_async_transport", + "//quic/server/test:mocks", + ], +) diff --git a/quic/server/handshake/BUCK b/quic/server/handshake/BUCK new file mode 100644 index 000000000..f7758b582 --- /dev/null +++ b/quic/server/handshake/BUCK @@ -0,0 +1,122 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "server_handshake", + srcs = [ + "ServerHandshake.cpp", + ], + headers = [ + "ServerHandshake.h", + "ServerHandshakeFactory.h", + ], + deps = [ + "//quic/fizz/handshake:fizz_handshake", + "//quic/state:stream_functions", + ], + exported_deps = [ + ":app_token", + ":server_extension", + "//fizz/protocol:default_certificate_verifier", + "//fizz/server:fizz_server", + "//fizz/server:fizz_server_context", + "//folly/io:iobuf", + "//folly/io/async:delayed_destruction", + "//quic:constants", + "//quic:exception", + "//quic/handshake:handshake", + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "server_extension", + headers = [ + "ServerTransportParametersExtension.h", + ], + exported_deps = [ + ":stateless_reset_generator", + "//fizz/server:server_extensions", + "//quic/fizz/handshake:fizz_handshake", + ], +) + +mvfst_cpp_library( + name = "app_token", + srcs = [ + "AppToken.cpp", + ], + headers = [ + "AppToken.h", + ], + exported_deps = [ + "//quic:constants", + "//quic/handshake:transport_parameters", + ], +) + +mvfst_cpp_library( + name = "default_app_token_validator", + srcs = [ + "DefaultAppTokenValidator.cpp", + ], + headers = [ + "DefaultAppTokenValidator.h", + ], + deps = [ + "//fizz/server:resumption_state", + "//folly:network_address", + "//quic:constants", + "//quic/api:transport", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/handshake:transport_parameters", + "//quic/server/state:server", + ], + exported_deps = [ + "//fizz/server:protocol", + "//folly:function", + "//folly:optional", + "//folly/io:iobuf", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "stateless_reset_generator", + srcs = [ + "StatelessResetGenerator.cpp", + ], + headers = [ + "StatelessResetGenerator.h", + ], + deps = [ + "//folly:range", + ], + exported_deps = [ + "//fizz/crypto:hkdf", + "//fizz/crypto:hmac_sha256", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "token_generator", + srcs = [ + "TokenGenerator.cpp", + ], + headers = [ + "TokenGenerator.h", + ], + deps = [ + "//folly:range", + "//quic/codec:decode", + ], + exported_deps = [ + "//fizz/server:aead_token_cipher", + "//folly/io:iobuf", + "//quic/codec:types", + ], +) diff --git a/quic/server/handshake/test/BUCK b/quic/server/handshake/test/BUCK new file mode 100644 index 000000000..87f77576b --- /dev/null +++ b/quic/server/handshake/test/BUCK @@ -0,0 +1,103 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "ServerHandshakeTest", + srcs = [ + "ServerHandshakeTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//fizz/client/test:mocks", + "//fizz/crypto/test:TestUtil", + "//fizz/protocol/clock/test:mock_clock", + "//fizz/protocol/test:mocks", + "//fizz/server/test:mocks", + "//folly/io/async:scoped_event_base_thread", + "//folly/io/async:ssl_context", + "//folly/io/async/test:mocks", + "//quic:constants", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/handshake:handshake", + "//quic/server/handshake:app_token", + "//quic/server/handshake:server_handshake", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "ServerTransportParametersTest", + srcs = [ + "ServerTransportParametersTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//fizz/protocol/test:test_messages", + "//quic:constants", + "//quic/common/test:test_utils", + "//quic/server/handshake:server_extension", + ], +) + +cpp_unittest( + name = "AppTokenTest", + srcs = [ + "AppTokenTest.cpp", + ], + deps = [ + "//fizz/server:resumption_state", + "//folly:optional", + "//quic:constants", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/server/state:server", + ], +) + +cpp_unittest( + name = "DefaultAppTokenValidatorTest", + srcs = [ + "DefaultAppTokenValidatorTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//fizz/server:resumption_state", + "//folly:optional", + "//quic:constants", + "//quic/api/test:mocks", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/server/handshake:default_app_token_validator", + "//quic/server/state:server", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "StatelessResetGeneratorTest", + srcs = [ + "StatelessResetGeneratorTest.cpp", + ], + deps = [ + "//folly:network_address", + "//folly:random", + "//folly/portability:gtest", + "//quic/server/handshake:stateless_reset_generator", + ], +) + +cpp_unittest( + name = "RetryTokenGeneratorTest", + srcs = [ + "RetryTokenGeneratorTest.cpp", + ], + deps = [ + "//folly:random", + "//folly/portability:gtest", + "//quic/server/handshake:token_generator", + ], +) diff --git a/quic/server/state/BUCK b/quic/server/state/BUCK new file mode 100644 index 000000000..820680df4 --- /dev/null +++ b/quic/server/state/BUCK @@ -0,0 +1,61 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "server_connection_id_rejector", + headers = [ + "ServerConnectionIdRejector.h", + ], + exported_deps = [ + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "server", + srcs = [ + "ServerStateMachine.cpp", + ], + headers = [ + "ServerStateMachine.h", + ], + deps = [ + "//quic/api:transport", + "//quic/common:buf_util", + "//quic/congestion_control:pacer", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:handshake_app_token", + "//quic/handshake:transport_parameters", + "//quic/logging:qlogger_constants", + "//quic/server/handshake:token_generator", + "//quic/state:datagram_handler", + "//quic/state:pacing_functions", + "//quic/state:stats_callback", + "//quic/state/stream:stream", + ], + exported_deps = [ + ":server_connection_id_rejector", + "//folly:exception_wrapper", + "//folly:network_address", + "//folly:overload", + "//folly:random", + "//folly/io/async:async_socket_exception", + "//quic:exception", + "//quic/codec:types", + "//quic/common:network_data", + "//quic/congestion_control:congestion_controller_factory", + "//quic/congestion_control:cubic", + "//quic/flowcontrol:flow_control", + "//quic/loss:loss", + "//quic/server/handshake:server_handshake", + "//quic/state:ack_handler", + "//quic/state:quic_state_machine", + "//quic/state:simple_frame_functions", + "//quic/state:state_functions", + "//quic/state:stream_functions", + ], + exported_external_deps = [ + "glog", + ], +) diff --git a/quic/server/test/BUCK b/quic/server/test/BUCK new file mode 100644 index 000000000..235116d66 --- /dev/null +++ b/quic/server/test/BUCK @@ -0,0 +1,146 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/server:server", + "//quic/server/state:server_connection_id_rejector", + ], +) + +cpp_unittest( + name = "QuicServerTest", + srcs = [ + "QuicServerTest.cpp", + "QuicSocketTest.cpp", + ], + deps = [ + ":mocks", + "//folly/futures:core", + "//folly/io:iobuf", + "//folly/io/async:async_base", + "//folly/io/async/test:mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api:transport", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/codec:header_codec", + "//quic/codec:types", + "//quic/codec/test:mocks", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/handshake:fizz_handshake", + "//quic/samples/echo:echo_handler", + "//quic/server:accept_observer", + "//quic/server:rate_limiter", + "//quic/server:server", + "//quic/server/handshake:stateless_reset_generator", + "//quic/server/handshake:token_generator", + "//quic/state/test:mocks", + ], +) + +mvfst_cpp_library( + name = "quic_server_transport_test_util", + headers = [ + "QuicServerTransportTestUtil.h", + ], + exported_deps = [ + "fbsource//third-party/googletest:gmock", + "fbsource//third-party/googletest:gtest", + ":mocks", + "//quic/api:transport", + "//quic/api/test:mocks", + "//quic/codec:types", + "//quic/common:transport_knobs", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/common/testutil:mock_async_udp_socket", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server:server", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "QuicServerTransportTest", + srcs = [ + "QuicServerTransportTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":quic_server_transport_test_util", + "//quic/codec:pktbuilder", + "//quic/common:transport_knobs", + "//quic/dsr:types", + "//quic/dsr/test:mocks", + "//quic/fizz/handshake:fizz_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/logging:file_qlogger", + "//quic/server/handshake:server_handshake", + "//quic/state:stream_functions", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "ServerStateMachineTest", + srcs = [ + "ServerStateMachineTest.cpp", + ], + supports_static_listing = False, + deps = [ + ":mocks", + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/codec:types", + "//quic/codec/test:mocks", + "//quic/common/test:test_utils", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state/test:mocks", + ], +) + +cpp_unittest( + name = "SlidingWindowRateLimiterTest", + srcs = [ + "SlidingWindowRateLimiterTest.cpp", + ], + deps = [ + "//quic/server:rate_limiter", + ], +) + +cpp_unittest( + name = "QuicClientServerIntegrationTest", + srcs = [ + "QuicClientServerIntegrationTest.cpp", + ], + deps = [ + "//folly/portability:gmock", + "//folly/portability:gtest", + "//quic/api/test:mocks", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:server", + ], +) diff --git a/quic/server/third-party/BUCK b/quic/server/third-party/BUCK new file mode 100644 index 000000000..fbede25ae --- /dev/null +++ b/quic/server/third-party/BUCK @@ -0,0 +1,8 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "siphash", + headers = ["siphash.h"], +) diff --git a/quic/somerge_defs.bzl b/quic/somerge_defs.bzl new file mode 100644 index 000000000..f2d83e15e --- /dev/null +++ b/quic/somerge_defs.bzl @@ -0,0 +1,192 @@ +"""Native library merge map for quic. + +Generated by xplat/cross_plat_devx/somerge_maps/compute_merge_maps.py + +@generated SignedSource<> +""" + +# Entry Points: +# //xplat/quic:fb-quic +QUIC_NATIVE_LIBRARY_MERGE_MAP = [ + "//xplat/quic/api:loop_detector_callbackAndroid", + "//xplat/quic/api:loop_detector_callbackAndroidAndroid", + "//xplat/quic/api:quic_batch_writerAndroid", + "//xplat/quic/api:quic_batch_writerAndroidAndroid", + "//xplat/quic/api:transportAndroid", + "//xplat/quic/api:transportAndroidAndroid", + "//xplat/quic/client:cached_server_tpAndroid", + "//xplat/quic/client:cached_server_tpAndroidAndroid", + "//xplat/quic/client:clientAndroid", + "//xplat/quic/client:clientAndroidAndroid", + "//xplat/quic/client:client_extensionAndroid", + "//xplat/quic/client:client_extensionAndroidAndroid", + "//xplat/quic/client:state_and_handshakeAndroid", + "//xplat/quic/client:state_and_handshakeAndroidAndroid", + "//xplat/quic/codec:codecAndroid", + "//xplat/quic/codec:codecAndroidAndroid", + "//xplat/quic/codec:decodeAndroid", + "//xplat/quic/codec:decodeAndroidAndroid", + "//xplat/quic/codec:packet_numberAndroid", + "//xplat/quic/codec:packet_numberAndroidAndroid", + "//xplat/quic/codec:packet_number_cipherAndroid", + "//xplat/quic/codec:packet_number_cipherAndroidAndroid", + "//xplat/quic/codec:pktbuilderAndroid", + "//xplat/quic/codec:pktbuilderAndroidAndroid", + "//xplat/quic/codec:pktrebuilderAndroid", + "//xplat/quic/codec:pktrebuilderAndroidAndroid", + "//xplat/quic/codec:typesAndroid", + "//xplat/quic/codec:typesAndroidAndroid", + "//xplat/quic/common/events:eventbaseAndroid", + "//xplat/quic/common/events:eventbaseAndroidAndroid", + "//xplat/quic/common/events:folly_eventbaseAndroid", + "//xplat/quic/common/events:folly_eventbaseAndroidAndroid", + "//xplat/quic/common/events:highres_quic_timerAndroid", + "//xplat/quic/common/events:highres_quic_timerAndroidAndroid", + "//xplat/quic/common/events:quic_timerAndroid", + "//xplat/quic/common/events:quic_timerAndroidAndroid", + "//xplat/quic/common/third-party:better_enumsAndroid", + "//xplat/quic/common/third-party:better_enumsAndroidAndroid", + "//xplat/quic/common/udpsocket:folly_async_udp_socketAndroid", + "//xplat/quic/common/udpsocket:folly_async_udp_socketAndroidAndroid", + "//xplat/quic/common/udpsocket:quic_async_udp_socketAndroid", + "//xplat/quic/common/udpsocket:quic_async_udp_socketAndroidAndroid", + "//xplat/quic/common/udpsocket:quic_async_udp_socket_implAndroid", + "//xplat/quic/common/udpsocket:quic_async_udp_socket_implAndroidAndroid", + "//xplat/quic/common:buf_accessorAndroid", + "//xplat/quic/common:buf_accessorAndroidAndroid", + "//xplat/quic/common:buf_utilAndroid", + "//xplat/quic/common:buf_utilAndroidAndroid", + "//xplat/quic/common:circular_dequeAndroid", + "//xplat/quic/common:circular_dequeAndroidAndroid", + "//xplat/quic/common:enum_arrayAndroid", + "//xplat/quic/common:enum_arrayAndroidAndroid", + "//xplat/quic/common:interval_setAndroid", + "//xplat/quic/common:interval_setAndroidAndroid", + "//xplat/quic/common:looperAndroid", + "//xplat/quic/common:looperAndroidAndroid", + "//xplat/quic/common:network_dataAndroid", + "//xplat/quic/common:network_dataAndroidAndroid", + "//xplat/quic/common:small_collectionsAndroid", + "//xplat/quic/common:small_collectionsAndroidAndroid", + "//xplat/quic/common:socket_utilAndroid", + "//xplat/quic/common:socket_utilAndroidAndroid", + "//xplat/quic/common:time_pointsAndroid", + "//xplat/quic/common:time_pointsAndroidAndroid", + "//xplat/quic/common:time_utilAndroid", + "//xplat/quic/common:time_utilAndroidAndroid", + "//xplat/quic/common:variantAndroid", + "//xplat/quic/common:variantAndroidAndroid", + "//xplat/quic/congestion_control/third_party:chromium_windowed_filterAndroid", + "//xplat/quic/congestion_control/third_party:chromium_windowed_filterAndroidAndroid", + "//xplat/quic/congestion_control:bandwidthAndroid", + "//xplat/quic/congestion_control:bandwidthAndroidAndroid", + "//xplat/quic/congestion_control:bbrAndroid", + "//xplat/quic/congestion_control:bbr2Android", + "//xplat/quic/congestion_control:bbr2AndroidAndroid", + "//xplat/quic/congestion_control:bbrAndroidAndroid", + "//xplat/quic/congestion_control:bbr_bandwidth_samplerAndroid", + "//xplat/quic/congestion_control:bbr_bandwidth_samplerAndroidAndroid", + "//xplat/quic/congestion_control:bbr_rtt_samplerAndroid", + "//xplat/quic/congestion_control:bbr_rtt_samplerAndroidAndroid", + "//xplat/quic/congestion_control:congestion_control_functionsAndroid", + "//xplat/quic/congestion_control:congestion_control_functionsAndroidAndroid", + "//xplat/quic/congestion_control:congestion_controllerAndroid", + "//xplat/quic/congestion_control:congestion_controllerAndroidAndroid", + "//xplat/quic/congestion_control:congestion_controller_factoryAndroid", + "//xplat/quic/congestion_control:congestion_controller_factoryAndroidAndroid", + "//xplat/quic/congestion_control:copaAndroid", + "//xplat/quic/congestion_control:copa2Android", + "//xplat/quic/congestion_control:copa2AndroidAndroid", + "//xplat/quic/congestion_control:copaAndroidAndroid", + "//xplat/quic/congestion_control:cubicAndroid", + "//xplat/quic/congestion_control:cubicAndroidAndroid", + "//xplat/quic/congestion_control:newrenoAndroid", + "//xplat/quic/congestion_control:newrenoAndroidAndroid", + "//xplat/quic/congestion_control:pacerAndroid", + "//xplat/quic/congestion_control:pacerAndroidAndroid", + "//xplat/quic/congestion_control:packet_processorAndroid", + "//xplat/quic/congestion_control:packet_processorAndroidAndroid", + "//xplat/quic/congestion_control:static_cwnd_congestion_controllerAndroid", + "//xplat/quic/congestion_control:static_cwnd_congestion_controllerAndroidAndroid", + "//xplat/quic/congestion_control:throttling_signal_providerAndroid", + "//xplat/quic/congestion_control:throttling_signal_providerAndroidAndroid", + "//xplat/quic/dsr:dsr_packetization_request_senderAndroid", + "//xplat/quic/dsr:dsr_packetization_request_senderAndroidAndroid", + "//xplat/quic/fizz/client/handshake:fizz_client_handshakeAndroid", + "//xplat/quic/fizz/client/handshake:fizz_client_handshakeAndroidAndroid", + "//xplat/quic/fizz/client/handshake:psk_cacheAndroid", + "//xplat/quic/fizz/client/handshake:psk_cacheAndroidAndroid", + "//xplat/quic/fizz/client/handshake:token_cacheAndroid", + "//xplat/quic/fizz/client/handshake:token_cacheAndroidAndroid", + "//xplat/quic/fizz/handshake:fizz_handshakeAndroid", + "//xplat/quic/fizz/handshake:fizz_handshakeAndroidAndroid", + "//xplat/quic/flowcontrol:flow_controlAndroid", + "//xplat/quic/flowcontrol:flow_controlAndroidAndroid", + "//xplat/quic/handshake:aeadAndroid", + "//xplat/quic/handshake:aeadAndroidAndroid", + "//xplat/quic/handshake:handshakeAndroid", + "//xplat/quic/handshake:handshakeAndroidAndroid", + "//xplat/quic/handshake:retry_integrity_tag_generatorAndroid", + "//xplat/quic/handshake:retry_integrity_tag_generatorAndroidAndroid", + "//xplat/quic/handshake:transport_parametersAndroid", + "//xplat/quic/handshake:transport_parametersAndroidAndroid", + "//xplat/quic/happyeyeballs:happyeyeballsAndroid", + "//xplat/quic/happyeyeballs:happyeyeballsAndroidAndroid", + "//xplat/quic/logging:qloggerAndroid", + "//xplat/quic/logging:qloggerAndroidAndroid", + "//xplat/quic/logging:qlogger_constantsAndroid", + "//xplat/quic/logging:qlogger_constantsAndroidAndroid", + "//xplat/quic/loss:lossAndroid", + "//xplat/quic/loss:lossAndroidAndroid", + "//xplat/quic/observer:socket_observer_containerAndroid", + "//xplat/quic/observer:socket_observer_containerAndroidAndroid", + "//xplat/quic/observer:socket_observer_interfaceAndroid", + "//xplat/quic/observer:socket_observer_interfaceAndroidAndroid", + "//xplat/quic/observer:socket_observer_typesAndroid", + "//xplat/quic/observer:socket_observer_typesAndroidAndroid", + "//xplat/quic/state/stream:streamAndroid", + "//xplat/quic/state/stream:streamAndroidAndroid", + "//xplat/quic/state:ack_eventAndroid", + "//xplat/quic/state:ack_eventAndroidAndroid", + "//xplat/quic/state:ack_frequency_functionsAndroid", + "//xplat/quic/state:ack_frequency_functionsAndroidAndroid", + "//xplat/quic/state:ack_handlerAndroid", + "//xplat/quic/state:ack_handlerAndroidAndroid", + "//xplat/quic/state:ack_statesAndroid", + "//xplat/quic/state:ack_statesAndroidAndroid", + "//xplat/quic/state:datagram_handlerAndroid", + "//xplat/quic/state:datagram_handlerAndroidAndroid", + "//xplat/quic/state:loss_stateAndroid", + "//xplat/quic/state:loss_stateAndroidAndroid", + "//xplat/quic/state:outstanding_packetAndroid", + "//xplat/quic/state:outstanding_packetAndroidAndroid", + "//xplat/quic/state:pacing_functionsAndroid", + "//xplat/quic/state:pacing_functionsAndroidAndroid", + "//xplat/quic/state:packet_eventAndroid", + "//xplat/quic/state:packet_eventAndroidAndroid", + "//xplat/quic/state:quic_connection_statsAndroid", + "//xplat/quic/state:quic_connection_statsAndroidAndroid", + "//xplat/quic/state:quic_priority_queueAndroid", + "//xplat/quic/state:quic_priority_queueAndroidAndroid", + "//xplat/quic/state:quic_state_machineAndroid", + "//xplat/quic/state:quic_state_machineAndroidAndroid", + "//xplat/quic/state:quic_stream_utilitiesAndroid", + "//xplat/quic/state:quic_stream_utilitiesAndroidAndroid", + "//xplat/quic/state:retransmission_policyAndroid", + "//xplat/quic/state:retransmission_policyAndroidAndroid", + "//xplat/quic/state:simple_frame_functionsAndroid", + "//xplat/quic/state:simple_frame_functionsAndroidAndroid", + "//xplat/quic/state:state_functionsAndroid", + "//xplat/quic/state:state_functionsAndroidAndroid", + "//xplat/quic/state:stats_callbackAndroid", + "//xplat/quic/state:stats_callbackAndroidAndroid", + "//xplat/quic/state:stream_functionsAndroid", + "//xplat/quic/state:stream_functionsAndroidAndroid", + "//xplat/quic/state:transport_settingsAndroid", + "//xplat/quic/state:transport_settingsAndroidAndroid", + "//xplat/quic:constantsAndroid", + "//xplat/quic:constantsAndroidAndroid", + "//xplat/quic:exceptionAndroid", + "//xplat/quic:exceptionAndroidAndroid", + "//xplat/quic:fb-quicAndroid", +] diff --git a/quic/state/BUCK b/quic/state/BUCK new file mode 100644 index 000000000..6e3017543 --- /dev/null +++ b/quic/state/BUCK @@ -0,0 +1,339 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "outstanding_packet", + headers = [ + "OutstandingPacket.h", + ], + exported_deps = [ + ":loss_state", + ":packet_event", + "//folly/io:socket_option_map", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "loss_state", + headers = [ + "LossState.h", + ], + exported_deps = [ + "//quic/codec:types", + "//quic/common:enum_array", + ], +) + +mvfst_cpp_library( + name = "transport_settings", + headers = [ + "TransportSettings.h", + ], + exported_deps = [ + ":quic_priority_queue", + "//folly:optional", + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "ack_states", + headers = [ + "AckStates.h", + ], + exported_deps = [ + "//folly:random", + "//quic:constants", + "//quic/codec:types", + "//quic/common:interval_set", + ], +) + +mvfst_cpp_library( + name = "packet_event", + srcs = [ + "PacketEvent.cpp", + ], + headers = [ + "PacketEvent.h", + ], + deps = [ + "//folly/hash:hash", + ], + exported_deps = [ + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "quic_stream_utilities", + srcs = [ + "QuicStreamUtilities.cpp", + ], + headers = [ + "QuicStreamUtilities.h", + ], + exported_deps = [ + "//quic:constants", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "quic_priority_queue", + srcs = ["QuicPriorityQueue.cpp"], + headers = ["QuicPriorityQueue.h"], + exported_deps = [ + "//folly/container:f14_hash", + "//quic/codec:types", + ], + exported_external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "quic_state_machine", + srcs = [ + "PendingPathRateLimiter.cpp", + "QuicStreamManager.cpp", + "StateData.cpp", + ], + headers = [ + "PendingPathRateLimiter.h", + "QuicStreamManager.h", + "QuicStreamPrioritiesObserver.h", + "QuicStreamUtilities.h", + "StateData.h", + "StreamData.h", + ], + exported_deps = [ + ":ack_event", + ":ack_states", + ":loss_state", + ":outstanding_packet", + ":packet_event", + ":quic_connection_stats", + ":quic_priority_queue", + ":retransmission_policy", + ":stats_callback", + ":transport_settings", + "//folly:optional", + "//folly/container:f14_hash", + "//folly/io:iobuf", + "//folly/io/async:delayed_destruction", + "//quic:constants", + "//quic/codec:codec", + "//quic/codec:types", + "//quic/common:buf_accessor", + "//quic/common:circular_deque", + "//quic/common:small_collections", + "//quic/congestion_control:congestion_controller", + "//quic/congestion_control:packet_processor", + "//quic/congestion_control:throttling_signal_provider", + "//quic/dsr:dsr_packetization_request_sender", + "//quic/handshake:handshake", + "//quic/logging:qlogger", + "//quic/observer:socket_observer_types", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "ack_handler", + srcs = [ + "AckHandlers.cpp", + ], + headers = [ + "AckHandlers.h", + ], + deps = [ + ":state_functions", + ":stream_functions", + "//folly:map_util", + "//quic/loss:loss", + ], + exported_deps = [ + ":quic_state_machine", + "//quic:constants", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "stream_functions", + srcs = [ + "QuicStreamFunctions.cpp", + ], + headers = [ + "QuicStreamFunctions.h", + ], + deps = [ + ":quic_stream_utilities", + "//folly/io:iobuf", + "//quic:exception", + "//quic/flowcontrol:flow_control", + ], + exported_deps = [ + ":quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "state_functions", + srcs = [ + "QuicStateFunctions.cpp", + ], + headers = [ + "QuicStateFunctions.h", + ], + deps = [ + ":stream_functions", + "//quic/common:time_util", + ], + exported_deps = [ + ":quic_state_machine", + "//quic:constants", + "//quic/codec:pktbuilder", + "//quic/codec:types", + "//quic/common:network_data", + ], +) + +mvfst_cpp_library( + name = "stats_callback", + headers = [ + "QuicTransportStatsCallback.h", + ], + exported_deps = [ + "//folly:optional", + "//folly/functional:invoke", + "//quic:constants", + "//quic:exception", + ], +) + +mvfst_cpp_library( + name = "pacing_functions", + srcs = [ + "QuicPacingFunctions.cpp", + ], + headers = [ + "QuicPacingFunctions.h", + ], + exported_deps = [ + ":quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "simple_frame_functions", + srcs = [ + "SimpleFrameFunctions.cpp", + ], + headers = [ + "SimpleFrameFunctions.h", + ], + deps = [ + ":state_functions", + ":stream_functions", + "//quic:constants", + "//quic/state/stream:stream", + ], + exported_deps = [ + ":quic_state_machine", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "quic_connection_stats", + srcs = [ + ], + headers = [ + "QuicConnectionStats.h", + ], + exported_deps = [ + "//folly:network_address", + "//quic:constants", + "//quic/congestion_control:congestion_controller", + ], +) + +mvfst_cpp_library( + name = "datagram_handler", + srcs = [ + "DatagramHandlers.cpp", + ], + headers = [ + "DatagramHandlers.h", + ], + exported_deps = [ + ":quic_state_machine", + "//quic/codec:types", + ], +) + +mvfst_cpp_library( + name = "ack_event", + srcs = [ + "AckEvent.cpp", + ], + headers = [ + "AckEvent.h", + ], + deps = [ + "//folly:map_util", + ], + exported_deps = [ + ":outstanding_packet", + "//folly:optional", + "//quic/codec:types", + "//quic/common:small_collections", + "//quic/congestion_control:congestion_controller", + ], +) + +mvfst_cpp_library( + name = "ack_frequency_functions", + srcs = [ + "QuicAckFrequencyFunctions.cpp", + ], + headers = [ + "QuicAckFrequencyFunctions.h", + ], + deps = [ + "//quic/common:time_util", + ], + exported_deps = [ + "//quic/state:quic_state_machine", + ], +) + +mvfst_cpp_library( + name = "retransmission_policy", + headers = [ + "QuicStreamGroupRetransmissionPolicy.h", + ], + exported_deps = [ + "//quic:constants", + ], +) + +mvfst_cpp_library( + name = "transport_settings_functions", + srcs = [ + "TransportSettingsFunctions.cpp", + ], + headers = [ + "TransportSettingsFunctions.h", + ], + exported_deps = [ + ":transport_settings", + "//folly/json:dynamic", + ], +) diff --git a/quic/state/stream/BUCK b/quic/state/stream/BUCK new file mode 100644 index 000000000..794134c81 --- /dev/null +++ b/quic/state/stream/BUCK @@ -0,0 +1,25 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "stream", + srcs = [ + "StreamReceiveHandlers.cpp", + "StreamSendHandlers.cpp", + "StreamStateFunctions.cpp", + ], + headers = [ + "StreamReceiveHandlers.h", + "StreamSendHandlers.h", + "StreamStateFunctions.h", + ], + deps = [ + "//quic/flowcontrol:flow_control", + ], + exported_deps = [ + "//quic/state:quic_state_machine", + "//quic/state:quic_stream_utilities", + "//quic/state:stream_functions", + ], +) diff --git a/quic/state/stream/test/BUCK b/quic/state/stream/test/BUCK new file mode 100644 index 000000000..cce9bf563 --- /dev/null +++ b/quic/state/stream/test/BUCK @@ -0,0 +1,37 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "StreamStateMachineTest", + srcs = [ + "StreamStateMachineTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//quic/api:transport", + "//quic/codec:types", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_utils", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/state:stream_functions", + "//quic/state/stream:stream", + ], +) + +cpp_unittest( + name = "StreamStateFunctionsTest", + srcs = [ + "StreamStateFunctionsTest.cpp", + ], + deps = [ + "//quic/common/test:test_utils", + "//quic/dsr:types", + "//quic/dsr/test:mocks", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/logging:file_qlogger", + "//quic/server/state:server", + "//quic/state:stream_functions", + "//quic/state/stream:stream", + ], +) diff --git a/quic/state/test/BUCK b/quic/state/test/BUCK new file mode 100644 index 000000000..6c5ef2ea2 --- /dev/null +++ b/quic/state/test/BUCK @@ -0,0 +1,187 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark") +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +mvfst_cpp_library( + name = "mocks", + headers = [ + "MockQuicStats.h", + "Mocks.h", + ], + exported_deps = [ + "//folly/portability:gmock", + "//quic:constants", + "//quic:exception", + "//quic/congestion_control:congestion_controller_factory", + "//quic/state:quic_state_machine", + "//quic/state:stats_callback", + ], +) + +cpp_unittest( + name = "QuicStateMachineTest", + srcs = [ + "StateDataTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + "//quic/common/test:test_utils", + "//quic/state:loss_state", + "//quic/state:quic_state_machine", + ], +) + +cpp_unittest( + name = "QuicStreamFunctionsTest", + srcs = [ + "QuicStreamFunctionsTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + "//quic/client:state_and_handshake", + "//quic/common/test:test_utils", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:quic_stream_utilities", + "//quic/state:stream_functions", + ], +) + +cpp_unittest( + name = "AckHandlersTest", + srcs = [ + "AckHandlersTest.cpp", + ], + supports_static_listing = False, + deps = [ + "fbsource//third-party/googletest:gmock", + ":ack_event_test_util", + ":mocks", + "//quic:constants", + "//quic/api/test:mocks", + "//quic/common/test:test_utils", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/logging/test:mocks", + "//quic/server/state:server", + "//quic/state:ack_handler", + "//quic/state:outstanding_packet", + "//quic/state:quic_state_machine", + "//quic/state/stream:stream", + ], +) + +cpp_unittest( + name = "QuicStateFunctionsTest", + srcs = [ + "QuicStateFunctionsTest.cpp", + ], + supports_static_listing = False, + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + "//quic/codec:types", + "//quic/common/test:test_utils", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:outstanding_packet", + "//quic/state:state_functions", + "//quic/state/stream:stream", + ], +) + +cpp_unittest( + name = "QuicPacingFunctionsTest", + srcs = [ + "QuicPacingFunctionsTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/state:pacing_functions", + ], +) + +cpp_unittest( + name = "TransportSettingsFunctionsTest", + srcs = [ + "TransportSettingsFunctionsTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/state:transport_settings_functions", + ], +) + +cpp_unittest( + name = "QuicStreamManagerTest", + srcs = [ + "QuicPriorityQueueTest.cpp", + "QuicStreamManagerTest.cpp", + ], + supports_static_listing = False, + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + "//quic/fizz/server/handshake:fizz_server_handshake", + "//quic/server/state:server", + "//quic/state:quic_priority_queue", + "//quic/state:quic_state_machine", + "//quic/state:quic_stream_utilities", + ], +) + +cpp_unittest( + name = "PacketEventTest", + srcs = [ + "PacketEventTest.cpp", + ], + deps = [ + "//folly/portability:gtest", + "//quic/state:packet_event", + ], +) + +cpp_unittest( + name = "OutstandingPacketTest", + srcs = [ + "OutstandingPacketTest.cpp", + ], + deps = [ + "fbsource//third-party/googletest:gmock", + ":mocks", + "//quic:constants", + "//quic/api/test:mocks", + "//quic/common/test:test_utils", + "//quic/logging/test:mocks", + "//quic/state:outstanding_packet", + "//quic/state/stream:stream", + ], +) + +mvfst_cpp_library( + name = "ack_event_test_util", + srcs = [ + "AckEventTestUtil.cpp", + ], + headers = [ + "AckEventTestUtil.h", + ], + exported_deps = [ + "fbsource//third-party/googletest:gmock", + "fbsource//third-party/googletest:gtest", + "//quic/state:ack_event", + ], +) + +cpp_benchmark( + name = "quic_priority_queue_benchmark", + srcs = ["QuicPriorityQueueBenchmark.cpp"], + deps = [ + "//common/init:init", + "//folly:benchmark", + "//quic/state:quic_priority_queue", + ], +) diff --git a/quic/tools/tperf/BUCK b/quic/tools/tperf/BUCK new file mode 100644 index 000000000..008096d52 --- /dev/null +++ b/quic/tools/tperf/BUCK @@ -0,0 +1,83 @@ +load("@fbcode//quic:defs.bzl", "mvfst_cpp_library") +load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") + +oncall("traffic_protocols") + +cpp_binary( + name = "tperf", + srcs = [ + "tperf.cpp", + ], + deps = [ + ":pacing_observer", + ":tperf_dsr_sender", + ":tperf_qlogger", + "//fizz/crypto:utils", + "//folly:memcpy-use", # @manual + "//folly/init:init", + "//folly/io/async:async_base", + "//folly/portability:gflags", + "//folly/stats:histogram", + "//quic:constants", + "//quic/client:client", + "//quic/common/events:folly_eventbase", + "//quic/common/test:test_client_utils", + "//quic/common/test:test_utils", + "//quic/common/udpsocket:folly_async_udp_socket", + "//quic/congestion_control:server_congestion_controller_factory", + "//quic/fizz/client/handshake:fizz_client_handshake", + "//quic/server:accept_observer", + "//quic/server:server", + ], + external_deps = [ + "glog", + ], +) + +mvfst_cpp_library( + name = "tperf_dsr_sender", + srcs = [ + "TperfDSRSender.cpp", + ], + headers = [ + "TperfDSRSender.h", + ], + deps = [ + "//quic/dsr/backend/test:test_utils", + ], + exported_deps = [ + "//folly:network_address", + "//quic/common/udpsocket:quic_async_udp_socket", + "//quic/dsr:dsr_packetization_request_sender", + "//quic/dsr:types", + "//quic/dsr/backend:dsr_packetizer", + "//quic/server:server", + ], +) + +mvfst_cpp_library( + name = "tperf_qlogger", + srcs = [ + "TperfQLogger.cpp", + ], + headers = [ + "TperfQLogger.h", + ], + exported_deps = [ + ":pacing_observer", + "//quic/logging:file_qlogger", + ], +) + +mvfst_cpp_library( + name = "pacing_observer", + headers = [ + "PacingObserver.h", + ], + exported_deps = [ + "//quic:constants", + "//quic/congestion_control:bandwidth", + "//quic/logging:qlogger", + "//quic/state:quic_state_machine", + ], +) diff --git a/quic/tools/tperf/test/BUCK b/quic/tools/tperf/test/BUCK new file mode 100644 index 000000000..b4aef448e --- /dev/null +++ b/quic/tools/tperf/test/BUCK @@ -0,0 +1,15 @@ +load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest") + +oncall("traffic_protocols") + +cpp_unittest( + name = "PacingObserverTest", + srcs = [ + "PacingObserverTest.cpp", + ], + deps = [ + "//quic/common/test:test_utils", + "//quic/logging/test:mocks", + "//quic/tools/tperf:pacing_observer", + ], +) diff --git a/quic/xsk/BUCK b/quic/xsk/BUCK new file mode 100644 index 000000000..317a2b859 --- /dev/null +++ b/quic/xsk/BUCK @@ -0,0 +1,62 @@ +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") + +cpp_library( + name = "xsk_lib", + srcs = [ + "packet_utils.cpp", + "xsk_lib.cpp", + ], + headers = [ + "packet_utils.h", + "xsk_lib.h", + ], + deps = [ + "//folly:benchmark", + ], + exported_deps = [ + "//folly:network_address", + ], + external_deps = [ + ("glibc", None, "rt"), + ], +) + +cpp_library( + name = "xsk_container", + srcs = [ + "BaseXskContainer.cpp", + "HashingXskContainer.cpp", + "ThreadLocalXskContainer.cpp", + ], + headers = [ + "BaseXskContainer.h", + "HashingXskContainer.h", + "ThreadLocalXskContainer.h", + ], + deps = [ + ], + exported_deps = [ + ":xsk_sender", + "//folly:thread_local", + "//folly/container:f14_hash", + ], +) + +cpp_library( + name = "xsk_sender", + srcs = ["XskSender.cpp"], + headers = [ + "XskSender.h", + ], + deps = [ + "//folly:benchmark", + "//folly:string", + ], + exported_deps = [ + ":xsk_lib", + "//folly:expected", + "//folly:network_address", + "//folly/container:f14_hash", + "//folly/io:iobuf", + ], +) diff --git a/shim/.buckconfig b/shim/.buckconfig new file mode 100644 index 000000000..e69de29bb diff --git a/shim/.gitignore b/shim/.gitignore new file mode 100644 index 000000000..a1412f7fa --- /dev/null +++ b/shim/.gitignore @@ -0,0 +1,5 @@ +# We currently expect end users to run reindeer vendor themselves +# so mark these things as to ignore +/third-party/rust/.cargo/ +/third-party/rust/BUCK +/third-party/rust/vendor/ diff --git a/shim/BUCK b/shim/BUCK new file mode 100644 index 000000000..9e740dde5 --- /dev/null +++ b/shim/BUCK @@ -0,0 +1,5 @@ +load("@prelude//toolchains:demo.bzl", "system_demo_toolchains") + +# All the default toolchains, suitable for a quick demo or early prototyping. +# Most real projects should copy/paste the implementation to configure them. +system_demo_toolchains() diff --git a/shim/README.md b/shim/README.md new file mode 100644 index 000000000..7a83226e0 --- /dev/null +++ b/shim/README.md @@ -0,0 +1,4 @@ +# Open Source Shim + +These files are a shim that allow us to build Buck2 with Buck2 outside Meta in +the open source world. diff --git a/shim/buck2/buck_rust_binary.bzl b/shim/buck2/buck_rust_binary.bzl new file mode 100644 index 000000000..aad0fdab7 --- /dev/null +++ b/shim/buck2/buck_rust_binary.bzl @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load( + "//:shims.bzl", + _rust_binary = "rust_binary", +) + +buck_rust_binary = _rust_binary diff --git a/shim/buck2/proto_defs.bzl b/shim/buck2/proto_defs.bzl new file mode 100644 index 000000000..5cafa19ac --- /dev/null +++ b/shim/buck2/proto_defs.bzl @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load( + "//:shims.bzl", + _rust_protobuf_library = "rust_protobuf_library", +) + +rust_protobuf_library = _rust_protobuf_library diff --git a/shim/build_defs/cpp_library.bzl b/shim/build_defs/cpp_library.bzl new file mode 100644 index 000000000..1e2d7877d --- /dev/null +++ b/shim/build_defs/cpp_library.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load("//:shims.bzl", _cpp_library = "cpp_library") + +cpp_library = _cpp_library diff --git a/shim/build_defs/custom_unittest.bzl b/shim/build_defs/custom_unittest.bzl new file mode 100644 index 000000000..f5aa4cf8f --- /dev/null +++ b/shim/build_defs/custom_unittest.bzl @@ -0,0 +1,9 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def custom_unittest(**_): + pass diff --git a/shim/build_defs/export_files.bzl b/shim/build_defs/export_files.bzl new file mode 100644 index 000000000..b34d9a4b6 --- /dev/null +++ b/shim/build_defs/export_files.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def export_file(visibility = ["PUBLIC"], **kwargs): + # @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode" + native.export_file(visibility = visibility, **kwargs) diff --git a/shim/build_defs/lib/python_common.bzl b/shim/build_defs/lib/python_common.bzl new file mode 100644 index 000000000..44dc75746 --- /dev/null +++ b/shim/build_defs/lib/python_common.bzl @@ -0,0 +1,14 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def get_ldflags(*args): + _unused = args # @unused + return [] + +def get_strip_mode(*args): + _unused = args # @unused + return "" diff --git a/shim/build_defs/native_rules.bzl b/shim/build_defs/native_rules.bzl new file mode 100644 index 000000000..fb9bddda7 --- /dev/null +++ b/shim/build_defs/native_rules.bzl @@ -0,0 +1,22 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def buck_genrule(visibility = ["PUBLIC"], **kwargs): + # @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode" + native.genrule(visibility = visibility, **kwargs) + +def buck_command_alias(**_): + pass + +def buck_filegroup(visibility = ["PUBLIC"], **kwargs): + # @lint-ignore BUCKLINT: avoid "native is forbidden in fbcode" + native.filegroup(visibility = visibility, **kwargs) + +def alias(actual, visibility = ["PUBLIC"], **kwargs): + if actual.startswith("//buck2/"): + actual = "root//" + actual.removeprefix("//buck2/") + native.alias(actual = actual, visibility = visibility, **kwargs) diff --git a/shim/build_defs/ocaml_binary.bzl b/shim/build_defs/ocaml_binary.bzl new file mode 100644 index 000000000..d5fd250f0 --- /dev/null +++ b/shim/build_defs/ocaml_binary.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load("//:shims.bzl", _ocaml_binary = "ocaml_binary") + +ocaml_binary = _ocaml_binary diff --git a/shim/build_defs/platform_utils.bzl b/shim/build_defs/platform_utils.bzl new file mode 100644 index 000000000..2ea71572f --- /dev/null +++ b/shim/build_defs/platform_utils.bzl @@ -0,0 +1,11 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def _get_cxx_platform_for_base_path(_base_path): + return struct(target_platform = None) + +platform_utils = struct(get_cxx_platform_for_base_path = _get_cxx_platform_for_base_path) diff --git a/shim/build_defs/python_binary.bzl b/shim/build_defs/python_binary.bzl new file mode 100644 index 000000000..5805fc30b --- /dev/null +++ b/shim/build_defs/python_binary.bzl @@ -0,0 +1,12 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def python_binary(srcs = [], **kwargs): + _unused = srcs # @unused + + # @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." + native.python_binary(**kwargs) diff --git a/shim/build_defs/rust_binary.bzl b/shim/build_defs/rust_binary.bzl new file mode 100644 index 000000000..188df9aa2 --- /dev/null +++ b/shim/build_defs/rust_binary.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load("//:shims.bzl", _rust_binary = "rust_binary") + +rust_binary = _rust_binary diff --git a/shim/build_defs/rust_library.bzl b/shim/build_defs/rust_library.bzl new file mode 100644 index 000000000..da9da2f0c --- /dev/null +++ b/shim/build_defs/rust_library.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load("//:shims.bzl", _rust_library = "rust_library") + +rust_library = _rust_library diff --git a/shim/build_defs/rust_unittest.bzl b/shim/build_defs/rust_unittest.bzl new file mode 100644 index 000000000..17f03052f --- /dev/null +++ b/shim/build_defs/rust_unittest.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +load("//:shims.bzl", _rust_unittest = "rust_unittest") + +rust_unittest = _rust_unittest diff --git a/shim/common/ocaml/interop/defs.bzl b/shim/common/ocaml/interop/defs.bzl new file mode 100644 index 000000000..b8e7f978f --- /dev/null +++ b/shim/common/ocaml/interop/defs.bzl @@ -0,0 +1,3 @@ +load("@root//defs.bzl", _RUST_FLAGS_2018 = "RUST_FLAGS_2018") + +RUST_FLAGS_2018 = _RUST_FLAGS_2018 diff --git a/shim/grpc_fb/codegen/buck_macros.bzl b/shim/grpc_fb/codegen/buck_macros.bzl new file mode 100644 index 000000000..ed51cb693 --- /dev/null +++ b/shim/grpc_fb/codegen/buck_macros.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def grpc_library(**kwargs): + _unused = kwargs # @unused + pass diff --git a/shim/shims.bzl b/shim/shims.bzl new file mode 100644 index 000000000..4bc98f9fe --- /dev/null +++ b/shim/shims.bzl @@ -0,0 +1,250 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +# @lint-ignore-every FBCODEBZLADDLOADS + +prelude = native + +_SELECT_TYPE = type(select({"DEFAULT": []})) + +def is_select(thing): + return type(thing) == _SELECT_TYPE + +def cpp_library( + deps = [], + external_deps = [], + undefined_symbols = None, + visibility = ["PUBLIC"], + **kwargs): + _unused = undefined_symbols # @unused + + prelude.cxx_library( + deps = _maybe_select_map(deps + external_deps_to_targets(external_deps), _fix_deps), + visibility = visibility, + preferred_linkage = "static", + **kwargs + ) + +def rust_library( + rustc_flags = [], + deps = [], + named_deps = None, + os_deps = None, + test_deps = None, + test_env = None, + test_os_deps = None, + autocargo = None, + unittests = None, + mapped_srcs = {}, + visibility = ["PUBLIC"], + **kwargs): + _unused = (test_deps, test_env, test_os_deps, named_deps, autocargo, unittests, visibility) # @unused + deps = _maybe_select_map(deps, _fix_deps) + mapped_srcs = _maybe_select_map(mapped_srcs, _fix_mapped_srcs) + if os_deps: + deps += _select_os_deps(_fix_dict_deps(os_deps)) + + # Reset visibility because internal and external paths are different. + visibility = ["PUBLIC"] + + prelude.rust_library( + rustc_flags = rustc_flags + [_CFG_BUCK_BUILD], + deps = deps, + visibility = visibility, + mapped_srcs = mapped_srcs, + **kwargs + ) + +def rust_binary( + rustc_flags = [], + deps = [], + autocargo = None, + unittests = None, + allocator = None, + default_strip_mode = None, + visibility = ["PUBLIC"], + **kwargs): + _unused = (unittests, allocator, default_strip_mode, autocargo) # @unused + deps = _maybe_select_map(deps, _fix_deps) + + # @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." + prelude.rust_binary( + rustc_flags = rustc_flags + [_CFG_BUCK_BUILD], + deps = deps, + visibility = visibility, + **kwargs + ) + +def rust_unittest( + rustc_flags = [], + deps = [], + visibility = ["PUBLIC"], + **kwargs): + deps = _maybe_select_map(deps, _fix_deps) + + prelude.rust_test( + rustc_flags = rustc_flags + [_CFG_BUCK_BUILD], + deps = deps, + visibility = visibility, + **kwargs + ) + +def rust_protobuf_library( + name, + srcs, + build_script, + protos, + build_env = None, + deps = [], + test_deps = None, + doctests = True): + if build_env: + build_env = { + k: _fix_dep_in_string(v) + for k, v in build_env.items() + } + + build_name = name + "-build" + proto_name = name + "-proto" + + rust_binary( + name = build_name, + srcs = [build_script], + crate_root = build_script, + deps = [ + "fbsource//third-party/rust:tonic-build", + "//buck2/app/buck2_protoc_dev:buck2_protoc_dev", + ], + ) + + build_env = build_env or {} + build_env.update( + { + "PROTOC": "$(exe buck//third-party/proto:protoc)", + "PROTOC_INCLUDE": "$(location buck//third-party/proto:google_protobuf)", + }, + ) + + prelude.genrule( + name = proto_name, + srcs = protos + [ + "buck//third-party/proto:google_protobuf", + ], + out = ".", + cmd = "$(exe :" + build_name + ")", + env = build_env, + ) + + rust_library( + name = name, + srcs = srcs, + doctests = doctests, + env = { + # This is where prost looks for generated .rs files + "OUT_DIR": "$(location :{})".format(proto_name), + }, + test_deps = test_deps, + deps = [ + "fbsource//third-party/rust:prost", + "fbsource//third-party/rust:prost-types", + ] + (deps or []), + ) + + # For python tests only + for proto in protos: + prelude.export_file( + name = proto, + visibility = ["PUBLIC"], + ) + +def ocaml_binary( + deps = [], + visibility = ["PUBLIC"], + **kwargs): + deps = _maybe_select_map(deps, _fix_deps) + + prelude.ocaml_binary( + deps = deps, + visibility = visibility, + **kwargs + ) + +_CFG_BUCK_BUILD = "--cfg=buck_build" + +def _maybe_select_map(v, mapper): + if is_select(v): + return select_map(v, mapper) + return mapper(v) + +def _select_os_deps(xss: list[( + str, + list[str], +)]) -> Select: + d = { + "prelude//os:" + os: xs + for os, xs in xss + } + d["DEFAULT"] = [] + return select(d) + +def _fix_dict_deps(xss: list[( + str, + list[str], +)]) -> list[( + str, + list[str], +)]: + return [ + (k, _fix_deps(xs)) + for k, xs in xss + ] + +def _fix_mapped_srcs(xs: dict[str, str]): + # For reasons, this is source -> file path, which is the opposite of what + # it should be. + return {_fix_dep(k): v for (k, v) in xs.items()} + +def _fix_deps(xs: list[str]) -> list[str]: + return filter(None, map(_fix_dep, xs)) + +def _fix_dep(x: str) -> [ + None, + str, +]: + if x == "//common/rust/shed/fbinit:fbinit": + return "fbsource//third-party/rust:fbinit" + elif x == "//common/rust/shed/sorted_vector_map:sorted_vector_map": + return "fbsource//third-party/rust:sorted_vector_map" + elif x == "//watchman/rust/watchman_client:watchman_client": + return "fbsource//third-party/rust:watchman_client" + elif x.startswith("fbsource//third-party/rust:") or x.startswith(":"): + return x + elif x.startswith("//buck2/facebook/"): + return None + elif x.startswith("//buck2/"): + return "root//" + x.removeprefix("//buck2/") + elif x.startswith("fbcode//common/ocaml/interop/"): + return "root//" + x.removeprefix("fbcode//common/ocaml/interop/") + elif x.startswith("fbcode//third-party-buck/platform010/build/supercaml"): + return "shim//third-party/ocaml" + x.removeprefix("fbcode//third-party-buck/platform010/build/supercaml") + else: + fail("Dependency is unaccounted for `{}`.\n".format(x) + + "Did you forget 'oss-disable'?") + +def _fix_dep_in_string(x: str) -> str: + """Replace internal labels in string values such as env-vars.""" + return (x + .replace("//buck2/", "root//")) + +# Do a nasty conversion of e.g. ("supercaml", None, "ocaml-dev") to +# 'fbcode//third-party-buck/platform010/build/supercaml:ocaml-dev' +# (which will then get mapped to `shim//third-party/ocaml:ocaml-dev`). +def external_dep_to_target(t): + return "fbcode//third-party-buck/platform010/build/{}:{}".format(t[0], t[2]) + +def external_deps_to_targets(ts): + return [external_dep_to_target(t) for t in ts] diff --git a/shim/target_determinator/macros/ci.bzl b/shim/target_determinator/macros/ci.bzl new file mode 100644 index 000000000..abbd47d88 --- /dev/null +++ b/shim/target_determinator/macros/ci.bzl @@ -0,0 +1,26 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def _lbl(*_args): + return "" + +def _package( + _values, + # starlark-lint-disable unused-argument + overwrite = False): # @unused + pass + +ci = struct( + package = _package, + linux = _lbl, + mac = _lbl, + windows = _lbl, + skip_test = _lbl, + aarch64 = _lbl, + mode = _lbl, + opt = _lbl, +) diff --git a/shim/third-party/macros/rust_third_party.bzl b/shim/third-party/macros/rust_third_party.bzl new file mode 100644 index 000000000..f6a0bd3d2 --- /dev/null +++ b/shim/third-party/macros/rust_third_party.bzl @@ -0,0 +1,11 @@ +# @nolint + +def third_party_rust_prebuilt_cxx_library(name, **kwargs): + # FIXME: This should probably be a fixup.toml, but it currently can't be expressed. + # The windows-sys crate does -lwindows to find windows. We pass libwindows.a on the command line, + # which resolves the symbols, but the linker still needs to "find" windows, so we also put its + # directory on the link options. + if name.endswith("libwindows.a"): + kwargs["exported_linker_flags"] = ["-Lshim/third-party/rust/" + kwargs["static_lib"].rpartition("/")[0]] + + native.prebuilt_cxx_library(name = name, **kwargs) diff --git a/shim/third-party/ocaml/BUCK b/shim/third-party/ocaml/BUCK new file mode 100644 index 000000000..2343d7b5e --- /dev/null +++ b/shim/third-party/ocaml/BUCK @@ -0,0 +1,7 @@ +# @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." +prebuilt_cxx_library( + name = "ocaml-dev", + header_dirs = ["opam/lib/ocaml"], + header_only = True, + visibility = ["PUBLIC"], +) diff --git a/shim/third-party/proto/BUCK b/shim/third-party/proto/BUCK new file mode 100644 index 000000000..d8381b74d --- /dev/null +++ b/shim/third-party/proto/BUCK @@ -0,0 +1,21 @@ +# @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." +load(":defs.bzl", "protoc_distribution") + +protoc_distribution( + name = "distribution", + version = "21.4", +) + +# @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." +alias( + name = "protoc", + actual = ":distribution[protoc]", + visibility = ["PUBLIC"], +) + +# @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." +alias( + name = "google_protobuf", + actual = ":distribution[google_protobuf]", + visibility = ["PUBLIC"], +) diff --git a/shim/third-party/proto/defs.bzl b/shim/third-party/proto/defs.bzl new file mode 100644 index 000000000..18938c5a7 --- /dev/null +++ b/shim/third-party/proto/defs.bzl @@ -0,0 +1,105 @@ +load("@prelude//http_archive/exec_deps.bzl", "HttpArchiveExecDeps") +load(":releases.bzl", "releases") + +ProtocReleaseInfo = provider(fields = [ + "version", + "url", + "sha256", +]) + +def _get_protoc_release( + version: str, + platform: str) -> ProtocReleaseInfo: + if not version in releases: + fail("Unknown protoc release version '{}'. Available versions: {}".format( + version, + ", ".join(releases.keys()), + )) + protoc_version = releases[version] + artifact = "protoc-{}-{}.zip".format(version, platform) + if not artifact in protoc_version: + fail("Unsupported platform '{}'. Available artifacts: {}".format( + platform, + ", ".join(protoc_version.keys()), + )) + protoc_artifact = protoc_version[artifact] + return ProtocReleaseInfo( + version = version, + url = protoc_artifact["url"], + sha256 = protoc_artifact["sha256"], + ) + +def _turn_http_archive_into_protoc_distribution( + providers: ProviderCollection, + protoc_filename: str) -> list[Provider]: + downloads = providers[DefaultInfo].sub_targets + include = downloads["include"][DefaultInfo] + protoc = downloads[protoc_filename][DefaultInfo] + + return [DefaultInfo( + sub_targets = { + "google_protobuf": [include], + "protoc": [ + protoc, + RunInfo(args = protoc.default_outputs[0]), + ], + }, + )] + +def _download_protoc_distribution_impl(ctx: AnalysisContext) -> Promise: + protoc_filename = "bin/protoc" + ctx.attrs.exe_extension + + # @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." + return ctx.actions.anon_target(native.http_archive, { + "exec_deps": ctx.attrs._http_archive_exec_deps, + "sha256": ctx.attrs.sha256, + "sub_targets": [ + protoc_filename, + "include", + ], + "urls": [ctx.attrs.url], + }).promise.map(lambda providers: _turn_http_archive_into_protoc_distribution( + providers = providers, + protoc_filename = protoc_filename, + )) + +download_protoc_distribution = rule( + impl = _download_protoc_distribution_impl, + attrs = { + "exe_extension": attrs.string(), + "sha256": attrs.string(), + "url": attrs.string(), + "_http_archive_exec_deps": attrs.default_only(attrs.exec_dep(providers = [HttpArchiveExecDeps], default = "prelude//http_archive/tools:exec_deps")), + }, +) + +def _host_platform(): + os = host_info().os + arch = host_info().arch + if os.is_linux and arch.is_x86_64: + return "linux-x86_64" + elif os.is_linux and arch.is_aarch64: + return "linux-aarch_64" + elif os.is_macos and arch.is_x86_64: + return "osx-x86_64" + elif os.is_macos and arch.is_aarch64: + return "osx-aarch_64" + elif os.is_windows and arch.is_x86_64: + return "win64" + else: + fail("Unknown platform: os={}, arch={}".format(os, arch)) + +def protoc_distribution( + name: str, + version: str, + platform: [None, str] = None): + if platform == None: + platform = _host_platform() + exe_extension = ".exe" if platform.startswith("win") else "" + release = _get_protoc_release(version, platform) + download_protoc_distribution( + name = name, + url = release.url, + sha256 = release.sha256, + exe_extension = exe_extension, + ) diff --git a/shim/third-party/proto/releases.bzl b/shim/third-party/proto/releases.bzl new file mode 100644 index 000000000..153ca496e --- /dev/null +++ b/shim/third-party/proto/releases.bzl @@ -0,0 +1,46 @@ +# @generated +# Update with ./update.py > releases.bzl +releases = { + "21.4": { + "protoc-21.4-win32.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-win32.zip", + "sha256": "09760ff98f76ac30c8bca7433715c47161fe305bf41573a7cd00b0afcc518617" + }, + "protoc-21.4-osx-x86_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-osx-x86_64.zip", + "sha256": "27ac01aee3e8b95ebec017b7b3aee55d4eb095cbd2a5148d2a20350af006072e" + }, + "protoc-21.4-osx-universal_binary.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-osx-universal_binary.zip", + "sha256": "0cf1a340d1fa1366cdf22043e3f92e5374096647037020b405acea706438c603" + }, + "protoc-21.4-osx-aarch_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-osx-aarch_64.zip", + "sha256": "6a677c88a5e5b032aaff96767461788a316408d4ed0afef3f1455390a689ec18" + }, + "protoc-21.4-linux-x86_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_64.zip", + "sha256": "d51e8f030162f08823a4738ab0ac00bee537e30b583a562e6962dbb040d86736" + }, + "protoc-21.4-linux-x86_32.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-x86_32.zip", + "sha256": "2101e3a4dd490625c15d31274a599e3bfb1f8c9fdd381ca9501da17bb6f7a3d2" + }, + "protoc-21.4-linux-s390_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-s390_64.zip", + "sha256": "e0b69b4242bf409c825d787669a4683d63320d6e52280750df971a3376e0af56" + }, + "protoc-21.4-linux-ppcle_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-ppcle_64.zip", + "sha256": "58c1be8ca89b8b2712f95a9dd9aeb174f8f479be9f55e71f6ffe0b0e83ef8be9" + }, + "protoc-21.4-linux-aarch_64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-linux-aarch_64.zip", + "sha256": "5a377b505cf8c3ed29ad0b6e3827c5eb27273c00147fcfd833b9686192143e8d" + }, + "protoc-21.4-win64.zip": { + "url": "https://github.com/protocolbuffers/protobuf/releases/download/v21.4/protoc-21.4-win64.zip", + "sha256": "090af381392abaf5fd8ae3070d8fc2a4ba2d0a9f8e52915d69b439c33be72da5" + } + } +} diff --git a/shim/third-party/proto/update.py b/shim/third-party/proto/update.py new file mode 100755 index 000000000..cfee489f6 --- /dev/null +++ b/shim/third-party/proto/update.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +"""Query recent Github release artifacts for protobuf. + +Use this script to update the releases.bzl file that contains metadata about +protoc releases. + +This script is not executed during the regular Buck2 build. +""" + +import aiohttp +import asyncio +from contextlib import asynccontextmanager +from copy import deepcopy +from gql import gql, Client +from gql.transport.aiohttp import AIOHTTPTransport +import hashlib +import json +import os + +GITHUB_GRAPHQL_URI = "https://api.github.com/graphql" +GITHUB_TOKEN = os.environ.get("GITHUB_TOKEN") +GITHUB_QUERY = """\ +query { + repository(owner: "protocolbuffers", name: "protobuf") { + releases(last: 1) { + nodes { + tagName + releaseAssets(first: 100) { + nodes { + name + downloadUrl + } + } + } + } + } +} +""" + +async def query_releases(): + async with aiohttp.ClientSession(raise_for_status=True) as session: + assert GITHUB_TOKEN is not None, "Provide a Github API token in $GITHUB_TOKEN" + headers = {'Authorization': f'bearer {GITHUB_TOKEN}'} + body = {"query": GITHUB_QUERY} + async with session.post(GITHUB_GRAPHQL_URI, headers=headers, json=body) as resp: + response = await resp.json() + return response["data"] + + +def format_releases(releases): + return { + release["tagName"].strip("v"): { + asset["name"]: { + "url": asset["downloadUrl"], + } + for asset in release["releaseAssets"]["nodes"] + if asset["name"].startswith("protoc-") + } + for release in releases["repository"]["releases"]["nodes"] + } + + +async def fetch_sha256(session, url): + async with session.get(url) as resp: + hasher = hashlib.sha256() + async for chunk, _ in resp.content.iter_chunks(): + hasher.update(chunk) + return hasher.hexdigest() + + +async def hash_releases(releases): + async def hash_asset(session, version, name, url): + sha256 = await fetch_sha256(session, url) + return (version, name, sha256) + + tasks = [] + async with aiohttp.ClientSession() as session: + for version, assets in releases.items(): + for name, asset in assets.items(): + tasks.append(hash_asset(session, version, name, asset["url"])) + + result = deepcopy(releases) + hashes = await asyncio.gather(*tasks) + for version, name, sha256 in hashes: + result[version][name]["sha256"] = sha256 + + return result + + +async def main(): + releases = await query_releases() + formatted = format_releases(releases) + with_sha256 = await hash_releases(formatted) + print("# @" + "generated") + print("# Update with ./update.py > releases.bzl") + print("releases = ", json.dumps(with_sha256, indent=4)) + + +asyncio.run(main()) diff --git a/shim/third-party/rust/.gitignore b/shim/third-party/rust/.gitignore new file mode 100644 index 000000000..c18f3dc43 --- /dev/null +++ b/shim/third-party/rust/.gitignore @@ -0,0 +1,31 @@ +# Ignore Cargo-related stuff +.cargo/registry +.cargo/git +/registry +/git +.package-cache + +# Various cruft in vendored packages +vendor/*/target +vendor/*/Cargo.lock +vendor/**/.buckconfig +vendor/**/BUCK +vendor/**/OWNERS +vendor/**/*~ +vendor/**/*.bzl +vendor/*/.github/** +vendor/*/.appveyor.yml +vendor/*/.travis.yml +/target/** + +# Bad Windows names - oh for case-insensitive regex matching! +vendor/**/[Aa][Uu][Xx] +vendor/**/[Aa][Uu][Xx].* +vendor/**/[Cc][Oo][Mm][1-9] +vendor/**/[Cc][Oo][Mm][1-9].* +vendor/**/[Cc][Oo][Nn] +vendor/**/[Cc][Oo][Nn].* +vendor/**/[Ll][Pp][Tt][1-9] +vendor/**/[Ll][Pp][Tt][1-9].* +vendor/**/[Nn][Uu][Ll] +vendor/**/[Nn][Uu][Ll].* diff --git a/shim/third-party/rust/Cargo.toml b/shim/third-party/rust/Cargo.toml new file mode 100644 index 000000000..95749d12c --- /dev/null +++ b/shim/third-party/rust/Cargo.toml @@ -0,0 +1,225 @@ +# Definitions of third-party libraries used for buck2 build of buck2. +# This file is **not** used by cargo build of buck2. +# See the /docs/bootstrapping.md for more details. + +[workspace] + +[package] +# Pseudo-package whose dependencies are imported and buckified +name = "rust-third-party" +version = "0.0.0" +publish = false +edition = "2021" + +# Dummy target to keep Cargo happy +[[bin]] +name = "top" +path = "top/main.rs" + +# List of packages to be imported, with version constraints, features +# and all options Cargo supports. +[dependencies] + +gazebo = {version = "0.8.1", features = ["str_pattern_extensions"]} +fbinit = "0.1" +sorted_vector_map = "0.1" +watchman_client = "0.8.0" + +annotate-snippets = { version = "0.9.0", features = ["color"] } +anyhow = "1.0.65" +anymap = "0.12.1" +arc-swap = "1.6.0" +argfile = "0.1.0" +assert_matches = "1.5" +async-compression = { version = "0.4.1", features = ["tokio", "gzip", "zstd"] } +async-condvar-fair = { version = "0.2.2", features = ["parking_lot_0_11", "tokio"] } +async-recursion = "1.0" +async-scoped = { version = "0.8", features = ["use-tokio"] } +async-trait = "0.1.24" +atomic = "0.5.1" +backtrace = "0.3.51" +base64 = "0.13.0" +bincode = "1.3.3" +bitflags = "2.4" +blake3 = { version = "1.3.1", features = [ "default", "digest", "rayon", "std", "traits-preview" ] } +bstr = { version = "1.4.0", features = ["serde", "std", "unicode"] } +bumpalo = { version = "3.14.0", features = ["allocator_api", "collections"] } +byteorder = "1.4.3" +bytes = "1.0" +bytesize = "1.1.0" +chrono = "0.4.28" +clap = { package = "clap", version = "4.5.4", features = ["derive", "env", "string"] } +clap-3 = { package = "clap", version = "3.2.24", features = ["derive", "env", "regex", "unicode", "wrap_help"] } +common-path = "1.0.0" +compact_str = "0.6.1" +constant_time_eq = "0.2.4" +convert_case = "0.4.0" +criterion = { version = "0.3.1", features = [] } +crossbeam = "0.8" +crossbeam-channel = "0.5" +crossbeam-epoch = "0.9.7" +crossterm = "0.27" +csv = "1.1" +ctor = "0.1.16" +dashmap = "5.5.3" +debugserver-types = "0.5.0" +derivative = "2.2" +derive_more = "0.99.3" +digest = "0.10" +dirs = "3.0.1" +dunce = "1.0.2" +either = "1.8" +enum-iterator = "1.4.1" +enum-map = "0.6.3" +env_logger = "0.9.0" +equivalent = "1.0.0" +erased-serde = "0.3.20" +faccess = "0.2.3" +fancy-regex = "0.10.0" +flate2 = "1.0.22" +fnv = "1.0.7" +fs4 = { version = "0.6", features = ["sync"] } +futures = { version = "0.3.28", features = ["async-await", "compat"] } +futures-intrusive = "0.4" +fxhash = "0.2.1" +glob = "0.3.0" +globset = "0.4.10" +hashbrown = { version = "0.14.3", features = ["raw"] } +hex = "0.4.3" +higher-order-closure = "0.0.5" +hostname = "0.3.1" +http = "0.2" +httparse = "1.7.1" +httptest = "0.15" +humantime = "2.0.1" +hyper = { version = "0.14.26", features = ["client", "http1", "http2"] } +hyper-proxy = { git = "https://github.com/get9/hyper-proxy", rev = "205e9fee42d469444d654d9fa207897f4a77d5b6", features = ["rustls"], default_features = false } # branch = tokio-rustls-0.23 Many PRs to bump versions (#28, #30, #31) are several years old, possibly abandoned crate. This fork contains changes from #28 + changes to upgrade rustls to 0.21. +hyper-rustls = { version = "0.24.0", features = ["http2"] } +hyper-timeout = "0.4" +hyper-unix-connector = "0.2" +indent_write = "2.2.0" +indenter = "0.3.3" +indexmap = { version = "2.1.0", features = ["arbitrary", "rayon", "serde"] } +indoc = "1.0.3" +inferno = { version = "0.11.11", default-features = false } +internment = { version = "0.7", features = ["arc"] } +inventory = "0.3.8" +ipnetwork = "0.20.0" +is_proc_translated = "0.1.1" +itertools = "0.10.3" +jemallocator = { version = "0.5.0", features = ["profiling"] } +lalrpop = { version = "0.19.7", artifact = "bin", features = ["pico-args"] } +lalrpop-util = "0.19.7" +libc = "0.2.132" +linked-hash-map = { version = "0.5", features = ["serde_impl"] } +linkme = { version = "0.3.17", features = ["used_linker"] } +log = "0.4" +logos = "0.12" +lsp-server = "0.7.2" +lsp-types = "0.94.1" +maplit = "1.0.2" +mappable-rc = { version = "0.1.1", features = ["std"] } +md-5 = "0.10" +memchr = "2.4.1" +memmap2 = "0.5.0" +memoffset = "0.6.4" +multimap = "0.8.2" +nix = "0.22" +nom = "7.1.3" +notify = "=5.0.0-pre.16" +num-bigint = "0.4.3" +num-traits = "0.2" +num_cpus = "1.11" +num_enum = "0.5" +object = "0.29.0" +once_cell = "1.8" +os_str_bytes = { version = "6.6.0", features = ["conversions"] } +parking_lot = { version = "0.11.2", features = ["send_guard"] } +paste = "1.0" +pathdiff = "0.2" +perf-event = "0.4" +perf-event-open-sys = "4.0" +pin-project = "0.4.29" +plist = "0.5" +pretty_assertions = "1.2.1" +proc-macro2 = { version = "1.0.70", features = ["span-locations"] } +prost = "0.11.9" +prost-build = "0.11.9" +prost-derive = "0.11.9" +prost-types = "0.11.9" +protoc-bin-vendored = "3.0.0" +psutil = "3.2" +quote = "1.0.3" +rand = { version = "0.8.4", features = ["small_rng"] } +rand_chacha = "0.3" +rand_distr = "0.4" +ref-cast = "1.0.0" +regex = "1.5.4" +relative-path = { version = "1.7.0", features = ["serde"] } +ring = "=0.17.5" # Upgrading this is possible, but a pain, so we don't want to pick up every new minor version +rusqlite = { version = "0.29.0", features = ["bundled"] } +rustc-hash = "1.1.0" +rustls = "0.21.0" +rustls-native-certs = { package = "rustls-native-certs", version = "0.6.2" } +rustls-pemfile = { package = "rustls-pemfile", version = "1.0.0" } +rustyline = "11.0" +scopeguard = "1.0.0" +sequence_trie = "0.3.6" +serde = { version = "1.0.173", features = ["derive", "rc"] } +serde_json = "1.0.48" +sha1 = "0.10" +sha2 = "0.10" +shlex = "1.3" +similar = { version = "2.2.0", features = ["inline"] } +siphasher = "0.3.3" +slab = "0.4.7" +slog = "2.7.0" +smallvec = { version = "1.10", features = ["const_generics", "const_new", "serde", "specialization", "union", "write"] } +static_assertions = "1.1.0" +strsim = "0.10.0" +structopt = "0.3.23" +syn = { version = "2", features = ["extra-traits", "full", "visit"] } +syn1 = { package = "syn", version = "1.0.109", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } +synstructure = "0.12" +sync_wrapper = "0.1.0" +sys-info = "0.9.1" +sysinfo = "0.26.8" +take_mut = "0.2.2" +tar = "0.4.38" +tempfile = "3.1.0" +termimad = "0.20.1" +termios = "0.3" +termwiz = "0.18" +test-case = "3.1.0" +textwrap = { version = "0.11", features = ["term_size"] } +thiserror = "1.0.36" +threadpool = "1.8.1" +tokio = { version = "1.25.0", features = ["full", "test-util", "tracing"] } +tokio-rustls = { package = "tokio-rustls", version = "0.24.0", features = ["dangerous_configuration"] } +tokio-stream = { version = "0.1.14", features = ["fs", "io-util", "net", "sync", "time", "signal"] } +tokio-util = { version = "0.6", features = ["full"] } +toml = "0.5" +tonic = { version = "0.9.2", features = ["tls", "tls-webpki-roots"] } +tonic-build = { version = "0.9.2", features = ["prost", "cleanup-markdown"] } +tower = "0.4" +tower-layer = "0.3.1" +tower-service = "0.3.2" +tracing = "0.1.22" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } +triomphe = "0.1.11" +trybuild = "1.0.56" +twox-hash = "1.6.1" +unicode-segmentation = "1.7" +uuid = { version = "1.2", features = ["v4"] } +walkdir = "2.3.2" +which = "4.3.0" +windows_x86_64_msvc = "=0.48.0" # our fixup only works if we are on precisely 0.48.0 +winapi = { version = "0.3", features = ["everything"] } +xattr = "0.2.2" +zip = "0.5" +zstd = "0.13.0" + +[patch.crates-io] +# For https://github.com/jimblandy/perf-event/pull/29 +perf-event = { git = "https://github.com/krallin/perf-event.git", rev = "86224a9bc025d5d19f719542f27c8c629a08b167", version = "0.4" } +perf-event-open-sys = { git = "https://github.com/krallin/perf-event.git", rev = "86224a9bc025d5d19f719542f27c8c629a08b167", version = "4.0" } diff --git a/shim/third-party/rust/defs.bzl b/shim/third-party/rust/defs.bzl new file mode 100644 index 000000000..6d295fdd5 --- /dev/null +++ b/shim/third-party/rust/defs.bzl @@ -0,0 +1,7 @@ +def rust_library_from_crates(name): + # @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." + native.export_file(name = name, src = "BUCK", visibility = ["PUBLIC"]) + +def rust_binary_from_crates(name): + # @lint-ignore BUCKLINT: avoid "Direct usage of native rules is not allowed." + native.genrule(name = name, cmd = "exit 1", executable = True, out = "out", visibility = ["PUBLIC"]) diff --git a/shim/third-party/rust/fixups/ahash/fixups.toml b/shim/third-party/rust/fixups/ahash/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/ahash/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/anyhow/fixups.toml b/shim/third-party/rust/fixups/anyhow/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/anyhow/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/async-trait/fixups.toml b/shim/third-party/rust/fixups/async-trait/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/async-trait/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/atomic/fixups.toml b/shim/third-party/rust/fixups/atomic/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/atomic/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/axum-core/fixups.toml b/shim/third-party/rust/fixups/axum-core/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/axum-core/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/axum/fixups.toml b/shim/third-party/rust/fixups/axum/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/axum/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/backtrace/fixups.toml b/shim/third-party/rust/fixups/backtrace/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/backtrace/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/blake3/fixups.toml b/shim/third-party/rust/fixups/blake3/fixups.toml new file mode 100644 index 000000000..389fd57ac --- /dev/null +++ b/shim/third-party/rust/fixups/blake3/fixups.toml @@ -0,0 +1,81 @@ +buildscript = [] + +## The various X86 platform fixups + +[platform_fixup.'cfg(target_arch = "x86_64")'] +cfgs = ["blake3_sse2_ffi", "blake3_sse41_ffi", "blake3_avx2_ffi", "blake3_avx512_ffi"] +buildscript = [] + +# , any(target_env = "fbcode", target_env = "gnu") +[[platform_fixup.'cfg(all(target_arch = "x86_64", any(target_os = "linux", target_os = "macos")))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", any(target_os = "linux", target_os = "macos")))'.buildscript.cxx_library] +name = "simd_x86_unix" +srcs = [ + "c/blake3.c", + "c/blake3_dispatch.c", + "c/blake3_portable.c", + "c/blake3_sse2_x86-64_unix.S", + "c/blake3_sse41_x86-64_unix.S", + "c/blake3_avx2_x86-64_unix.S", + "c/blake3_avx512_x86-64_unix.S" +] +# Older versions of Clang require these flags, even for assembly. See +# https://github.com/BLAKE3-team/BLAKE3/issues/79. +compiler_flags = ["-mavx512f", "-mavx512vl"] +headers = ["c/*.h"] +compatible_with = [ + "prelude//os/constraints:linux", + "prelude//os/constraints:macos", +] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript.cxx_library] +name = "simd_x86_windows_gnu" +srcs = [ + "c/blake3.c", + "c/blake3_dispatch.c", + "c/blake3_portable.c", + "c/blake3_sse2_x86-64_windows_gnu.S", + "c/blake3_sse41_x86-64_windows_gnu.S", + "c/blake3_avx2_x86-64_windows_gnu.S", + "c/blake3_avx512_x86-64_windows_gnu.S" +] +# Older versions of Clang require these flags, even for assembly. See +# https://github.com/BLAKE3-team/BLAKE3/issues/79. +compiler_flags = ["-mavx512f", "-mavx512vl"] +headers = ["c/*.h"] +compatible_with = ["prelude//os/constraints:windows"] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript.cxx_library] +name = "simd_x86_windows_msvc" +srcs = [ + "c/blake3.c", + "c/blake3_dispatch.c", + "c/blake3_portable.c", + "c/blake3_sse2_x86-64_windows_msvc.asm", + "c/blake3_sse41_x86-64_windows_msvc.asm", + "c/blake3_avx2_x86-64_windows_msvc.asm", + "c/blake3_avx512_x86-64_windows_msvc.asm" +] +headers = ["c/*.h"] +compatible_with = ["prelude//os/constraints:windows"] + +## ARM and AArch64 fixups + +[platform_fixup.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'] +cfgs = ["blake3_neon"] +buildscript = [] + +[[platform_fixup.'cfg(target_arch = "aarch64")'.buildscript]] +[platform_fixup.'cfg(target_arch = "aarch64")'.buildscript.cxx_library] +name = "simd_neon-aarch64" +srcs = ["c/blake3_neon.c"] +headers = ["c/*.h"] + +[[platform_fixup.'cfg(target_arch = "arm")'.buildscript]] +[platform_fixup.'cfg(target_arch = "arm")'.buildscript.cxx_library] +name = "simd_neon-armv7" +srcs = ["c/blake3_neon.c"] +compiler_flags = ["-mfpu=neon-vfpv4", "-mfloat-abi=hard"] +headers = ["c/*.h"] diff --git a/shim/third-party/rust/fixups/bumpalo/fixups.toml b/shim/third-party/rust/fixups/bumpalo/fixups.toml new file mode 100644 index 000000000..edd9a2079 --- /dev/null +++ b/shim/third-party/rust/fixups/bumpalo/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["README.md"] diff --git a/shim/third-party/rust/fixups/bzip2-sys/fixups.toml b/shim/third-party/rust/fixups/bzip2-sys/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/bzip2-sys/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/clap/fixups.toml b/shim/third-party/rust/fixups/clap/fixups.toml new file mode 100644 index 000000000..ee94fdc2f --- /dev/null +++ b/shim/third-party/rust/fixups/clap/fixups.toml @@ -0,0 +1 @@ +omit_features = ["deprecated"] diff --git a/shim/third-party/rust/fixups/clap_builder/fixups.toml b/shim/third-party/rust/fixups/clap_builder/fixups.toml new file mode 100644 index 000000000..edd9a2079 --- /dev/null +++ b/shim/third-party/rust/fixups/clap_builder/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["README.md"] diff --git a/shim/third-party/rust/fixups/clap_derive/fixups.toml b/shim/third-party/rust/fixups/clap_derive/fixups.toml new file mode 100644 index 000000000..ee94fdc2f --- /dev/null +++ b/shim/third-party/rust/fixups/clap_derive/fixups.toml @@ -0,0 +1 @@ +omit_features = ["deprecated"] diff --git a/shim/third-party/rust/fixups/core-foundation-sys/fixups.toml b/shim/third-party/rust/fixups/core-foundation-sys/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/core-foundation-sys/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/crc32fast/fixups.toml b/shim/third-party/rust/fixups/crc32fast/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/crc32fast/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/criterion/fixups.toml b/shim/third-party/rust/fixups/criterion/fixups.toml new file mode 100644 index 000000000..41439d335 --- /dev/null +++ b/shim/third-party/rust/fixups/criterion/fixups.toml @@ -0,0 +1 @@ +cargo_env = true diff --git a/shim/third-party/rust/fixups/crossbeam-epoch/fixups.toml b/shim/third-party/rust/fixups/crossbeam-epoch/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/crossbeam-epoch/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/crossbeam-queue/fixups.toml b/shim/third-party/rust/fixups/crossbeam-queue/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/crossbeam-queue/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/crossbeam-utils/fixups.toml b/shim/third-party/rust/fixups/crossbeam-utils/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/crossbeam-utils/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/crunchy/fixups.toml b/shim/third-party/rust/fixups/crunchy/fixups.toml new file mode 100644 index 000000000..ac9ebfb4a --- /dev/null +++ b/shim/third-party/rust/fixups/crunchy/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/darwin-libproc-sys/fixups.toml b/shim/third-party/rust/fixups/darwin-libproc-sys/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/darwin-libproc-sys/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/debugserver-types/fixups.toml b/shim/third-party/rust/fixups/debugserver-types/fixups.toml new file mode 100644 index 000000000..50645274f --- /dev/null +++ b/shim/third-party/rust/fixups/debugserver-types/fixups.toml @@ -0,0 +1,2 @@ +extra_srcs = ["src/schema.json"] +cargo_env = true diff --git a/shim/third-party/rust/fixups/erased-serde/fixups.toml b/shim/third-party/rust/fixups/erased-serde/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/erased-serde/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/fs-err/fixups.toml b/shim/third-party/rust/fixups/fs-err/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/fs-err/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/fs4/fixups.toml b/shim/third-party/rust/fixups/fs4/fixups.toml new file mode 100644 index 000000000..af7edb27e --- /dev/null +++ b/shim/third-party/rust/fixups/fs4/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/futures-channel/fixups.toml b/shim/third-party/rust/fixups/futures-channel/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/futures-channel/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/futures-core/fixups.toml b/shim/third-party/rust/fixups/futures-core/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/futures-core/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/futures-task/fixups.toml b/shim/third-party/rust/fixups/futures-task/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/futures-task/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/futures-util/fixups.toml b/shim/third-party/rust/fixups/futures-util/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/futures-util/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/generic-array/fixups.toml b/shim/third-party/rust/fixups/generic-array/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/generic-array/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/getrandom/fixups.toml b/shim/third-party/rust/fixups/getrandom/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/getrandom/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/httparse/fixups.toml b/shim/third-party/rust/fixups/httparse/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/httparse/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/hyper/fixups.toml b/shim/third-party/rust/fixups/hyper/fixups.toml new file mode 100644 index 000000000..9118e9de7 --- /dev/null +++ b/shim/third-party/rust/fixups/hyper/fixups.toml @@ -0,0 +1,5 @@ +# reindeer cannot see through `cfg_proto!` macros and the like +extra_srcs = ["src/**/*.rs"] + +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/indexmap/fixups.toml b/shim/third-party/rust/fixups/indexmap/fixups.toml new file mode 100644 index 000000000..4aa45eda1 --- /dev/null +++ b/shim/third-party/rust/fixups/indexmap/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cfgs = ["has_std"] diff --git a/shim/third-party/rust/fixups/io-lifetimes/fixups.toml b/shim/third-party/rust/fixups/io-lifetimes/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/io-lifetimes/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/jemalloc-sys/fixups.toml b/shim/third-party/rust/fixups/jemalloc-sys/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/jemalloc-sys/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/lalrpop/fixups.toml b/shim/third-party/rust/fixups/lalrpop/fixups.toml new file mode 100644 index 000000000..41439d335 --- /dev/null +++ b/shim/third-party/rust/fixups/lalrpop/fixups.toml @@ -0,0 +1 @@ +cargo_env = true diff --git a/shim/third-party/rust/fixups/lexical-core/fixups.toml b/shim/third-party/rust/fixups/lexical-core/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/lexical-core/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/libc/fixups.toml b/shim/third-party/rust/fixups/libc/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/libc/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/libm/fixups.toml b/shim/third-party/rust/fixups/libm/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/libm/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/libsqlite3-sys/fixups.toml b/shim/third-party/rust/fixups/libsqlite3-sys/fixups.toml new file mode 100644 index 000000000..b82bb848a --- /dev/null +++ b/shim/third-party/rust/fixups/libsqlite3-sys/fixups.toml @@ -0,0 +1,19 @@ +# libsqlite3-sys uses a bindgen binding to libsqlite. +# We can't easily import bindgen because of its libclang dependency, +# so in the meantime we need to use pre-generated bindgen files. + +extra_mapped_srcs = {"sqlite3/bindgen_bundled_version.rs" = "src/bindgen.rs"} + +[env] +OUT_DIR = "." + +[[buildscript]] +[buildscript.cxx_library] +name = "sqlite3" +srcs = ["sqlite3/sqlite3.c"] +headers = ["sqlite3/*.h"] +preprocessor_flags = [ + "-DSQLITE_ENABLE_COLUMN_METADATA", + "-DSQLITE_ENABLE_FTS3", + "-DSQLITE_ENABLE_RTREE", +] diff --git a/shim/third-party/rust/fixups/lock_api/fixups.toml b/shim/third-party/rust/fixups/lock_api/fixups.toml new file mode 100644 index 000000000..6c1a3d45a --- /dev/null +++ b/shim/third-party/rust/fixups/lock_api/fixups.toml @@ -0,0 +1,3 @@ +# the build script for lock_api is a version check for rust 1.61. +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/log/fixups.toml b/shim/third-party/rust/fixups/log/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/log/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/memchr/fixups.toml b/shim/third-party/rust/fixups/memchr/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/memchr/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/memoffset/fixups.toml b/shim/third-party/rust/fixups/memoffset/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/memoffset/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/mio/fixups.toml b/shim/third-party/rust/fixups/mio/fixups.toml new file mode 100644 index 000000000..af7edb27e --- /dev/null +++ b/shim/third-party/rust/fixups/mio/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/native-tls/fixups.toml b/shim/third-party/rust/fixups/native-tls/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/native-tls/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/nix/fixups.toml b/shim/third-party/rust/fixups/nix/fixups.toml new file mode 100644 index 000000000..1849ea069 --- /dev/null +++ b/shim/third-party/rust/fixups/nix/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/nom/fixups.toml b/shim/third-party/rust/fixups/nom/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/nom/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/ntapi/fixups.toml b/shim/third-party/rust/fixups/ntapi/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/ntapi/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/num-bigint/fixups.toml b/shim/third-party/rust/fixups/num-bigint/fixups.toml new file mode 100644 index 000000000..df0b424f4 --- /dev/null +++ b/shim/third-party/rust/fixups/num-bigint/fixups.toml @@ -0,0 +1,5 @@ +[[buildscript]] +[buildscript.rustc_flags] + +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/num-integer/fixups.toml b/shim/third-party/rust/fixups/num-integer/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/num-integer/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/num-traits/fixups.toml b/shim/third-party/rust/fixups/num-traits/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/num-traits/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/parking_lot/fixups.toml b/shim/third-party/rust/fixups/parking_lot/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/parking_lot/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/parking_lot_core/fixups.toml b/shim/third-party/rust/fixups/parking_lot_core/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/parking_lot_core/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/paste/fixups.toml b/shim/third-party/rust/fixups/paste/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/paste/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/pest/fixups.toml b/shim/third-party/rust/fixups/pest/fixups.toml new file mode 100644 index 000000000..af7edb27e --- /dev/null +++ b/shim/third-party/rust/fixups/pest/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/pin-project-internal/fixups.toml b/shim/third-party/rust/fixups/pin-project-internal/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/pin-project-internal/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/platforms/fixups.toml b/shim/third-party/rust/fixups/platforms/fixups.toml new file mode 100644 index 000000000..e086791cd --- /dev/null +++ b/shim/third-party/rust/fixups/platforms/fixups.toml @@ -0,0 +1,26 @@ +# Buildscript sets TARGET in environment +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "aarch64"))'] +env = { TARGET = "aarch64-unknown-linux-gnu" } +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "x86_64"))'] +env = { TARGET = "x86_64-unknown-linux-gnu" } +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "macos", target_arch = "aarch64"))'] +env = { TARGET = "aarch64-apple-darwin" } +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "macos", target_arch = "x86_64"))'] +env = { TARGET = "x86_64-apple-darwin" } +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "windows", target_env = "gnu"))'] +env = { TARGET = "x86_64-pc-windows-gnu" } +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'] +env = { TARGET = "x86_64-pc-windows-msvc" } +buildscript = [] diff --git a/shim/third-party/rust/fixups/prettyplease/fixups.toml b/shim/third-party/rust/fixups/prettyplease/fixups.toml new file mode 100644 index 000000000..351092842 --- /dev/null +++ b/shim/third-party/rust/fixups/prettyplease/fixups.toml @@ -0,0 +1,2 @@ +buildscript = [] +cargo_env = true diff --git a/shim/third-party/rust/fixups/proc-macro-error-attr/fixups.toml b/shim/third-party/rust/fixups/proc-macro-error-attr/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/proc-macro-error-attr/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/proc-macro-error/fixups.toml b/shim/third-party/rust/fixups/proc-macro-error/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/proc-macro-error/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/proc-macro-hack/fixups.toml b/shim/third-party/rust/fixups/proc-macro-hack/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/proc-macro-hack/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/proc-macro2/fixups.toml b/shim/third-party/rust/fixups/proc-macro2/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/proc-macro2/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/prost-build/fixups.toml b/shim/third-party/rust/fixups/prost-build/fixups.toml new file mode 100644 index 000000000..5865e6904 --- /dev/null +++ b/shim/third-party/rust/fixups/prost-build/fixups.toml @@ -0,0 +1,7 @@ +buildscript = [] + +# These are here because the crate uses the env! macro +# We override them at runtime. +[env] +PROTOC = "" +PROTOC_INCLUDE = "" diff --git a/shim/third-party/rust/fixups/pulldown-cmark/fixups.toml b/shim/third-party/rust/fixups/pulldown-cmark/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/pulldown-cmark/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/quote/fixups.toml b/shim/third-party/rust/fixups/quote/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/quote/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/radium/fixups.toml b/shim/third-party/rust/fixups/radium/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/radium/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/rayon-core/fixups.toml b/shim/third-party/rust/fixups/rayon-core/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/rayon-core/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/ref-cast/fixups.toml b/shim/third-party/rust/fixups/ref-cast/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/ref-cast/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/reqwest/fixups.toml b/shim/third-party/rust/fixups/reqwest/fixups.toml new file mode 100644 index 000000000..af7edb27e --- /dev/null +++ b/shim/third-party/rust/fixups/reqwest/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/ring/fixups.toml b/shim/third-party/rust/fixups/ring/fixups.toml new file mode 100644 index 000000000..d2c83589c --- /dev/null +++ b/shim/third-party/rust/fixups/ring/fixups.toml @@ -0,0 +1,162 @@ +# Copied from fbsource fixup. + +buildscript = [] + +# Generate a C/C++ build rule for all the C code + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.buildscript.cxx_library] +name = "ring-c-asm-elf-x86_84" +srcs = [ "crypto/**/*.c", "pregenerated/*x86_64*-elf.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] + +# redundant `any` is needed to differentiate key for config specific to v0.17.5 version +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "linux")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "linux")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "linux")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "linux")))'.buildscript.cxx_library] +name = "ring-c-asm-elf-x86_84" +srcs = [ "crypto/**/*.c", "pregenerated/*x86_64*-elf.S", "third_party/fiat/asm/fiat_curve25519_adx_mul.S", "third_party/fiat/asm/fiat_curve25519_adx_square.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.buildscript.cxx_library] +name = "ring-c-asm-elf-aarch64" +srcs = [ "crypto/**/*.c", "pregenerated/*armv8*-linux64.S", "pregenerated/*armx*-linux64.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +exclude = [ "crypto/cpu-intel.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] + +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "linux")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "linux")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "linux")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "linux")))'.buildscript.cxx_library] +name = "ring-c-asm-elf-aarch64" +srcs = [ "crypto/**/*.c", "pregenerated/*armv8*-linux64.S", "pregenerated/*armx*-linux64.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +exclude = [ "crypto/cpu-intel.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "macos"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "macos"))'.buildscript.cxx_library] +name = "ring-c-asm-macos-x86_64" +srcs = [ "crypto/**/*.c", "pregenerated/*x86_64*-macosx.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] + +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "macos")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "macos")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "macos")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "macos")))'.buildscript.cxx_library] +name = "ring-c-asm-macos-x86_64" +srcs = [ "crypto/**/*.c", "pregenerated/*x86_64*-macosx.S", "third_party/fiat/asm/fiat_curve25519_adx_mul.S", "third_party/fiat/asm/fiat_curve25519_adx_square.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "aarch64", target_os = "macos"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "aarch64", target_os = "macos"))'.buildscript.cxx_library] +name = "ring-c-asm-macos-arm64" +srcs = [ "crypto/**/*.c", "pregenerated/*armv8*-ios64.S", "pregenerated/*armx*-ios64.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +exclude = [ "crypto/cpu-intel.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] + +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "macos")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "macos")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "macos")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "aarch64", target_os = "macos")))'.buildscript.cxx_library] +name = "ring-c-asm-macos-arm64" +srcs = [ "crypto/**/*.c", "pregenerated/*armv8*-ios64.S", "pregenerated/*armx*-ios64.S" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +exclude = [ "crypto/cpu-intel.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu"))'.buildscript.cxx_library] +name = "ring-c-win-x86_84" +srcs = [ "crypto/**/*.c" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] + +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "gnu")))'.buildscript.cxx_library] +name = "ring-c-win-x86_84" +srcs = [ "crypto/**/*.c" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +compiler_flags = ["-Wno-error"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc"))'.buildscript.cxx_library] +name = "ring-c-win-msvc-x86_84" +srcs = [ "crypto/**/*.c" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] + +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")))'] +version = "=0.17.5" +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")))'.env] +RING_CORE_PREFIX = "ring_core_0_17_5_" +[[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows", target_env = "msvc")))'.buildscript.cxx_library] +name = "ring-c-win-msvc-x86_84" +srcs = [ "crypto/**/*.c" ] +headers = [ "include/**/*.h", "crypto/**/*.h", "third_party/**/*.h", "crypto/**/*.inl" ] +# Exclude C AES because we've got the x86_64 one +exclude = [ "crypto/fipsmodule/aes/aes.c" ] +include_paths = ["include"] +fixup_include_paths = ["include"] + +[[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows"))'.buildscript]] +[platform_fixup.'cfg(all(target_arch = "x86_64", target_os = "windows"))'.buildscript.prebuilt_cxx_library] +name = "ring-asm-windows-x86_84" +static_libs = [ "pregenerated/*x86_64*-nasm.obj" ] + +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows")))'] +version = "=0.17.5" +[[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows")))'.buildscript]] +[platform_fixup.'cfg(any(all(target_arch = "x86_64", target_os = "windows")))'.buildscript.prebuilt_cxx_library] +name = "ring-asm-windows-x86_84" +static_libs = [ "pregenerated/*x86_64*-nasm.o" ] diff --git a/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols.h b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols.h new file mode 100644 index 000000000..9ee40055e --- /dev/null +++ b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols.h @@ -0,0 +1,119 @@ + +#ifndef ring_core_generated_PREFIX_SYMBOLS_H +#define ring_core_generated_PREFIX_SYMBOLS_H + +#define ecp_nistz256_point_double p256_point_double +#define ecp_nistz256_point_add p256_point_add +#define ecp_nistz256_point_add_affine p256_point_add_affine +#define ecp_nistz256_ord_mul_mont p256_scalar_mul_mont +#define ecp_nistz256_ord_sqr_mont p256_scalar_sqr_rep_mont +#define ecp_nistz256_mul_mont p256_mul_mont +#define ecp_nistz256_sqr_mont p256_sqr_mont +#define CRYPTO_memcmp ring_core_0_17_5_CRYPTO_memcmp +#define CRYPTO_poly1305_finish ring_core_0_17_5_CRYPTO_poly1305_finish +#define CRYPTO_poly1305_finish_neon ring_core_0_17_5_CRYPTO_poly1305_finish_neon +#define CRYPTO_poly1305_init ring_core_0_17_5_CRYPTO_poly1305_init +#define CRYPTO_poly1305_init_neon ring_core_0_17_5_CRYPTO_poly1305_init_neon +#define CRYPTO_poly1305_update ring_core_0_17_5_CRYPTO_poly1305_update +#define CRYPTO_poly1305_update_neon ring_core_0_17_5_CRYPTO_poly1305_update_neon +#define ChaCha20_ctr32 ring_core_0_17_5_ChaCha20_ctr32 +#define LIMBS_add_mod ring_core_0_17_5_LIMBS_add_mod +#define LIMBS_are_even ring_core_0_17_5_LIMBS_are_even +#define LIMBS_are_zero ring_core_0_17_5_LIMBS_are_zero +#define LIMBS_equal ring_core_0_17_5_LIMBS_equal +#define LIMBS_equal_limb ring_core_0_17_5_LIMBS_equal_limb +#define LIMBS_less_than ring_core_0_17_5_LIMBS_less_than +#define LIMBS_less_than_limb ring_core_0_17_5_LIMBS_less_than_limb +#define LIMBS_reduce_once ring_core_0_17_5_LIMBS_reduce_once +#define LIMBS_select_512_32 ring_core_0_17_5_LIMBS_select_512_32 +#define LIMBS_shl_mod ring_core_0_17_5_LIMBS_shl_mod +#define LIMBS_sub_mod ring_core_0_17_5_LIMBS_sub_mod +#define LIMBS_window5_split_window ring_core_0_17_5_LIMBS_window5_split_window +#define LIMBS_window5_unsplit_window ring_core_0_17_5_LIMBS_window5_unsplit_window +#define LIMB_shr ring_core_0_17_5_LIMB_shr +#define OPENSSL_armcap_P ring_core_0_17_5_OPENSSL_armcap_P +#define OPENSSL_cpuid_setup ring_core_0_17_5_OPENSSL_cpuid_setup +#define OPENSSL_ia32cap_P ring_core_0_17_5_OPENSSL_ia32cap_P +#define aes_hw_ctr32_encrypt_blocks ring_core_0_17_5_aes_hw_ctr32_encrypt_blocks +#define aes_hw_encrypt ring_core_0_17_5_aes_hw_encrypt +#define aes_hw_set_encrypt_key ring_core_0_17_5_aes_hw_set_encrypt_key +#define aes_nohw_ctr32_encrypt_blocks ring_core_0_17_5_aes_nohw_ctr32_encrypt_blocks +#define aes_nohw_encrypt ring_core_0_17_5_aes_nohw_encrypt +#define aes_nohw_set_encrypt_key ring_core_0_17_5_aes_nohw_set_encrypt_key +#define aesni_gcm_decrypt ring_core_0_17_5_aesni_gcm_decrypt +#define aesni_gcm_encrypt ring_core_0_17_5_aesni_gcm_encrypt +#define bn_from_montgomery_in_place ring_core_0_17_5_bn_from_montgomery_in_place +#define bn_gather5 ring_core_0_17_5_bn_gather5 +#define bn_mul_mont ring_core_0_17_5_bn_mul_mont +#define bn_mul_mont_gather5 ring_core_0_17_5_bn_mul_mont_gather5 +#define bn_neg_inv_mod_r_u64 ring_core_0_17_5_bn_neg_inv_mod_r_u64 +#define bn_power5 ring_core_0_17_5_bn_power5 +#define bn_scatter5 ring_core_0_17_5_bn_scatter5 +#define bn_sqr8x_internal ring_core_0_17_5_bn_sqr8x_internal +#define bn_sqrx8x_internal ring_core_0_17_5_bn_sqrx8x_internal +#define bsaes_ctr32_encrypt_blocks ring_core_0_17_5_bsaes_ctr32_encrypt_blocks +#define bssl_constant_time_test_conditional_memcpy ring_core_0_17_5_bssl_constant_time_test_conditional_memcpy +#define bssl_constant_time_test_conditional_memxor ring_core_0_17_5_bssl_constant_time_test_conditional_memxor +#define bssl_constant_time_test_main ring_core_0_17_5_bssl_constant_time_test_main +#define chacha20_poly1305_open ring_core_0_17_5_chacha20_poly1305_open +#define chacha20_poly1305_seal ring_core_0_17_5_chacha20_poly1305_seal +#define fiat_curve25519_adx_mul ring_core_0_17_5_fiat_curve25519_adx_mul +#define fiat_curve25519_adx_square ring_core_0_17_5_fiat_curve25519_adx_square +#define gcm_ghash_avx ring_core_0_17_5_gcm_ghash_avx +#define gcm_ghash_clmul ring_core_0_17_5_gcm_ghash_clmul +#define gcm_ghash_neon ring_core_0_17_5_gcm_ghash_neon +#define gcm_gmult_clmul ring_core_0_17_5_gcm_gmult_clmul +#define gcm_gmult_neon ring_core_0_17_5_gcm_gmult_neon +#define gcm_init_avx ring_core_0_17_5_gcm_init_avx +#define gcm_init_clmul ring_core_0_17_5_gcm_init_clmul +#define gcm_init_neon ring_core_0_17_5_gcm_init_neon +#define k25519Precomp ring_core_0_17_5_k25519Precomp +#define limbs_mul_add_limb ring_core_0_17_5_limbs_mul_add_limb +#define little_endian_bytes_from_scalar ring_core_0_17_5_little_endian_bytes_from_scalar +#define ecp_nistz256_neg ring_core_0_17_5_ecp_nistz256_neg +#define ecp_nistz256_select_w5 ring_core_0_17_5_ecp_nistz256_select_w5 +#define ecp_nistz256_select_w7 ring_core_0_17_5_ecp_nistz256_select_w7 +#define p256_mul_mont ring_core_0_17_5_p256_mul_mont +#define p256_point_add ring_core_0_17_5_p256_point_add +#define p256_point_add_affine ring_core_0_17_5_p256_point_add_affine +#define p256_point_double ring_core_0_17_5_p256_point_double +#define p256_point_mul ring_core_0_17_5_p256_point_mul +#define p256_point_mul_base ring_core_0_17_5_p256_point_mul_base +#define p256_point_mul_base_vartime ring_core_0_17_5_p256_point_mul_base_vartime +#define p256_scalar_mul_mont ring_core_0_17_5_p256_scalar_mul_mont +#define p256_scalar_sqr_rep_mont ring_core_0_17_5_p256_scalar_sqr_rep_mont +#define p256_sqr_mont ring_core_0_17_5_p256_sqr_mont +#define p384_elem_div_by_2 ring_core_0_17_5_p384_elem_div_by_2 +#define p384_elem_mul_mont ring_core_0_17_5_p384_elem_mul_mont +#define p384_elem_neg ring_core_0_17_5_p384_elem_neg +#define p384_elem_sub ring_core_0_17_5_p384_elem_sub +#define p384_point_add ring_core_0_17_5_p384_point_add +#define p384_point_double ring_core_0_17_5_p384_point_double +#define p384_point_mul ring_core_0_17_5_p384_point_mul +#define p384_scalar_mul_mont ring_core_0_17_5_p384_scalar_mul_mont +#define openssl_poly1305_neon2_addmulmod ring_core_0_17_5_openssl_poly1305_neon2_addmulmod +#define openssl_poly1305_neon2_blocks ring_core_0_17_5_openssl_poly1305_neon2_blocks +#define sha256_block_data_order ring_core_0_17_5_sha256_block_data_order +#define sha512_block_data_order ring_core_0_17_5_sha512_block_data_order +#define vpaes_ctr32_encrypt_blocks ring_core_0_17_5_vpaes_ctr32_encrypt_blocks +#define vpaes_encrypt ring_core_0_17_5_vpaes_encrypt +#define vpaes_encrypt_key_to_bsaes ring_core_0_17_5_vpaes_encrypt_key_to_bsaes +#define vpaes_set_encrypt_key ring_core_0_17_5_vpaes_set_encrypt_key +#define x25519_NEON ring_core_0_17_5_x25519_NEON +#define x25519_fe_invert ring_core_0_17_5_x25519_fe_invert +#define x25519_fe_isnegative ring_core_0_17_5_x25519_fe_isnegative +#define x25519_fe_mul_ttt ring_core_0_17_5_x25519_fe_mul_ttt +#define x25519_fe_neg ring_core_0_17_5_x25519_fe_neg +#define x25519_fe_tobytes ring_core_0_17_5_x25519_fe_tobytes +#define x25519_ge_double_scalarmult_vartime ring_core_0_17_5_x25519_ge_double_scalarmult_vartime +#define x25519_ge_frombytes_vartime ring_core_0_17_5_x25519_ge_frombytes_vartime +#define x25519_ge_scalarmult_base ring_core_0_17_5_x25519_ge_scalarmult_base +#define x25519_ge_scalarmult_base_adx ring_core_0_17_5_x25519_ge_scalarmult_base_adx +#define x25519_public_from_private_generic_masked ring_core_0_17_5_x25519_public_from_private_generic_masked +#define x25519_sc_mask ring_core_0_17_5_x25519_sc_mask +#define x25519_sc_muladd ring_core_0_17_5_x25519_sc_muladd +#define x25519_sc_reduce ring_core_0_17_5_x25519_sc_reduce +#define x25519_scalar_mult_adx ring_core_0_17_5_x25519_scalar_mult_adx +#define x25519_scalar_mult_generic_masked ring_core_0_17_5_x25519_scalar_mult_generic_masked + +#endif diff --git a/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_asm.h b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_asm.h new file mode 100644 index 000000000..84e487091 --- /dev/null +++ b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_asm.h @@ -0,0 +1,236 @@ + +#ifndef ring_core_generated_PREFIX_SYMBOLS_ASM_H +#define ring_core_generated_PREFIX_SYMBOLS_ASM_H + +#if defined(__APPLE__) +#define _ecp_nistz256_point_double _p256_point_double +#define _ecp_nistz256_point_add _p256_point_add +#define _ecp_nistz256_point_add_affine _p256_point_add_affine +#define _ecp_nistz256_ord_mul_mont _p256_scalar_mul_mont +#define _ecp_nistz256_ord_sqr_mont _p256_scalar_sqr_rep_mont +#define _ecp_nistz256_mul_mont _p256_mul_mont +#define _ecp_nistz256_sqr_mont _p256_sqr_mont +#define _CRYPTO_memcmp _ring_core_0_17_5_CRYPTO_memcmp +#define _CRYPTO_poly1305_finish _ring_core_0_17_5_CRYPTO_poly1305_finish +#define _CRYPTO_poly1305_finish_neon _ring_core_0_17_5_CRYPTO_poly1305_finish_neon +#define _CRYPTO_poly1305_init _ring_core_0_17_5_CRYPTO_poly1305_init +#define _CRYPTO_poly1305_init_neon _ring_core_0_17_5_CRYPTO_poly1305_init_neon +#define _CRYPTO_poly1305_update _ring_core_0_17_5_CRYPTO_poly1305_update +#define _CRYPTO_poly1305_update_neon _ring_core_0_17_5_CRYPTO_poly1305_update_neon +#define _ChaCha20_ctr32 _ring_core_0_17_5_ChaCha20_ctr32 +#define _LIMBS_add_mod _ring_core_0_17_5_LIMBS_add_mod +#define _LIMBS_are_even _ring_core_0_17_5_LIMBS_are_even +#define _LIMBS_are_zero _ring_core_0_17_5_LIMBS_are_zero +#define _LIMBS_equal _ring_core_0_17_5_LIMBS_equal +#define _LIMBS_equal_limb _ring_core_0_17_5_LIMBS_equal_limb +#define _LIMBS_less_than _ring_core_0_17_5_LIMBS_less_than +#define _LIMBS_less_than_limb _ring_core_0_17_5_LIMBS_less_than_limb +#define _LIMBS_reduce_once _ring_core_0_17_5_LIMBS_reduce_once +#define _LIMBS_select_512_32 _ring_core_0_17_5_LIMBS_select_512_32 +#define _LIMBS_shl_mod _ring_core_0_17_5_LIMBS_shl_mod +#define _LIMBS_sub_mod _ring_core_0_17_5_LIMBS_sub_mod +#define _LIMBS_window5_split_window _ring_core_0_17_5_LIMBS_window5_split_window +#define _LIMBS_window5_unsplit_window _ring_core_0_17_5_LIMBS_window5_unsplit_window +#define _LIMB_shr _ring_core_0_17_5_LIMB_shr +#define _OPENSSL_armcap_P _ring_core_0_17_5_OPENSSL_armcap_P +#define _OPENSSL_cpuid_setup _ring_core_0_17_5_OPENSSL_cpuid_setup +#define _OPENSSL_ia32cap_P _ring_core_0_17_5_OPENSSL_ia32cap_P +#define _aes_hw_ctr32_encrypt_blocks _ring_core_0_17_5_aes_hw_ctr32_encrypt_blocks +#define _aes_hw_encrypt _ring_core_0_17_5_aes_hw_encrypt +#define _aes_hw_set_encrypt_key _ring_core_0_17_5_aes_hw_set_encrypt_key +#define _aes_nohw_ctr32_encrypt_blocks _ring_core_0_17_5_aes_nohw_ctr32_encrypt_blocks +#define _aes_nohw_encrypt _ring_core_0_17_5_aes_nohw_encrypt +#define _aes_nohw_set_encrypt_key _ring_core_0_17_5_aes_nohw_set_encrypt_key +#define _aesni_gcm_decrypt _ring_core_0_17_5_aesni_gcm_decrypt +#define _aesni_gcm_encrypt _ring_core_0_17_5_aesni_gcm_encrypt +#define _bn_from_montgomery_in_place _ring_core_0_17_5_bn_from_montgomery_in_place +#define _bn_gather5 _ring_core_0_17_5_bn_gather5 +#define _bn_mul_mont _ring_core_0_17_5_bn_mul_mont +#define _bn_mul_mont_gather5 _ring_core_0_17_5_bn_mul_mont_gather5 +#define _bn_neg_inv_mod_r_u64 _ring_core_0_17_5_bn_neg_inv_mod_r_u64 +#define _bn_power5 _ring_core_0_17_5_bn_power5 +#define _bn_scatter5 _ring_core_0_17_5_bn_scatter5 +#define _bn_sqr8x_internal _ring_core_0_17_5_bn_sqr8x_internal +#define _bn_sqrx8x_internal _ring_core_0_17_5_bn_sqrx8x_internal +#define _bsaes_ctr32_encrypt_blocks _ring_core_0_17_5_bsaes_ctr32_encrypt_blocks +#define _bssl_constant_time_test_conditional_memcpy _ring_core_0_17_5_bssl_constant_time_test_conditional_memcpy +#define _bssl_constant_time_test_conditional_memxor _ring_core_0_17_5_bssl_constant_time_test_conditional_memxor +#define _bssl_constant_time_test_main _ring_core_0_17_5_bssl_constant_time_test_main +#define _chacha20_poly1305_open _ring_core_0_17_5_chacha20_poly1305_open +#define _chacha20_poly1305_seal _ring_core_0_17_5_chacha20_poly1305_seal +#define _fiat_curve25519_adx_mul _ring_core_0_17_5_fiat_curve25519_adx_mul +#define _fiat_curve25519_adx_square _ring_core_0_17_5_fiat_curve25519_adx_square +#define _gcm_ghash_avx _ring_core_0_17_5_gcm_ghash_avx +#define _gcm_ghash_clmul _ring_core_0_17_5_gcm_ghash_clmul +#define _gcm_ghash_neon _ring_core_0_17_5_gcm_ghash_neon +#define _gcm_gmult_clmul _ring_core_0_17_5_gcm_gmult_clmul +#define _gcm_gmult_neon _ring_core_0_17_5_gcm_gmult_neon +#define _gcm_init_avx _ring_core_0_17_5_gcm_init_avx +#define _gcm_init_clmul _ring_core_0_17_5_gcm_init_clmul +#define _gcm_init_neon _ring_core_0_17_5_gcm_init_neon +#define _k25519Precomp _ring_core_0_17_5_k25519Precomp +#define _limbs_mul_add_limb _ring_core_0_17_5_limbs_mul_add_limb +#define _little_endian_bytes_from_scalar _ring_core_0_17_5_little_endian_bytes_from_scalar +#define _ecp_nistz256_neg _ring_core_0_17_5_ecp_nistz256_neg +#define _ecp_nistz256_select_w5 _ring_core_0_17_5_ecp_nistz256_select_w5 +#define _ecp_nistz256_select_w7 _ring_core_0_17_5_ecp_nistz256_select_w7 +#define _p256_mul_mont _ring_core_0_17_5_p256_mul_mont +#define _p256_point_add _ring_core_0_17_5_p256_point_add +#define _p256_point_add_affine _ring_core_0_17_5_p256_point_add_affine +#define _p256_point_double _ring_core_0_17_5_p256_point_double +#define _p256_point_mul _ring_core_0_17_5_p256_point_mul +#define _p256_point_mul_base _ring_core_0_17_5_p256_point_mul_base +#define _p256_point_mul_base_vartime _ring_core_0_17_5_p256_point_mul_base_vartime +#define _p256_scalar_mul_mont _ring_core_0_17_5_p256_scalar_mul_mont +#define _p256_scalar_sqr_rep_mont _ring_core_0_17_5_p256_scalar_sqr_rep_mont +#define _p256_sqr_mont _ring_core_0_17_5_p256_sqr_mont +#define _p384_elem_div_by_2 _ring_core_0_17_5_p384_elem_div_by_2 +#define _p384_elem_mul_mont _ring_core_0_17_5_p384_elem_mul_mont +#define _p384_elem_neg _ring_core_0_17_5_p384_elem_neg +#define _p384_elem_sub _ring_core_0_17_5_p384_elem_sub +#define _p384_point_add _ring_core_0_17_5_p384_point_add +#define _p384_point_double _ring_core_0_17_5_p384_point_double +#define _p384_point_mul _ring_core_0_17_5_p384_point_mul +#define _p384_scalar_mul_mont _ring_core_0_17_5_p384_scalar_mul_mont +#define _openssl_poly1305_neon2_addmulmod _ring_core_0_17_5_openssl_poly1305_neon2_addmulmod +#define _openssl_poly1305_neon2_blocks _ring_core_0_17_5_openssl_poly1305_neon2_blocks +#define _sha256_block_data_order _ring_core_0_17_5_sha256_block_data_order +#define _sha512_block_data_order _ring_core_0_17_5_sha512_block_data_order +#define _vpaes_ctr32_encrypt_blocks _ring_core_0_17_5_vpaes_ctr32_encrypt_blocks +#define _vpaes_encrypt _ring_core_0_17_5_vpaes_encrypt +#define _vpaes_encrypt_key_to_bsaes _ring_core_0_17_5_vpaes_encrypt_key_to_bsaes +#define _vpaes_set_encrypt_key _ring_core_0_17_5_vpaes_set_encrypt_key +#define _x25519_NEON _ring_core_0_17_5_x25519_NEON +#define _x25519_fe_invert _ring_core_0_17_5_x25519_fe_invert +#define _x25519_fe_isnegative _ring_core_0_17_5_x25519_fe_isnegative +#define _x25519_fe_mul_ttt _ring_core_0_17_5_x25519_fe_mul_ttt +#define _x25519_fe_neg _ring_core_0_17_5_x25519_fe_neg +#define _x25519_fe_tobytes _ring_core_0_17_5_x25519_fe_tobytes +#define _x25519_ge_double_scalarmult_vartime _ring_core_0_17_5_x25519_ge_double_scalarmult_vartime +#define _x25519_ge_frombytes_vartime _ring_core_0_17_5_x25519_ge_frombytes_vartime +#define _x25519_ge_scalarmult_base _ring_core_0_17_5_x25519_ge_scalarmult_base +#define _x25519_ge_scalarmult_base_adx _ring_core_0_17_5_x25519_ge_scalarmult_base_adx +#define _x25519_public_from_private_generic_masked _ring_core_0_17_5_x25519_public_from_private_generic_masked +#define _x25519_sc_mask _ring_core_0_17_5_x25519_sc_mask +#define _x25519_sc_muladd _ring_core_0_17_5_x25519_sc_muladd +#define _x25519_sc_reduce _ring_core_0_17_5_x25519_sc_reduce +#define _x25519_scalar_mult_adx _ring_core_0_17_5_x25519_scalar_mult_adx +#define _x25519_scalar_mult_generic_masked _ring_core_0_17_5_x25519_scalar_mult_generic_masked + +#else +#define ecp_nistz256_point_double p256_point_double +#define ecp_nistz256_point_add p256_point_add +#define ecp_nistz256_point_add_affine p256_point_add_affine +#define ecp_nistz256_ord_mul_mont p256_scalar_mul_mont +#define ecp_nistz256_ord_sqr_mont p256_scalar_sqr_rep_mont +#define ecp_nistz256_mul_mont p256_mul_mont +#define ecp_nistz256_sqr_mont p256_sqr_mont +#define CRYPTO_memcmp ring_core_0_17_5_CRYPTO_memcmp +#define CRYPTO_poly1305_finish ring_core_0_17_5_CRYPTO_poly1305_finish +#define CRYPTO_poly1305_finish_neon ring_core_0_17_5_CRYPTO_poly1305_finish_neon +#define CRYPTO_poly1305_init ring_core_0_17_5_CRYPTO_poly1305_init +#define CRYPTO_poly1305_init_neon ring_core_0_17_5_CRYPTO_poly1305_init_neon +#define CRYPTO_poly1305_update ring_core_0_17_5_CRYPTO_poly1305_update +#define CRYPTO_poly1305_update_neon ring_core_0_17_5_CRYPTO_poly1305_update_neon +#define ChaCha20_ctr32 ring_core_0_17_5_ChaCha20_ctr32 +#define LIMBS_add_mod ring_core_0_17_5_LIMBS_add_mod +#define LIMBS_are_even ring_core_0_17_5_LIMBS_are_even +#define LIMBS_are_zero ring_core_0_17_5_LIMBS_are_zero +#define LIMBS_equal ring_core_0_17_5_LIMBS_equal +#define LIMBS_equal_limb ring_core_0_17_5_LIMBS_equal_limb +#define LIMBS_less_than ring_core_0_17_5_LIMBS_less_than +#define LIMBS_less_than_limb ring_core_0_17_5_LIMBS_less_than_limb +#define LIMBS_reduce_once ring_core_0_17_5_LIMBS_reduce_once +#define LIMBS_select_512_32 ring_core_0_17_5_LIMBS_select_512_32 +#define LIMBS_shl_mod ring_core_0_17_5_LIMBS_shl_mod +#define LIMBS_sub_mod ring_core_0_17_5_LIMBS_sub_mod +#define LIMBS_window5_split_window ring_core_0_17_5_LIMBS_window5_split_window +#define LIMBS_window5_unsplit_window ring_core_0_17_5_LIMBS_window5_unsplit_window +#define LIMB_shr ring_core_0_17_5_LIMB_shr +#define OPENSSL_armcap_P ring_core_0_17_5_OPENSSL_armcap_P +#define OPENSSL_cpuid_setup ring_core_0_17_5_OPENSSL_cpuid_setup +#define OPENSSL_ia32cap_P ring_core_0_17_5_OPENSSL_ia32cap_P +#define aes_hw_ctr32_encrypt_blocks ring_core_0_17_5_aes_hw_ctr32_encrypt_blocks +#define aes_hw_encrypt ring_core_0_17_5_aes_hw_encrypt +#define aes_hw_set_encrypt_key ring_core_0_17_5_aes_hw_set_encrypt_key +#define aes_nohw_ctr32_encrypt_blocks ring_core_0_17_5_aes_nohw_ctr32_encrypt_blocks +#define aes_nohw_encrypt ring_core_0_17_5_aes_nohw_encrypt +#define aes_nohw_set_encrypt_key ring_core_0_17_5_aes_nohw_set_encrypt_key +#define aesni_gcm_decrypt ring_core_0_17_5_aesni_gcm_decrypt +#define aesni_gcm_encrypt ring_core_0_17_5_aesni_gcm_encrypt +#define bn_from_montgomery_in_place ring_core_0_17_5_bn_from_montgomery_in_place +#define bn_gather5 ring_core_0_17_5_bn_gather5 +#define bn_mul_mont ring_core_0_17_5_bn_mul_mont +#define bn_mul_mont_gather5 ring_core_0_17_5_bn_mul_mont_gather5 +#define bn_neg_inv_mod_r_u64 ring_core_0_17_5_bn_neg_inv_mod_r_u64 +#define bn_power5 ring_core_0_17_5_bn_power5 +#define bn_scatter5 ring_core_0_17_5_bn_scatter5 +#define bn_sqr8x_internal ring_core_0_17_5_bn_sqr8x_internal +#define bn_sqrx8x_internal ring_core_0_17_5_bn_sqrx8x_internal +#define bsaes_ctr32_encrypt_blocks ring_core_0_17_5_bsaes_ctr32_encrypt_blocks +#define bssl_constant_time_test_conditional_memcpy ring_core_0_17_5_bssl_constant_time_test_conditional_memcpy +#define bssl_constant_time_test_conditional_memxor ring_core_0_17_5_bssl_constant_time_test_conditional_memxor +#define bssl_constant_time_test_main ring_core_0_17_5_bssl_constant_time_test_main +#define chacha20_poly1305_open ring_core_0_17_5_chacha20_poly1305_open +#define chacha20_poly1305_seal ring_core_0_17_5_chacha20_poly1305_seal +#define fiat_curve25519_adx_mul ring_core_0_17_5_fiat_curve25519_adx_mul +#define fiat_curve25519_adx_square ring_core_0_17_5_fiat_curve25519_adx_square +#define gcm_ghash_avx ring_core_0_17_5_gcm_ghash_avx +#define gcm_ghash_clmul ring_core_0_17_5_gcm_ghash_clmul +#define gcm_ghash_neon ring_core_0_17_5_gcm_ghash_neon +#define gcm_gmult_clmul ring_core_0_17_5_gcm_gmult_clmul +#define gcm_gmult_neon ring_core_0_17_5_gcm_gmult_neon +#define gcm_init_avx ring_core_0_17_5_gcm_init_avx +#define gcm_init_clmul ring_core_0_17_5_gcm_init_clmul +#define gcm_init_neon ring_core_0_17_5_gcm_init_neon +#define k25519Precomp ring_core_0_17_5_k25519Precomp +#define limbs_mul_add_limb ring_core_0_17_5_limbs_mul_add_limb +#define little_endian_bytes_from_scalar ring_core_0_17_5_little_endian_bytes_from_scalar +#define ecp_nistz256_neg ring_core_0_17_5_ecp_nistz256_neg +#define ecp_nistz256_select_w5 ring_core_0_17_5_ecp_nistz256_select_w5 +#define ecp_nistz256_select_w7 ring_core_0_17_5_ecp_nistz256_select_w7 +#define p256_mul_mont ring_core_0_17_5_p256_mul_mont +#define p256_point_add ring_core_0_17_5_p256_point_add +#define p256_point_add_affine ring_core_0_17_5_p256_point_add_affine +#define p256_point_double ring_core_0_17_5_p256_point_double +#define p256_point_mul ring_core_0_17_5_p256_point_mul +#define p256_point_mul_base ring_core_0_17_5_p256_point_mul_base +#define p256_point_mul_base_vartime ring_core_0_17_5_p256_point_mul_base_vartime +#define p256_scalar_mul_mont ring_core_0_17_5_p256_scalar_mul_mont +#define p256_scalar_sqr_rep_mont ring_core_0_17_5_p256_scalar_sqr_rep_mont +#define p256_sqr_mont ring_core_0_17_5_p256_sqr_mont +#define p384_elem_div_by_2 ring_core_0_17_5_p384_elem_div_by_2 +#define p384_elem_mul_mont ring_core_0_17_5_p384_elem_mul_mont +#define p384_elem_neg ring_core_0_17_5_p384_elem_neg +#define p384_elem_sub ring_core_0_17_5_p384_elem_sub +#define p384_point_add ring_core_0_17_5_p384_point_add +#define p384_point_double ring_core_0_17_5_p384_point_double +#define p384_point_mul ring_core_0_17_5_p384_point_mul +#define p384_scalar_mul_mont ring_core_0_17_5_p384_scalar_mul_mont +#define openssl_poly1305_neon2_addmulmod ring_core_0_17_5_openssl_poly1305_neon2_addmulmod +#define openssl_poly1305_neon2_blocks ring_core_0_17_5_openssl_poly1305_neon2_blocks +#define sha256_block_data_order ring_core_0_17_5_sha256_block_data_order +#define sha512_block_data_order ring_core_0_17_5_sha512_block_data_order +#define vpaes_ctr32_encrypt_blocks ring_core_0_17_5_vpaes_ctr32_encrypt_blocks +#define vpaes_encrypt ring_core_0_17_5_vpaes_encrypt +#define vpaes_encrypt_key_to_bsaes ring_core_0_17_5_vpaes_encrypt_key_to_bsaes +#define vpaes_set_encrypt_key ring_core_0_17_5_vpaes_set_encrypt_key +#define x25519_NEON ring_core_0_17_5_x25519_NEON +#define x25519_fe_invert ring_core_0_17_5_x25519_fe_invert +#define x25519_fe_isnegative ring_core_0_17_5_x25519_fe_isnegative +#define x25519_fe_mul_ttt ring_core_0_17_5_x25519_fe_mul_ttt +#define x25519_fe_neg ring_core_0_17_5_x25519_fe_neg +#define x25519_fe_tobytes ring_core_0_17_5_x25519_fe_tobytes +#define x25519_ge_double_scalarmult_vartime ring_core_0_17_5_x25519_ge_double_scalarmult_vartime +#define x25519_ge_frombytes_vartime ring_core_0_17_5_x25519_ge_frombytes_vartime +#define x25519_ge_scalarmult_base ring_core_0_17_5_x25519_ge_scalarmult_base +#define x25519_ge_scalarmult_base_adx ring_core_0_17_5_x25519_ge_scalarmult_base_adx +#define x25519_public_from_private_generic_masked ring_core_0_17_5_x25519_public_from_private_generic_masked +#define x25519_sc_mask ring_core_0_17_5_x25519_sc_mask +#define x25519_sc_muladd ring_core_0_17_5_x25519_sc_muladd +#define x25519_sc_reduce ring_core_0_17_5_x25519_sc_reduce +#define x25519_scalar_mult_adx ring_core_0_17_5_x25519_scalar_mult_adx +#define x25519_scalar_mult_generic_masked ring_core_0_17_5_x25519_scalar_mult_generic_masked + +#endif +#endif diff --git a/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_nasm.inc b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_nasm.inc new file mode 100644 index 000000000..50e986a6a --- /dev/null +++ b/shim/third-party/rust/fixups/ring/include/ring_core_generated/prefix_symbols_nasm.inc @@ -0,0 +1,236 @@ + +%ifndef ring_core_generated_PREFIX_SYMBOLS_NASM_INC +%define ring_core_generated_PREFIX_SYMBOLS_NASM_INC + +%ifidn __OUTPUT_FORMAT__,win32 +%define _ecp_nistz256_point_double _p256_point_double +%define _ecp_nistz256_point_add _p256_point_add +%define _ecp_nistz256_point_add_affine _p256_point_add_affine +%define _ecp_nistz256_ord_mul_mont _p256_scalar_mul_mont +%define _ecp_nistz256_ord_sqr_mont _p256_scalar_sqr_rep_mont +%define _ecp_nistz256_mul_mont _p256_mul_mont +%define _ecp_nistz256_sqr_mont _p256_sqr_mont +%define _CRYPTO_memcmp _ring_core_0_17_5_CRYPTO_memcmp +%define _CRYPTO_poly1305_finish _ring_core_0_17_5_CRYPTO_poly1305_finish +%define _CRYPTO_poly1305_finish_neon _ring_core_0_17_5_CRYPTO_poly1305_finish_neon +%define _CRYPTO_poly1305_init _ring_core_0_17_5_CRYPTO_poly1305_init +%define _CRYPTO_poly1305_init_neon _ring_core_0_17_5_CRYPTO_poly1305_init_neon +%define _CRYPTO_poly1305_update _ring_core_0_17_5_CRYPTO_poly1305_update +%define _CRYPTO_poly1305_update_neon _ring_core_0_17_5_CRYPTO_poly1305_update_neon +%define _ChaCha20_ctr32 _ring_core_0_17_5_ChaCha20_ctr32 +%define _LIMBS_add_mod _ring_core_0_17_5_LIMBS_add_mod +%define _LIMBS_are_even _ring_core_0_17_5_LIMBS_are_even +%define _LIMBS_are_zero _ring_core_0_17_5_LIMBS_are_zero +%define _LIMBS_equal _ring_core_0_17_5_LIMBS_equal +%define _LIMBS_equal_limb _ring_core_0_17_5_LIMBS_equal_limb +%define _LIMBS_less_than _ring_core_0_17_5_LIMBS_less_than +%define _LIMBS_less_than_limb _ring_core_0_17_5_LIMBS_less_than_limb +%define _LIMBS_reduce_once _ring_core_0_17_5_LIMBS_reduce_once +%define _LIMBS_select_512_32 _ring_core_0_17_5_LIMBS_select_512_32 +%define _LIMBS_shl_mod _ring_core_0_17_5_LIMBS_shl_mod +%define _LIMBS_sub_mod _ring_core_0_17_5_LIMBS_sub_mod +%define _LIMBS_window5_split_window _ring_core_0_17_5_LIMBS_window5_split_window +%define _LIMBS_window5_unsplit_window _ring_core_0_17_5_LIMBS_window5_unsplit_window +%define _LIMB_shr _ring_core_0_17_5_LIMB_shr +%define _OPENSSL_armcap_P _ring_core_0_17_5_OPENSSL_armcap_P +%define _OPENSSL_cpuid_setup _ring_core_0_17_5_OPENSSL_cpuid_setup +%define _OPENSSL_ia32cap_P _ring_core_0_17_5_OPENSSL_ia32cap_P +%define _aes_hw_ctr32_encrypt_blocks _ring_core_0_17_5_aes_hw_ctr32_encrypt_blocks +%define _aes_hw_encrypt _ring_core_0_17_5_aes_hw_encrypt +%define _aes_hw_set_encrypt_key _ring_core_0_17_5_aes_hw_set_encrypt_key +%define _aes_nohw_ctr32_encrypt_blocks _ring_core_0_17_5_aes_nohw_ctr32_encrypt_blocks +%define _aes_nohw_encrypt _ring_core_0_17_5_aes_nohw_encrypt +%define _aes_nohw_set_encrypt_key _ring_core_0_17_5_aes_nohw_set_encrypt_key +%define _aesni_gcm_decrypt _ring_core_0_17_5_aesni_gcm_decrypt +%define _aesni_gcm_encrypt _ring_core_0_17_5_aesni_gcm_encrypt +%define _bn_from_montgomery_in_place _ring_core_0_17_5_bn_from_montgomery_in_place +%define _bn_gather5 _ring_core_0_17_5_bn_gather5 +%define _bn_mul_mont _ring_core_0_17_5_bn_mul_mont +%define _bn_mul_mont_gather5 _ring_core_0_17_5_bn_mul_mont_gather5 +%define _bn_neg_inv_mod_r_u64 _ring_core_0_17_5_bn_neg_inv_mod_r_u64 +%define _bn_power5 _ring_core_0_17_5_bn_power5 +%define _bn_scatter5 _ring_core_0_17_5_bn_scatter5 +%define _bn_sqr8x_internal _ring_core_0_17_5_bn_sqr8x_internal +%define _bn_sqrx8x_internal _ring_core_0_17_5_bn_sqrx8x_internal +%define _bsaes_ctr32_encrypt_blocks _ring_core_0_17_5_bsaes_ctr32_encrypt_blocks +%define _bssl_constant_time_test_conditional_memcpy _ring_core_0_17_5_bssl_constant_time_test_conditional_memcpy +%define _bssl_constant_time_test_conditional_memxor _ring_core_0_17_5_bssl_constant_time_test_conditional_memxor +%define _bssl_constant_time_test_main _ring_core_0_17_5_bssl_constant_time_test_main +%define _chacha20_poly1305_open _ring_core_0_17_5_chacha20_poly1305_open +%define _chacha20_poly1305_seal _ring_core_0_17_5_chacha20_poly1305_seal +%define _fiat_curve25519_adx_mul _ring_core_0_17_5_fiat_curve25519_adx_mul +%define _fiat_curve25519_adx_square _ring_core_0_17_5_fiat_curve25519_adx_square +%define _gcm_ghash_avx _ring_core_0_17_5_gcm_ghash_avx +%define _gcm_ghash_clmul _ring_core_0_17_5_gcm_ghash_clmul +%define _gcm_ghash_neon _ring_core_0_17_5_gcm_ghash_neon +%define _gcm_gmult_clmul _ring_core_0_17_5_gcm_gmult_clmul +%define _gcm_gmult_neon _ring_core_0_17_5_gcm_gmult_neon +%define _gcm_init_avx _ring_core_0_17_5_gcm_init_avx +%define _gcm_init_clmul _ring_core_0_17_5_gcm_init_clmul +%define _gcm_init_neon _ring_core_0_17_5_gcm_init_neon +%define _k25519Precomp _ring_core_0_17_5_k25519Precomp +%define _limbs_mul_add_limb _ring_core_0_17_5_limbs_mul_add_limb +%define _little_endian_bytes_from_scalar _ring_core_0_17_5_little_endian_bytes_from_scalar +%define _ecp_nistz256_neg _ring_core_0_17_5_ecp_nistz256_neg +%define _ecp_nistz256_select_w5 _ring_core_0_17_5_ecp_nistz256_select_w5 +%define _ecp_nistz256_select_w7 _ring_core_0_17_5_ecp_nistz256_select_w7 +%define _p256_mul_mont _ring_core_0_17_5_p256_mul_mont +%define _p256_point_add _ring_core_0_17_5_p256_point_add +%define _p256_point_add_affine _ring_core_0_17_5_p256_point_add_affine +%define _p256_point_double _ring_core_0_17_5_p256_point_double +%define _p256_point_mul _ring_core_0_17_5_p256_point_mul +%define _p256_point_mul_base _ring_core_0_17_5_p256_point_mul_base +%define _p256_point_mul_base_vartime _ring_core_0_17_5_p256_point_mul_base_vartime +%define _p256_scalar_mul_mont _ring_core_0_17_5_p256_scalar_mul_mont +%define _p256_scalar_sqr_rep_mont _ring_core_0_17_5_p256_scalar_sqr_rep_mont +%define _p256_sqr_mont _ring_core_0_17_5_p256_sqr_mont +%define _p384_elem_div_by_2 _ring_core_0_17_5_p384_elem_div_by_2 +%define _p384_elem_mul_mont _ring_core_0_17_5_p384_elem_mul_mont +%define _p384_elem_neg _ring_core_0_17_5_p384_elem_neg +%define _p384_elem_sub _ring_core_0_17_5_p384_elem_sub +%define _p384_point_add _ring_core_0_17_5_p384_point_add +%define _p384_point_double _ring_core_0_17_5_p384_point_double +%define _p384_point_mul _ring_core_0_17_5_p384_point_mul +%define _p384_scalar_mul_mont _ring_core_0_17_5_p384_scalar_mul_mont +%define _openssl_poly1305_neon2_addmulmod _ring_core_0_17_5_openssl_poly1305_neon2_addmulmod +%define _openssl_poly1305_neon2_blocks _ring_core_0_17_5_openssl_poly1305_neon2_blocks +%define _sha256_block_data_order _ring_core_0_17_5_sha256_block_data_order +%define _sha512_block_data_order _ring_core_0_17_5_sha512_block_data_order +%define _vpaes_ctr32_encrypt_blocks _ring_core_0_17_5_vpaes_ctr32_encrypt_blocks +%define _vpaes_encrypt _ring_core_0_17_5_vpaes_encrypt +%define _vpaes_encrypt_key_to_bsaes _ring_core_0_17_5_vpaes_encrypt_key_to_bsaes +%define _vpaes_set_encrypt_key _ring_core_0_17_5_vpaes_set_encrypt_key +%define _x25519_NEON _ring_core_0_17_5_x25519_NEON +%define _x25519_fe_invert _ring_core_0_17_5_x25519_fe_invert +%define _x25519_fe_isnegative _ring_core_0_17_5_x25519_fe_isnegative +%define _x25519_fe_mul_ttt _ring_core_0_17_5_x25519_fe_mul_ttt +%define _x25519_fe_neg _ring_core_0_17_5_x25519_fe_neg +%define _x25519_fe_tobytes _ring_core_0_17_5_x25519_fe_tobytes +%define _x25519_ge_double_scalarmult_vartime _ring_core_0_17_5_x25519_ge_double_scalarmult_vartime +%define _x25519_ge_frombytes_vartime _ring_core_0_17_5_x25519_ge_frombytes_vartime +%define _x25519_ge_scalarmult_base _ring_core_0_17_5_x25519_ge_scalarmult_base +%define _x25519_ge_scalarmult_base_adx _ring_core_0_17_5_x25519_ge_scalarmult_base_adx +%define _x25519_public_from_private_generic_masked _ring_core_0_17_5_x25519_public_from_private_generic_masked +%define _x25519_sc_mask _ring_core_0_17_5_x25519_sc_mask +%define _x25519_sc_muladd _ring_core_0_17_5_x25519_sc_muladd +%define _x25519_sc_reduce _ring_core_0_17_5_x25519_sc_reduce +%define _x25519_scalar_mult_adx _ring_core_0_17_5_x25519_scalar_mult_adx +%define _x25519_scalar_mult_generic_masked _ring_core_0_17_5_x25519_scalar_mult_generic_masked + +%else +%define ecp_nistz256_point_double p256_point_double +%define ecp_nistz256_point_add p256_point_add +%define ecp_nistz256_point_add_affine p256_point_add_affine +%define ecp_nistz256_ord_mul_mont p256_scalar_mul_mont +%define ecp_nistz256_ord_sqr_mont p256_scalar_sqr_rep_mont +%define ecp_nistz256_mul_mont p256_mul_mont +%define ecp_nistz256_sqr_mont p256_sqr_mont +%define CRYPTO_memcmp ring_core_0_17_5_CRYPTO_memcmp +%define CRYPTO_poly1305_finish ring_core_0_17_5_CRYPTO_poly1305_finish +%define CRYPTO_poly1305_finish_neon ring_core_0_17_5_CRYPTO_poly1305_finish_neon +%define CRYPTO_poly1305_init ring_core_0_17_5_CRYPTO_poly1305_init +%define CRYPTO_poly1305_init_neon ring_core_0_17_5_CRYPTO_poly1305_init_neon +%define CRYPTO_poly1305_update ring_core_0_17_5_CRYPTO_poly1305_update +%define CRYPTO_poly1305_update_neon ring_core_0_17_5_CRYPTO_poly1305_update_neon +%define ChaCha20_ctr32 ring_core_0_17_5_ChaCha20_ctr32 +%define LIMBS_add_mod ring_core_0_17_5_LIMBS_add_mod +%define LIMBS_are_even ring_core_0_17_5_LIMBS_are_even +%define LIMBS_are_zero ring_core_0_17_5_LIMBS_are_zero +%define LIMBS_equal ring_core_0_17_5_LIMBS_equal +%define LIMBS_equal_limb ring_core_0_17_5_LIMBS_equal_limb +%define LIMBS_less_than ring_core_0_17_5_LIMBS_less_than +%define LIMBS_less_than_limb ring_core_0_17_5_LIMBS_less_than_limb +%define LIMBS_reduce_once ring_core_0_17_5_LIMBS_reduce_once +%define LIMBS_select_512_32 ring_core_0_17_5_LIMBS_select_512_32 +%define LIMBS_shl_mod ring_core_0_17_5_LIMBS_shl_mod +%define LIMBS_sub_mod ring_core_0_17_5_LIMBS_sub_mod +%define LIMBS_window5_split_window ring_core_0_17_5_LIMBS_window5_split_window +%define LIMBS_window5_unsplit_window ring_core_0_17_5_LIMBS_window5_unsplit_window +%define LIMB_shr ring_core_0_17_5_LIMB_shr +%define OPENSSL_armcap_P ring_core_0_17_5_OPENSSL_armcap_P +%define OPENSSL_cpuid_setup ring_core_0_17_5_OPENSSL_cpuid_setup +%define OPENSSL_ia32cap_P ring_core_0_17_5_OPENSSL_ia32cap_P +%define aes_hw_ctr32_encrypt_blocks ring_core_0_17_5_aes_hw_ctr32_encrypt_blocks +%define aes_hw_encrypt ring_core_0_17_5_aes_hw_encrypt +%define aes_hw_set_encrypt_key ring_core_0_17_5_aes_hw_set_encrypt_key +%define aes_nohw_ctr32_encrypt_blocks ring_core_0_17_5_aes_nohw_ctr32_encrypt_blocks +%define aes_nohw_encrypt ring_core_0_17_5_aes_nohw_encrypt +%define aes_nohw_set_encrypt_key ring_core_0_17_5_aes_nohw_set_encrypt_key +%define aesni_gcm_decrypt ring_core_0_17_5_aesni_gcm_decrypt +%define aesni_gcm_encrypt ring_core_0_17_5_aesni_gcm_encrypt +%define bn_from_montgomery_in_place ring_core_0_17_5_bn_from_montgomery_in_place +%define bn_gather5 ring_core_0_17_5_bn_gather5 +%define bn_mul_mont ring_core_0_17_5_bn_mul_mont +%define bn_mul_mont_gather5 ring_core_0_17_5_bn_mul_mont_gather5 +%define bn_neg_inv_mod_r_u64 ring_core_0_17_5_bn_neg_inv_mod_r_u64 +%define bn_power5 ring_core_0_17_5_bn_power5 +%define bn_scatter5 ring_core_0_17_5_bn_scatter5 +%define bn_sqr8x_internal ring_core_0_17_5_bn_sqr8x_internal +%define bn_sqrx8x_internal ring_core_0_17_5_bn_sqrx8x_internal +%define bsaes_ctr32_encrypt_blocks ring_core_0_17_5_bsaes_ctr32_encrypt_blocks +%define bssl_constant_time_test_conditional_memcpy ring_core_0_17_5_bssl_constant_time_test_conditional_memcpy +%define bssl_constant_time_test_conditional_memxor ring_core_0_17_5_bssl_constant_time_test_conditional_memxor +%define bssl_constant_time_test_main ring_core_0_17_5_bssl_constant_time_test_main +%define chacha20_poly1305_open ring_core_0_17_5_chacha20_poly1305_open +%define chacha20_poly1305_seal ring_core_0_17_5_chacha20_poly1305_seal +%define fiat_curve25519_adx_mul ring_core_0_17_5_fiat_curve25519_adx_mul +%define fiat_curve25519_adx_square ring_core_0_17_5_fiat_curve25519_adx_square +%define gcm_ghash_avx ring_core_0_17_5_gcm_ghash_avx +%define gcm_ghash_clmul ring_core_0_17_5_gcm_ghash_clmul +%define gcm_ghash_neon ring_core_0_17_5_gcm_ghash_neon +%define gcm_gmult_clmul ring_core_0_17_5_gcm_gmult_clmul +%define gcm_gmult_neon ring_core_0_17_5_gcm_gmult_neon +%define gcm_init_avx ring_core_0_17_5_gcm_init_avx +%define gcm_init_clmul ring_core_0_17_5_gcm_init_clmul +%define gcm_init_neon ring_core_0_17_5_gcm_init_neon +%define k25519Precomp ring_core_0_17_5_k25519Precomp +%define limbs_mul_add_limb ring_core_0_17_5_limbs_mul_add_limb +%define little_endian_bytes_from_scalar ring_core_0_17_5_little_endian_bytes_from_scalar +%define ecp_nistz256_neg ring_core_0_17_5_ecp_nistz256_neg +%define ecp_nistz256_select_w5 ring_core_0_17_5_ecp_nistz256_select_w5 +%define ecp_nistz256_select_w7 ring_core_0_17_5_ecp_nistz256_select_w7 +%define p256_mul_mont ring_core_0_17_5_p256_mul_mont +%define p256_point_add ring_core_0_17_5_p256_point_add +%define p256_point_add_affine ring_core_0_17_5_p256_point_add_affine +%define p256_point_double ring_core_0_17_5_p256_point_double +%define p256_point_mul ring_core_0_17_5_p256_point_mul +%define p256_point_mul_base ring_core_0_17_5_p256_point_mul_base +%define p256_point_mul_base_vartime ring_core_0_17_5_p256_point_mul_base_vartime +%define p256_scalar_mul_mont ring_core_0_17_5_p256_scalar_mul_mont +%define p256_scalar_sqr_rep_mont ring_core_0_17_5_p256_scalar_sqr_rep_mont +%define p256_sqr_mont ring_core_0_17_5_p256_sqr_mont +%define p384_elem_div_by_2 ring_core_0_17_5_p384_elem_div_by_2 +%define p384_elem_mul_mont ring_core_0_17_5_p384_elem_mul_mont +%define p384_elem_neg ring_core_0_17_5_p384_elem_neg +%define p384_elem_sub ring_core_0_17_5_p384_elem_sub +%define p384_point_add ring_core_0_17_5_p384_point_add +%define p384_point_double ring_core_0_17_5_p384_point_double +%define p384_point_mul ring_core_0_17_5_p384_point_mul +%define p384_scalar_mul_mont ring_core_0_17_5_p384_scalar_mul_mont +%define openssl_poly1305_neon2_addmulmod ring_core_0_17_5_openssl_poly1305_neon2_addmulmod +%define openssl_poly1305_neon2_blocks ring_core_0_17_5_openssl_poly1305_neon2_blocks +%define sha256_block_data_order ring_core_0_17_5_sha256_block_data_order +%define sha512_block_data_order ring_core_0_17_5_sha512_block_data_order +%define vpaes_ctr32_encrypt_blocks ring_core_0_17_5_vpaes_ctr32_encrypt_blocks +%define vpaes_encrypt ring_core_0_17_5_vpaes_encrypt +%define vpaes_encrypt_key_to_bsaes ring_core_0_17_5_vpaes_encrypt_key_to_bsaes +%define vpaes_set_encrypt_key ring_core_0_17_5_vpaes_set_encrypt_key +%define x25519_NEON ring_core_0_17_5_x25519_NEON +%define x25519_fe_invert ring_core_0_17_5_x25519_fe_invert +%define x25519_fe_isnegative ring_core_0_17_5_x25519_fe_isnegative +%define x25519_fe_mul_ttt ring_core_0_17_5_x25519_fe_mul_ttt +%define x25519_fe_neg ring_core_0_17_5_x25519_fe_neg +%define x25519_fe_tobytes ring_core_0_17_5_x25519_fe_tobytes +%define x25519_ge_double_scalarmult_vartime ring_core_0_17_5_x25519_ge_double_scalarmult_vartime +%define x25519_ge_frombytes_vartime ring_core_0_17_5_x25519_ge_frombytes_vartime +%define x25519_ge_scalarmult_base ring_core_0_17_5_x25519_ge_scalarmult_base +%define x25519_ge_scalarmult_base_adx ring_core_0_17_5_x25519_ge_scalarmult_base_adx +%define x25519_public_from_private_generic_masked ring_core_0_17_5_x25519_public_from_private_generic_masked +%define x25519_sc_mask ring_core_0_17_5_x25519_sc_mask +%define x25519_sc_muladd ring_core_0_17_5_x25519_sc_muladd +%define x25519_sc_reduce ring_core_0_17_5_x25519_sc_reduce +%define x25519_scalar_mult_adx ring_core_0_17_5_x25519_scalar_mult_adx +%define x25519_scalar_mult_generic_masked ring_core_0_17_5_x25519_scalar_mult_generic_masked + +%endif +%endif diff --git a/shim/third-party/rust/fixups/rustix/fixups.toml b/shim/third-party/rust/fixups/rustix/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/rustix/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/rustls/fixups.toml b/shim/third-party/rust/fixups/rustls/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/rustls/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/rustversion/fixups.toml b/shim/third-party/rust/fixups/rustversion/fixups.toml new file mode 100644 index 000000000..ac9ebfb4a --- /dev/null +++ b/shim/third-party/rust/fixups/rustversion/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/serde/fixups.toml b/shim/third-party/rust/fixups/serde/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/serde/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/serde_derive/fixups.toml b/shim/third-party/rust/fixups/serde_derive/fixups.toml new file mode 100644 index 000000000..7de4ebb3e --- /dev/null +++ b/shim/third-party/rust/fixups/serde_derive/fixups.toml @@ -0,0 +1,3 @@ +# To set `CARGO_MANIFEST_DIR` +cargo_env = true +buildscript = [] diff --git a/shim/third-party/rust/fixups/serde_json/fixups.toml b/shim/third-party/rust/fixups/serde_json/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/serde_json/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/signal-hook/fixups.toml b/shim/third-party/rust/fixups/signal-hook/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/signal-hook/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/slab/fixups.toml b/shim/third-party/rust/fixups/slab/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/slab/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/slog/fixups.toml b/shim/third-party/rust/fixups/slog/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/slog/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/syn/fixups.toml b/shim/third-party/rust/fixups/syn/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/syn/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/sys-info/fixups.toml b/shim/third-party/rust/fixups/sys-info/fixups.toml new file mode 100644 index 000000000..5d124b3ad --- /dev/null +++ b/shim/third-party/rust/fixups/sys-info/fixups.toml @@ -0,0 +1,19 @@ +buildscript = [] + +[[platform_fixup.'cfg(target_os = "linux")'.buildscript]] +[platform_fixup.'cfg(target_os = "linux")'.buildscript.cxx_library] +name = "linux" +srcs = ["c/linux.c"] +headers = ["c/*.h"] + +[[platform_fixup.'cfg(target_os = "macos")'.buildscript]] +[platform_fixup.'cfg(target_os = "macos")'.buildscript.cxx_library] +name = "macos" +srcs = ["c/darwin.c"] +headers = ["c/*.h"] + +[[platform_fixup.'cfg(target_os = "windows")'.buildscript]] +[platform_fixup.'cfg(target_os = "windows")'.buildscript.cxx_library] +name = "windows" +srcs = ["c/windows.c"] +headers = ["c/*.h"] diff --git a/shim/third-party/rust/fixups/sysinfo/fixups.toml b/shim/third-party/rust/fixups/sysinfo/fixups.toml new file mode 100644 index 000000000..8518b1897 --- /dev/null +++ b/shim/third-party/rust/fixups/sysinfo/fixups.toml @@ -0,0 +1,11 @@ +extra_srcs = ["README.md", "md_doc/**/*.md"] +buildscript = [] + +[platform_fixup.'cfg(target_os = "macos")'] +buildscript = [] +rustc_flags = [ + "-lframework=IOKit", + "-lframework=Foundation", + "-lframework=CoreFoundation", + "-lframework=DiskArbitration", +] diff --git a/shim/third-party/rust/fixups/tempfile/fixups.toml b/shim/third-party/rust/fixups/tempfile/fixups.toml new file mode 100644 index 000000000..5e026f75e --- /dev/null +++ b/shim/third-party/rust/fixups/tempfile/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/terminfo/fixups.toml b/shim/third-party/rust/fixups/terminfo/fixups.toml new file mode 100644 index 000000000..ac9ebfb4a --- /dev/null +++ b/shim/third-party/rust/fixups/terminfo/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/termwiz/fixups.toml b/shim/third-party/rust/fixups/termwiz/fixups.toml new file mode 100644 index 000000000..fdba1eb21 --- /dev/null +++ b/shim/third-party/rust/fixups/termwiz/fixups.toml @@ -0,0 +1,2 @@ +cargo_env = true +extra_srcs = ["src/**/*.pest"] diff --git a/shim/third-party/rust/fixups/test-case/fixups.toml b/shim/third-party/rust/fixups/test-case/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/test-case/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/thiserror/fixups.toml b/shim/third-party/rust/fixups/thiserror/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/thiserror/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/tiny-keccak/fixups.toml b/shim/third-party/rust/fixups/tiny-keccak/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/tiny-keccak/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/tokio-stream/fixups.toml b/shim/third-party/rust/fixups/tokio-stream/fixups.toml new file mode 100644 index 000000000..a1f4f0e70 --- /dev/null +++ b/shim/third-party/rust/fixups/tokio-stream/fixups.toml @@ -0,0 +1,2 @@ +# reindeer cannot see through `cfg_sync!` macros and the like +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/tokio-util/fixups.toml b/shim/third-party/rust/fixups/tokio-util/fixups.toml new file mode 100644 index 000000000..af7edb27e --- /dev/null +++ b/shim/third-party/rust/fixups/tokio-util/fixups.toml @@ -0,0 +1 @@ +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/tokio/fixups.toml b/shim/third-party/rust/fixups/tokio/fixups.toml new file mode 100644 index 000000000..d69dcefdd --- /dev/null +++ b/shim/third-party/rust/fixups/tokio/fixups.toml @@ -0,0 +1,8 @@ +cfgs = ["tokio_unstable", "tokio_track_caller"] + +extra_srcs = ["src/**/*.rs"] + +buildscript = [] +features = ["tokio_track_caller"] + +extra_deps = [ ":tracing" ] diff --git a/shim/third-party/rust/fixups/tonic/fixups.toml b/shim/third-party/rust/fixups/tonic/fixups.toml new file mode 100644 index 000000000..41439d335 --- /dev/null +++ b/shim/third-party/rust/fixups/tonic/fixups.toml @@ -0,0 +1 @@ +cargo_env = true diff --git a/shim/third-party/rust/fixups/tracing-subscriber/fixups.toml b/shim/third-party/rust/fixups/tracing-subscriber/fixups.toml new file mode 100644 index 000000000..28683dbe3 --- /dev/null +++ b/shim/third-party/rust/fixups/tracing-subscriber/fixups.toml @@ -0,0 +1,2 @@ +# Reindeer can't find the dependencies due to being confused by the feature! macro. +extra_srcs = ["src/**/*.rs"] diff --git a/shim/third-party/rust/fixups/trybuild/fixups.toml b/shim/third-party/rust/fixups/trybuild/fixups.toml new file mode 100644 index 000000000..ac9ebfb4a --- /dev/null +++ b/shim/third-party/rust/fixups/trybuild/fixups.toml @@ -0,0 +1,2 @@ +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/typenum/fixups.toml b/shim/third-party/rust/fixups/typenum/fixups.toml new file mode 100644 index 000000000..7ab02e4fd --- /dev/null +++ b/shim/third-party/rust/fixups/typenum/fixups.toml @@ -0,0 +1,4 @@ +features = ["force_unix_path_separator"] + +[[buildscript]] +[buildscript.gen_srcs] diff --git a/shim/third-party/rust/fixups/unicase/fixups.toml b/shim/third-party/rust/fixups/unicase/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/unicase/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/winapi-x86_64-pc-windows-gnu/fixups.toml b/shim/third-party/rust/fixups/winapi-x86_64-pc-windows-gnu/fixups.toml new file mode 100644 index 000000000..07c79834d --- /dev/null +++ b/shim/third-party/rust/fixups/winapi-x86_64-pc-windows-gnu/fixups.toml @@ -0,0 +1,9 @@ +buildscript = [] + +[[platform_fixup.'cfg(target_os = "windows")'.buildscript]] +[platform_fixup.'cfg(target_os = "windows")'.buildscript.prebuilt_cxx_library] +name = "extra_libraries" +# The static_libs this crate provides overlaps quite heavily with those in a default +# MinGW install, and there are also many that are DirectX specific. +# We list only those we actually need, since the others are more likely to cause problems. +static_libs = ["lib/libwinapi_ole32.a", "lib/libwinapi_shell32.a"] diff --git a/shim/third-party/rust/fixups/winapi/fixups.toml b/shim/third-party/rust/fixups/winapi/fixups.toml new file mode 100644 index 000000000..ec4f86e50 --- /dev/null +++ b/shim/third-party/rust/fixups/winapi/fixups.toml @@ -0,0 +1,4 @@ +buildscript = [] + +[[platform_fixup.'cfg(target_os = "windows")'.buildscript]] +[platform_fixup.'cfg(target_os = "windows")'.buildscript.rustc_flags] diff --git a/shim/third-party/rust/fixups/windows-targets/fixups.toml b/shim/third-party/rust/fixups/windows-targets/fixups.toml new file mode 100644 index 000000000..b3555c779 --- /dev/null +++ b/shim/third-party/rust/fixups/windows-targets/fixups.toml @@ -0,0 +1,3 @@ +[platform_fixup.'cfg(any(target_os = "windows", target_os = "linux"))'] +version = ">=0.48.0" +cfgs = ["windows_raw_dylib"] diff --git a/shim/third-party/rust/fixups/windows_aarch64_gnullvm/fixups.toml b/shim/third-party/rust/fixups/windows_aarch64_gnullvm/fixups.toml new file mode 100644 index 000000000..f40e9f9cb --- /dev/null +++ b/shim/third-party/rust/fixups/windows_aarch64_gnullvm/fixups.toml @@ -0,0 +1,8 @@ +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "aarch64"))'] +version = "=0.48.0" +[[platform_fixup.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.buildscript]] +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "aarch64"))'.buildscript.prebuilt_cxx_library] +name = "libwindows" +static_libs = ["lib/libwindows.0.48.0.a"] diff --git a/shim/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml b/shim/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml new file mode 100644 index 000000000..b25e7f05f --- /dev/null +++ b/shim/third-party/rust/fixups/windows_x86_64_gnu/fixups.toml @@ -0,0 +1,8 @@ +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "windows", target_env = "gnu"))'] +version = "=0.48.0" +[[platform_fixup.'cfg(all(target_os = "windows", target_env = "gnu"))'.buildscript]] +[platform_fixup.'cfg(all(target_os = "windows", target_env = "gnu"))'.buildscript.prebuilt_cxx_library] +name = "libwindows" +static_libs = ["lib/libwindows.0.48.0.a"] diff --git a/shim/third-party/rust/fixups/windows_x86_64_gnullvm/fixups.toml b/shim/third-party/rust/fixups/windows_x86_64_gnullvm/fixups.toml new file mode 100644 index 000000000..a5579b693 --- /dev/null +++ b/shim/third-party/rust/fixups/windows_x86_64_gnullvm/fixups.toml @@ -0,0 +1,8 @@ +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "x86_64"))'] +version = "=0.48.0" +[[platform_fixup.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.buildscript]] +[platform_fixup.'cfg(all(target_os = "linux", target_arch = "x86_64"))'.buildscript.prebuilt_cxx_library] +name = "libwindows" +static_libs = ["lib/libwindows.0.48.0.a"] diff --git a/shim/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml b/shim/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml new file mode 100644 index 000000000..8e8dea351 --- /dev/null +++ b/shim/third-party/rust/fixups/windows_x86_64_msvc/fixups.toml @@ -0,0 +1,8 @@ +buildscript = [] + +[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'] +version = "=0.48.0" +[[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'.buildscript]] +[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'.buildscript.prebuilt_cxx_library] +name = "windows" +static_libs = ["lib/windows.0.48.0.lib"] diff --git a/shim/third-party/rust/fixups/winreg/fixups.toml b/shim/third-party/rust/fixups/winreg/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/winreg/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/zerocopy/fixups.toml b/shim/third-party/rust/fixups/zerocopy/fixups.toml new file mode 100644 index 000000000..41439d335 --- /dev/null +++ b/shim/third-party/rust/fixups/zerocopy/fixups.toml @@ -0,0 +1 @@ +cargo_env = true diff --git a/shim/third-party/rust/fixups/zstd-safe/fixups.toml b/shim/third-party/rust/fixups/zstd-safe/fixups.toml new file mode 100644 index 000000000..db40d72cb --- /dev/null +++ b/shim/third-party/rust/fixups/zstd-safe/fixups.toml @@ -0,0 +1 @@ +buildscript = [] diff --git a/shim/third-party/rust/fixups/zstd-sys/fixups.toml b/shim/third-party/rust/fixups/zstd-sys/fixups.toml new file mode 100644 index 000000000..164b6a723 --- /dev/null +++ b/shim/third-party/rust/fixups/zstd-sys/fixups.toml @@ -0,0 +1,114 @@ +buildscript = [] + +[[platform_fixup.'cfg(not(all(target_os = "windows", target_env = "msvc")))'.buildscript]] +[platform_fixup.'cfg(not(all(target_os = "windows", target_env = "msvc")))'.buildscript.cxx_library] +name = "zstd" +srcs = [ + "zstd/lib/common/debug.c", + "zstd/lib/common/entropy_common.c", + "zstd/lib/common/error_private.c", + "zstd/lib/common/fse_decompress.c", + "zstd/lib/common/pool.c", + "zstd/lib/common/threading.c", + #"zstd/lib/common/xxhash.c", + "zstd/lib/common/zstd_common.c", + "zstd/lib/compress/**/*.c", + "zstd/lib/decompress/**/*.c", + "zstd/lib/decompress/huf_decompress_amd64.S", + "zstd/lib/dictBuilder/**/*.c", + "zstd/lib/legacy/**/*.c", +] +headers = [ + "zdict.h", + "zstd.h", + "zstd/lib/common/bitstream.h", + "zstd/lib/common/compiler.h", + "zstd/lib/common/cpu.h", + "zstd/lib/common/debug.h", + "zstd/lib/common/error_private.h", + "zstd/lib/common/fse.h", + "zstd/lib/common/huf.h", + "zstd/lib/common/mem.h", + "zstd/lib/common/pool.h", + "zstd/lib/common/portability_macros.h", + "zstd/lib/common/threading.h", + #"zstd/lib/common/xxhash.h", + "zstd/lib/common/zstd_deps.h", + "zstd/lib/common/zstd_internal.h", + "zstd/lib/common/zstd_trace.h", + "zstd/lib/compress/**/*.h", + "zstd/lib/decompress/**/*.h", + "zstd/lib/deprecated/zbuff.h", + "zstd/lib/dictBuilder/cover.h", + "zstd/lib/dictBuilder/divsufsort.h", + "zstd/lib/legacy/**/*.h", + "zstd/lib/zdict.h", + "zstd/lib/zstd_errors.h", + "zstd/lib/zstd.h", +] +compiler_flags = [ + "-O3", + "-DZSTD_LIB_DEPRECATED=0", + "-fvisibility=hidden", + "-DXXH_PRIVATE_API=", + "-DZSTDLIB_VISIBILITY=", + "-DZDICTLIB_VISIBILITY=", + "-DZSTDERRORLIB_VISIBILITY=", + "-DZSTD_LEGACY_SUPPORT=1" +] + +[[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'.buildscript]] +[platform_fixup.'cfg(all(target_os = "windows", target_env = "msvc"))'.buildscript.cxx_library] +name = "zstd-msvc" +srcs = [ + "zstd/lib/common/debug.c", + "zstd/lib/common/entropy_common.c", + "zstd/lib/common/error_private.c", + "zstd/lib/common/fse_decompress.c", + "zstd/lib/common/pool.c", + "zstd/lib/common/threading.c", + #"zstd/lib/common/xxhash.c", + "zstd/lib/common/zstd_common.c", + "zstd/lib/compress/**/*.c", + "zstd/lib/decompress/**/*.c", + #"zstd/lib/decompress/huf_decompress_amd64.S", + "zstd/lib/dictBuilder/**/*.c", + "zstd/lib/legacy/**/*.c", +] +headers = [ + "zdict.h", + "zstd.h", + "zstd/lib/common/bitstream.h", + "zstd/lib/common/compiler.h", + "zstd/lib/common/cpu.h", + "zstd/lib/common/debug.h", + "zstd/lib/common/error_private.h", + "zstd/lib/common/fse.h", + "zstd/lib/common/huf.h", + "zstd/lib/common/mem.h", + "zstd/lib/common/pool.h", + "zstd/lib/common/portability_macros.h", + "zstd/lib/common/threading.h", + #"zstd/lib/common/xxhash.h", + "zstd/lib/common/zstd_deps.h", + "zstd/lib/common/zstd_internal.h", + "zstd/lib/common/zstd_trace.h", + "zstd/lib/compress/**/*.h", + "zstd/lib/decompress/**/*.h", + "zstd/lib/deprecated/zbuff.h", + "zstd/lib/dictBuilder/cover.h", + "zstd/lib/dictBuilder/divsufsort.h", + "zstd/lib/legacy/**/*.h", + "zstd/lib/zdict.h", + "zstd/lib/zstd_errors.h", + "zstd/lib/zstd.h", +] +compiler_flags = [ + "/O2", + "-DZSTD_LIB_DEPRECATED=0", + "-DXXH_PRIVATE_API=", + "-DZSTDLIB_VISIBILITY=", + "-DZDICTLIB_VISIBILITY=", + "-DZSTDERRORLIB_VISIBILITY=", + "-DZSTD_LEGACY_SUPPORT=1" +] diff --git a/shim/third-party/rust/reindeer.toml b/shim/third-party/rust/reindeer.toml new file mode 100644 index 000000000..4aa852e04 --- /dev/null +++ b/shim/third-party/rust/reindeer.toml @@ -0,0 +1,29 @@ +# Configuration for Reindeer to generate Buck targets from Cargo.toml +# +# Overview of available options: +# https://github.com/facebookincubator/reindeer/blob/main/example/third-party/reindeer.toml + +# Parse Rust code to work out the precise set of source files for each crate. +precise_srcs = true + +# Include a public top-level target which depends on all other targets. +include_top_level = true + +[cargo] +# Support Cargo's unstable "artifact dependencies" functionality, RFC 3028. +bindeps = true + +[buck] +# Name of the generated file. +file_name = "BUCK" + +# Rules used for various kinds of targets. +rust_library = "cargo.rust_library" +rust_binary = "cargo.rust_binary" +prebuilt_cxx_library = "third_party_rust_prebuilt_cxx_library" + +buckfile_imports = """ +load("@prelude//rust:cargo_buildscript.bzl", "buildscript_run") +load("@prelude//rust:cargo_package.bzl", "cargo") +load("//third-party/macros:rust_third_party.bzl", "third_party_rust_prebuilt_cxx_library") +""" diff --git a/shim/third-party/rust/top/main.rs b/shim/third-party/rust/top/main.rs new file mode 100644 index 000000000..7dde67dd1 --- /dev/null +++ b/shim/third-party/rust/top/main.rs @@ -0,0 +1,8 @@ +// Copyright (c) Meta Platforms, Inc. and affiliates. +// +// This source code is licensed under the MIT license found in the +// LICENSE file in the root directory of this source tree. + +#![allow(unused_crate_dependencies)] + +fn main() {} diff --git a/shim/tools/build_defs/audit_dependencies_test.bzl b/shim/tools/build_defs/audit_dependencies_test.bzl new file mode 100644 index 000000000..a3174389f --- /dev/null +++ b/shim/tools/build_defs/audit_dependencies_test.bzl @@ -0,0 +1,10 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +# Noop in OSS +def audit_dependencies_test(**_kwargs): + pass diff --git a/shim/tools/build_defs/buck2/is_buck2.bzl b/shim/tools/build_defs/buck2/is_buck2.bzl new file mode 100644 index 000000000..45140ef21 --- /dev/null +++ b/shim/tools/build_defs/buck2/is_buck2.bzl @@ -0,0 +1,9 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +def is_buck2(): + return True diff --git a/shim/tools/build_defs/default_platform_defs.bzl b/shim/tools/build_defs/default_platform_defs.bzl new file mode 100644 index 000000000..753ec6a3d --- /dev/null +++ b/shim/tools/build_defs/default_platform_defs.bzl @@ -0,0 +1 @@ +DEVSERVER_PLATFORM_REGEX = "UNUSED" diff --git a/shim/tools/build_defs/glob_defs.bzl b/shim/tools/build_defs/glob_defs.bzl new file mode 100644 index 000000000..c119afa55 --- /dev/null +++ b/shim/tools/build_defs/glob_defs.bzl @@ -0,0 +1,8 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under both the MIT license found in the +# LICENSE-MIT file in the root directory of this source tree and the Apache +# License, Version 2.0 found in the LICENSE-APACHE file in the root directory +# of this source tree. + +glob = native.glob diff --git a/shim/xplat/executorch/kernels/optimized/lib_defs.bzl b/shim/xplat/executorch/kernels/optimized/lib_defs.bzl new file mode 100644 index 000000000..39c94f70f --- /dev/null +++ b/shim/xplat/executorch/kernels/optimized/lib_defs.bzl @@ -0,0 +1,142 @@ +load("@fbsource//tools/build_defs:default_platform_defs.bzl", "DEVSERVER_PLATFORM_REGEX") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") + +# Because vec exists as a collection of header files, compile and preprocessor +# flags applied to the vec target do not have any effect, since no compilation +# actually occurs for the target. +# +# Targets using the vec library must therefore call the get_vec_*_flags +# functions in order to declare the required compiler flags needed in order to +# access CPU vector intrinsics. + +def get_vec_android_preprocessor_flags(): + preprocessor_flags = [ + ( + "^android-arm64.*$", + [ + "-DET_BUILD_ARM_VEC256_WITH_SLEEF", + ], + ), + ] + return preprocessor_flags + +def get_vec_cxx_preprocessor_flags(): + preprocessor_flags = [ + ( + DEVSERVER_PLATFORM_REGEX, + [ + "-DCPU_CAPABILITY_AVX2", + ], + ), + ] + return preprocessor_flags + +def get_vec_fbcode_preprocessor_flags(): + preprocessor_flags = [ + "-DCPU_CAPABILITY_AVX2", + ] + return preprocessor_flags + +# Currently, having a dependency on fbsource//third-party/sleef:sleef may cause +# duplicate symbol errors when linking fbcode targets in opt mode that also +# depend on ATen. This is because ATen accesses sleef via the third-party folder +# in caffe2 (caffe2/third-party//sleef:sleef). +# TODO(ssjia): Enable -DCPU_CAPABILITY_AVX2 in fbcode, which requires sleef. +def define_libs(): + runtime.cxx_library( + name = "libvec", + srcs = [], + exported_headers = native.glob([ + "vec/**/*.h", + ]), + header_namespace = "executorch/kernels/optimized", + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + cxx_platform_deps = select({ + "DEFAULT": [ + ( + DEVSERVER_PLATFORM_REGEX, + [ + "fbsource//third-party/sleef:sleef", + ], + ), + ], + "ovr_config//cpu:arm64": [ + ( + DEVSERVER_PLATFORM_REGEX, + [ + "fbsource//third-party/sleef:sleef_arm", + ], + ), + ], + }), + fbandroid_platform_deps = [ + ( + "^android-arm64.*$", + [ + "fbsource//third-party/sleef:sleef_arm", + ], + ), + ], + ) + + runtime.cxx_library( + name = "libutils", + srcs = [], + exported_headers = native.glob([ + "utils/**/*.h", + ]), + header_namespace = "executorch/kernels/optimized", + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + exported_deps = [ + # Needed to access the __ET_INLINE macro + "//executorch/runtime/platform:compiler", + ], + ) + + runtime.cxx_library( + name = "libblas", + srcs = native.glob([ + "blas/**/*.cpp", + ]), + exported_headers = native.glob([ + "blas/**/*.h", + ]), + header_namespace = "executorch/kernels/optimized", + visibility = [ + "//executorch/...", + "@EXECUTORCH_CLIENTS", + ], + fbandroid_platform_preprocessor_flags = [ + ( + "^android-arm64.*$", + [ + "-DET_BUILD_WITH_BLAS", + ], + ), + ], + fbandroid_platform_deps = [ + ( + "^android-arm64.*$", + [ + "fbsource//third-party/openblas:openblas", + ], + ), + ], + fbobjc_exported_preprocessor_flags = [ + "-DET_BUILD_WITH_BLAS", + "-DET_BUILD_FOR_APPLE", + ], + fbobjc_frameworks = [ + "Accelerate", + ], + exported_deps = [ + "//executorch/kernels/optimized:libutils", + "//executorch/runtime/core/exec_aten:lib", + ], + ) diff --git a/shim/xplat/executorch/kernels/optimized/op_registration_util.bzl b/shim/xplat/executorch/kernels/optimized/op_registration_util.bzl new file mode 100644 index 000000000..785c40187 --- /dev/null +++ b/shim/xplat/executorch/kernels/optimized/op_registration_util.bzl @@ -0,0 +1,131 @@ +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") +load("@fbsource//xplat/executorch/build:selects.bzl", "selects") +load( + "@fbsource//xplat/executorch/kernels/optimized:lib_defs.bzl", + "get_vec_android_preprocessor_flags", +) + +def op_target(name, deps = []): + """Registers an optimized implementation for an operator overload group. + + An operator overload group is a set of operator overloads with a common + operator name. That common operator name should be the base name of this + target. + + E.g., the "add" operator overload group, named "op_add" in this target, + might implement: + - add.Tensor + - add_.Tensor + - add.out + - add.Scalar + + If an op target would like to share a header/sources with a different op + target (e.g., helpers/utilities), it should declare a separate cxx_library + and add it as a dep. + + Args: + name: The name of the operator overload group; e.g., + "op_add". This directory must contain a source file named + ".cpp"; e.g., "op_add.cpp". + deps: Optional extra deps to add to the cxx_library(). Note: + - op targets may not depend on other op targets, to keep the + dependencies manageable. If two op targets would like to share + code, define a separate runtime.cxx_library that they both depend + on. + """ + + # Note that this doesn't actually define the target, but helps register + # it in a table that's used to define the target. + return { + "deps": deps, + "name": name, + } + +def _enforce_deps(deps, name): + """Fails if any of the deps are not allowed. + + Args: + deps: A list of build target strings. + name: The name of the target; e.g., "op_add" + """ + for dep in deps: + if dep.startswith(":op_"): + # op targets may not depend on other op targets, to keep the + # dependencies manageable. If two op targets would like to share + # code, define a separate runtime.cxx_library that they both depend + # on. + fail("op_target {} may not depend on other op_target {}".format( + name, + dep, + )) + +def define_op_library(name, deps): + """Defines a cxx_library target for the named operator overload group. + + Args: + name: The name of the target; e.g., "op_add" + deps: List of deps for the target. + """ + selects.apply(obj = deps, function = native.partial(_enforce_deps, name = name)) + + augmented_deps = deps + [ + "//executorch/kernels/optimized:libvec", + "//executorch/kernels/optimized:libutils", + ] + + runtime.cxx_library( + name = "{}".format(name), + srcs = [ + "{}.cpp".format(name), + ], + visibility = [ + "//executorch/kernels/portable/test/...", + "//executorch/kernels/quantized/test/...", + "//executorch/kernels/optimized/test/...", + "//executorch/kernels/test/...", + "@EXECUTORCH_CLIENTS", + ], + # kernels often have helpers with no prototypes just disabling the warning here as the headers + # are codegend and linked in later + compiler_flags = ["-Wno-missing-prototypes"], + deps = [ + "//executorch/runtime/kernel:kernel_includes", + ] + augmented_deps, + fbandroid_platform_preprocessor_flags = get_vec_android_preprocessor_flags(), + # sleef needs to be added as a direct dependency of the operator target when building for Android, + # or a linker error may occur. Not sure why this happens; it seems that fbandroid_platform_deps of + # dependencies are not transitive + fbandroid_platform_deps = [ + ( + "^android-arm64.*$", + [ + "fbsource//third-party/sleef:sleef_arm", + ], + ), + ], + # link_whole is necessary because the operators register themselves + # via static initializers that run at program startup. + # @lint-ignore BUCKLINT link_whole + link_whole = True, + ) + +def define_op_target(name, deps): + """Possibly defines cxx_library targets for the named operator group. + + Args: + name: The base name of the target; e.g., "op_add" + deps: List of deps for the targets. + """ + + # When building in ATen mode, ATen-compatible (non-custom) operators will + # use the implementations provided by ATen, so we should not build the + # versions defined here. + define_op_library( + name = name, + deps = deps, + ) + +def is_op_disabled(name): + # TODO (gjcomer) Enable ops with sleef dependency in OSS + disabled_ops = ["op_gelu", "op_log_softmax"] + return name in disabled_ops