From 45a70ddf000334e7f21ef036fde8e7ff36554dcb Mon Sep 17 00:00:00 2001 From: pjh456 <147148383@qq.com> Date: Mon, 29 Jun 2026 14:42:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20build.sh=20=E5=AE=89=E8=A3=85=20OpenSSL?= =?UTF-8?q?=20dev=20+=20cmake=20=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - map_pkgs: 所有发行版加入 pkg-config + cmake - 新增 install_openssl_dev: 各平台装 libssl-dev - BOA 构建前调用 install_openssl_dev (cherry picked from commit 2be7c7dd22bdcba8c8cec299645de1c522b90d7a) --- benchmark/build.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/benchmark/build.sh b/benchmark/build.sh index 5f2b3ad8..96703f20 100644 --- a/benchmark/build.sh +++ b/benchmark/build.sh @@ -25,15 +25,26 @@ detect_pm() { map_pkgs() { case "$1" in - apt) echo "gcc make git python3 python3-pip curl";; - dnf|yum) echo "gcc make git python3 python3-pip curl";; - pacman) echo "gcc make git python python-pip curl";; - apk) echo "gcc make git python3 py3-pip curl";; - zypper) 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 pkgconfig cmake";; + pacman) echo "gcc make git python python-pip curl pkgconf cmake";; + apk) echo "gcc make git python3 py3-pip curl pkgconfig cmake";; + zypper) echo "gcc make git python3 python3-pip curl pkg-config cmake";; *) echo "gcc make git python3 curl";; 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() { local pm=$1 icmd=$2 ucmd=$3; shift 3 local missing=() @@ -103,8 +114,9 @@ build_boa() { return 0 fi info "编译 BOA (Rust --release, 约 5-10 分钟)..." + install_openssl_dev "$pm" # BOA depends on openssl-sys 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 编译成功" else warn "BOA 编译失败,跳过 (不影响整体)"