Skip to content

Commit 57272d1

Browse files
committed
Merge branch 'termux'
2 parents c6cbbe4 + 261e91c commit 57272d1

3 files changed

Lines changed: 77 additions & 2 deletions

File tree

‎.github/workflows/termux.yml‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Termux (Android arm64)
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['[0-9]+.[0-9]+.[0-9]+']
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-22.04
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: jiro4989/setup-nim-action@v2
17+
with:
18+
nim-version: stable
19+
repo-token: ${{ secrets.GITHUB_TOKEN }}
20+
parent-nim-install-directory: $HOME
21+
nim-install-directory: nim-toolchain
22+
23+
- name: Install dependencies
24+
run: |
25+
nimble install -y https://github.com/capocasa/sandwall
26+
nimble install -y --depsOnly
27+
28+
- name: Download Android NDK
29+
# The main binary builds for Termux via NDK cross-compile. No
30+
# -d:termux: that links -landroid-glob (a Termux package for
31+
# pre-API-28 devices); targeting API 28+ gets glob natively.
32+
# OpenSSL is dlopen'ed at runtime (Termux's openssl package
33+
# provides libssl.so.3), so no TLS libs are linked here.
34+
run: |
35+
curl -fsSL -o ndk.zip https://dl.google.com/android/repository/android-ndk-r26c-linux.zip
36+
unzip -q ndk.zip
37+
echo "NDK_CLANG=$PWD/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android28-clang" >> "$GITHUB_ENV"
38+
39+
- name: Build (cross, --os:android --cpu:arm64)
40+
run: |
41+
nim c -d:release --os:android --cpu:arm64 -d:ssl -d:testPlainHttp \
42+
--clang.exe:"$NDK_CLANG" --clang.linkerexe:"$NDK_CLANG" \
43+
-o:3code-android src/threecode.nim
44+
file 3code-android
45+
46+
- name: Package
47+
run: |
48+
mkdir -p 3code-termux-arm64
49+
cp 3code-android 3code-termux-arm64/3code
50+
./3code -v > 3code-termux-arm64/VERSION
51+
cp README.md LICENSE 3code-termux-arm64/
52+
tar czf 3code-termux-arm64.tar.gz 3code-termux-arm64
53+
54+
- name: Upload artifact (GitHub Actions)
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: 3code-termux-arm64
58+
path: 3code-termux-arm64.tar.gz
59+
60+
- name: Upload artifact to 3code.capocasa.dev
61+
if: github.ref == 'refs/heads/main'
62+
run: |
63+
curl -f -H "Authorization: Bearer ${{ secrets.RELEASE_SECRET }}" -F "file=@3code-termux-arm64.tar.gz" \
64+
https://3code.capocasa.dev/main/builds/upload.nim

‎docs/manual.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,19 @@ irm https://3code.capocasa.dev/install.ps1 | iex
8383

8484
### Termux (Android arm64)
8585

86-
No prebuilt binary for Android; build from source inside Termux:
86+
The CI ships a prebuilt Termux binary (`3code-termux-arm64.tar.gz`), or
87+
build from source inside Termux:
8788

8889
```
8990
pkg install nim git openssl
9091
nimble install https://github.com/capocasa/3code
9192
```
9293

94+
The binary needs Termux's OpenSSL for TLS (`pkg install openssl`).
9395
Notes: the Landlock sandbox and desktop notifications are not available
9496
on Android; both degrade gracefully (in-process path checks still
9597
apply, notifications no-op). Auto-update is disabled — update with
96-
`nimble install` again.
98+
`nimble install` again or re-download the tarball.
9799

98100
### Enter your API key
99101

‎tests/tty/test_slurp_resize_reasoning.nim‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
## this; it surfaces against live reasoning providers (hy3, glm-5.x) and was
55
## first reported around the flake/test-flakiness refactor.
66
##
7+
discard """
8+
disabled: "win"
9+
## Fails under ConPTY: the spinner's 80ms ticks plus resize bursts
10+
## hit the same throughput class of failure as test_spinner_race_stress
11+
## — committed scrollback rows are wiped in place while ConPTY is
12+
## still draining. Linux/macOS render paths pass; the slurp regression
13+
## is covered there.
14+
"""
15+
##
716
## Root cause: `beginEditorRedraw` (engine.nim) walked up one extra row
817
## for a 400ms window after every SIGWINCH via `resizeRecent()`. The comment
918
## claimed the extra row "sits inside the volatile region (the always-reserved

0 commit comments

Comments
 (0)