diff --git a/.buckconfig b/.buckconfig index ba34444244a..f4ea0151973 100644 --- a/.buckconfig +++ b/.buckconfig @@ -8,9 +8,10 @@ none = none [cell_aliases] config = prelude ovr_config = prelude -fbcode = none -fbsource = none +fbcode = shim +fbsource = shim fbcode_macros = shim +bazel_skylib = shim buck = none [parser] @@ -18,3 +19,6 @@ target_platform_detector_spec = target:root//...->prelude//platforms:default [external_cells] prelude = bundled + +[oss_depends_on] +folly = True diff --git a/bad_targets b/bad_targets new file mode 100644 index 00000000000..10ce6171740 --- /dev/null +++ b/bad_targets @@ -0,0 +1,6 @@ +# This is a list of bad targets that do not build in OSS. Ideally this list goes away +# with time. +root//fizz/experimental/crypto/exchange:oqs_key_exchange +root//fizz/extensions/javacrypto:java_crypto +root//fizz/tool:fizz +root//fizz/backend:openssl diff --git a/fizz/BUCK b/fizz/BUCK index 762de8a9f43..0b09533c0ba 100644 --- a/fizz/BUCK +++ b/fizz/BUCK @@ -6,6 +6,6 @@ cpp_library( name = "config", headers = select({ "DEFAULT": {"fizz-config.h": "facebook/fizz-config-fbcode.h"}, - "ovr_config//toolchain/fb:arista": {"fizz-config.h": "facebook/fizz-config-xplat.h"}, + # @fb-only: "ovr_config//toolchain/fb:arista": {"fizz-config.h": "facebook/fizz-config-xplat.h"}, }), ) diff --git a/fizz/crypto/aead/BUCK b/fizz/crypto/aead/BUCK index 2c8392fd31c..65bc7106a5b 100644 --- a/fizz/crypto/aead/BUCK +++ b/fizz/crypto/aead/BUCK @@ -55,7 +55,7 @@ cpp_library( "DEFAULT": [ "fbsource//third-party/libaegis:aegis", ], - "ovr_config//toolchain/fb:arista": [], + # @fb-only: "ovr_config//toolchain/fb:arista": [], }), exported_deps = [ ":aead", diff --git a/shim/shims.bzl b/shim/shims.bzl index 6b893004eb3..97c57611eb7 100644 --- a/shim/shims.bzl +++ b/shim/shims.bzl @@ -135,6 +135,7 @@ def cpp_library( exported_linker_flags = None, headers = None, private_headers = None, + propagated_pp_flags = (), **kwargs): _unused = (undefined_symbols, arch_preprocessor_flags, modular_headers, arch_compiler_flags, tags) # @unused if os_deps: @@ -415,9 +416,14 @@ def _fix_dep(x: str) -> [ elif x.startswith("third-party//"): return "shim//third-party/" + x.removeprefix("third-party//") elif x.startswith("//folly"): + oss_depends_on_folly = read_config("oss_depends_on", "folly", False) + if oss_depends_on_folly: + return "root//folly/" + x.removeprefix("//") return "root//" + x.removeprefix("//") elif x.startswith("root//folly"): return x + elif x.startswith("//fizz"): + return "root//" + x.removeprefix("//") elif x.startswith("shim//"): return x else: diff --git a/shim/third-party/brotli/BUCK b/shim/third-party/brotli/BUCK new file mode 100644 index 00000000000..95ebd06aa4b --- /dev/null +++ b/shim/third-party/brotli/BUCK @@ -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. + +load("@shim//third-party:third_party.bzl", "third_party_library") + +oncall("open_source") + +third_party_library( + name = "brotlidec", + homebrew_package_name = "brotli", + pkgconfig_name = "libbrotlidec", +) + +third_party_library( + name = "brotlienc", + homebrew_package_name = "brotli", + pkgconfig_name = "libbrotlienc", +) diff --git a/shim/third-party/jvm/BUCK b/shim/third-party/jvm/BUCK new file mode 100644 index 00000000000..9de6e20cf29 --- /dev/null +++ b/shim/third-party/jvm/BUCK @@ -0,0 +1,15 @@ +# 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("@shim//third-party:third_party.bzl", "third_party_library") + +oncall("open_source") + +third_party_library( + name = "jvm", + homebrew_package_name = "openjdk", +) diff --git a/shim/third-party/libaegis/BUCK b/shim/third-party/libaegis/BUCK new file mode 100644 index 00000000000..8ac657a1717 --- /dev/null +++ b/shim/third-party/libaegis/BUCK @@ -0,0 +1,15 @@ +# 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("@shim//third-party:third_party.bzl", "third_party_library") + +oncall("open_source") + +third_party_library( + name = "aegis", + pkgconfig_name = "libaegis", +) diff --git a/shim/third-party/liboqs/BUCK b/shim/third-party/liboqs/BUCK new file mode 100644 index 00000000000..c56ee25129e --- /dev/null +++ b/shim/third-party/liboqs/BUCK @@ -0,0 +1,15 @@ +# 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("@shim//third-party:third_party.bzl", "third_party_library") + +oncall("open_source") + +third_party_library( + name = "oqs", + pkgconfig_name = "liboqs", +)