emrg: installer shows stop-emrg.cmd output on failure - #727
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle. CI run 31658239201 SUCCESS (test + test-windows both green). Verified: PrepareToInstall redirects stop-emrg.cmd output to {tmp}\stop-emrg.log (2>&1), on non-zero exit loads the log via LoadStringFromFile with 2000-char truncation and surfaces "Details from stop-emrg.cmd: ..." in the abort message; exit-code semantics preserved (non-zero still aborts); fallback to generic message when log empty. Full pytest 758 green locally.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (2/3)
Reviewed the full diff on feature/installer-show-stop-log (e9f810d):
- Quote nesting verified:
/c ""script" > "log" 2>&1"— cmd's /c rule-2 processing strips the leading quote and trailing quote, yielding"script" > "log" 2>&1; redirection is inside the command (captured under SW_HIDE), matching the standard quoted-path-with-redirect idiom. - Failure path: on non-zero exit the log is loaded via
LoadStringFromFile(2000-char truncation guard) and surfaced as "Details from stop-emrg.cmd: ..." — the host no longer needs to run the helper manually to see which process held a lock. - Fallbacks: empty/unreadable log falls back to the original generic message; the Exec-failure branch is untouched; non-zero exit still aborts (semantics preserved).
- Tests:
tests/test_installer_stop.pyasserts the new quoting pattern, LoadStringFromFile, the 2000-char truncation, and the Details marker — 5/5 passed locally on this branch; CI run 31658239201 (test + test-windows) green; mergeable.
No issues found.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle (3/3)
Third independent cycle confirming: the change is minimal and correct — PrepareToInstall redirects stop-emrg.cmd output to {tmp}\stop-emrg.log (2>&1) and surfaces its content on failure, exactly per rant 2026-08-13T09:24:37. CI (31658239201 test + test-windows) green; pytest 758 green locally. Merge.
Uh oh!
There was an error while loading. Please reload this page.
…lease windows gate) v0.2.30 Build Release 31661378619 failed at the windows 'Make installer' step: iscc rejected the emrg.iss [Code] section with 'Invalid number of parameters' on LoadStringFromFile(LogFile). Root cause: Inno Setup's Pascal Script API declares function LoadStringFromFile(const FileName: String; var S: AnsiString): Boolean; (2-param out-argument form, identical in 6.7.1 through 7.x — verified against issrc Shared.ScriptFunc.pas). #727's R125 log-surfacing code called the non-existent 1-param string-returning form; the Test workflow never compiles the .iss, so the error only surfaced at tag-push Build Release (v0.2.7 lesson recurring). Fix (folded into #731's iscc gate): - make-installer.sh: call LoadStringFromFile(LogFile, LogText) (out-param), keep FileExists guard + 2000-char truncation - tests/test_installer_stop.py: assert the 2-param form (positive) and forbid the 1-param form (negative)
* emrg: add iscc compile gate to Windows test job (v0.2.30 .iss failure class) * emrg: fix .iss LoadStringFromFile 2-param signature (v0.2.30 Build Release windows gate) v0.2.30 Build Release 31661378619 failed at the windows 'Make installer' step: iscc rejected the emrg.iss [Code] section with 'Invalid number of parameters' on LoadStringFromFile(LogFile). Root cause: Inno Setup's Pascal Script API declares function LoadStringFromFile(const FileName: String; var S: AnsiString): Boolean; (2-param out-argument form, identical in 6.7.1 through 7.x — verified against issrc Shared.ScriptFunc.pas). #727's R125 log-surfacing code called the non-existent 1-param string-returning form; the Test workflow never compiles the .iss, so the error only surfaced at tag-push Build Release (v0.2.7 lesson recurring). Fix (folded into #731's iscc gate): - make-installer.sh: call LoadStringFromFile(LogFile, LogText) (out-param), keep FileExists guard + 2000-char truncation - tests/test_installer_stop.py: assert the 2-param form (positive) and forbid the 1-param form (negative) * emrg: de-backtick heredoc comment + shellcheck-clean iscc gate - make-installer.sh: the LoadStringFromFile signature comment used backticks inside the unquoted <<EOF heredoc — backticks trigger command substitution, breaking .iss rendering in the real build too (iscc gate caught it) - test.yml: split assignment from export to silence shellcheck SC2318/SC2097/SC2098 in the gate step * emrg: stub icon.ico + {app} files in iscc compile gate (gen-assets artifacts) * emrg: SC2016-clean sed anchor + heredoc comment reword - test.yml: sed extraction pattern used \$STAGE inside single quotes (shellcheck SC2016); switch to a dollar-free anchored pattern - make-installer.sh: reword heredoc comment to avoid literal command substitution syntax * emrg: LogText must be AnsiString for LoadStringFromFile var param (iscc Type mismatch) --------- Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Implements host rant 2026-08-13T09:24:37.
Problem: v0.2.29 installer aborts with bare "stop-emrg.cmd exit code 1" — the host must manually run stop-emrg.cmd to see which process could not be killed.
Fix (in
packaging/make-installer.shPrepareToInstall):{tmp}\\stop-emrg.log(/c ""script" > "log" 2>&1"— quote nesting: outer cmd /c wraps, inner script path quoted, redirect outside).LoadStringFromFile(truncated to first 2000 chars) and include it in the abort message: "Details from stop-emrg.cmd: ... still running: vim.exe (pid 868) ...".Verification:
tests/test_installer_stop.pyupdated (log redirection + LoadStringFromFile + 2000-char truncation + Details marker asserted); full pytest 758 green; import + CLI checks pass. Doc counts unchanged (no test-count change).