From 125b39ea26af58052f93978d7be8d6b26a4c7288 Mon Sep 17 00:00:00 2001 From: agw Date: Tue, 13 Oct 2026 21:55:00 +0200 Subject: [PATCH] Fall back to a module's release tag when its lockfile is broken jaspDescriptives master has carried a stray "|" in renv.lock since 2026-10-07. The lockfile patch could not parse it, so the build stopped after 85 minutes. A module whose renv.lock does not parse is now built from its newest release tag up to the JASP version (jaspDescriptives v0.98.1, the version the official 0.98.8 builds ship as well). The build stops early if no such tag exists. Claude-Session: https://claude.ai/code/session_01JmhJG6JnhXfzNiKv8f2vHu --- build/build-jasp.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/build/build-jasp.sh b/build/build-jasp.sh index be400d0..25d611b 100755 --- a/build/build-jasp.sh +++ b/build/build-jasp.sh @@ -381,6 +381,34 @@ for module in "${ALL_MODULES[@]}"; do fi done +# Modules are built from their default branch, which upstream occasionally +# leaves broken: jaspDescriptives master carried a stray "|" in renv.lock from +# 2026-10-07, which stopped the lockfile patch below and the whole build. A +# module whose lockfile does not parse falls back to its newest release tag that +# is no newer than the JASP release; with no such tag the build stops here. +for module in "${ALL_MODULES[@]}"; do + dir="ModuleBundleBuildDir/Modules/${module}" + [[ -f "$dir/renv.lock" ]] || continue + python3 -c 'import json, sys; json.load(open(sys.argv[1]))' "$dir/renv.lock" 2>/dev/null && continue + fallback="$(git ls-remote --tags --refs "https://github.com/jasp-stats/${module}" 'v*' \ + | sed 's|.*refs/tags/||' | python3 -c ' +import re, sys +key = lambda t: [int(n) for n in re.findall(r"\d+", t)] +limit = key(sys.argv[1]) +tags = [t for t in sys.stdin.read().split() if re.fullmatch(r"v[\d.]+", t) and key(t) <= limit] +print(max(tags, key=key) if tags else "") +' "$JASP_TAG")" + if [[ -z "$fallback" ]]; then + echo "error: ${module}/renv.lock on the default branch is not valid JSON" >&2 + echo " and the module has no release tag up to ${JASP_TAG} to fall back to" >&2 + exit 1 + fi + log "${module}: renv.lock on the default branch does not parse, building ${fallback} instead" + rm -rf "$dir" + git clone --depth 1 --branch "$fallback" "https://github.com/jasp-stats/${module}" "$dir" + python3 -c 'import json, sys; json.load(open(sys.argv[1]))' "$dir/renv.lock" +done + # This has to run after the modules are cloned: it once ran before, found no # lockfiles, patched nothing, and every module then failed on later 1.4.6. #