Skip to content
This repository was archived by the owner on Oct 31, 2026. It is now read-only.

Commit d5ea5f3

Browse files
committed
fix(build): rebase cli-build patch for upstream v2.0.28
1 parent 1dddf2c commit d5ea5f3

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

‎.github/workflows/build-weekly.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ jobs:
180180
181181
- name: Clone upstream + apply patches
182182
run: |
183+
rm -rf upstream
183184
git clone --depth 1 --branch "${UPSTREAM_TAG}" "https://github.com/${REPO_UPSTREAM}.git" upstream
184185
cd upstream || exit
185186
git apply --check ../patches/cli-build-android.patch

‎patches/cli-build-android.patch‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ index f55d890..e89d3ed 100755
4949
loader: "js",
5050
}))
5151
},
52-
@@ -155,8 +164,12 @@ export default { path: file, version: ${JSON.stringify(opencodePty.version)}, sh
53-
OPENCODE_ARTIFACT: `'cli'`,
52+
@@ -192,7 +201,11 @@
5453
OPENCODE_LIBC: item.os === "linux" ? `'${item.abi ?? "glibc"}'` : "undefined",
5554
// FFF_LIBC selects the fff native lib variant: "musl" or "gnu".
5655
- FFF_LIBC: item.os === "linux" ? `'${item.abi ?? "gnu"}'` : "undefined",

‎scripts/build-libopentui-ci.sh‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ echo "==> clone opentui v${OPENTUI_VERSION}"
2121
if [ ! -d "$WORK/opentui-${OPENTUI_VERSION}/.git" ]; then
2222
git clone --depth 1 --branch "v${OPENTUI_VERSION}" https://github.com/anomalyco/opentui.git "$WORK/opentui-${OPENTUI_VERSION}"
2323
fi
24-
git -C "$WORK/opentui-${OPENTUI_VERSION}" apply --check "$REPO_ROOT/patches/v2-android.patch"
25-
git -C "$WORK/opentui-${OPENTUI_VERSION}" apply "$REPO_ROOT/patches/v2-android.patch" 2>/dev/null || true
26-
# idempotent: already-applied is fine, broken-patch is fatal (checked above)
24+
if git -C "$WORK/opentui-${OPENTUI_VERSION}" apply --reverse --check "$REPO_ROOT/patches/v2-android.patch" 2>/dev/null; then
25+
echo "v2-android.patch already applied, skipping"
26+
else
27+
git -C "$WORK/opentui-${OPENTUI_VERSION}" apply --check "$REPO_ROOT/patches/v2-android.patch"
28+
git -C "$WORK/opentui-${OPENTUI_VERSION}" apply "$REPO_ROOT/patches/v2-android.patch"
29+
fi
30+
# idempotent: already-applied is skipped, broken-patch is fatal (checked above)
2731

2832
echo "==> merged bionic sysroot"
2933
BIONIC_INC="$WORK/bionic-include"

‎scripts/build-pty-android-ci.sh‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ if [ ! -d "$WORK/opencode-pty-${PTY_VERSION}/.git" ]; then
4141
git clone --depth 1 --branch "v${PTY_VERSION}" https://github.com/anomalyco/opencode-pty.git "$WORK/opencode-pty-${PTY_VERSION}"
4242
fi
4343
for p in opencode-pty-socket-tmpdir.patch opencode-pty-buildrs-android.patch; do
44-
git -C "$WORK/opencode-pty-${PTY_VERSION}" apply --check "$REPO_ROOT/patches/$p"
45-
git -C "$WORK/opencode-pty-${PTY_VERSION}" apply "$REPO_ROOT/patches/$p" 2>/dev/null || true
44+
if git -C "$WORK/opencode-pty-${PTY_VERSION}" apply --reverse --check "$REPO_ROOT/patches/$p" 2>/dev/null; then
45+
echo "$p already applied, skipping"
46+
else
47+
git -C "$WORK/opencode-pty-${PTY_VERSION}" apply --check "$REPO_ROOT/patches/$p"
48+
git -C "$WORK/opencode-pty-${PTY_VERSION}" apply "$REPO_ROOT/patches/$p"
49+
fi
4650
done
47-
# idempotent: already-applied is fine, broken-patch is fatal (checked above)
51+
# idempotent: already-applied is skipped, broken-patch is fatal (checked above)
4852
(
4953
cd "$WORK/opencode-pty-${PTY_VERSION}"
5054
rustup target add "$TARGET"
@@ -61,8 +65,12 @@ if [ ! -d "$WORK/bun-pty-${BUN_PTY_VERSION}/.git" ]; then
6165
fi
6266
# portable-pty 0.8 pulls termios/serial (no Android target); 0.9 uses serial2.
6367
# The rust-pty code compiles unchanged (verified on-device).
64-
git -C "$WORK/bun-pty-${BUN_PTY_VERSION}" apply --check "$REPO_ROOT/patches/bun-pty-portable09.patch"
65-
git -C "$WORK/bun-pty-${BUN_PTY_VERSION}" apply "$REPO_ROOT/patches/bun-pty-portable09.patch" 2>/dev/null || true
68+
if git -C "$WORK/bun-pty-${BUN_PTY_VERSION}" apply --reverse --check "$REPO_ROOT/patches/bun-pty-portable09.patch" 2>/dev/null; then
69+
echo "bun-pty-portable09.patch already applied, skipping"
70+
else
71+
git -C "$WORK/bun-pty-${BUN_PTY_VERSION}" apply --check "$REPO_ROOT/patches/bun-pty-portable09.patch"
72+
git -C "$WORK/bun-pty-${BUN_PTY_VERSION}" apply "$REPO_ROOT/patches/bun-pty-portable09.patch"
73+
fi
6674
(
6775
cd "$WORK/bun-pty-${BUN_PTY_VERSION}/rust-pty"
6876
rustup target add "$TARGET"

0 commit comments

Comments
 (0)