mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7215] [MERGED] fix(termux): update in-app without downloading every platform's binaries #7626
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7626
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7215
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/termux-updater-no-force-7214📝 Commits (3)
599c40efix(termux): update in-app without downloading every platform's binariesc8880cfMerge remote-tracking branch 'origin/staging' into fix/termux-updater-no-force-7214bacd062Merge remote-tracking branch 'origin/staging' into fix/termux-updater-no-force-7214📊 Changes
3 files changed (+74 additions, -5 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/routes/updates.routes.ts(+20 -4)📝
scripts/regressions/update-apply-hardening.regression.ts(+53 -1)📄 Description
Linked issue
Closes #7214
Why this change
pnpm install --force --frozen-lockfile.--forceturns off pnpm's platform filter, so the phone downloaded and linked builds for every other platform: all eight@anthropic-ai/claude-agent-sdkbuilds (about 1.7 GB on their own), 25 rollup, 26 sharp and 26 esbuild platform packages. None of them can run on Android, and phones often run out of storage during updates.start-termux.shalready avoids--forceon Android for this reason. The updater was the odd one out.--forcewas what healed the stale pnpm "skipped" state behind #7173. Since #7179 made@emnapi/runtimea direct server dependency, a plain frozen install repairs that state too (re-checked below), so Android no longer needs--force.What changed
getUpdateInstallStep(platform)inpackages/server/src/routes/updates.routes.tsnow returns the install command and its environment. On Android it is the same asstart-termux.sh'sinstall_workspace_dependencies:SHARP_IGNORE_GLOBAL_LIBVIPS=1 … install --frozen-lockfile --prefer-offline. Windows, macOS, Linux and unknown platforms keepinstall --force --frozen-lockfileexactly as before.runPinnedPnpmpasses the step's environment to pnpm.scripts/regressions/update-apply-hardening.regression.tsnow pins the Android install and checks it matches thestart-termux.shline. It also checks the Android manual recipe has no--force, desktop recipes and platforms keep--force, and the apply route is wired to the platform's install step.[Unreleased].Evidence (scratch install with the shared store, pnpm 10.34.5,
--os android --cpu arm64,--ignore-scripts)--force)skipped(platform-filtered)android-arm64,sharp-wasm32,android-arm64)The new command installed only the android-arm64 packages and the wasm32 fallbacks (
@img/sharp-wasm32plus@emnapi/runtime). For the stale #7173 state, I added@emnapi/runtime@1.11.3back to.modules.yaml'sskippedlist and deleted its package. Rerunning the new command reinstalled it and removed it fromskipped. The scratch installs were removed afterwards.Desktop note (not changed)
--forcedisables pnpm's platform filter on every OS (skippedwas 0 above), so desktop in-app updates also download builds for other platforms. The issue scoped this fix to Termux and the Windows installer intentionally uses--force, so desktop behaviour is unchanged here. Changing it could be a separate issue.In-place update check (adversarial verification)
Each scratch install below kept its
node_modulesbetween versions, like a real in-place update. It used the shared store, pnpm 10.34.5,--os android --cpu arm64and--ignore-scripts. After each run the result was compared with a fresh install of this branch and then loaded as Android (process.platform = "android").android-arm64check-workspace-install(android)skippedentries that 2.4.6 left behind are now only old versions that this lockfile no longer uses, and@emnapi/runtime@1.11.3is no longer one of them.process.platform === "android"check, which the update timeouts and the one-package-at-a-time Termux build already use. Desktop and Docker never reportandroid. If a Termux Node ever reportedlinux, the update would simply keep the old--forceinstall. The manual commands for Windows, macOS, Linux and unknown platforms are the same as onstaging, byte for byte, and so are all the hints.start-termux.sh'ssupportedArchitectures.*[]lines in.npmrchave no effect (pnpm config get supportedArchitecturesreturnsundefined). Termux therefore installs only the android packages, which this check relied on and the launcher already does.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks:
pnpm check(exit 0).node scripts/run-regressions.mjs --filter update-apply-hardeningpasses, and fails without the route change.update-channel-metadata,termux-postmortem,shutdown-deadlineandopen-issuesregressions pass, and so do the launcherupdate,format-guardandtermux-client-buildregressions.After merging the latest
staging(onlyCHANGELOG.mdconflicted, and both entries are kept):pnpm checkexits 0.update-apply-hardeningpasses, and fails againststaging'supdates.routes.ts.update-channel-metadata,termux-postmortem,sharp-wasm-runtime-missing,shutdown-deadline,open-issuesand all 8 launcher regressions pass.termux-sharppasses against the shared pnpm store; it needs a populated store because it installs offline.Manual verification notes
.pnpmhas noclaude-agent-sdk-platform folders yet (for example a freshstart-termux.shinstall, checked withls .pnpm | grep claude-agent-sdk-) that an in-app update adds none, and that the store doesn't grow by about 1.7 GB. On a phone that already ran forced updates, older folders stay until pnpm's weekly cleanup removes them, so they don't mean the fix failed.SHARP_IGNORE_GLOBAL_LIBVIPS=1 … install --frozen-lockfile --prefer-offlineand no--force.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated. No
docs/page describes the updater's install flags, so no English docs changed and there's nothing to translate.UI evidence (if applicable)
Not applicable (server-only change).
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.