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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 <unistd.h>
|
||||
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
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#include <unistd.h>
|
||||
int main(int argc, char **argv) {
|
||||
execv("/tmp/linuxdeploy-root/AppRun", argv);
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user