You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -75,8 +75,7 @@ Manual compilation is suitable when you don't need to compile your application f
75
75
76
76
:::warning
77
77
78
-
Ubuntu 20.04 WSL has issues with webkit dependencies. It's recommended to use Debian instead.
79
-
Furthermore, AppImage is not supported on ARM devices. To avoid Tauri from building it, you need to 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:
78
+
AppImage is not supported on ARM devices. To avoid Tauri from building it, you need to 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:
@@ -91,58 +90,139 @@ Furthermore, AppImage is not supported on ARM devices. To avoid Tauri from build
91
90
Now, let's cross-compile the Tauri application for ARM:
92
91
93
92
1. Install Rust targets for your desired architecture:
93
+
94
94
- For ARMv7 (32-bit): `rustup target add armv7-unknown-linux-gnueabihf`
95
95
- For ARMv8 (ARM64, 64-bit): `rustup target add aarch64-unknown-linux-gnu`
96
96
97
97
2. Install the corresponding linker for your chosen architecture:
98
+
98
99
- For ARMv7: `sudo apt install gcc-arm-linux-gnueabihf`
99
100
- For ARMv8 (ARM64): `sudo apt install gcc-aarch64-linux-gnu`
100
101
101
102
3. Open or create the file `<project-root>/.cargo/config.toml` and add the following configurations accordingly:
103
+
102
104
```toml
103
105
[target.armv7-unknown-linux-gnueabihf]
104
106
linker = "arm-linux-gnueabihf-gcc"
105
-
107
+
106
108
[target.aarch64-unknown-linux-gnu]
107
109
linker = "aarch64-linux-gnu-gcc"
108
110
```
109
111
110
-
4. Enable the respective architecture in the package manager (only for non-Debian distributions):
112
+
4. Enable the respective architecture in the package manager:
113
+
111
114
- For ARMv7: `sudo dpkg --add-architecture armhf`
112
115
- For ARMv8 (ARM64): `sudo dpkg --add-architecture arm64`
113
116
114
-
:::info Adjusting Package Sources
117
+
5. Adjusting Package Sources
118
+
119
+
On Debian, this step should not be necessary, but on other distributions, you might need to edit `/etc/apt/sources.list` to include the ARM architecture variant. For example on Ubuntu 22.04 add these lines to the bottom of the file (Remember to replace `jammy` with the codename of your Ubuntu version):
115
120
116
-
On Debian, this step isn't necessary, but on other distributions, you might need to edit `/etc/apt/sources.list` to include the ARM architecture variant. For example, add these lines:
117
121
```bash
118
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy main restricted
119
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted
120
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy universe
121
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates universe
122
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy multiverse
123
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-updates multiverse
124
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse
125
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
126
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security universe
127
-
deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
122
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted
123
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricted
124
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy universe
125
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates universe
126
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy multiverse
127
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates multiverse
128
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse
129
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted
130
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security universe
131
+
deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse
128
132
```
129
-
After making changes, verify if the armhf architecture is still enabled in the package manager by re-running the command from Step 4.
130
133
131
-
:::
134
+
Then, to prevent issues with the main packages, you have to add the correct main architecture to all other lines the file contained beforehand. For standard 64-bit systems you need to add `[arch=amd64]`, the full file on Ubuntu 22.04 then looks similar to this:
135
+
136
+
<details><summary>Click to see the full example file for Ubuntu 22.04</summary>
137
+
138
+
```bash
139
+
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
140
+
# newer versions of the distribution.
141
+
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted
142
+
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted
143
+
144
+
## Major bug fix updates produced after the final release of the
145
+
## distribution.
146
+
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
147
+
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
148
+
149
+
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
150
+
## team. Also, please note that software in universe WILL NOT receive any
151
+
## review or updates from the Ubuntu security team.
152
+
deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe
7. Install the required webkitgtk library for your chosen architecture:
134
200
135
-
6. Install the required webkitgtk library for your chosen architecture:
136
201
- For ARMv7: `sudo apt install libwebkit2gtk-4.0-dev:armhf`
137
202
- For ARMv8 (ARM64): `sudo apt install libwebkit2gtk-4.0-dev:arm64`
138
203
139
-
7. Set the `PKG_CONFIG_SYSROOT_DIR` to the appropriate directory based on your chosen architecture:
204
+
8. Install OpenSSL or use a vendored version:
205
+
206
+
This is not always required so you may want to proceed first and check if you see errors like `Failed to find OpenSSL development headers`.
207
+
208
+
- Either install the development headers system-wide:
209
+
- For ARMv7: `sudo apt install libssl-dev-dev:armhf`
210
+
- For ARMv8 (ARM64): `sudo apt install libssl-dev-dev:arm64`
211
+
- Or enable the `vendor` feature for the OpenSSL Rust crate which will affect all other Rust dependencies using the same minor version. You can do so by adding this to the dependencies section in your `Cargo.toml` file:
212
+
213
+
```toml
214
+
openssl-sys = {version = "0.9", features = ["vendored"]}
215
+
```
216
+
217
+
9. Set the `PKG_CONFIG_SYSROOT_DIR` to the appropriate directory based on your chosen architecture:
218
+
140
219
- For ARMv7: `export PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf/`
141
220
- For ARMv8 (ARM64): `export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/`
142
221
143
-
8. Build the app for your desired ARM version:
144
-
- For ARMv7: `cargo tauri build --target armv7-unknown-linux-gnueabihf`
145
-
- For ARMv8 (ARM64): `cargo tauri build --target aarch64-unknown-linux-gnu`
222
+
10. Build the app for your desired ARM version:
223
+
224
+
- For ARMv7: `cargo tauri build --target armv7-unknown-linux-gnueabihf`
225
+
- For ARMv8 (ARM64): `cargo tauri build --target aarch64-unknown-linux-gnu`
146
226
147
227
Choose the appropriate set of instructions based on whether you want to cross-compile your Tauri application for ARMv7 or ARMv8 (ARM64). Please note that the specific steps may vary depending on your Linux distribution and setup.
148
228
@@ -153,6 +233,7 @@ For automated ARM executable builds on GitHub, we'll use the [arm-runner-action]
153
233
:::warning
154
234
155
235
AppImage is not supported on ARM devices. To avoid Tauri building it, you need to 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:
0 commit comments