build: appimage: fix fresh_clone builds for type2-runtime
What changed, and why it matters
This commit fixes a build script bug in Electrum's Linux AppImage packaging. When developers set a specific commit to build from (ELECBUILD_COMMIT), the script looked for a helper file in the wrong directory and the build would fail. The fix simply points the script to the correct location. There is no security issue here—just a broken build path being corrected.
No security action required. This is a routine build-system fix. Reviewers may verify the corrected paths work in fresh-clone AppImage builds with ELECBUILD_COMMIT set.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change corrects a path resolution regression introduced in commit daaf7b7c6bd6eaa2975777f1092dc01248c680fd. In build.sh, the call to make_type2_runtime.sh is changed from “$CONTRIB_APPIMAGE/make_type2_runtime.sh” to “$PROJECT_ROOT_OR_FRESHCLONE_ROOT/contrib/build-linux/appimage/make_type2_runtime.sh”. In make_type2_runtime.sh, the unused PROJECT_ROOT_OR_FRESHCLONE_ROOT variable is removed and TYPE2_RUNTIME_REPO_DIR is changed from using PROJECT_ROOT_OR_FRESHCLONE_ROOT to PROJECT_ROOT. This ensures the type2-runtime cache directory is resolved relative to the actual project root rather than an unset/ambiguous variable, fixing fresh-clone builds when ELECBUILD_COMMIT is set.
Changed components
contrib/build-linux/appimage/build.shcontrib/build-linux/appimage/make_type2_runtime.shInspect captured patch +2 / −3
diff --git a/contrib/build-linux/appimage/build.sh b/contrib/build-linux/appimage/build.sh
index 8f66d53..a06f51e 100755
--- a/contrib/build-linux/appimage/build.sh
+++ b/contrib/build-linux/appimage/build.sh
@@ -48,7 +48,7 @@ fi
# build the type2-runtime binary, this build step uses a separate docker container
# defined in the type2-runtime repo (patched with type2-runtime-reproducible-build.patch)
-"$CONTRIB_APPIMAGE/make_type2_runtime.sh" || fail "Error building type2-runtime."
+"$PROJECT_ROOT_OR_FRESHCLONE_ROOT/contrib/build-linux/appimage/make_type2_runtime.sh" || fail "Error building type2-runtime."
DOCKER_RUN_FLAGS=""
if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then
diff --git a/contrib/build-linux/appimage/make_type2_runtime.sh b/contrib/build-linux/appimage/make_type2_runtime.sh
index fdf7513..a17bc35 100755
--- a/contrib/build-linux/appimage/make_type2_runtime.sh
+++ b/contrib/build-linux/appimage/make_type2_runtime.sh
@@ -3,7 +3,6 @@
set -e
PROJECT_ROOT="$(dirname "$(readlink -e "$0")")/../../.."
-PROJECT_ROOT_OR_FRESHCLONE_ROOT="$PROJECT_ROOT"
CONTRIB="$PROJECT_ROOT/contrib"
CONTRIB_APPIMAGE="$CONTRIB/build-linux/appimage"
@@ -14,7 +13,7 @@ TYPE2_RUNTIME_REPO="https://github.com/AppImage/type2-runtime.git"
. "$CONTRIB"/build_tools_util.sh
-TYPE2_RUNTIME_REPO_DIR="$PROJECT_ROOT_OR_FRESHCLONE_ROOT/contrib/build-linux/appimage/.cache/appimage/type2-runtime"
+TYPE2_RUNTIME_REPO_DIR="$PROJECT_ROOT/contrib/build-linux/appimage/.cache/appimage/type2-runtime"
if [ -f "$TYPE2_RUNTIME_REPO_DIR/runtime-x86_64" ]; then
info "type2-runtime already built, skipping"
exit 0
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.