Skip to content

Conversation

@DistractionRectangle
Copy link
Contributor

@DistractionRectangle DistractionRectangle commented Jun 24, 2025

AppImages built with Tauri fail to render with EGL_BAD_PARAMETER on wayland + mesa. This is a side effect of binary stripping in older linuxdeploy builds. Tauri cli pulls in an outdated build of linuxdeploy. This can be fixed by opting out of binary stripping, or by upgrading linuxdeploy. Tauri cli is well behaved in that it doesn't fetch linuxdeploy if it already exists in the cache. This behavior allows us to pin linuxdeploy to any version of our choosing by prepopulating the toolsdirectory with a linuxdeploy binary before calling Tauri cli.

Describe Your Changes

  • Pins linuxdeploy version to prevent @tauri-apps/cli-linux-x64-gnu from pulling in an outdated version

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Pins linuxdeploy version in GitHub workflow to fix Tauri AppImage rendering issues on Wayland + Mesa.

This description was created by Ellipsis for 1f1a6fb. You can customize this summary. It will automatically update as commits are pushed.

Edit: correct github keyword from closes to fixes, added some hyperlinks to issue desc for improved context.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 1f1a6fb in 1 minute and 38 seconds. Click for details.
  • Reviewed 17 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/template-tauri-build-linux-x64.yml:154
  • Draft comment:
    Consider checking if the linuxdeploy binary already exists in TAURI_TOOLKIT_PATH to avoid redundant downloads on subsequent builds.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
2. .github/workflows/template-tauri-build-linux-x64.yml:157
  • Draft comment:
    Consider verifying the checksum of the downloaded linuxdeploy binary to ensure its integrity and guard against tampering.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None

Workflow ID: wflow_xOqDRKXFjj2pr0Zl

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

# Pin linuxdeploy version to prevent @tauri-apps/cli-linux-x64-gnu from pulling in an outdated version
TAURI_TOOLKIT_PATH="${XDG_CACHE_HOME:-$HOME/.cache}/tauri"
mkdir -p "$TAURI_TOOLKIT_PATH"
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage -O "$TAURI_TOOLKIT_PATH/linuxdeploy-x86_64.AppImage"
Copy link
Contributor

Choose a reason for hiding this comment

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

