Skip to content

fix(bundler): inline linuxdeploy plugin scripts#12

Open
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_fixbundler_inline_linuxdeploy_plugin_scripts_pr154from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_fixbundler_inline_linuxdeploy_plugin_scripts_pr154
Open

fix(bundler): inline linuxdeploy plugin scripts#12
tomerqodo wants to merge 2 commits intocursor_combined_20260121_qodo_grep_cursor_copilot_1_base_fixbundler_inline_linuxdeploy_plugin_scripts_pr154from
cursor_combined_20260121_qodo_grep_cursor_copilot_1_head_fixbundler_inline_linuxdeploy_plugin_scripts_pr154

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 21, 2026

Benchmark PR from qodo-benchmark#154


Note

Purpose
Inline linuxdeploy plugin scripts to avoid fetching from raw.githubusercontent.com and related 429 errors.

  • Adds linuxdeploy-plugin-gtk.sh and linuxdeploy-plugin-gstreamer.sh to the repo and bundles them via include_bytes!, writing them to the tools dir during prepare_tools
  • Updates prepare_tools to use embedded scripts (replacing previous remote downloads) and tweaks linuxdeploy URL/args
  • Refactors write_and_make_executable to accept &[u8], introduce FileWriteError, and adjust permission handling
  • Adds changelog entry under .changes/

Written by Cursor Bugbot for commit 15bde81. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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)?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants