fix(benchmark): build.sh 安装 OpenSSL dev + cmake 依赖
- map_pkgs: 所有发行版加入 pkg-config + cmake - 新增 install_openssl_dev: 各平台装 libssl-dev - BOA 构建前调用 install_openssl_dev (cherry picked from commit 2be7c7dd22bdcba8c8cec299645de1c522b90d7a)
This commit is contained in:
+18
-6
@@ -25,15 +25,26 @@ detect_pm() {
|
|||||||
|
|
||||||
map_pkgs() {
|
map_pkgs() {
|
||||||
case "$1" in
|
case "$1" in
|
||||||
apt) echo "gcc make git python3 python3-pip curl";;
|
apt) echo "gcc make git python3 python3-pip curl pkg-config cmake";;
|
||||||
dnf|yum) echo "gcc make git python3 python3-pip curl";;
|
dnf|yum) echo "gcc make git python3 python3-pip curl pkgconfig cmake";;
|
||||||
pacman) echo "gcc make git python python-pip curl";;
|
pacman) echo "gcc make git python python-pip curl pkgconf cmake";;
|
||||||
apk) echo "gcc make git python3 py3-pip curl";;
|
apk) echo "gcc make git python3 py3-pip curl pkgconfig cmake";;
|
||||||
zypper) echo "gcc make git python3 python3-pip curl";;
|
zypper) echo "gcc make git python3 python3-pip curl pkg-config cmake";;
|
||||||
*) echo "gcc make git python3 curl";;
|
*) echo "gcc make git python3 curl";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_openssl_dev() {
|
||||||
|
case "$1" in
|
||||||
|
apt) apt-get install -y libssl-dev 2>/dev/null || true;;
|
||||||
|
dnf|yum) dnf install -y openssl-devel 2>/dev/null || true;;
|
||||||
|
pacman) ;; # openssl is part of base
|
||||||
|
apk) apk add --no-cache openssl-dev 2>/dev/null || true;;
|
||||||
|
zypper) zypper install -y libopenssl-devel 2>/dev/null || true;;
|
||||||
|
*) ;; # best effort
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
install_deps() {
|
install_deps() {
|
||||||
local pm=$1 icmd=$2 ucmd=$3; shift 3
|
local pm=$1 icmd=$2 ucmd=$3; shift 3
|
||||||
local missing=()
|
local missing=()
|
||||||
@@ -103,8 +114,9 @@ build_boa() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
info "编译 BOA (Rust --release, 约 5-10 分钟)..."
|
info "编译 BOA (Rust --release, 约 5-10 分钟)..."
|
||||||
|
install_openssl_dev "$pm" # BOA depends on openssl-sys
|
||||||
cd "$boa_dir"
|
cd "$boa_dir"
|
||||||
if cargo build --release -p boa_cli --bin boa 2>&1 | tail -5; then
|
if cargo build --release -p boa_cli --bin boa 2>&1 | grep -E "error|Compiling boa|Finished|warning:" | tail -10; then
|
||||||
info "BOA 编译成功"
|
info "BOA 编译成功"
|
||||||
else
|
else
|
||||||
warn "BOA 编译失败,跳过 (不影响整体)"
|
warn "BOA 编译失败,跳过 (不影响整体)"
|
||||||
|
|||||||
Reference in New Issue
Block a user