Add error handling (e.g. using 'set -e' or checking wget's exit code) for the linuxdeploy download step to ensure a failed download aborts the build.

@louis-jan louis-jan requested review from qnixsynapse and samhvw8 and removed request for samhvw8 June 24, 2025 08:18
@louis-jan louis-jan changed the base branch from dev to release/v0.6.3 June 26, 2025 05:43
@louis-jan louis-jan added this to the v0.6.3 milestone Jun 26, 2025
@LazyYuuki LazyYuuki moved this to Needs Review in Jan Jun 26, 2025
@LazyYuuki LazyYuuki modified the milestones: v0.6.3, v0.6.4 Jun 26, 2025
@Minh141120
Copy link
Member

Hi @DistractionRectangle,

I'm Minh from Menlo Research. First of all, thank you so much for your contribution and for flagging this issue with Tauri's linuxdeploy, as well as for digging into the root cause in issue #5367. We really appreciate the time and care you've put into this.

Following your suggestion, I downloaded the latest linuxdeploy-x86_64.AppImage from this release https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20250213-2/linuxdeploy-x86_64.AppImage, set TAURI_TOOLKIT_PATH to ${XDG_CACHE_HOME:-$HOME/.cache}/tauri, and moved the binary into that location as linuxdeploy-x86_64.AppImage.

I've tried this setup on both a fresh Fedora Workstation 42 (GNOME desktop) and Ubuntu 22.04. However, I'm still encountering an error during make build-tauri (and make build as well), specifically:

failed to bundle project: failed to run linuxdeploy

We’re actively working on this and continuing to investigate what might be causing the failure. If there's anything else you think we should double-check, your input would be greatly appreciated.

I've attached a screenshot of the terminal output below for reference:

  • On Ubuntu
    image
  • On Fedora
    image

@DistractionRectangle
Copy link
Contributor Author

Hi @Minh141120, that's to be expected. That's the other issue I touched upon in #5367, there's a bit of magic in the github release workflow that isn't reflected by the makefile. As I've come to understand it, linuxdeploy drills down the dependency tree of bundled resources and errors when dependencies are missing (as you've just run into). This is normally reasonable, expect when you want dependencies to be provided by the end users' systems. Tauri doesn't provide an escape hatch for this.

What it appears you guys are doing is this, you first remove the resources you intend to bundle from tauri.conf.json, proceed to call make build-tauri (necessary as the make build doesn't call yarn:copylib which is needed when building from a clean slate), throw out the appimage from that build (it's just used to create a skeleton appdir), then you manually copy the resources you intend to bundle to flesh out that app dir and then proceed to manually build the appimage with appimagetool (which doesn't drill down the dependency tree and just bundles the image) [0].

[0] https://github.com/menloresearch/jan/blob/e9b28c5a901c1954d7c4953761887ce991640e01/.github/workflows/template-tauri-build-linux-x64.yml#L174C1-L181C29

@Minh141120
Copy link
Member

Hi @DistractionRectangle, thank you so much for the incredibly detailed explanation, your insight has been extremely helpful.

I'll try to get it working locally first, and once everything builds smoothly, I'll proceed with merging your changes. Your thorough breakdown really helped us understand the issue and saved us a lot of time!

By the way, we're planning to move toward a Flatpak distribution for Jan in the near future (issue #5416), which should help us avoid these kinds of packaging issues going forward.

Once again, we greatly appreciate your contribution. I’ll keep you posted here as soon as I make progress.

Thanks again for your support!

@Minh141120
Copy link
Member

Minh141120 commented Jun 27, 2025

HI @DistractionRectangle,

Its working now on my fedora machine, the Wayland rendering issue is gone! 🎉🎉. Thanks to your contribution, everything is running smoothly:

image

We greatly appreciate your help! We’ll be including this in the upcoming v0.6.4 release. Once again, thank you for your contributions. I’ll go ahead and merge both of your PRs: the Tauri fix and the reproducible dev environment via .devcontainer.

Copy link
Member

@Minh141120 Minh141120 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Minh141120
Copy link
Member

Hi @DistractionRectangle,

Could you help us rebase your branch with the latest changes from release/v0.6.4 and push the updated commit? That’ll help us proceed with the merge.

Copy link
Contributor

@qnixsynapse qnixsynapse left a comment

Choose a reason for hiding this comment

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

LGTM

AppImages built with Tauri fail to render with EGL_BAD_PARAMETER on
wayland + mesa. This is a side effect of binary stripping in older
linuxdeploy builds. Tauri cli pulls in an outdated build of linuxdeploy.
This can be fixed by opting out of binary stripping, or by upgrading
linuxdeploy. Tauri cli is well behaved in that it doesn't fetch
linuxdeploy if it already exists in the cache. This behavior allows us
to pin linuxdeploy to any version of our choosing by prepopulating the
toolsdirectory with a linuxdeploy binary before calling Tauri cli.
@DistractionRectangle
Copy link
Contributor Author

Rebased on release/v.0.6.4

@Minh141120
Copy link
Member

Thank you @DistractionRectangle, I’ll go ahead and merge it once all the CI checks have passed.

@Minh141120 Minh141120 merged commit 50f3563 into janhq:release/v0.6.4 Jun 27, 2025
2 of 5 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to QA in Jan Jun 27, 2025
@LazyYuuki LazyYuuki modified the milestones: v0.6.4, v0.6.5 Jul 1, 2025
@LazyYuuki LazyYuuki modified the milestones: v0.7.1, v0.6.5 Jul 3, 2025
DistractionRectangle added a commit to DistractionRectangle/jan that referenced this pull request Jul 8, 2025
…b workflow

- pulls fix for janhq#5463 out of the github release workflow and into
  the make/yarn build process
- implements a wrapper script that pins linuxdeploy and injects
  a new location for XDG_CACHE_HOME into the build pipeline,
  allowing manipulating .cache/tauri without tainting the hosts
  .cache
- adds ./.cache (project_root/.cache) to make clean and mise clean
  task
- remove .devcontainer/buildAppImage.sh, obsolete now that extra
  build steps have been removed from the github workflow and
  incorporated in the normal build process
DistractionRectangle added a commit to DistractionRectangle/jan that referenced this pull request Jul 8, 2025
…b workflow

- pulls fix for janhq#5463 out of the github release workflow and into
  the make/yarn build process
- implements a wrapper script that pins linuxdeploy and injects
  a new location for XDG_CACHE_HOME into the build pipeline,
  allowing manipulating .cache/tauri without tainting the hosts
  .cache
- adds ./.cache (project_root/.cache) to make clean and mise clean
  task
- remove .devcontainer/buildAppImage.sh, obsolete now that extra
  build steps have been removed from the github workflow and
  incorporated in the normal build process
- remove appimagetool from .devcontainer/postCreateCommand.sh,
  as it was only used by .devcontainer/buildAppImage.sh
@Minh141120 Minh141120 moved this from QA to Done in Jan Jul 10, 2025
DistractionRectangle added a commit to DistractionRectangle/jan that referenced this pull request Jul 10, 2025
…b workflow

- pulls fix for janhq#5463 out of the github release workflow and into
  the make/yarn build process
- implements a wrapper script that pins linuxdeploy and injects
  a new location for XDG_CACHE_HOME into the build pipeline,
  allowing manipulating .cache/tauri without tainting the hosts
  .cache
- adds ./.cache (project_root/.cache) to make clean and mise clean
  task
- remove .devcontainer/buildAppImage.sh, obsolete now that extra
  build steps have been removed from the github workflow and
  incorporated in the normal build process
- remove appimagetool from .devcontainer/postCreateCommand.sh,
  as it was only used by .devcontainer/buildAppImage.sh
@LazyYuuki LazyYuuki mentioned this pull request Jul 14, 2025
3 tasks
@turtton turtton mentioned this pull request Jul 15, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug: Can't start on linux (Wayland) bug: Wayland issue - display empty windows

5 participants