From cda61649d48a0dabdd286130b24b255ad6e9c22a Mon Sep 17 00:00:00 2001 From: agw Date: Wed, 30 Sep 2026 21:30:00 +0200 Subject: [PATCH] Write module manifest versions as strings JASP can parse jaspModuleTools HEAD emits "version": [[0,96,5]]. JASP 0.98.1 checks root["version"].isMember("Version"), and jsoncpp throws on isMember for an array. The exception is caught per manifest and only logged to the log file, so all 36 bundled modules were dropped and JASP started with none, falling back to downloading Flatpak-built bundles that cannot load on Arch. Verified headless: with string versions JASP opens every module_libs entry. Claude-Session: https://claude.ai/code/session_01GGe7kUhooMFuzY6GaDb2w9 --- build/build-jasp.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/build/build-jasp.sh b/build/build-jasp.sh index 1221525..97a3fea 100755 --- a/build/build-jasp.sh +++ b/build/build-jasp.sh @@ -491,6 +491,30 @@ install -d "$STAGE_DIR$PREFIX/Modules" # on-demand downloads; shipping them alongside the installed form sends the # same content twice and took the tarball from 1.86 GB to 4.3 GB. +# jaspModuleTools is installed from GitHub HEAD, which writes the manifest +# version as an array ([[0,96,5]]). JASP's InstalledModules::parseModuleInfo +# calls isMember() on it, which jsoncpp refuses for arrays; the exception is +# caught per manifest and logged only to the (off by default) log file, so +# every bundled module is silently dropped and JASP starts with none at all. +# A plain version string is the first form that parser accepts. +log "normalising module manifest versions" +python3 - "$STAGE_DIR$PREFIX/Modules/manifests" <<'PY' +import json, pathlib, sys +manifests = sorted(pathlib.Path(sys.argv[1]).glob("*_manifest.json")) +if not manifests: + sys.exit("error: no module manifests were staged") +for p in manifests: + d = json.loads(p.read_text()) + v = d.get("version") + if isinstance(v, list): + parts = v[0] if v and isinstance(v[0], list) else v + d["version"] = ".".join(str(x) for x in parts) + p.write_text(json.dumps(d, indent=1) + "\n") + if not isinstance(d.get("version"), (str, dict)): + sys.exit(f"error: {p.name} has a version JASP cannot parse: {d.get('version')!r}") +print(f" {len(manifests)} manifests carry a version JASP can parse") +PY + install -Dm644 /work/packaging/org.jaspstats.JASP.desktop \ "$STAGE_DIR/usr/share/applications/org.jaspstats.JASP.desktop"