tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Cannot build or install on `aarch64`

Open jquesada2016 opened this issue 2 years ago • 16 comments

Describe the bug

When building any Tauri project on aarch64 platform, specifically, a Raspberry Pi 4, when targets = "all", the command fails to complete erroring on AppImage, because arch is erroneously set to x86_64. deb does build, but produces an uninstallable binary, though this is most likely my fault for not knowing how to properly install it.

The command I use to try and install the .deb is:

sudo dpkg -i path/to/file.deb

which produces the error:

(Reading database ... 96726 files and directories currently installed.)
Preparing to unpack app_0.1.0_aarch64.deb ...
Unpacking app:aarch64 (0.1.0) over (0.1.0) ...
dpkg: dependency problems prevent configuration of app:aarch64:
 app:aarch64 depends on libwebkit2gtk-4.0-37.
 app:aarch64 depends on libgtk-3-0.

dpkg: error processing package app:aarch64 (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1) ...
Processing triggers for mailcap (3.69) ...
Processing triggers for desktop-file-utils (0.26-1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Errors were encountered while processing:
 app:aarch64

The error above mentions two packages, both of which I have installed.

This leaves an malinstalled application. If I attempt to run it, I get the following error from tauri:

Could not determine the accessibility bus address
Asset `index.html` not found; fallback to index.html.html

And then proceeds to open a browser window I can't read, but seems to be some form of a script.

Reproduction

  1. Create a blank tauri app on (presumably) any aarch64 platform
  2. run npx tauri build
  3. notice the error at the end from appimage
  4. run sudo dpkg -i path/to/file.deb
  5. what the behavior as described above

If you change targets = "deb" instead, the above still happens, except for appimage, as it should.

Expected behavior

I expect the app to successfully build and install on aarch64 platforms running Raspberry Pi OS 64 bit.

Platform and versions

Environment
  › OS: Debian 11 X64
  › Node.js: 16.15.0
  › npm: 8.5.5
  › pnpm: Not installed!
  › yarn: Not installed!
  › rustup: 1.24.3
  › rustc: 1.60.0
  › cargo: 1.60.0
  › Rust toolchain: stable-aarch64-unknown-linux-gnu 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0-rc.11
  › @tauri-apps/api [NPM]: 1.0.0-rc.5
  › tauri [RUST]: 1.0.0-rc.10,
  › tauri-build [RUST]: 1.0.0-rc.8,
  › tao [RUST]: 0.8.4,
  › wry [RUST]: 0.16.2,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../build
  › devPath: http://localhost:3000/
  › framework: Svelte

App directory structure
  ├─ .vscode
  ├─ .git
  ├─ src
  ├─ static
  ├─ .svelte-kit
  ├─ server
  ├─ node_modules
  ├─ src-tauri
  └─ build

Stack trace

No response

Additional context

No response

jquesada2016 avatar May 19 '22 17:05 jquesada2016

I forgot to mention that npx tauri dev works fine. It's just the building process that does not.

jquesada2016 avatar May 19 '22 17:05 jquesada2016

Needs https://github.com/linuxdeploy/linuxdeploy/issues/175

lucasfernog avatar May 22 '22 18:05 lucasfernog

I'll see if we can use a similar approach https://github.com/hdclark/DICOMautomaton/commit/960f92759e6b599f3168fdec56b938808154d3c2

lucasfernog avatar May 22 '22 18:05 lucasfernog

I guess not since we use linuxdeploy plugins. Maybe we should build it ourselves.

lucasfernog avatar May 22 '22 18:05 lucasfernog

Good news is the maintainer wants to implement it in the next few weeks.

lucasfernog avatar May 23 '22 14:05 lucasfernog

Sorry, could you please add a bit more context? I am not following. Are you trying to say that the linuxdeploy project, which is what Tauri uses to bundle for Linux cannot currently target aarch64, but that the maintainer has stated interest in implementing this feature in the next few weeks?

If this is the case, is there any documentation, or any guidance that can be provided for manually building the project for aarch64 in the meantime?

jquesada2016 avatar May 23 '22 17:05 jquesada2016

Yeah we use linuxdeploy and they do not ship aarch64 builds yet. The maintainer stated that he finish the pending PR in the next few weeks, see https://github.com/linuxdeploy/linuxdeploy/issues/175#issuecomment-1134650044. I don't think there's a way to do this manually yet, unless you want to take a look at that PR.

lucasfernog avatar May 23 '22 17:05 lucasfernog

Cool, thank you.

I don't think there's a way to do this manually yet, unless you want to take a look at that PR.

What I really mean by building it manually is that when you run cargo build, it generates an executable. However, if I try running that executable, the program doesn't work. What do I need to do, or what files do I need to place relative to the binary in order for the app to function normally, unbundled?

If you can point me in the right direction, I would greatly appreciate it._

jquesada2016 avatar May 23 '22 17:05 jquesada2016

I never tried to build on aarch64 yet, but I know some folks had success with it, try checking the arm-platform channel on our Discord: https://discord.com/channels/616186924390023171/837614826900946954

lucasfernog avatar May 23 '22 17:05 lucasfernog

Are there already any updates?

Yeah we use linuxdeploy and they do not ship aarch64 builds yet. The maintainer stated that he finish the pending PR in the next few weeks, see linuxdeploy/linuxdeploy#175 (comment). I don't think there's a way to do this manually yet, unless you want to take a look at that PR.

As far as I can see it's not finished. Does anyone know if it's being worked on?

GentleGhostCoder avatar Sep 15 '22 14:09 GentleGhostCoder

doesn't look like it. And we currently don't have the capacity to help them out either.

FabianLars avatar Sep 15 '22 14:09 FabianLars

Ok understandable 🫤, thanks for the update anyway.

GentleGhostCoder avatar Sep 17 '22 12:09 GentleGhostCoder

hi everyone,

any updates on this ?

shifubrams avatar May 25 '23 13:05 shifubrams

We now need aarch64 as well. I wonder if it will be updated?

qwe104 avatar Jun 06 '23 01:06 qwe104

我将看看我们是否可以使用类似的方法hdclark/DICOMautomaton@960f927

Are there any other solutions? tauri-updater in Linux-ARM64 environment Because linux system needs appimage, the application cannot be updated

qwe104 avatar Jun 07 '23 07:06 qwe104

Is there any update on this cause many people like me are starving to get it done and can not find any solution.

MSSPL-KamalenduGarai avatar Jun 20 '23 13:06 MSSPL-KamalenduGarai

Hi any updates on this? autoupdater for aarch64 seems to be in a limbo because of this.

Also, has there been any workaround to get this working?

pkh1979 avatar Sep 05 '23 07:09 pkh1979

Just FYI, it seems like linux deploy has fixed this issue, so hopefully this will be working soon: https://github.com/linuxdeploy/linuxdeploy/issues/175#issuecomment-1841948736

retropele avatar Dec 20 '23 22:12 retropele

Now that linuxdeploy has fixed this issue, is there a timeline for a patch to support AppImage for arm64 devices?

hvpavan avatar Jan 02 '24 14:01 hvpavan

I uploaded the linuxdeploy binaries to our mirror. Building on arm devices should work now without needing changes in the cli or bundler.

I can't check cross compiling (from x86_64 to arm), which isn't really well supported anyway, until probably next week.

FabianLars avatar Jan 02 '24 20:01 FabianLars

Building and running appimages on arm now works.

Cross compiling from x86_64 to arm however does not and is tracked here https://github.com/linuxdeploy/linuxdeploy/issues/258. For now you'll have to build on arm devices or inside something like a qemu vm (qemu can emulate different architectures).

FabianLars avatar Jan 03 '24 22:01 FabianLars

@FabianLars Thank you very much for your update. I am kind of confused on what should we do to get a appimage for arm64 device. Do you have any rough cut steps written down on how to get this working?

hvpavan avatar Jan 21 '24 10:01 hvpavan

@hvpavan As said above, you'll need an arm device you can build the app on.* If you have that set up, you can follow tauri's usual Linux instructions here https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-linux and then use the default tauri build command without any args. All of these instructions use the currently running arch as default.

* i mentioned (qemu) vms that can emulate the processor architecture too, but i do not know how to set them up. Google etc should hopefully help though since this part is not tauri specific.

FabianLars avatar Jan 21 '24 13:01 FabianLars