Skip to content

Commit 8fecbe8

Browse files
authored
Merge pull request #12 from openSVM/copilot/fix-3f62d90b-d464-405e-873e-9ab413300b8a
Fix Rust compiler flags incompatibility for Android builds
2 parents 7055f04 + 3194507 commit 8fecbe8

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.cargo/config.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[build]
2-
# Removed incompatible Rust flags
3-
# Previous configuration
2+
# Removed incompatible Rust flags to prevent build errors
3+
# Previous configuration was incompatible with LTO:
44
# rustflags = "-C embed-bitcode=no"
5+
#
6+
# NOTE: The flags "-C embed-bitcode=no" and "-C lto" are incompatible.
7+
# When using LTO (Link Time Optimization), avoid setting embed-bitcode=no
8+
# in rustflags as Cargo may automatically add it for certain targets.
9+
# Use profile-specific settings instead for better compatibility.

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ jobs:
370370
- name: Build for Android
371371
run: |
372372
cd opensvm-dioxus
373-
RUSTFLAGS="-C opt-level=3 -C lto=thin" cargo build --target aarch64-linux-android --features android --release --no-default-features --bin opensvm_dioxus
373+
cargo build --target aarch64-linux-android --features android --profile android-release --no-default-features --bin opensvm_dioxus
374374
375375
- name: Upload Android artifact
376376
uses: actions/upload-artifact@v4
377377
with:
378378
name: opensvm-dioxus-android
379-
path: opensvm-dioxus/target/aarch64-linux-android/release/opensvm_dioxus
379+
path: opensvm-dioxus/target/aarch64-linux-android/android-release/opensvm_dioxus

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ dioxus build --features desktop --profile desktop-release --platform desktop --r
148148

149149
#### Android
150150
```bash
151-
RUSTFLAGS="-C opt-level=3 -C lto=thin" dioxus build --features android --platform android --release
151+
dioxus build --features android --platform android --profile android-release
152152
```
153153

154154
## Project Structure

opensvm-dioxus/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ dioxus build --features web --profile wasm-release --platform web --release
140140
RUSTFLAGS="-C target-cpu=native -C opt-level=3" dioxus build --features desktop --profile desktop-release --platform desktop --release
141141

142142
# Android (balanced optimization)
143-
RUSTFLAGS="-C opt-level=3 -C lto=thin" dioxus build --features android --platform android --release
143+
dioxus build --features android --platform android --profile android-release
144144
```
145145

146146
## Continuous Integration

0 commit comments

Comments
 (0)