From 2de368847c749c656a4f5bf8451720b504bee096 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Thu, 11 Jun 2026 13:19:06 -0400 Subject: [PATCH] fix: resolve YAML parse error in release.yml CI workflow Column-0 lines inside run: | blocks (Python -c script and C heredoc) caused Gitea's YAML parser to terminate the literal block early, resulting in a 500 error on every workflow_dispatch call. Fix by collapsing the Python to a single line and moving the C source into tools/ld_wrapper.c so CI can compile it directly without any heredoc. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 23 ++--------------------- tools/ld_wrapper.c | 5 +++++ 2 files changed, 7 insertions(+), 21 deletions(-) create mode 100644 tools/ld_wrapper.c diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 898c9c1..a36d7d4 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -159,33 +159,14 @@ jobs: cp tools/AppRun-x86_64 ~/.cache/tauri/AppRun-x86_64 chmod +x ~/.cache/tauri/AppRun-x86_64 - # Download and extract linuxdeploy without FUSE. - # Tauri also runs `dd if=/dev/zero bs=1 count=3 seek=8` on the cached file - # to hide AppImage magic bytes — this corrupts a shell script's shebang. - # A compiled ELF binary is safe: bytes 8-10 (EI_OSABI/EI_ABIVERSION/pad) - # are already zero in standard ELF and survive the dd no-op. wget -q \ "https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-x86_64.AppImage" \ -O /tmp/linuxdeploy.AppImage - # Find squashfs at a page-aligned boundary after the ELF runtime - OFFSET=$(python3 -c " -d=open('/tmp/linuxdeploy.AppImage','rb').read() -for i in range(4096,len(d),4096): - if d[i:i+4] in (b'hsqs',b'sqsh'): - print(i); break -") + OFFSET=$(python3 -c "d=open('/tmp/linuxdeploy.AppImage','rb').read();next(print(i) for i in range(4096,len(d),4096) if d[i:i+4] in (b'hsqs',b'sqsh'))") unsquashfs -d /tmp/linuxdeploy-root -offset "$OFFSET" /tmp/linuxdeploy.AppImage - # Compile a tiny ELF forwarder as the cached AppImage entry point - cat > /tmp/ld_wrapper.c << 'CSRC' -#include -int main(int argc, char** argv) { - execv("/tmp/linuxdeploy-root/AppRun", argv); - return 1; -} -CSRC - gcc -o ~/.cache/tauri/linuxdeploy-x86_64.AppImage /tmp/ld_wrapper.c + gcc -o ~/.cache/tauri/linuxdeploy-x86_64.AppImage tools/ld_wrapper.c chmod +x ~/.cache/tauri/linuxdeploy-x86_64.AppImage - name: Build diff --git a/tools/ld_wrapper.c b/tools/ld_wrapper.c new file mode 100644 index 0000000..083bc1b --- /dev/null +++ b/tools/ld_wrapper.c @@ -0,0 +1,5 @@ +#include +int main(int argc, char **argv) { + execv("/tmp/linuxdeploy-root/AppRun", argv); + return 1; +}