我有几个依赖于 的第三方库,所以我通过存储库机制 ( )openssl
获取和构建 openssl 。http_archive()
而且我有 GRPC,boringssl
它具有与 openssl 相同的符号(链接后我因冲突而出错)。
我想重新定义boringsll
使用new_local_repository()
方法。但我不知道如何将生成的路径传递给path
参数以及new_local_repository()
调用如何取决于openssl
目标。
想要获取的代码如下所示:
new_local_repository(
name = "boringssl",
??? path = "bazel-out/k8-fastbuild/bin/external/openssl/openssl/", <-- generated path with openssl
build_file_content = """
cc_library(
name = "ssl",
deps = ["@openssl"],
srcs = ["lib/libssl.a"],
hdrs = glob(["include/openssl/*.h"]),
strip_include_prefix = "/include/openssl",
visibility = ["//visibility:public"],
)
cc_library(
name = "crypto",
deps = ["@openssl"],
srcs = ["lib/libcrypto.a"],
hdrs = glob(["include/openssl/*.h"]),
strip_include_prefix = "/include/openssl",
visibility = ["//visibility:public"],
)
""",
)