Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add necessary third party libs #124

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .buckconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ 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]
target_platform_detector_spec = target:root//...->prelude//platforms:default

[external_cells]
prelude = bundled

[oss_depends_on]
folly = True
6 changes: 6 additions & 0 deletions bad_targets
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion fizz/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}),
)
2 changes: 1 addition & 1 deletion fizz/crypto/aead/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions shim/shims.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 22 additions & 0 deletions shim/third-party/brotli/BUCK
Original file line number Diff line number Diff line change
@@ -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",
)
15 changes: 15 additions & 0 deletions shim/third-party/jvm/BUCK
Original file line number Diff line number Diff line change
@@ -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",
)
15 changes: 15 additions & 0 deletions shim/third-party/libaegis/BUCK
Original file line number Diff line number Diff line change
@@ -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",
)
15 changes: 15 additions & 0 deletions shim/third-party/liboqs/BUCK
Original file line number Diff line number Diff line change
@@ -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",
)
Loading