mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6994] [MERGED] fix(launcher): repair a damaged server build and unblock installer updates #7422
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#7422
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/6994
Author: @SpicyMarinara
Created: 10/3/2026
Status: ✅ Merged
Merged: 10/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/damaged-server-build-6984📝 Commits (9)
dd70013fix(launcher): repair a damaged server build and unblock installer updates6180562fix(launcher): keep type-error builds startable and prove the build checksbf01d09Merge remote-tracking branch 'origin/staging' into HEADb5dbe39Merge remote-tracking branch 'origin/staging' into fix/damaged-server-build-69840a23059fix(launcher): let a stop end the repair build and its tscdada4d8Merge remote-tracking branch 'origin/staging' into fix/damaged-server-build-6984732dfbatest(launcher): let the stop regression exit as soon as it is done7f1096bdocs(changelog): split the damaged-build entry into one step per sentence2954d6cMerge branch 'staging' into fix/damaged-server-build-6984📊 Changes
8 files changed (+300 additions, -32 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
package.json(+1 -1)📝
packages/server/scripts/build.mjs(+17 -15)📝
packages/server/scripts/write-build-meta.mjs(+50 -9)📝
scripts/check-windows-installer-layout.mjs(+13 -0)➕
scripts/regressions/launcher/server-build.regression.mjs(+170 -0)📝
scripts/run-server.mjs(+46 -7)📝
win/installer/installer.nsi(+2 -0)📄 Description
Linked issue
Closes #6984
Why this change
A Windows user's built server file
packages/server/dist/services/generation/conversation-command-runtime.jsended up containingif(, raw) { }. After that, the server would not start, restarting the PC did not help, and only a clean install fixed it. The latest.exeinstaller also refused to update the install. Two problems are behind this, and both are on staging, so today's release would ship them:git checkout,win/installer/installer.nsireadsgit rev-parse HEADwithnsExec::ExecToStackand compares it with the release commit. NSIS keeps git's trailing newline in stack mode and only the release commit is trimmed, so the check fails after every successful checkout: "Repository update did not land on the expected commit". This started withf35f8a475andd7179e7a7(2026-05-04), and v2.4.6 shipped it. The fresh-clone path already trims, so only updates over an existing install are affected.build-meta.jsonchanges, so a damaged file with matching metadata is started every time. The rebuilds run by the installer and the in-app updater are incrementaltscruns, which were a 1.9 s no-op that left the damaged line in place.What wrote the bad line is not proven.
tsccannot emit it. The only in-app writer that can reachpackages/server/distis Professor Mari's workspace tools; a separate PR stops her from writing build output.What changed
packages/server/scripts/write-build-meta.mjsrecords a SHA-256 for every built code file (.js,.mjs,.cjs,.json; 658 on the real server) indist/config/build-meta.json. It also exportsfindChangedBuildFile(), which returns the first missing or changed file.scripts/run-server.mjs, which start.bat, start.sh, start-termux.sh, start-local.bat andpnpm startall use, checks the build before each start in about 25 ms. When a file is missing or changed, it names the file, rebuilds the server, and starts. If the rebuild fails it prints a clear error; a Ctrl+C during the rebuild is not reported as a failure. A stop sent to the launcher reaches the rebuild the same way it reaches the server, andbuild.mjspasses it on totsc, so stopping during a rebuild ends the whole build at once and the server does not start. Private builds (dist-*) and runs fromsrcare not checked.packages/server/scripts/build.mjsdeletestsconfig.tsbuildinfobefore the incrementaltscrun when dist does not match its recorded hashes, or has none.tscthen rewrites every file, so the installer's and the in-app updater's rebuilds repair a damaged build. A build that fails type-checking still records the files it wrote, with commitnull, so the launchers rebuild it as before instead of starting it.win/installer/installer.nsitrims the post-checkoutgit rev-parse HEADoutput before the comparison, andscripts/check-windows-installer-layout.mjsnow requires every commit the installer reads to be trimmed. That check fails on current staging and passes here.scripts/regressions/launcher/server-build.regression.mjs, added toregression:launcher-update. It runs the real run-server, build and metadata scripts on a one-module package and covers:tscat once, and the server does not start (macOS and Linux);Release compatibility (how a 2.4.6 install reaches this code):
.exeover an old install: the update check now passes. The installer's build sees no hashes and does a full rebuild, which records them.build-meta.jsonand startdist/index.jsdirectly, so the check is inert there.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent:
pnpm check,pnpm regression:launcher-update(including the new regression),restart-supervisorandserver-signal-shutdownpass.build.mjsleavestscrunning).conversation-command-runtime.jswas replaced withif(, raw) { }. That gives exactly the reportedSyntaxError. Through the fixed launcher it prints a warning naming the file, rebuilds, and/api/healthanswers.0a2305994. Local CodeRabbit on that fix found one minor item, a guard timer in the new regression that kept Node running 10 s after the launcher exited; fixed in732dfba2d.pnpm version:check, the Docker image and the Termux esbuild path were all fine..exeitself was not run on Windows.Still to verify by hand:
.exeover an existing install: it updates without "Repository update did not land on the expected commit".if(, raw) { }topackages/server/dist/services/generation/conversation-command-runtime.js) and run start.bat: it names the file, rebuilds and starts. Press Ctrl+C during the rebuild and check no "reinstall" error appears.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 user docs describe the build check.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.