From cd1806b57f544fd25ba252e6d82cc4fba0144970 Mon Sep 17 00:00:00 2001 From: kaichaosun Date: Fri, 5 Sep 2025 17:40:43 +0800 Subject: [PATCH] chore: fix build with concurrent jobs. --- scripts/build_rln.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/build_rln.sh b/scripts/build_rln.sh index cd2fa3827..b2de86d42 100755 --- a/scripts/build_rln.sh +++ b/scripts/build_rln.sh @@ -14,6 +14,14 @@ output_filename=$3 [[ -z "${rln_version}" ]] && { echo "No rln version specified"; exit 1; } [[ -z "${output_filename}" ]] && { echo "No output filename specified"; exit 1; } +# Create lock (wait if another process is building) +lockfile="${output_filename}.lock" +exec 9>"$lockfile" +if ! flock -n 9; then + echo "Another build process is running, waiting..." + flock 9 +fi + # Get the host triplet host_triplet=$(rustc --version --verbose | awk '/host:/{print $2}')