feat: preflight as a release asset - download, verify, unpack, then run the tree preflight (#151, C)
CI / verify (push) Successful in 2m26s
CI / pwsh (push) Failing after 11s
Release / release (push) Successful in 37s

Files changed:
- .gitea/workflows/release.yml
- CHANGES.md
- INSTALL.md
- README.md
- VERSION
- instructions/dev/testing-conventions.md
- instructions/preflight.md
- tools/CONTRACT.md
- tools/README.md
- tools/chemenu/tests/test_preflight.py
- tools/chemenu/tests/test_preflight_pwsh.py
- tools/preflight.ps1
- tools/preflight.sh
This commit is contained in:
torben committed 2026-10-01 13:39:56 +02:00
1 parent 210e0c8286
commit c33e8cdfb1
13 files changed
+1020 -88

No files matched your search

+36 -1
View File
@@ -59,7 +59,7 @@ concern - readable here, never shipped as something to parse.
---
## 8.0.0-beta.15 - 2026-10-01 - PowerShell 7 preflight and launcher: tools/preflight.ps1, tools/wikitool.ps1, doctor checks for execution policy and Mark of the Web
## 8.0.0-beta.16 - 2026-10-01 - Preflight as a release asset: download, verify and unpack the stack, then run the tree preflight
**Author:** Torben Nehmer
@@ -90,6 +90,7 @@ concern - readable here, never shipped as something to parse.
- publish: the gate lists the staged state; a missing or unreachable remote stops before the commit
- Path budget: a file's path stays at 160 characters or fewer so a Windows checkout works without long paths (#163)
- PowerShell 7 preflight and launcher: tools/preflight.ps1, tools/wikitool.ps1, doctor checks for execution policy and Mark of the Web
- Preflight as a release asset: download, verify and unpack the stack, then run the tree preflight
**Low impact**
- version bump no longer points at version release in its output
@@ -126,6 +127,40 @@ concern - readable here, never shipped as something to parse.
- raw/CONTRACT.md points at the path budget for a name accepted from incoming/
<!-- /wikitool:bumps -->
### Preflight as a release asset: download, verify and unpack the stack, then run the tree preflight
Section C of #151, the first install. Until now a new user had to get the stack onto the machine
before any preflight could run - which is exactly the step that fails on a machine without git
or a short enough path. Each release now also attaches `preflight.sh` and `preflight.ps1` as
assets, and a script without `tools/prerequisites.txt` beside it runs in **asset mode**: it
downloads the release tarball and its `.sha256`, stops with exit 1 unless the checksum matches,
reads the folder limit from `tools/prerequisites.txt` inside the archive, and unpacks into
`chemenu/` next to itself (`--into <path>` for another place). It unpacks into a temporary
sibling and renames, requires exactly one top-level folder, and refuses an existing target
without touching it. Then it runs the unpacked tree's own preflight, passing `--set` and the exit
code through, so everything after the unpack is the tree mode that already existed.
The asset copies are made by `release.yml`: it writes the same release's tarball and checksum
URLs into two placeholder lines of each script, checks that the substitution took, and uploads
the two files under exactly those names. The tree copies keep the placeholders empty; an asset
script with empty placeholders and no `--archive` exits 1 saying it does not come from a release.
`--archive <tarball>` uses a tarball already on disk (its `<tarball>.sha256` must sit beside it)
for a machine that cannot download, and is the entry point the tests use.
On POSIX asset mode needs `curl`, `tar` and `sha256sum` (or `shasum`) and stops with exit 42 and
the usual guidance block when one is missing; the PowerShell script uses what Windows ships plus
`tar`. On Windows with long paths off, the 95-character folder limit is judged at the final
target before anything is unpacked, so a too-long `--into` stops with exit 42 and the fix is a
shorter folder. Git Bash gets the target and archive converted with `cygpath -u`, because GNU
tar would read `C:` as a host.
The tests build a release tarball with a checksum and run both scripts against it, including a
local HTTP server for the PowerShell download, the 95/96 boundary, a failed checksum, two
top-level folders, an existing target, and a test that ties the placeholder lines to the `sed`
expressions in `release.yml`. `tools/CONTRACT.md`, `tools/README.md`, `README.md`,
`instructions/preflight.md` (a new decision point for the asset script),
`instructions/dev/testing-conventions.md` and `INSTALL.md` describe the first-install route.
### PowerShell 7 preflight and launcher: tools/preflight.ps1, tools/wikitool.ps1, doctor checks for execution policy and Mark of the Web
The PowerShell half of #151. Harnesses that run in PowerShell 7 on Windows (GitHub Copilot CLI,