Skip to content

Commit 4818617

Browse files
committed
fix(ci): 在 cd 上游源码前解析 SCRIPT_DIR
相对路径 BASH_SOURCE 在进入 rocksdb 临时目录后失效,导致 patch 步骤找不到 .github/scripts。
1 parent 4915dbd commit 4818617

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎.github/scripts/build_upstream_rocksdb.sh‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ fi
3030
# SIGILL on run hosts without AVX-512. Override e.g. PORTABLE=skylake-avx512.
3131
export DEBUG_LEVEL="${DEBUG_LEVEL:-0}"
3232
export PORTABLE="${PORTABLE:-haswell}"
33-
cd "$SRC_DIR"
33+
# Resolve script dir before cd: BASH_SOURCE may be a relative path.
3434
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
35+
cd "$SRC_DIR"
3536
python3 "$SCRIPT_DIR/patch_db_bench_time.py" "$SRC_DIR/tools/db_bench_tool.cc"
3637
echo "Building upstream rocksdb with PORTABLE=${PORTABLE} DEBUG_LEVEL=${DEBUG_LEVEL}"
3738
make db_bench memtablerep_bench -j"$(nproc)" DEBUG_LEVEL="$DEBUG_LEVEL" PORTABLE="$PORTABLE"

0 commit comments

Comments
 (0)