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. #