Skip to content

chore(install): install.ps1 narrates on the verbose stream, gives its results as output, and fails with error records of its own - #1103

Merged
David-Noble-at-work merged 7 commits into
developfrom
chore/1044-install-ps1-narrates-fails-and
Oct 20, 2026
Merged

David-Noble-at-work merged 7 commits into
developfrom
chore/1044-install-ps1-narrates-fails-and

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 30 of #949. install.ps1 speaks and fails as the PowerShell style guide's section 7 says (noblefactor-ops 0f8b2fd), as #1044 rules.

Resolves #1044

Test plan

  • Off Windows, here, PowerShell 7.4.6:
    • as a file, a failure exits 1 and -Help exits 0;
    • the script-block form with -Verbose shows the narration and the session goes on;
    • under irm | iex the session goes on and the caller's error action is unchanged;
    • a caller at Stop catches RequiresWindows,Install-DevLore;
    • one at SilentlyContinue sees nothing, and $Error keeps the record.
  • scripts/Test-InstallScript.ps1 off Windows: its one check passes, by the record
  • Test-PowerShell.ps1 (PSScriptAnalyzer and the shebang rule): no findings
  • This script's pre-flight: CI's whole quality gate, the suite off Windows, make test-race and make test-scenario
  • CI on this pull request, every leg: the Installers workflow's install.ps1 legs run the suite under Windows PowerShell 5.1 and PowerShell 7, on amd64 and arm64, where the installing checks run

Written with AI assistance.

Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code

Time

Marker UTC Elapsed
opened (first commit) 2026-10-20T06:04:12Z —
submitted (PR opened) 2026-10-20T16:15:34Z 10.2 h after opened
merged 2026-10-20T16:33:19Z 0.3 h after submitted; 10.5 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

@David-Noble-at-work
David-Noble-at-work merged commit 4612242 into develop Oct 20, 2026
22 of 27 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the chore/1044-install-ps1-narrates-fails-and branch October 20, 2026 16:33
David-Noble-at-work added a commit that referenced this pull request Oct 20, 2026
…nder Windows PowerShell 5.1 with a UTF-8 console (#1105)

## Summary

Lane 57 of #949: a defect lane 30 (#1103) merged.

- **No byte-order mark reaches a program `install.ps1` runs (#1104).**
  - Under Windows PowerShell 5.1 with a UTF-8 console, every program the installer runs read `EF BB BF` from the standard input #1044 closed for it, before the end of that input.
  - The cause is .NET Framework 4.8: it writes the console input encoding's preamble to a redirected standard input the moment the process starts, and its `ProcessStartInfo` has no `StandardInputEncoding`.
  - `Invoke-NativeCommand` now sets UTF-8 without a preamble for that moment and restores the caller's encoding in a `finally`. The code page is 65001 throughout, so section 7's rule never to change it holds.
  - Ruled 2026-10-20: "We do not store boms. Ever!" Offered this, an inherited standard input, or `cmd /c ... < NUL`, you answered: "Implement your solution."
- **The suite catches it on any console.** The stdin check's child session sets its input encoding to UTF-8 with a preamble first, and a new check confirms the caller's encoding is as it was afterwards. #1044's check passed on danoble-wd11-3 only because that console is OEM.
- **#1103 merged with these checks failing.** A rerun I requested while its PR script's gate was watching hid the checks from the gate. That is logged on NobleFactor/noblefactor-engprod#317. This script's gate now also reads every check run for the head commit from GitHub's API, the latest attempt of each, and refuses to merge unless each succeeded.
- **Plan:** `docs/plans/fix/1104-install-ps1-s-programs-read-a.md`.

Resolves #1104

## Test plan

- [x] danoble-wd11-3 (windows/arm64), with this branch's archive:
  - 85 of 85 checks under Windows PowerShell 5.1.26100.9711 and under PowerShell 7.6.6;
  - against `46122426`'s `install.ps1` under 5.1, the stdin check fails with "stdin read: 3", as on CI's runners.
- [x] Tried there before writing it:
  - with a UTF-8 console, the program read `239,187,191` before the fix and nothing after, under 5.1;
  - closing the writer's base stream instead does not help.
- [x] `Test-PowerShell.ps1`: no findings
- [x] This script's pre-flight: CI's whole quality gate, the suite off Windows, `make test-race` and `make test-scenario`
- [ ] CI on this pull request, every leg: the `install.ps1` legs under 5.1 and 7 on amd64 and arm64

Written with AI assistance.

Signed-off-by: David Noble <[email protected]>
Assisted-by: Claude Code
Sign up for free to 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.

install.ps1 narrates, fails and runs programs as the PowerShell style guide's section 7 says

1 participant