【发布时间】:2021-06-26 06:13:04
【问题描述】:
我正在尝试使用 bazel 构建 openssl。这是我目前的设置
在我的项目根目录中的/WORKSPACE 中
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "openssl",
urls = ["https://www.openssl.org/source/openssl-1.1.1c.tar.gz"],
sha256 = "f6fb3079ad15076154eda9413fed42877d668e7069d9b87396d0804fdb3f4c90",
strip_prefix = "openssl-1.1.1c",
build_file = "@//:BUILD.openssl",
)
在我的/BUILD.openssl 文件中
genrule(
name = "build",
visibility = ["//visibility:public"],
srcs = glob(["**"]),
cmd = '\n'.join([
'./Configure darwin64-x86_64-cc -mmacosx-version-min="10.14" --prefix=$@ --openssldir=$@',
'make',
'make install',
]),
outs = ["openssl"],
)
我不太明白 genrule 运行时我所在的文件夹,因为它会抱怨
/bin/bash: ./Configure: No such file or directory
另外,我在 makefile 目标中为 srcs 和 outs 指定什么?
在这种情况下,我将为 openssls --prefix 和 --openssldir 指定什么目录?
考虑到这可能是最重要的用例,Bazel 中未配置的集成目标的文档记录如此之差,这让我有点惊讶。
【问题讨论】:
标签: bazel