appimage build: split out building type2-runtime into separate .sh
What changed, and why it matters
This commit simply moves existing build instructions from one shell script into a new, separate shell script. It does not change what the build does, what software it downloads, or how it behaves. There is no security-relevant change visible in the code.
No security action needed. Treat as routine build-system refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors the AppImage build process by extracting the type2-runtime build logic from contrib/build-linux/appimage/build.sh into a new script contrib/build-linux/appimage/make_type2_runtime.sh. The commands, repository URL, pinned commit hash, patch application, and build steps are identical. No functional or security-relevant modifications are introduced.
Changed components
contrib/build-linux/appimage/build.shcontrib/build-linux/appimage/make_type2_runtime.shInspect captured patch +38 / −27
diff --git a/contrib/build-linux/appimage/build.sh b/contrib/build-linux/appimage/build.sh
index 8c1bfd7..c16b19f 100755
--- a/contrib/build-linux/appimage/build.sh
+++ b/contrib/build-linux/appimage/build.sh
@@ -13,10 +13,6 @@ CONTRIB_APPIMAGE="$CONTRIB/build-linux/appimage"
DISTDIR="$PROJECT_ROOT/dist"
BUILD_UID=$(/usr/bin/stat -c %u "$PROJECT_ROOT")
-# when bumping the runtime commit also check if the `type2-runtime-reproducible-build.patch` still works
-TYPE2_RUNTIME_COMMIT="5e7217b7cfeecee1491c2d251e355c3cf8ba6e4d"
-TYPE2_RUNTIME_REPO="https://github.com/AppImage/type2-runtime.git"
-
. "$CONTRIB"/build_tools_util.sh
@@ -52,29 +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)
-TYPE2_RUNTIME_REPO_DIR="$PROJECT_ROOT_OR_FRESHCLONE_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
- fi
- clone_or_update_repo "$TYPE2_RUNTIME_REPO" "$TYPE2_RUNTIME_COMMIT" "$TYPE2_RUNTIME_REPO_DIR"
-
- # Apply patch to make runtime build reproducible
- info "Applying type2-runtime patch..."
- cd "$TYPE2_RUNTIME_REPO_DIR"
- git apply "$CONTRIB_APPIMAGE/patches/type2-runtime-reproducible-build.patch" || fail "Failed to apply runtime repo patch"
-
- info "building type2-runtime in build container..."
- cd "$TYPE2_RUNTIME_REPO_DIR/scripts/docker"
- env ARCH=x86_64 ./build-with-docker.sh
- mv "./runtime-x86_64" "$TYPE2_RUNTIME_REPO_DIR/"
-
- # clean up the empty created 'out' dir to prevent permission issues
- rm -rf "$TYPE2_RUNTIME_REPO_DIR/out"
-
- info "runtime build successful: $(sha256sum "$TYPE2_RUNTIME_REPO_DIR/runtime-x86_64")"
-)
+"$CONTRIB_APPIMAGE/make_type2_runtime.sh" || fail "Error building type2-runtime."
info "building binary..."
# check uid and maybe chown. see #8261
diff --git a/contrib/build-linux/appimage/make_type2_runtime.sh b/contrib/build-linux/appimage/make_type2_runtime.sh
new file mode 100755
index 0000000..fdf7513
--- /dev/null
+++ b/contrib/build-linux/appimage/make_type2_runtime.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+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"
+
+# when bumping the runtime commit also check if the `type2-runtime-reproducible-build.patch` still works
+TYPE2_RUNTIME_COMMIT="5e7217b7cfeecee1491c2d251e355c3cf8ba6e4d"
+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"
+if [ -f "$TYPE2_RUNTIME_REPO_DIR/runtime-x86_64" ]; then
+ info "type2-runtime already built, skipping"
+ exit 0
+fi
+clone_or_update_repo "$TYPE2_RUNTIME_REPO" "$TYPE2_RUNTIME_COMMIT" "$TYPE2_RUNTIME_REPO_DIR"
+
+# Apply patch to make runtime build reproducible
+info "Applying type2-runtime patch..."
+cd "$TYPE2_RUNTIME_REPO_DIR"
+git apply "$CONTRIB_APPIMAGE/patches/type2-runtime-reproducible-build.patch" || fail "Failed to apply runtime repo patch"
+
+info "building type2-runtime in build container..."
+cd "$TYPE2_RUNTIME_REPO_DIR/scripts/docker"
+env ARCH=x86_64 ./build-with-docker.sh
+mv "./runtime-x86_64" "$TYPE2_RUNTIME_REPO_DIR/"
+
+# clean up the empty created 'out' dir to prevent permission issues
+rm -rf "$TYPE2_RUNTIME_REPO_DIR/out"
+
+info "runtime build successful: $(sha256sum "$TYPE2_RUNTIME_REPO_DIR/runtime-x86_64")"
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.