Skip to content

emrg: installer old-python health check before stop_all (rant 2026-08-19T00:44:52) - #857

Merged
argszero merged 1 commit into
masterfrom
feature/installer-old-python-health-check
Aug 18, 2026
Merged

emrg: installer old-python health check before stop_all (rant 2026-08-19T00:44:52)#857
argszero merged 1 commit into
masterfrom
feature/installer-old-python-health-check

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

Windows upgrade installs could hard-abort when the old runtime python in the previous install directory was corrupted. Per host rant 2026-08-19T00:44:52 (reproduced on v0.2.51 upgrade): ModuleNotFoundError: No module named 'encodings' at startup — the old python-dist was broken by the earlier v0.2.49/v0.2.50 -I incident, so running stop_all.py with it always failed and aborted the install. Deleting the old install\bin (clean-install path) made the same v0.2.51 package install successfully — the package itself is fine, the upgrade path was the fragile point.

Change

In PrepareToInstall (generated .iss via make-installer.sh), before running stop_all with the old runtime python:

  1. Health-check the old python first: python.exe -c "import encodings, sys" (redirected to the log via {cmd}, same pattern as stop_all per R125).
  2. If the health check fails (non-zero exit, or cannot even be spawned) → skip stop_all and continue the install (clean-install path). A locked file producing a DeleteFile error is recoverable/retryable; a hard abort from a broken python is not.
  3. If it passes → run stop_all exactly as before (existing logic preserved).

The health-check failure details go into the log file + the Setup log (Log(...)).

Verification

  • bash -n packaging/make-installer.sh
  • .iss heredoc rendered exactly as CI does (stub payload) — generated PrepareToInstall inspected ✓
  • New text-assertion test test_make_installer_iss_old_python_health_check + existing test_make_installer_iss_has_prepare_to_install / test_build_runtime_copies_stop_all_not_stop_emrg / test_stop_emrg_cmd_deleted pass (pure text assertions, no iscc/cmd/python execution) ✓
  • Import + CLI checks pass ✓
  • Agent.md test count 958 → 959 (new test function; guarded by test_doc_counts.py)
  • Full CI (incl. Windows iscc compile smoke test) will validate the Inno Pascal syntax

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 786 (Committer). CI test + test-windows (incl. iscc compile smoke test) both PASS on head 781614f. Health-check pattern verified: skip-on-broken-python preserves the clean-install path, healthy-python path unchanged.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 787 (Committer). Independent re-verify: head unchanged (781614f), CI test + test-windows PASS. Diff re-inspected — health-check command pattern, skip-on-failure path (Result stays '' → install continues), and preserved stop_all path all correct. 2/3.

@argszeroargszero left a comment

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 788 (Committer). 3rd consecutive approval. Head unchanged (781614f), CI green, MERGEABLE. Merging.

@argszero
argszero merged commit f52c4f6 into masterAug 18, 2026
2 checks passed
@argszero
argszero deleted the feature/installer-old-python-health-check branch August 18, 2026 18:10
argszero added a commit that referenced this pull request Aug 19, 2026
Co-authored-by: EMRG Evolution <emrg@argszero.dev>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@argszero