Skip to content

fix(build): pin proot 5.1.107.97, the version Termux still serves - #393

Merged
yuga-hashimoto merged 2 commits into
mainfrom
ccr-d1e4054d-xnh8mt
Oct 18, 2026
Merged

yuga-hashimoto merged 2 commits into
mainfrom
ccr-d1e4054d-xnh8mt

Conversation

@yuga-hashimoto

Copy link
Copy Markdown
Owner

Summary

Termux removed proot 5.1.107.96 from packages.termux.dev. Every mirror that carried it now answers 404, and grimler.se returns a body that does not match the pinned SHA-256 (a different hash on each attempt). A CI run that misses the generated-runtime cache then fails in :app:prepareOpenCodeRuntimeAssets before any test starts. That is what happened to the Android CI run of the #388 merge commit (2dbba4c8), twice; the run of the next merge commit (6268d158) passed, so the code on main is fine and only the pinned download is stale.

  • Lock file: regenerated with scripts/prepare_android_runtime_assets.py --lock-only. Only proot changes (5.1.107.96 → 5.1.107.97, new filename and SHA-256 for arm64-v8a and x86_64); libandroid-shmem 0.7 and libtalloc 2.5.0 are unchanged.
  • Mirrored recipe (runtime_tools/termux-packaging-recipes/proot.build.sh): the matching termux-packages recipe. Compared with the previous copy, only TERMUX_PKG_VERSION and TERMUX_PKG_SHA256 differ, plus the header's retrieval date and commit.
  • Notices: THIRD_PARTY_NOTICES.md and its offline copy app/src/main/assets/legal/oss_licenses.md now point at the 5.1.107.97 source archive and SHA-256. The fdroid paragraph says the pin can lag the mirror by "a few versions" (follow-up commit a4a90386, applying a non-blocking suggestion of the review below).

The cache key hashes the lock file, so this PR's own CI cannot hit the old cache: its test-and-build job downloads and extracts the new packages for real, which is the verification of the fix.

Testing

  • prepare_android_runtime_assets.py with the new lock (default lock file, nothing refreshed): all three packages downloaded for both ABIs with SHA-256 verification, assets extracted, manifest.json written for arm64-v8a and x86_64.
  • The Validate runtime build scripts step of android.yml run locally: py_compile, --help, and the lock assertions.
  • ./gradlew spotlessCheck: passed. No Kotlin or XML changes. The full detekt/unit-test/build run is left to CI (no Android SDK in this environment).
  • THIRD_PARTY_NOTICES.md and oss_licenses.md are byte-identical (what LegalDisclosureComplianceTest checks).

Not verified

  • TERMUX_PKG_SHA256=badd014e… (SHA-256 of the v5.1.107.97.zip source archive) is copied from the upstream termux-packages recipe. The archive itself could not be downloaded from this environment, so the value was not recomputed. It appears in a legal document ("content-addressed" column); please recompute it with curl -L https://github.com/termux/proot/archive/v5.1.107.97.zip | sha256sum before merging if that matters.
  • The recipe header records the termux-packages master commit it was retrieved at (6be420e7…), not the bump(main/proot) commit the older headers record; that commit could not be looked up.

Review note

The repo-reviewer subagent type is not registered in this environment. The review below was produced by a general read-only agent that was told to read .opencode/agents/repo-reviewer.md and follow it, with the output format it prescribes. The review covered 9a687821; a4a90386 only applies its first suggestion.

Pre-PR review

判定: APPROVE

ブロッカー

なし

提案(非ブロッキング)

  • THIRD_PARTY_NOTICES.md:28-29(app/src/main/assets/legal/oss_licenses.md:28-29 も同じ): 「fdroid flavor は pinned commit からビルドするので mirror より a version or two 遅れることがある(currently proot 5.1.107.94 …)」という段落は、今回の更新で不正確になりました。mirror 側が .97、fdroid 側が .94 なので、差は .95/.96/.97 の3パッチになります。括弧内の具体値は pin(TermuxPackages@2a342d4…)を変えていないのでそのまま正しいはずです。直すなら "can lag the mirror by a few patch releases" などに改め、2ファイルを同一内容で揃えてください(drift テストがあるため)。
  • runtime_tools/termux-packaging-recipes/proot.build.sh:2-3: ヘッダが記録する commit の種類が変わっています。従来の proot ヘッダと libtalloc.build.sh は bump コミット("bump(main/proot): 5.1.107.96")を記録していましたが、今回は取得時点の master HEAD(6be420e7…)を「packages/proot/build.sh at 5.1.107.97」と添えて記録しています。記述としては矛盾しません。ただ、この SHA が master 上に実在し、その時点で .97 のレシピを指すことは確認できませんでした(理由は チェック済み項目 の最終項)。GitHub に届く環境で git ls-remote https://github.com/termux/termux-packages master 等により確認してください。可能なら .97 の bump コミットも併記すると、他レシピと記録方法が揃います。
  • THIRD_PARTY_NOTICES.md:24 と proot.build.sh:15 の badd014e…(v5.1.107.97.zip): 既知の未検証事項のとおり、独立計算はできていません。法務文書の "content-addressed" 欄に載る値なので、マージ前に GitHub へ届く環境で curl -L https://github.com/termux/proot/archive/v5.1.107.97.zip | sha256sum を確認するか、PR 本文に「上流レシピからの転記で未検証」と明記するのが安全です。
  • (既存の挙動で本PRの範囲外)scripts/prepare_android_runtime_assets.py:220-239, 558-566: fdroid 経路(--local-debs-dir)の local_locked_package は lock の version/SHA を照合しません。一方 serializable_manifest は lock の値をそのまま manifest.json に書きます。そのため fdroid ビルドの manifest は、実体が .94 でも proot 5.1.107.97 と新しい SHA を名乗ります。アプリ側は opencode-runtime の manifest.json の packages を読まないので動作への影響は無く、今回は対応不要です。

