fix(bundler): inline linuxdeploy plugin scripts#12
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| if !gtk.exists() { | ||
| let data = download("https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh")?; | ||
| if gtk.exists() { | ||
| let data = include_bytes!("./linuxdeploy-plugin-gtk.sh"); |
There was a problem hiding this comment.
GTK plugin condition is inverted, never creates file
High Severity
The condition if gtk.exists() is inverted. It writes the GTK plugin only when the file already exists, meaning the plugin will never be created on fresh installs. The gstreamer block correctly uses if !gstreamer.exists(), but the gtk block's condition was accidentally changed from !gtk.exists() to gtk.exists() during the refactor. This breaks AppImage bundling for all new users who don't have a cached GTK plugin file.
| fs::write(path, data)?; | ||
| fs::set_permissions(path, fs::Permissions::from_mode(0o770))?; | ||
| fs::set_permissions(path, fs::Permissions::from_mode(0o770)).map_err(FileWriteError::Permissions)?; | ||
| fs::write(path, data).map_err(FileWriteError::Write)?; |
There was a problem hiding this comment.
Permissions set before file write causes failure
High Severity
The write_and_make_executable function calls fs::set_permissions before fs::write. Since this function is called when files don't exist (e.g., !apprun.exists(), !linuxdeploy.exists()), attempting to set permissions on a non-existent file fails with "No such file or directory". The original code correctly wrote the file first, then set permissions.
Benchmark PR from qodo-benchmark#154
Note
Purpose
Inline linuxdeploy plugin scripts to avoid fetching from
raw.githubusercontent.comand related 429 errors.linuxdeploy-plugin-gtk.shandlinuxdeploy-plugin-gstreamer.shto the repo and bundles them viainclude_bytes!, writing them to the tools dir duringprepare_toolsprepare_toolsto use embedded scripts (replacing previous remote downloads) and tweaks linuxdeploy URL/argswrite_and_make_executableto accept&[u8], introduceFileWriteError, and adjust permission handling.changes/Written by Cursor Bugbot for commit 15bde81. Configure here.