fix: pre-stage linuxdeploy plugins; add wrapper diagnostic log
This commit is contained in:
@@ -188,6 +188,14 @@ jobs:
|
|||||||
ls /root/linuxdeploy-root/
|
ls /root/linuxdeploy-root/
|
||||||
ls /root/linuxdeploy-root/usr/bin/ 2>/dev/null || echo "no usr/bin"
|
ls /root/linuxdeploy-root/usr/bin/ 2>/dev/null || echo "no usr/bin"
|
||||||
|
|
||||||
|
# Pre-stage plugin scripts next to linuxdeploy so it finds them via /proc/self/exe lookup
|
||||||
|
wget -q "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" \
|
||||||
|
-O /root/linuxdeploy-root/usr/bin/linuxdeploy-plugin-gtk.sh
|
||||||
|
wget -q "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gstreamer/master/linuxdeploy-plugin-gstreamer.sh" \
|
||||||
|
-O /root/linuxdeploy-root/usr/bin/linuxdeploy-plugin-gstreamer.sh
|
||||||
|
chmod +x /root/linuxdeploy-root/usr/bin/linuxdeploy-plugin-gtk.sh \
|
||||||
|
/root/linuxdeploy-root/usr/bin/linuxdeploy-plugin-gstreamer.sh
|
||||||
|
|
||||||
gcc -o ~/.cache/tauri/linuxdeploy-x86_64.AppImage tools/ld_wrapper.c
|
gcc -o ~/.cache/tauri/linuxdeploy-x86_64.AppImage tools/ld_wrapper.c
|
||||||
chmod +x ~/.cache/tauri/linuxdeploy-x86_64.AppImage
|
chmod +x ~/.cache/tauri/linuxdeploy-x86_64.AppImage
|
||||||
|
|
||||||
@@ -199,6 +207,10 @@ jobs:
|
|||||||
RUST_LOG: tauri_bundler=debug
|
RUST_LOG: tauri_bundler=debug
|
||||||
run: npm run tauri -- build --bundles appimage,deb
|
run: npm run tauri -- build --bundles appimage,deb
|
||||||
|
|
||||||
|
- name: Show linuxdeploy wrapper log
|
||||||
|
if: always()
|
||||||
|
run: cat /tmp/ld-wrapper.log 2>/dev/null || echo "no wrapper log found"
|
||||||
|
|
||||||
- name: Upload to release
|
- name: Upload to release
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
|||||||
+16
-6
@@ -12,15 +12,13 @@ int main(int argc, char **argv) {
|
|||||||
snprintf(apprun, sizeof(apprun), "%s/AppRun", appdir);
|
snprintf(apprun, sizeof(apprun), "%s/AppRun", appdir);
|
||||||
snprintf(ldbin, sizeof(ldbin), "%s/usr/bin/linuxdeploy", appdir);
|
snprintf(ldbin, sizeof(ldbin), "%s/usr/bin/linuxdeploy", appdir);
|
||||||
|
|
||||||
/* Strip --appimage-extract-and-run: that's an AppImage runtime flag,
|
/* Strip --appimage-extract-and-run: AppImage runtime flag, not a linuxdeploy flag */
|
||||||
not a linuxdeploy flag. Passing it to the real binary causes immediate failure. */
|
|
||||||
char **new_argv = malloc((argc + 1) * sizeof(char *));
|
char **new_argv = malloc((argc + 1) * sizeof(char *));
|
||||||
int new_argc = 0;
|
int new_argc = 0;
|
||||||
new_argv[new_argc++] = argv[0];
|
new_argv[new_argc++] = argv[0];
|
||||||
for (int i = 1; i < argc; i++) {
|
for (int i = 1; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "--appimage-extract-and-run") != 0) {
|
if (strcmp(argv[i], "--appimage-extract-and-run") != 0)
|
||||||
new_argv[new_argc++] = argv[i];
|
new_argv[new_argc++] = argv[i];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
new_argv[new_argc] = NULL;
|
new_argv[new_argc] = NULL;
|
||||||
|
|
||||||
@@ -35,9 +33,21 @@ int main(int argc, char **argv) {
|
|||||||
appdir, appdir, old_ldpath ? old_ldpath : "");
|
appdir, appdir, old_ldpath ? old_ldpath : "");
|
||||||
setenv("LD_LIBRARY_PATH", new_ldpath, 1);
|
setenv("LD_LIBRARY_PATH", new_ldpath, 1);
|
||||||
|
|
||||||
if (stat(ldbin, &st) == 0) {
|
/* Write diagnostic log visible in the always() post-step */
|
||||||
execv(ldbin, new_argv);
|
FILE *log = fopen("/tmp/ld-wrapper.log", "w");
|
||||||
|
if (log) {
|
||||||
|
fprintf(log, "APPDIR=%s\n", appdir);
|
||||||
|
fprintf(log, "AppRun exists: %s\n", stat(apprun, &st) == 0 ? "yes" : "NO");
|
||||||
|
fprintf(log, "linuxdeploy exists: %s\n", stat(ldbin, &st) == 0 ? "yes" : "NO");
|
||||||
|
fprintf(log, "argc=%d new_argc=%d\n", argc, new_argc);
|
||||||
|
fprintf(log, "args:");
|
||||||
|
for (int i = 0; i < new_argc; i++) fprintf(log, " [%s]", new_argv[i]);
|
||||||
|
fprintf(log, "\nPATH=%s\n", getenv("PATH") ? getenv("PATH") : "(null)");
|
||||||
|
fclose(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stat(ldbin, &st) == 0)
|
||||||
|
execv(ldbin, new_argv);
|
||||||
execv(apprun, new_argv);
|
execv(apprun, new_argv);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user