Skip to content

Commit

Permalink
Merge pull request #256 from singnet/pedro/mbedtls
Browse files Browse the repository at this point in the history
[#179] Move mbed dependency to bazel registry
  • Loading branch information
Pedrobc89 authored Feb 7, 2025
2 parents a3962c5 + c0845bb commit 534bd0d
Show file tree
Hide file tree
Showing 13 changed files with 5,675 additions and 115 deletions.
Binary file modified src/assets/3rd-party.tgz
Binary file not shown.
10 changes: 5 additions & 5 deletions src/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cc_binary(
"@com_github_grpc_grpc//:grpc++",
"@com_github_grpc_grpc//:grpc++_reflection",
"@com_github_singnet_das_proto//:attention_broker_cc_grpc",
"@mbedcrypto//:lib",
"@mbedtls//:mbedtls",
],
)

Expand All @@ -21,7 +21,7 @@ cc_binary(
deps = [
"//main:query_engine_main_lib",
"//utils:utils_lib",
"@mbedcrypto//:lib",
"@mbedtls//:mbedtls",
],
)

Expand All @@ -33,7 +33,7 @@ cc_binary(
deps = [
"//main:query_client_main_lib",
"//utils:utils_lib",
"@mbedcrypto//:lib",
"@mbedtls//:mbedtls",
],
)

Expand All @@ -45,7 +45,7 @@ cc_binary(
deps = [
"//main:link_creation_engine_main_lib",
"//utils:utils_lib",
"@mbedcrypto//:lib",
"@mbedtls//:mbedtls",
],
)

Expand All @@ -57,7 +57,7 @@ cc_binary(
deps = [
"//main:word_query_main_lib",
"//utils:utils_lib",
"@mbedcrypto//:lib",
"@mbedtls//:mbedtls",
],
)

Expand Down
34 changes: 17 additions & 17 deletions src/cpp/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
"""
This Bazel module configuration file sets up dependencies for the DAS project.
It includes project's direct dependencies such as `rules_cc`, `grpc`, and `googletest`, but also lists some
dependencies of the dependencies, like `rules_go`, `googleapis`, and `protoc-gen-validate`, among others.
This is required basically to set alternative names (`repo_name`) used internally by some packages,
such as `grpc`, which is in a transitory state (from WORKSPACE to MODULE.bazel support) and needs this
temporary workaround. Hopefully, this will be fixed by the end of 2025 and it'll be possible to list
only the direct dependencies. TODO: https://github.com/singnet/das/issues/180
It includes project's direct dependencies such as `mbedtls`, `rules_cc`,
`grpc`, and `googletest`, but also lists some dependencies of the dependencies,
like `rules_go`, `googleapis`, and `protoc-gen-validate`, among others. This is
required basically to set alternative names (`repo_name`) used internally by
some packages, such as `grpc`, which is in a transitory state (from WORKSPACE
to MODULE.bazel support) and needs this temporary workaround. Hopefully, this
will be fixed by the end of 2025 and it'll be possible to list only the direct
dependencies. TODO: https://github.com/singnet/das/issues/180
Additionally, this file configures:
- a local repository for the `mbedcrypto` library. <- not working as expected / TODO: https://github.com/singnet/das/issues/179
- an `http_archive` to get `das-proto` repo content.
"""

module(name = "das")
bazel_dep(name = "abseil-cpp", version = "20240722.0", repo_name = "com_google_absl")
bazel_dep(name = "rules_apple", version = "3.16.1", repo_name = "build_bazel_rules_apple")
# Work around https://github.com/bazelbuild/bazel/issues/24426. See
# https://github.com/bazelbuild/bazel-central-registry/pull/3320#issuecomment-2546030208.
# FIXME: Remove once fixed upstream in googletest and abseil-cpp.
bazel_dep(name = "re2", version = "2024-07-02.bcr.1")

bazel_dep(name = "abseil-cpp", version = "20250127.0")
bazel_dep(name = "rules_apple", version = "3.17.1", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "protoc-gen-validate", version = "1.0.4.bcr.2", repo_name = "com_envoyproxy_protoc_gen_validate")
bazel_dep(name = "apple_support", version = "1.17.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_go", version = "0.52.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "googleapis", version = "0.0.0-20240819-fe8ba054a", repo_name = "com_google_googleapis")
bazel_dep(name = "gazelle", version = "0.41.0", repo_name = "bazel_gazelle")
bazel_dep(name = "protobuf", version = "29.3", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_cc", version = "0.0.16")
bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "grpc", version = "1.69.0", repo_name = "com_github_grpc_grpc")
bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_github_google_googletest")
bazel_dep(name = "mbedtls", version = "3.6.0")

# nanobind
bazel_dep(name = "nanobind_bazel", version = "2.4.0")
Expand All @@ -41,10 +48,3 @@ http_archive(
sha256 = "c1e32db184cddb58468139d2fdc592be876c58cf67aa2600a2ec9670ca03cdc9",
urls = ["https://github.com/singnet/das-proto/archive/refs/tags/0.1.14.tar.gz"],
)

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")
new_local_repository(
name = "mbedcrypto",
path = "/opt/3rd-party/mbedcrypto",
build_file_content = 'cc_library(name = "lib", srcs = ["libmbedcrypto.a"], visibility = ["//visibility:public"])',
)
Loading

0 comments on commit 534bd0d

Please sign in to comment.