チェック済み項目

  • 範囲: git fetch origin main のうえ merge-base が 6268d15(origin/main の先端)と一致することを確認しました。git diff origin/main...HEAD は4ファイル・各 +12/-12 行で、全 hunk を読みました。git diff --check も問題なしです。
  • lock の差分(確認事項1): python3 -I で旧・新 lock をそれぞれ json.dumps(indent=2, sort_keys=True)+"\n" に再シリアライズし、どちらも元ファイルとバイト単位で一致しました。インデント・キー順・末尾改行は従来の生成物と同じです。
    • 意味上の差分は、両 ABI の proot エントリの filename/sha256/version の3キーだけです。
    • depends、パッケージの並び順(proot → libandroid-shmem → libtalloc)、root_packages、termux_main_base_url、version、termux_arch は不変です。
    • 6エントリすべてで basename が <name>_<version>_<termux_arch>.deb、ディレクトリが pool/main/*/<name>/ に一致し、sha256 は64桁の16進数です。
  • lock の読み書きコード: build_lock_payload / _package_record_to_json / write_lock_file / load_lock_file / locked_packages / _package_record_from_json を読みました。バージョン固有の分岐はありません。
    • ダウンロードは download_locked_package → download_termux_main_path(expected_sha256=…) → verify_sha256 で検証されます。
    • grimler.se のように内容が一致しない mirror はエラーとして記録され、次の mirror に進みます。
  • 旧値の残存: git grep で 5\.1\.107 / 75f654fe / 8199dca0 / 77ea4554 を検索し、旧 proot .96 の値はすべて消えていることを確認しました。残る 5.1.107.94 は fdroid pin を説明する段落だけです。
  • 後段スクリプトの前提: prepare_android_runtime_native_libs.py が必須とするファイル(bin/proot、libexec/proot/loader、loader32、lib/libandroid-shmem.so、lib/libtalloc.so.*)を確認しました。
    • 依頼者が scratchpad に生成した両 ABI の出力に、これらがすべて存在します。
    • proot バイナリには patch_needed の対象である libtalloc.so.2 の文字列が含まれています。
    • manifest のバージョンは proot 5.1.107.97、libandroid-shmem 0.7、libtalloc 2.5.0 でした。
    • これはファイルを読んだだけで、スクリプトは実行していません。
  • 法務文書の同一性(確認事項2): diff と cmp で THIRD_PARTY_NOTICES.md と oss_licenses.md が完全に同一であることを確認しました(base 側も同一)。
    • LegalDisclosureComplianceTest の本体を読み、byte-for-byte の drift テストは通る内容であることを確認しました。
    • THIRD_PARTY_NOTICES を参照する他のアサーションも grep で確認し、変更行はどれにも触れていません(vosk-android、not part of the APK、両 Vosk モデル名、REQUIRES_LICENSE_REVIEW、NOTICE-aggregate.txt が存在し、禁止フレーズと hey_mycroft の行は無い)。
    • Gradle テスト自体は実行していません。
  • proot.build.sh(確認事項3): 本体の差分は TERMUX_PKG_VERSION と TERMUX_PKG_SHA256 の2行だけで、ほかはヘッダの2行です。末尾改行も維持されています。
    • ヘッダ以外の本体は、依頼者が scratchpad に取得した上流の upstream/proot.build.sh と upstream/proot.build.at-sha.sh(この2つは互いに同一)とバイト単位で一致しました。
    • ヘッダの記述は、NOTICES の「各ファイルのヘッダに取得日と(更新したレシピは)commit を記録」という説明と矛盾しません。
  • fdroid 段落: TermuxPackages の pin(2a342d4…)は scripts/build_android_runtime_native_debs.sh、docs/RELEASE.md、release.yml のコメントで変わっていません。この pin が .94 を指すことはオフラインでは確認できません。段落の不正確化は上の提案に書きました。
  • 他の記載箇所(確認事項4): README.md、README.ja.md、docs/、pages/、legal/*.ja.md、Kotlin ソースに proot のバージョン記載は無いことを確認しました。アプリは opencode-runtime の manifest の packages を読みません(LocalRuntimeManifest は別のアセットを使います)。
  • CI: android.yml / release.yml のキャッシュキーは lock のハッシュを含むので、この PR の CI ではキャッシュに当たらず、新しい lock での実ダウンロードが走ります。それ自体が修正の検証になります。「Validate runtime build scripts」の assert(version==1、ABI の集合、packages が空でない)も満たしています。
  • 規約: コミット件名は Conventional Commits 形式です。worktree は .worktree/fix/termux-proot-lock で base は origin/main です(new-worktree.sh の方式どおり)。Kotlin/XML/strings の変更は無いので、i18n・spotless・detekt への影響はありません。
  • 確認できなかった事項:
    • badd014e… の実アーカイブとの一致。
    • commit 6be420e7… の実在と意味。scratchpad の commits.atom は GitHub アクセス不可のエラー JSON でした。
    • pin 2a342d4 の proot が .94 であること。
    • Gradle の単体テストと Android ビルド。いずれもネットワーク・SDK の制約で実行・検証していません。

Generated by Claude Code

Termux dropped proot 5.1.107.96 from packages.termux.dev (404 on every
mirror it was on; grimler.se answers with a body that does not match the
pinned SHA-256). A CI run that misses the generated-runtime cache then
fails in :app:prepareOpenCodeRuntimeAssets before any test starts, as
the re-run of the #388 merge commit did twice.

- Refresh runtime_tools/termux_assets.lock.json with
  `prepare_android_runtime_assets.py --lock-only`. Only proot changes
  (5.1.107.96 -> 5.1.107.97, new filename and SHA-256 for arm64-v8a and
  x86_64); libandroid-shmem and libtalloc are unchanged.
- Mirror the matching termux-packages recipe: only TERMUX_PKG_VERSION and
  TERMUX_PKG_SHA256 differ from the previous one.
- Point THIRD_PARTY_NOTICES.md and its offline copy at the 5.1.107.97
  source archive and SHA-256.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xw2ucui6t6dQdyGRrnCbHb
The mirror is now at proot 5.1.107.97 while the fdroid pin still builds
5.1.107.94, so "a version or two" no longer describes the gap. Applies a
non-blocking suggestion of the pre-PR review, in both the root document and
its offline copy.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xw2ucui6t6dQdyGRrnCbHb
@yuga-hashimoto
yuga-hashimoto marked this pull request as ready for review October 18, 2026 15:00
@yuga-hashimoto
yuga-hashimoto merged commit 47c8383 into main Oct 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants