Skip to content

Commit 114506f

Browse files
committed
fix build
1 parent 54c5be6 commit 114506f

8 files changed

Lines changed: 52 additions & 6 deletions

File tree

.github/workflows/android.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,23 @@ jobs:
3636
run: |
3737
yes | sdkmanager --licenses
3838
39+
# Chaquopy targets Python 3.8, and only emits .pyc when the build interpreter
40+
# matches. Without this the APK ships .py and the phone compiles esptool on the
41+
# first flash. Runner images no longer carry 3.8, so install it and make it python3.
42+
- name: Set up Python 3.8 for Chaquopy
43+
run: |
44+
curl -LsSf https://astral.sh/uv/install.sh | sh
45+
"$HOME/.local/bin/uv" python install --default 3.8.18
46+
echo "$HOME/.local/bin" >> $GITHUB_PATH
47+
48+
- name: Verify python3 is 3.8
49+
run: |
50+
python3 -V
51+
python3 -V | grep -q '^Python 3\.8\.' || {
52+
echo "::error::python3 is not 3.8 — Chaquopy would ship .py instead of .pyc"
53+
exit 1
54+
}
55+
3956
- name: Build with Gradle
4057
run: ./gradlew clean assembleRelease
4158

.github/workflows/fdroid.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,22 @@ jobs:
3030
run: |
3131
yes | sdkmanager --licenses || true
3232
33+
# Chaquopy targets Python 3.8 and only emits .pyc when the build interpreter
34+
# matches; otherwise the released APK ships .py and the first flash is very slow.
35+
- name: Set up Python 3.8 for Chaquopy
36+
run: |
37+
curl -LsSf https://astral.sh/uv/install.sh | sh
38+
"$HOME/.local/bin/uv" python install --default 3.8.18
39+
echo "$HOME/.local/bin" >> $GITHUB_PATH
40+
41+
- name: Verify python3 is 3.8
42+
run: |
43+
python3 -V
44+
python3 -V | grep -q '^Python 3\.8\.' || {
45+
echo "::error::python3 is not 3.8 — Chaquopy would ship .py instead of .pyc"
46+
exit 1
47+
}
48+
3349
- name: Build release APK
3450
run: |
3551
./gradlew clean assembleRelease

bruce_app_config_mainmenu.png

-70.2 KB
Binary file not shown.

desktop/build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ compose.desktop {
2727
mainClass = "bruce.app.MainKt"
2828

2929
nativeDistributions {
30-
targetFormats(TargetFormat.Dmg, TargetFormat.Exe, TargetFormat.AppImage)
30+
// Only the host's own format: Compose rejects Dmg on Linux, AppImage on macOS, etc.
31+
val hostOs = System.getProperty("os.name").lowercase()
32+
targetFormats(
33+
when {
34+
hostOs.startsWith("mac") -> TargetFormat.Dmg
35+
hostOs.startsWith("win") -> TargetFormat.Exe
36+
else -> TargetFormat.AppImage
37+
}
38+
)
3139
packageName = "BruceApp"
3240
packageVersion = "1.2.0"
3341
description = "Bruce Firmware Flasher"

esptool-android/build.gradle.kts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ chaquopy {
4242
version = "3.8"
4343

4444
defaultConfig {
45-
// Must match `version` above (3.8), or Chaquopy ships .py instead of .pyc
46-
// and the device compiles esptool on first import (very slow first flash).
47-
// Also: the system python3 (3.14) can't run Chaquopy 15's pip — it imports
48-
// `cgi`, removed in 3.13.
49-
buildPython("/home/user/.pyenv/versions/3.8.18/bin/python")
45+
// buildPython must match `version` above (3.8), or Chaquopy ships .py instead
46+
// of .pyc and the device compiles esptool on first import (very slow first
47+
// flash). Chaquopy 15's pip also can't run on Python 3.13+ (it imports `cgi`).
48+
// CI runners' default python3 is fine, so only override when a local pyenv 3.8
49+
// exists. If your system python3 is 3.13+, `pyenv install 3.8.18`.
50+
// Must be 3.8 to match `version` above, or Chaquopy ships .py instead of .pyc
51+
// and the phone compiles esptool on the first flash. On CI the workflow makes
52+
// python3 itself 3.8, which Chaquopy finds on its own — this is just for here.
53+
val localPy = "/home/user/.pyenv/versions/3.8.18/bin/python"
54+
if (File(localPy).canExecute()) buildPython(localPy)
5055

5156
pip {
5257
install("git+https://github.com/xCarlost/pyserial.git@b6adda109d814499a65c671ff60a888d479f3a3d")

print_bruce_app.png

-185 KB
Binary file not shown.

print_bruce_app_fullscreen.png

-127 KB
Binary file not shown.

print_bruce_app_inside_fm_menu.png

-75.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)