Skip to content

Conversation

@chengzeyi
Copy link
Member

Motivation

  • Prevent crashes on Ubuntu caused by Electron sandbox incompatibility by forcing --no-sandbox for installed launches.
  • Ensure the bundled Stable Diffusion shared library is discovered at runtime by setting LD_LIBRARY_PATH.
  • Avoid AppImage-related desktop launcher issues by handling launch behavior in the deb installer wrapper.

Description

  • Replace post-install symlink with a wrapper script in build/linux/after-install.sh that execs the packaged binary with --no-sandbox, patches the .desktop Exec= line, installs multiple icon sizes, and refreshes the icon cache.
  • Remove the AppImage target and the executableArgs entry from the linux section of package.json so the deb installer/wrapper is used for launches.
  • Prepend the SD binary directory to LD_LIBRARY_PATH in electron/lib/sdGenerator.ts before calling spawn so bundled shared libraries (e.g. libstable-diffusion.so) are found.

Testing

  • No automated tests were run.

Codex Task

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +5 to +8
cat > '/usr/bin/${executable}' << 'EOF'
#!/bin/bash
exec '/opt/${sanitizedProductName}/${executable}' --no-sandbox "$@"
EOF

Choose a reason for hiding this comment

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

P1 Badge Remove existing alternatives symlink before writing wrapper

On upgrades from the previous deb, /usr/bin/${executable} is a symlink created via update-alternatives. Using cat > /usr/bin/${executable} follows that symlink chain and truncates the real target (often /opt/.../${executable}), replacing the binary with the wrapper script contents. This leaves the installed app broken for users who upgrade. You should rm -f /usr/bin/${executable} (and possibly /etc/alternatives/${executable}) before writing the wrapper, or write the wrapper to a temporary file and mv it into place without following symlinks.

Useful? React with 👍 / 👎.

@chengzeyi chengzeyi merged commit 0402c19 into main Dec 27, 2025
4 checks passed
@chengzeyi chengzeyi deleted the codex/github-mention-linux-fixes-and-cuda-support-for-wavespeed-d branch December 27, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants