[PR #8680] [MERGED] fix(android): repair a Termux Node.js that cannot start before launching #8744

Closed
opened 2026-11-07 17:39:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8680
Author: @SpicyMarinara
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/termux-node-link-8675


📝 Commits (2)

  • 822f70d fix(android): repair a Termux Node.js that cannot start before launching (#8675)
  • 8ef8338 docs(troubleshooting): give the full manual-install restart command

📊 Changes

6 files changed (+104 additions, -3 deletions)

View changed files

📝 android/README.md (+1 -1)
📝 android/app/src/main/java/com/marinara/engine/MainActivity.java (+10 -0)
📝 docs/TROUBLESHOOTING.md (+12 -0)
📝 docs/installation/android-termux.md (+2 -2)
📝 scripts/regressions/android-local-auth.regression.ts (+66 -0)
📝 start-termux.sh (+13 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8675

Why this change

  • Launching through Termux fails, even after updating the app. The reporter's screenshot shows:
    • CANNOT LINK EXECUTABLE "node": cannot locate symbol "_ZNSt6__ndk113__hash_memoryEPKvm"
    • then "Could not verify that this Marinara Android build can safely read your stored data. Install a newer APK or retry later."
  • Cause: a Termux partial upgrade.
    • pkg update only runs apt update (termux-tools pkg.in) and upgrades nothing.
    • pkg install -y git nodejs-lts then upgrades nodejs-lts on its own while libc++ stays old, so the new node cannot link. Termux doesn't support partial upgrades.
    • The APK bootstrap's first node call is the storage-format guard, which then exits non-zero and blames the APK. A newer APK can't fix that.
  • start-termux.sh had the same gap. With a broken node it ran pkg install nodejs-lts, which reports "already the newest version", and then stopped with "Could not determine Node.js version".

What changed

  • APK bootstrap (MainActivity.buildTermuxSetupCommand): right after installing git and nodejs-lts, and before git or the guard runs, it checks node --version.

    • If node fails, it runs pkg upgrade -y -o Dpkg::Options::=--force-confold and checks again.
    • If node still fails, it prints "Node.js could not start in Termux. Run pkg upgrade in Termux, then start Marinara again." and exits.
    • The storage-format guard and its two messages are unchanged, so they now report only real guard results.
    • The copied manual setup command uses the same script.
  • start-termux.sh: the same check, repair and recheck, before any other node call.

  • Healthy installs pay only one node --version and no full upgrade. The routine pkg update -y stays, so there's no slow full upgrade on every Start tap.

  • Docs:

    • The copy-paste commands in android/README.md and docs/installation/android-termux.md start with pkg upgrade -y: a fresh F-Droid bootstrap is older than the repository, so new users would otherwise start from a partial upgrade. Step 1 explains why, and what to do if a configuration-file question appears.
    • docs/TROUBLESHOOTING.md gets a "Termux: CANNOT LINK EXECUTABLE "node"" entry with pkg upgrade -y as the repair.
  • Test: scripts/regressions/android-local-auth.regression.ts rebuilds the APK bootstrap shell from the Java literals and slices out the Node.js block of start-termux.sh. It runs both in bash with node and pkg stubs; the node stub prints the reporter's exact link error. It asserts the node check comes before the guard and runs three cases on each entry point:

    • healthy, so no upgrade;
    • repaired by the upgrade, so setup continues;
    • still broken, so a clear Termux message, never the APK one.

    It fails on the old code.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

What the agent ran locally, after rebasing on staging:

  • node ./scripts/pnpm-runner.mjs check passes.

  • These regressions pass: android-local-auth, the launcher regressions (format-guard, env, update, termux-client-build and others), every "termux" regression, open-issues, launcher-browser-ready and command-center.

  • bash -n passes on start-termux.sh and on the extracted bootstrap.

  • An independent review agent reproduced the reporter's exact output with the old bootstrap and stubs, confirmed the fixed one repairs it, and repeated the fails-before proof.

  • Local CodeRabbit noted the Troubleshooting entry's manual-install restart step needs the full cd "$HOME/Marinara-Engine" && ./start-termux.sh command; fixed.

For a human to verify:

  • After the next APK build, manually verify on a Termux where nodejs-lts is newer than libc++ (a fresh F-Droid Termux, or one with pending upgrades). Tap Install / Start Marinara. Termux should say Node.js can't start, run pkg upgrade, then fetch, pass the storage-format guard and start the server. It should never show "Could not verify that this Marinara Android build can safely read your stored data".
  • On a Termux where node fails with CANNOT LINK EXECUTABLE, manually verify that ./start-termux.sh runs a full pkg upgrade with no configuration-file prompt and starts once node links.
  • On a fresh Termux, manually verify that the updated copy-paste command from docs/installation/android-termux.md completes and the launcher builds.
  • On a healthy, up-to-date Termux, manually verify that Install / Start Marinara doesn't run a full pkg upgrade.

Release note: the APK bootstrap change reaches users with the next APK. The Android versionCode and app version aren't bumped here, because that belongs to a release PR. start-termux.sh and the docs help right away. Until the next APK, APK users can run pkg upgrade in Termux and start again.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/installation/android-termux.md and docs/TROUBLESHOOTING.md changed. Follow-up: #8681 ([docs-i18n] catch-up for these pages). The translated packs on docs-i18n will be updated in one catch-up PR after this merges, and that PR closes it.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8680 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/termux-node-link-8675` --- ### 📝 Commits (2) - [`822f70d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/822f70dae705b2cf2b313d51e9014c6ed9792b0c) fix(android): repair a Termux Node.js that cannot start before launching (#8675) - [`8ef8338`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ef83384fbf0209581cec70331c970eac2b3aa83) docs(troubleshooting): give the full manual-install restart command ### 📊 Changes **6 files changed** (+104 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `android/README.md` (+1 -1) 📝 `android/app/src/main/java/com/marinara/engine/MainActivity.java` (+10 -0) 📝 `docs/TROUBLESHOOTING.md` (+12 -0) 📝 `docs/installation/android-termux.md` (+2 -2) 📝 `scripts/regressions/android-local-auth.regression.ts` (+66 -0) 📝 `start-termux.sh` (+13 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8675 ## Why this change - Launching through Termux fails, even after updating the app. The reporter's screenshot shows: - `CANNOT LINK EXECUTABLE "node": cannot locate symbol "_ZNSt6__ndk113__hash_memoryEPKvm"` - then "Could not verify that this Marinara Android build can safely read your stored data. Install a newer APK or retry later." - **Cause: a Termux partial upgrade.** - `pkg update` only runs `apt update` (termux-tools `pkg.in`) and upgrades nothing. - `pkg install -y git nodejs-lts` then upgrades nodejs-lts on its own while libc++ stays old, so the new `node` cannot link. Termux doesn't support partial upgrades. - The APK bootstrap's first `node` call is the storage-format guard, which then exits non-zero and blames the APK. A newer APK can't fix that. - `start-termux.sh` had the same gap. With a broken node it ran `pkg install nodejs-lts`, which reports "already the newest version", and then stopped with "Could not determine Node.js version". ## What changed - **APK bootstrap** (`MainActivity.buildTermuxSetupCommand`): right after installing git and nodejs-lts, and before git or the guard runs, it checks `node --version`. - If node fails, it runs `pkg upgrade -y -o Dpkg::Options::=--force-confold` and checks again. - If node still fails, it prints "Node.js could not start in Termux. Run pkg upgrade in Termux, then start Marinara again." and exits. - The storage-format guard and its two messages are unchanged, so they now report only real guard results. - The copied manual setup command uses the same script. - **`start-termux.sh`:** the same check, repair and recheck, before any other `node` call. - **Healthy installs** pay only one `node --version` and no full upgrade. The routine `pkg update -y` stays, so there's no slow full upgrade on every Start tap. - **Docs:** - The copy-paste commands in `android/README.md` and `docs/installation/android-termux.md` start with `pkg upgrade -y`: a fresh F-Droid bootstrap is older than the repository, so new users would otherwise start from a partial upgrade. Step 1 explains why, and what to do if a configuration-file question appears. - `docs/TROUBLESHOOTING.md` gets a "Termux: CANNOT LINK EXECUTABLE "node"" entry with `pkg upgrade -y` as the repair. - **Test:** `scripts/regressions/android-local-auth.regression.ts` rebuilds the APK bootstrap shell from the Java literals and slices out the Node.js block of `start-termux.sh`. It runs both in bash with `node` and `pkg` stubs; the `node` stub prints the reporter's exact link error. It asserts the node check comes before the guard and runs three cases on each entry point: - healthy, so no upgrade; - repaired by the upgrade, so setup continues; - still broken, so a clear Termux message, never the APK one. It fails on the old code. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes What the agent ran locally, after rebasing on staging: - `node ./scripts/pnpm-runner.mjs check` passes. - These regressions pass: android-local-auth, the launcher regressions (format-guard, env, update, termux-client-build and others), every "termux" regression, open-issues, launcher-browser-ready and command-center. - `bash -n` passes on `start-termux.sh` and on the extracted bootstrap. - An independent review agent reproduced the reporter's exact output with the old bootstrap and stubs, confirmed the fixed one repairs it, and repeated the fails-before proof. - Local CodeRabbit noted the Troubleshooting entry's manual-install restart step needs the full `cd "$HOME/Marinara-Engine" && ./start-termux.sh` command; fixed. For a human to verify: - After the next APK build, manually verify on a Termux where nodejs-lts is newer than libc++ (a fresh F-Droid Termux, or one with pending upgrades). Tap Install / Start Marinara. Termux should say Node.js can't start, run `pkg upgrade`, then fetch, pass the storage-format guard and start the server. It should never show "Could not verify that this Marinara Android build can safely read your stored data". - On a Termux where `node` fails with CANNOT LINK EXECUTABLE, manually verify that `./start-termux.sh` runs a full `pkg upgrade` with no configuration-file prompt and starts once node links. - On a fresh Termux, manually verify that the updated copy-paste command from `docs/installation/android-termux.md` completes and the launcher builds. - On a healthy, up-to-date Termux, manually verify that Install / Start Marinara doesn't run a full `pkg upgrade`. Release note: the APK bootstrap change reaches users with the next APK. The Android versionCode and app version aren't bumped here, because that belongs to a release PR. `start-termux.sh` and the docs help right away. Until the next APK, APK users can run `pkg upgrade` in Termux and start again. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/installation/android-termux.md` and `docs/TROUBLESHOOTING.md` changed. Follow-up: #8681 ([docs-i18n] catch-up for these pages). The translated packs on `docs-i18n` will be updated in one catch-up PR after this merges, and that PR closes it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8744
No description provided.