Repository navigation
fix(install): install.ps1 knows whether a new terminal would run what it installed, and says only what is so - #1108
Merged
David-Noble-at-work merged 5 commits intoOct 21, 2026
Conversation
This was referenced Oct 21, 2026
This was referenced Oct 21, 2026
Open
David-Noble-at-work
added a commit
that referenced
this pull request
Oct 21, 2026
…directory, and one list of checks serves CI and the local gate (#1111) ## Summary Lane 35 of #949, with #670 and #1110 (ruled 2026-10-21: "We will do that change in the same PR as lane 35"). - **Every installer run removes its download directory (#1051).** #958 fixed `install.sh` leaving its download directory in `TMPDIR`, proved by hand; nothing tested it. - The `install.sh` suite checks after every run that the account's `TMPDIR` is empty; the `install.ps1` suite, that its temporary directory holds no `devlore-install-*`. - Each check names its run. Against installers patched to keep their directory, 55 of the `install.sh` suite's 66 checks fail and 36 of the `install.ps1` suite's 39; the others are runs refused before the directory is made. - Found doing it: under Windows PowerShell 5.1, `Add-Type`, which `install.ps1`'s file-identity check uses since #1108, leaves one empty, randomly named directory in `TEMP` a session. It is the .NET Framework compiler's, PowerShell 7 leaves none, and nothing records whose it is. Not cleaned up; ruled: "it sounds like powershell is unhygenic, not a litterbug." The design document's § 2 says so. - **One list of checks (#670).** CI's quality gate, `make check` and every PR script's pre-flight were three lists that drifted. - `make quality-gate` runs every check CI's quality-gate job ran, in its order, plus `complexity` and `verify-ldflags`, which `make check` ran and no workflow did. Both pass on develop. - CI's quality-gate job installs its tools and runs `make quality-gate`; each check's reason, written in the workflow until now, moves beside it in the Makefile. - `make check` is `quality-gate` and `test`; `make shell-lint` is `star lint shell`, as CI's is. - `make check-all` runs the quality gate, the race tests, the scenarios and both installer suites, then names what CI alone runs: other platforms' legs and the Installers workflow's Windows and macOS legs. This script's pre-flight is `make check-all`. - **The PowerShell analyzer, pinned once (#1110).** The Makefile pins PSScriptAnalyzer 1.25.0 beside golangci-lint. CI installs it with `Install-PSResource` at that version; #1108's `Install-Module` step found no PSGallery. The lint imports the pinned version and refuses when it is not installed, so a profile's unpinned install cannot drift from CI's. - **Plan:** `docs/plans/chore/1051-installer-suites-never-check.md`. Resolves #1051 Resolves #670 Resolves #1110 ## Test plan - [x] The `install.ps1` suite on danoble-wd11-3: 131 passed under Windows PowerShell 5.1 and 131 under PowerShell 7; against an installer that keeps its directory, the 36 leftover checks fail - [x] The `install.sh` suite here: every check passed; against one that keeps its directory, 55 fail - [x] CI's analyzer install, `Install-PSResource` at the pinned version, from a clean home; the pin check accepting 1.25.0 and refusing 1.24.0 - [x] This script's pre-flight: `make check-all` - [ ] CI on this pull request, every leg; `quality-gate` running `make quality-gate` Written with AI assistance. Signed-off-by: David Noble <[email protected]> Assisted-by: Claude Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lane 34 of #949.
PATH. A session opened before the PATH changed is stale, a folder can be named many ways, and another copy of the program can come first.Get-CommandOnPersistentPathgets a program asGet-Commanddoes, from the PATH a new terminal searches: the machine PATH then the user PATH, as the registry stores them, each entry as written, empty entries skipped. Names without an extension take PATHEXT's extensions, through a case-insensitive map. It returnsGet-Command'sApplicationInfo, takes-All, and splits intobeginandprocess.-Alland compares each copy with the installed file byGet-FileIdentity: the volume serial number and 128-bit file ID fromGetFileInformationByHandleEx. A hard link, a symbolic link or a junction to the installed file counts as the installed file; a copy does not.Userscope needs none, and "then open a new terminal".install.shdoes: only when a layer was registered or skipped. A run that changed no layer ends with the documentation line.git init. Theinstall.ps1suite also checks the PATH advice. Against844a947f'sinstall.ps1, the four new checks of the summary fail.catch,finallyandelseon their own lines;ifexpressions;-ErrorAction Ignorerather thanSilentlyContinue;docs/plans/fix/1050-install-ps1-says-to-run-as.md.Resolves #1050
Test plan
cmdcopy behindSystem32's, andklistinSystem32behind the Zulu JDK's: the machine advice.Get-FileIdentityon danoble-wd11-3, both editions: the path in upper case, a hard link, a junction and a symbolic link match; a copy and an unrelated file do not.install.ps1suite on danoble-wd11-3: 92 passed under 5.1 and 92 under 7; against844a947f'sinstall.ps1, its four new checks fail.install.shsuite: every check passed.make test-raceandmake test-scenarioWritten with AI assistance.
Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code
Time
Computed by the algorithm of noblefactor-ops#188 at merge.