Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] cargo tauri build fails to build appimage with "error running appimage.sh" #4928

Closed
malaire opened this issue Aug 13, 2022 · 7 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@malaire
Copy link

malaire commented Aug 13, 2022

Describe the bug

When running cargo tauri build the deb is built successfully but building appimage fails with following error:

...
   Compiling app v0.1.0 (/y/projects/A-Z/D/dioxus-testing/tauri-bug/src-tauri)
   Compiling webkit2gtk v0.18.0
   Compiling tauri-runtime v0.10.2
   Compiling tauri-runtime-wry v0.10.2
    Finished release [optimized] target(s) in 5m 23s
    Bundling my-app_0.1.0_amd64.deb (target/release/bundle/deb/my-app_0.1.0_amd64.deb)
    Bundling my-app_0.1.0_amd64.AppImage (target/release/bundle/appimage/my-app_0.1.0_amd64.AppImage)
       Error failed to bundle project: error running appimage.sh: error running appimage.sh: `No such file or directory (os error 2)`: No such file or directory (os error 2)

Reproduction

$ cargo install tauri-cli
$ mkdir tauri-bug
$ cd tauri-bug
- create `ui/index.html` with contents given in https://tauri.app/v1/guides/getting-started/setup/html-css-js/
$ cargo tauri init
App name           : My App
Window title       : My Window
Web assets location: ../ui
Dev server URL     : ../ui
$ mkdir src-tauri/.cargo
$ echo "build.target-dir = \"target\"" > src-tauri/.cargo/config
$ cargo tauri dev
; succeeds
- change bundle identified in `tauri.conf.json` to "my.test"
$ cargo tauri build
; fails

Note: .cargo/config is because of #4632 to override the global value I have.

Expected behavior

Build should succeed and create appimage file.

Platform and versions

Environment
  › OS: Debian 11 X64
  › Node.js: 12.22.12
  › npm: Not installed!
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.25.1
  › rustc: 1.63.0
  › cargo: 1.63.0
  › Rust toolchain: stable-x86_64-unknown-linux-gnu 

Packages
WARNING: no lock files found, defaulting to npm
  › @tauri-apps/cli [NPM]: 1.0.5
  › @tauri-apps/api [NPM]: Not installed!
  › tauri [RUST]: 1.0.5,
  › tauri-build [RUST]: 1.0.4,
  › tao [RUST]: 0.12.2,
  › wry [RUST]: 0.19.0,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../ui
  › devPath: ../ui
package.json not found

App directory structure
  ├─ src-tauri
  └─ ui

Stack trace

No response

Additional context

No response

@malaire malaire added status: needs triage This issue needs to triage, applied to new issues type: bug labels Aug 13, 2022
@FabianLars
Copy link
Member

Can you re-run it with the verbose flag so that we hopefully can see where it fails exactly? cargo tauri build --verbose

@malaire
Copy link
Author

malaire commented Aug 13, 2022

Log after deleting targetand running cargo tauri build --verbose 2>&1 | tee log:

...
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("appimage_filename")], "appimage_filename")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("tauri_tools_path")], "tauri_tools_path")))
       Debug [handlebars::render] Rendering value: Path(Relative(([Named("app_name")], "app_name")))
    Bundling [tauri_bundler::bundle::linux::appimage] my-app_0.1.0_amd64.AppImage (target/release/bundle/appimage/my-app_0.1.0_amd64.AppImage)
     Running [tauri_bundler::bundle::common] Command `target/release/bundle/appimage/build_appimage.sh `
       Error [tauri_cli] failed to bundle project: error running appimage.sh: error running appimage.sh: `No such file or directory (os error 2)`: No such file or directory (os error 2)

Full log attached.

btw, there is no appimage.sh file anywhere under target directory, but there is release/bundle/appimage/build_appimage.sh

log.txt

@FabianLars
Copy link
Member

Meh, hoped for a more helpful log/error x) Thanks nonetheless!

but there is release/bundle/appimage/build_appimage.sh

Sounds like a side effect of the target-dir setting to me. Gonna double check asap.

@malaire
Copy link
Author

malaire commented Aug 13, 2022

Problem was that I had missed installing librsvg2-dev.

After disabling my global and local target-dir setting, cargo tauri build --verbose gave a lot of debug info, ending with:

...
[gtk/stderr] No package 'librsvg-2.0' found
[gtk/stderr] /home/malaire/.cache/tauri/linuxdeploy-plugin-gtk.sh: there is no 'libdir' variable for 'librsvg-2.0' library.
[gtk/stderr] Please check the 'librsvg-2.0.pc' file is present in $PKG_CONFIG_PATH (you may need to install the appropriate -dev/-devel package).
ERROR: Failed to run plugin: gtk (exit code: 1) 
       Error [tauri_cli] failed to bundle project: error running appimage.sh: error running appimage.sh: `failed to run /y/projects/A-Z/D/dioxus-testing/tauri-bug/src-tauri/target/release/bundle/appimage/build_appimage.sh`

I have no idea why target-dir setting would hide debug info, but looks like it does.

@malaire malaire closed this as completed Aug 13, 2022
@FabianLars
Copy link
Member

Well, actually there are 2 issues. The first one (the one you initially posted) is indeed because of target-dir, and you need to remove both the global and local settings for it to work again (which you did).
The second one was like you said a missing dependency, but this happens way after the first issue.

@malaire
Copy link
Author

malaire commented Aug 13, 2022

Yes, I just noticed that if I don't have any target-dir setting build now succeeds.

But if I then add local build.target-dir = "target" (which should be no-op without global setting) build then fails.

@FabianLars
Copy link
Member

Yeah, super weird. i'm looking into it right now and gonna try to fix 4632 while i'm at it.

FabianLars added a commit that referenced this issue Aug 13, 2022
FabianLars added a commit that referenced this issue Aug 21, 2022
lucasfernog pushed a commit that referenced this issue Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants