every-day-things/citadel

Error failed to bundle project: error running appimage.sh

Closed this issue · 10 comments

warning: unused import: dto::UpdateBookDto
--> src/main.rs:7:43
|
7 | application::services::domain::book::{dto::UpdateBookDto, service::BookService},
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: unused import: format::StrftimeItems
--> src/book.rs:3:25
|
3 | use chrono::{NaiveDate, format::StrftimeItems};
| ^^^^^^^^^^^^^^^^^^^^^

warning: unused variable: book_list
--> src/main.rs:63:9
|
63 | let book_list = book_service.all();
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _book_list
|
= note: #[warn(unused_variables)] on by default

warning: citadel-rs (bin "citadel-rs") generated 3 warnings (run cargo fix --bin "citadel-rs" to apply 3 suggestions)
Finished release [optimized] target(s) in 1m 36s
Bundling citadel_0.1.0_amd64.deb (/home/demor/programs/citadel/src-tauri/target/release/bundle/deb/citadel_0.1.0_amd64.deb)
Bundling citadel_0.1.0_amd64.AppImage (/home/demor/programs/citadel/src-tauri/target/release/bundle/appimage/citadel_0.1.0_amd64.AppImage)
Error failed to bundle project: error running appimage.sh
error: script "build:app" exited with code 1
error: script "build" exited with code 1

Apologies, main wasn't up to date! bun run build should work now — please give it a go :)

Same error for me after commit 178:

# [...]
Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-static
  Wrote site to "build"
  ✔ done
✓ built in 27.37s
warning: unused `Result` that must be used
   --> libcalibre/src/application/services/library/service.rs:323:17
    |
323 | / ...   match self.file_service.lock() {
324 | | ...       Ok(file_service_guard) => file_service_guard
325 | | ...           .copy_file_to_directory(file.path.as_path(), book_rel_path.as_path())
326 | | ...           .map_err(|_| LibSrvcError::InvalidDto),
...   |
329 | | ...       }
330 | | ...   };
    | |_______^
    |
    = note: this `Result` may be an `Err` variant, which should be handled
    = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
    |
323 |                 let _ = match self.file_service.lock() {
    |                 +++++++

warning: `libcalibre` (lib) generated 1 warning
   Compiling citadel-rs v0.1.0 (/tmp/makepkg/citadel-git/src/citadel/src-tauri)
warning: unused import: `crate::libs::file_formats::cover_data`
  --> src/libs/calibre/mod.rs:10:5
   |
10 | use crate::libs::file_formats::cover_data;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::templates::format_calibre_metadata_opf`
  --> src/libs/calibre/mod.rs:12:5
   |
12 | use crate::templates::format_calibre_metadata_opf;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `libcalibre::application::services::domain::file::dto::NewFileDto`
  --> src/libs/calibre/mod.rs:26:5
   |
26 | use libcalibre::application::services::domain::file::dto::NewFileDto;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `self::add_book::insert_book_metadata`
  --> src/libs/calibre/mod.rs:45:5
   |
45 | use self::add_book::insert_book_metadata;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: use of deprecated associated function `chrono::NaiveDate::from_ymd`: use `from_ymd_opt()` instead
   --> src/libs/calibre/mod.rs:214:51
    |
214 | ...                   .unwrap_or(NaiveDate::from_ymd(1970, 1, 1)),
    |                                             ^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `chrono::NaiveTime::from_hms`: use `from_hms_opt()` instead
   --> src/libs/calibre/mod.rs:215:44
    |
215 |                         chrono::NaiveTime::from_hms(0, 0, 0),
    |                                            ^^^^^^^^

warning: function `format_calibre_metadata_opf` is never used
 --> src/templates/mod.rs:1:8
  |
1 | pub fn format_calibre_metadata_opf(
  |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: `citadel-rs` (bin "citadel-rs") generated 7 warnings (run `cargo fix --bin "citadel-rs"` to apply 4 suggestions)
    Finished release [optimized] target(s) in 57.24s
    Bundling citadel_0.1.0_amd64.deb (/tmp/makepkg/citadel-git/src/citadel/src-tauri/target/release/bundle/deb/citadel_0.1.0_amd64.deb)
    Bundling citadel_0.1.0_amd64.AppImage (/tmp/makepkg/citadel-git/src/citadel/src-tauri/target/release/bundle/appimage/citadel_0.1.0_amd64.AppImage)
       Error failed to bundle project: error running appimage.sh
error: script "build:app" exited with code 1
error: script "build" exited with code 1

Can you tell me more about your build environment? I'm not seeing an error building an app image or .deb in a Codespace. I'll try in an Ubuntu 22.04 VM.

FWIW these are the steps I followed:

  • install bun via script on website
  • install rust via script on website
  • follow Tauri setup guide to install necesary packages (Debian, in a codespace)
  • bun install
  • bun run build

I do see that others are facing the same issue for other Tauri apps, so I want to help narrow down what the issue is.


edit: It also built on my Ubuntu 22.04 VM following the same steps.

Apologies, main wasn't up to date! bun run build should work now — please give it a go :)

Run npm run preview to preview your production build locally.

Using @sveltejs/adapter-static
Wrote site to "build"
✔ done
✓ built in 1.92s
Compiling citadel-rs v0.1.0 (/home/demor/programs/citadel/src-tauri)
warning: unused import: dto::UpdateBookDto
--> src/main.rs:7:43
|
7 | application::services::domain::book::{dto::UpdateBookDto, service::BookService},
| ^^^^^^^^^^^^^^^^^^
|
= note: #[warn(unused_imports)] on by default

warning: unused import: format::StrftimeItems
--> src/book.rs:3:25
|
3 | use chrono::{NaiveDate, format::StrftimeItems};
| ^^^^^^^^^^^^^^^^^^^^^

warning: unused variable: book_list
--> src/main.rs:63:9
|
63 | let book_list = book_service.all();
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: _book_list
|
= note: #[warn(unused_variables)] on by default

warning: citadel-rs (bin "citadel-rs") generated 3 warnings (run cargo fix --bin "citadel-rs" to apply 3 suggestions)
Finished release [optimized] target(s) in 13.27s
Bundling citadel_0.1.0_amd64.deb (/home/demor/programs/citadel/src-tauri/target/release/bundle/deb/citadel_0.1.0_amd64.deb)
Bundling citadel_0.1.0_amd64.AppImage (/home/demor/programs/citadel/src-tauri/target/release/bundle/appimage/citadel_0.1.0_amd64.AppImage)
Error failed to bundle project: error running appimage.sh
error: script "build:app" exited with code 1
error: script "build" exited with code 1

Can you tell me more about your build environment? I'm not seeing an error building an app image or .deb in a Codespace. I'll try in an Ubuntu 22.04 VM.

FWIW these are the steps I followed:

  • install bun via script on website
  • install rust via script on website
  • follow Tauri setup guide to install necesary packages (Debian, in a codespace)
  • bun install
  • bun run build

I do see that others are facing the same issue for other Tauri apps, so I want to help narrow down what the issue is.

edit: It also built on my Ubuntu 22.04 VM following the same steps.

I'm on arch linux

https://tauri.app/v1/guides/building/linux/#prerequisites

AppImages can only be built on ARM devices. To avoid Tauri from building it, you can customize tauri.conf.json in the src-tauri folder. Adjust the "targets" array to include only the desired platforms for your ARM-based device. For instance:

"targets": ["deb", "nsis", "msi", "app", "dmg", "updater"],

Alternatively you can use the --bundles flag when calling tauri build.


Unrelated, I took the freedom to port it to Arch Linux users through AUR: https://aur.archlinux.org/packages/citadel-git

@1ilir0lika what if you just try building for the .deb? bun run build --bundles deb. It's not clear from your messages — does bun run dev do anything?

@AlphaJack thank you!! You got to an automated build before I did :)

@phildenhoff bun run build --bundles deb works for me!


A minor issue, that would prevent reproducible builds: I get a warning that the citadel binary contains references to the directory path in which it was build

However, I don't know what part of the source code is causing this

A reproducible build is not a priority at the moment, but if that is required for Arch (and Nix, I assume) please open another issue and we'll keep it tracked. If someone wants to contribute to finding out how we can do that, I'd certainly appreciate it.

I assume it's related to Diesel and the migration/database setup script, but I'm also not sure (not without looking more into it, anyway).

I think we've resolved this, closing