[PR #737] [MERGED] fix(termux): improve installation reliability and sharp compatibility #4757

Closed
opened 2026-10-22 04:10:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/737
Author: @vanta-jack
Created: 5/12/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @Xelvanis

Base: main ← Head: fix/termux-installation


📝 Commits (3)

  • 79025d7 fix(termux): improve installation reliability and sharp compatibility
  • 336628f fix: remove duplicate dependencies key in package.json
  • e8b97b9 fix(termux): scope fixes to startup script and improve wasm32 detection

📊 Changes

1 file changed (+8 additions, -3 deletions)

View changed files

📝 start-termux.sh (+8 -3)

📄 Description

Linked issue

Closes #752

Why this change

The official start-termux.sh script currently fails on fresh Termux installations due to several factors:

  1. Sharp Binary Mismatch: sharp v0.34+ requires wasm32 architecture support to correctly fall back when native android-arm64 binaries are missing or incompatible with Termux's environment.
  2. Interactive Prompt Hangs: pkg update and pkg install commands can hang indefinitely waiting for user input regarding configuration file conflicts.
  3. Build Memory Exhaustion: The PWA service worker generation during vite build frequently causes Out-Of-Memory (OOM) errors on mobile devices.

What changed

  • Scoped .npmrc Fix: Modified start-termux.sh to dynamically inject supportedArchitectures.cpu[]=wasm32 into .npmrc if running on Android. This keeps the fix scoped to the Termux environment as requested by maintainers.
  • Improved Injection Logic: Enhanced the architecture detection in start-termux.sh to ensure wasm32 is added even if the platform marker already exists from a previous run.
  • Non-Interactive Setup: Added -o Dpkg::Options::="--force-confold" and non-interactive flags to all pkg commands in start-termux.sh to ensure a smooth, unattended setup.
  • Memory Safety: Ensured SKIP_PWA=1 is consistently used as a fallback in the client build process to prevent OOM crashes on mobile.
  • Clean Repo State: Reverted project-level .npmrc and package.json changes to avoid affecting non-Termux platforms.

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

  1. Installed Marinara-Engine on a fresh Termux environment.
  2. Verified that pkg commands no longer hang on configuration prompts.
  3. Verified that pnpm install correctly resolves sharp using the wasm32 fallback automatically via the dynamic .npmrc configuration.
  4. Verified that the client build completes successfully using the memory-safe fallback.
  5. Successfully launched and accessed the application via a mobile browser at http://127.0.0.1:7860.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

🔄 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/737 **Author:** [@vanta-jack](https://github.com/vanta-jack) **Created:** 5/12/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `main` ← **Head:** `fix/termux-installation` --- ### 📝 Commits (3) - [`79025d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/79025d72b56402af71d96a1b94e75256e49bdb54) fix(termux): improve installation reliability and sharp compatibility - [`336628f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/336628fa4e7420f49156b09ecf8ffb9f2f2f6849) fix: remove duplicate dependencies key in package.json - [`e8b97b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e8b97b96fa92228f8581beb81d7ac420af142dd7) fix(termux): scope fixes to startup script and improve wasm32 detection ### 📊 Changes **1 file changed** (+8 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `start-termux.sh` (+8 -3) </details> ### 📄 Description ## Linked issue Closes #752 ## Why this change The official `start-termux.sh` script currently fails on fresh Termux installations due to several factors: 1. **Sharp Binary Mismatch**: `sharp` v0.34+ requires `wasm32` architecture support to correctly fall back when native `android-arm64` binaries are missing or incompatible with Termux's environment. 2. **Interactive Prompt Hangs**: `pkg update` and `pkg install` commands can hang indefinitely waiting for user input regarding configuration file conflicts. 3. **Build Memory Exhaustion**: The PWA service worker generation during `vite build` frequently causes Out-Of-Memory (OOM) errors on mobile devices. ## What changed - **Scoped .npmrc Fix**: Modified `start-termux.sh` to dynamically inject `supportedArchitectures.cpu[]=wasm32` into `.npmrc` if running on Android. This keeps the fix scoped to the Termux environment as requested by maintainers. - **Improved Injection Logic**: Enhanced the architecture detection in `start-termux.sh` to ensure `wasm32` is added even if the platform marker already exists from a previous run. - **Non-Interactive Setup**: Added `-o Dpkg::Options::="--force-confold"` and non-interactive flags to all `pkg` commands in `start-termux.sh` to ensure a smooth, unattended setup. - **Memory Safety**: Ensured `SKIP_PWA=1` is consistently used as a fallback in the client build process to prevent OOM crashes on mobile. - **Clean Repo State**: Reverted project-level `.npmrc` and `package.json` changes to avoid affecting non-Termux platforms. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes 1. Installed Marinara-Engine on a fresh Termux environment. 2. Verified that `pkg` commands no longer hang on configuration prompts. 3. Verified that `pnpm install` correctly resolves `sharp` using the `wasm32` fallback automatically via the dynamic `.npmrc` configuration. 4. Verified that the client build completes successfully using the memory-safe fallback. 5. Successfully launched and accessed the application via a mobile browser at `http://127.0.0.1:7860`. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:24 +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#4757
No description provided.