Repository navigation
Install a release without a clone: the release installer, and field upgrade for release installs (install.md chunk 3) - #214
Conversation
… the install plan's chunk 3 The README and the CLI manual lead with the one-line release install now that the repository is public, and docs/install.md drops the private-repository token passage and gains the release install's status rows and environment variables. Plan §2.1, §3.2, §4, §5, and §6 describe chunk 3 as built, §7.5 and §7.6 are decided, and windows-portability.md §7.2 takes over a Windows installer.
…ut vitest's worker Plan §10 records the end-to-end runs: a cold release install in 258 s, an upgrade through field upgrade in 58 s with no JUCE clone, a re-run in a second, and a failed release leaving the old version current. §9 records the first release, 0.2.0. src/install.test.ts yields one event-loop turn after each test, because a minute of synchronous tests left vitest's onTaskUpdate reply unread until it timed out, and takes a 30-second timeout, which the yield makes enforceable.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.8 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 34m 25s
This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's immutable tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A two-line shim in ~/.local/bin runs whatever current names. field upgrade tells a release install from a checkout and downloads the newest installer for a release install. The change knowingly leaves a Windows installer to windows-portability.md §7.2 and the field.one URL to chunk 4, and no real install from GitHub or on Linux has run yet.
4 finding threads: 0 resolved, 4 open
Covered 11 of 11 changed files; none are generated.
- Not run.
shellcheckis not installed on this machine, soinstall.shhad onlybash -n. Neither a real install from GitHub nor a Linux run was possible here, as the pull request also says. - CI.
linuxpasses at830f3ab.windowsfailed on two tests outside this change.punch-daemon.test.tslost the daemon mid-way through a loop take, which is the race #203 describes and open #204 fixes.push.test.tshit vitest's 5-second timeout, the Windows timeout that failedrelease.test.tsandknobs.test.tson other branches today. TheCMakeLists.txtchange does nothing unlessFIELD_FETCHCONTENT_BASE_DIRis set, and CI does not set it. - Readiness. The install plan is
in-progressat prioritynow. This change decides §7.5 and §7.6, §7.2 was already answered, and §7.4, the domain that serves the installer, is an open question from before that chunk 4 owns. windows-portability isin-progressatnow. This change adds an item to its §7.2 inventory, which no chunk has scheduled yet, so no new question blocks either plan.
Suggestions
install.sh:537says the repository is private until chunk 4, andinstall.sh:517saysGITHUB_TOKENis there so a maintainer can install while it is private. The repository is public now, so give the reason plan §3.2 gives: it matters only for a private fork.install.sh:937: refuse on Windows whenuname -sisMINGW*,MSYS*, orCYGWIN*, with the messagefield upgradegives onwin32. At the base, a piped run stopped on every platform with "run this from a Field checkout". Now Git Bash goes on into a release install that the README says does not run on Windows yet. I could not run it there, so I don't know how far it gets.install.sh:736andinstall.sh:582: match only names made of digits and dots, theX.Y.Zthatrelease_versionrequires. The pattern[0-9]*.[0-9]*.[0-9]*also matches a name such as2024.01.15 photos, so aFIELD_DATA_DIRpointed at a shared directory would haveprunedelete it.install.sh:892: also check that the bin directory can be written, inrequire_shim_free.write_shimruns after the switch, so an unwritableFIELD_BIN_DIR, such as/usr/local/binon Linux, fails with a bare "Permission denied" aftercurrenthas moved, and beforerelease.confand pruning.src/commands/upgrade.ts:153: the comment says a root that does not exist fails below, but withoutdeps.installersuch a root goes down the release path and installs into the default data directory. Delete the comment or make it say that.docs/install.md:59: list git among a release install's prerequisites, becausenative/audiod/CMakeLists.txtclones JUCE with it and the release path checks only node, pnpm, cmake, curl, and tar.README.md:119: this change dropspnpm remove -g field, which was the only removal step for a checkout install. Add it beside "Remove a release install" indocs/install.md.docs/projects/install/readme.md:338points at "the release-install bullet at the end of this list", but two more bullets now follow the shim bullet. Name the bullet instead.docs/projects/install/readme.md:739: §10.2 says the tests cover every status row, but nothing assertsrelease-ahead, and the release-modecli-missing,cli-unbuilt,ui-missing, andaudiod-missingrows are asserted only in checkout mode. Add the tests or narrow the claim.
What was checked
- A truncated download runs nothing. Every command is inside a function, and
main "$@"is the last line. Before it, the script only assigns variables. A piped run under bash 3.2 sees an emptyBASH_SOURCE, so it never takes the checkout path. - What the installer trusts. It uses HTTPS by default and reads
v0only for the version, which it holds toX.Y.Z. It downloads thevX.Y.Zarchive and refuses one that does not hold exactly one directory whosepackage.jsonnames that version.FIELD_REPOandFIELD_REFare held to the characters GitHub allows before either goes into a URL.GITHUB_TOKENgoes to curl on standard input, only for GitHub's own hosts over HTTPS, in bothinstall.shandupgrade.ts. - The switch.
currentchanges only after the download, the builds, and the worker setup succeed. The new link is renamed over the old one withrename(2), somvnever moves it into the directory the old link names. A function that fails at the end of an||list still stops the script underset -e; I checked that in bash 3.2. The shim single-quotes its path, and an existingfieldthat is not the shim stops the install before anything changes. - Pruning. It keeps the new version and the one it replaced, which is the one
field upgradeis running from. - Docs. Every section the changed docs cite exists and says what they claim, the new anchors resolve, the §4 and §7 decisions are appended with the alternatives that lost, and the wrapping matches the text around each edit.
- Tests.
pnpm install --frozen-lockfile,pnpm typecheck,bash -n install.sh, andproject checkpass.project checkwarns only that theAGENTS.mdsection and the site workflow are older shapes, which is not this change.pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.tspassed 103 tests in 3 files with no unhandled errors. Before running them, I read how both test files sandbox:install.test.tsreplaces the whole environment with a temporaryHOMEand aPATHof stand-ins, andupgrade.test.tsservesfile://URLs to stand-in installers. The reproductions behind the threads ran in the same kind of sandbox, and I removed it afterwards.
…line In a release install, field upgrade always downloaded the newest install.sh, and nothing read FIELD_OFFLINE, so FIELD_OFFLINE=1 field upgrade status failed offline with "could not download the installer" instead of reaching the status row that says it compared nothing. Offline, it now runs the install.sh inside the installed version, with FIELD_DATA_DIR set, which reports and rebuilds without downloading.
…to switch back to When a download, build, or worker setup failed, release_failed said so and left <data>/<version> in place. kept_versions lists every version directory beside current, so the next field upgrade status printed the half-built version as "previous ..., kept to switch back to by hand", and docs/install.md's ln -sfn would have switched to a build with no field-audiod. The exit trap now removes the version's directory and its download, never the one current names, since the next install deletes and downloads a version that is not current anyway.
The help still read "run this field's install.sh from anywhere", and the comment above it said the command runs the installer beside its package. A release install downloads the newest release's installer instead, so the help now gives docs/cli.md's wording, and the comment says which installer each kind of install runs.
…uld not move off docs/install.md offered v0.2.0 as the exact tag to pin to, and said FIELD_REF=v0 field upgrade follows v0 again. 0.2.0's field upgrade runs the install.sh beside its package, which takes any directory with src/cli.ts as a checkout and never reads FIELD_REF, so an install pinned to it could never return to v0, and its upgrade would run pnpm add -g on the release directory. The installer now refuses a version whose install.sh writes no shim, before anything is built or switched. A pin to a later tag still holds, as release.conf records it, and FIELD_REF=v0 field upgrade leaves it. The docs name vX.Y.Z rather than 0.2.0, say what a pin does, and plan §4 records the decision with the alternatives that lost, among them Projector's one-command PROJECTOR_REF.
- Refuse a release install in a Windows shell (MINGW, MSYS, or Cygwin), naming the checkout steps, as field upgrade refuses on Windows. A piped run used to stop everywhere, and Git Bash now went on into an install nobody has run there. - Treat only X.Y.Z directory names as versions when status lists them and prune removes them. The glob it used also matched a name such as "2024.01.15 photos" in a shared FIELD_DATA_DIR. - Check that the bin directory can be written before anything changes, because the shim is written after the switch. - Say GITHUB_TOKEN matters only for a private fork, now the repository is public, and make upgrade.ts's comment on a missing root say what happens to it. - List git among a release install's prerequisites, document pnpm remove -g field for a checkout install, and name the shim bullet in plan §4 rather than "the bullet at the end of this list". - Test the release-mode release-ahead, cli-missing, cli-unbuilt, ui-missing, audiod-missing, and audiod-override rows, so §10.2's claim of every status row holds.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 10m 11s
This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's own tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A short shim in ~/.local/bin runs whatever current names, and field upgrade downloads the newest installer for a release install. Since the last review at 830f3ab, the branch merged main cleanly and fixed the four findings: offline, field upgrade runs the installed version's own installer; a failed install removes what it built; field upgrade --help names both installers; and the installer refuses a release from before release installs, such as 0.2.0. It also took every suggestion, including a refusal in a Windows shell, a bin-directory check before the switch, and an X.Y.Z pattern for the versions it lists and prunes.
5 finding threads: 4 resolved, 1 open
Covered 12 of 12 changed files; none are generated.
- Not run.
shellcheckis not installed on this machine, soinstall.shhad onlybash -n. Neither a real install from GitHub nor a Linux run was possible here. - The merge.
f0f61deis exactly the treegit merge-treebuilds from830f3abande791a11, so the merge resolved nothing by hand.mainchanged six of this pull request's files, and the pull request's own diff in each is the same as before. - CI.
linuxandwindowsboth pass at98dc9d5. - Readiness. The install plan stays
in-progressat prioritynow. This head adds one decision to §4, on pinning to an exact tag, with the alternatives that lost, and opens no question. §7.4, the domain that serves the installer, is still the open question from before, and chunk 4 owns it.
Suggestions
src/commands/upgrade.ts:28:installerPath()has no caller now but its own test, becauseupgrade()buildsjoin(root, 'install.sh'). Remove it and its test, or haveupgrade()call it.
What was checked
- The earlier findings, at this head.
- Offline. I called the built
upgrade('status')fromcurrentwithFIELD_OFFLINE=1: it downloaded nothing and ran<data>/0.2.0/install.sh statuswithFIELD_DATA_DIRset. - Failed install. With the test harness, a 0.3.0 install that failed in the daemon build left no
0.3.0/, andstatusprinted nopreviousrow. - Help.
node dist/cli.js upgrade --helpnames a checkout's owninstall.shor the newest release's. - Pin.
v0.2.0'sinstall.shcarries no$SHIM_MARKER, sodownload_releaserefuses it before anything builds, and the new test covers that.
- Offline. I called the built
- The suggestions that were taken. The Windows refusal runs first in
release_main, beforerelease_init. The bin-directory check walks up to the nearest directory that exists, so a bin directory not made yet passes when its parent can be written. The comments onGITHUB_TOKENand on a missing root now say what the code does. - Tests.
pnpm install --frozen-lockfile,pnpm typecheck,bash -n install.sh, andproject checkpass.pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.tspassed 110 tests in 3 files with no unhandled errors. The reproductions ran in a temporary copy of the harness and a throwaway data directory, and I removed both.
…rectory that holds other things prune treated any directory named X.Y.Z as a Field version, so a first install into a FIELD_DATA_DIR holding 3.11.4/bin/python3 deleted it and printed "removed 3.11.4". download_release likewise deleted whatever directory had the name of the version it installed. A directory now counts as a version only when it is named X.Y.Z and its install.sh carries the shim's marker, which download_release requires of every version, and a download only when it is .download-X.Y.Z holding the unpacked/ the installer makes. prune, kept_versions, and the exit trap act on nothing else, and a directory in the way that is neither stops the install with exit status 69 before anything changes. The plan no longer promises that a shared directory loses nothing; the docs say to give FIELD_DATA_DIR a directory of Field's own and what the installer writes there.
upgrade() builds join(root, 'install.sh') from a root it can be handed, so installerPath() had no caller left. Its test now checks packageRoot(), which upgrade() does call, against the install.sh beside the package.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CLEAN · took 6m 00s
This change lets you install Field without a clone. Piped from curl, or downloaded by field upgrade, install.sh reads the version that package.json names at the moving v0 tag, downloads GitHub's archive of that version's own tag into a directory of its own under ~/.local/share/field, builds it the way a checkout install builds, sets up again the workers the old version had, and only then switches the current link with one atomic rename. A short shim in ~/.local/bin runs whatever current names, and field upgrade downloads the newest installer for a release install. Since the review at 98dc9d5, the installer treats a directory as one of its versions only when it is named X.Y.Z and its install.sh carries the shim's marker, and as one of its downloads only when it is .download-X.Y.Z holding unpacked/. It stops with exit status 69 before replacing anything else. installerPath(), which nothing called, is gone.
5 finding threads: 5 resolved, 0 open
Covered 12 of 12 changed files; none are generated.
- Not run.
shellcheckis not installed on this machine, soinstall.shhad onlybash -n. Neither a real install from GitHub nor a Linux run was possible here. - CI.
linuxandwindowsboth pass atce42ef9. - Readiness. The install plan stays
in-progressat prioritynow. This head rewrites §3.2 step 5 to describe what the installer removes, and opens no question. §7.4, the domain that serves the installer, is still the open question from before, and chunk 4 owns it.
Suggestions
install.sh:489: infer the data directory from acurrentlink beside the script only when the script's own directory is namedX.Y.Z, as a version's own copy is. In a temporary copy of the test harness, I unpacked a release asopt/field-0.2.0/beside another program'sopt/current -> 2.0.1and ran itsinstall.sh. It deleted nothing, but it installed intoopt/, pointed that program'scurrentat Field's 0.2.0, and wroterelease.confthere. With the check, GitHub'sfield-0.2.0directory falls through to the default data directory.
What was checked
- The earlier finding, at this head. In a temporary copy of the test harness:
- Shared directory. A first install into a
FIELD_DATA_DIRholding3.11.4/bin/python3andnotes/left both and printed noremovedrow. - Foreign directories in the way. A
0.2.0/of someone else's, and a.download-0.2.0/withoutunpacked/, each stopped the install with exit status 69 and the "is in the way" message, with the directory intact. - Another program's
currentlink. The case above deleted neither of the other program's directories. - I removed the harness copy afterwards.
- Shared directory. A first install into a
- The exit trap.
release_failednow removes the new version only when it is a Field version and not the onecurrentnames, and the download only when it is Field's.require_version_freeruns beforeINSTALLINGis set or the trap is armed, so a refusal there removes nothing. - All earlier threads. I verified the four fixes from the first review again by the tests that cover them, and all five finding threads are resolved.
- Tests.
pnpm install --frozen-lockfile,pnpm typecheck,bash -n install.sh, andproject checkpass.pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.tspassed 111 tests in 3 files with no unhandled errors. No reference toinstallerPathremains.
…her program's current link is left alone A release's own install.sh took any directory with a current link beside the script's as its data directory. Unpacked as GitHub names it, opt/field-0.2.0/ beside another program's opt/current -> 2.0.1, it installed into opt/, pointed that program's current at Field's 0.2.0, and wrote release.conf there. field upgrade made the same inference from its package's real path, and read that directory's release.conf. Both now infer the data directory only when the version's own directory is named X.Y.Z, as the installer names every version, and fall back to the default otherwise.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.9 · model claude-opus-5-5 · effort xhigh · CLEAN · incremental from ce42ef9 · took 4m 35s
Incremental review of the change since the full review of ce42ef9: +51 −10 lines in 5 files.
This push takes the last suggestion: install.sh and upgrade.ts infer the data directory from a current link only beside a directory named X.Y.Z. In a test-harness sandbox, a release unpacked as field-0.2.0 beside another program's current -> 2.0.1 left that link, wrote nothing beside it, and installed into the default directory. Each changed check has one caller, which runs on a resolved path. The 113 focused tests, pnpm typecheck, and CI on linux and windows pass.
…e installer made (install.md §3.5) (#219) Field can now be installed with one command, so it should be removable with one too. Until now, removing a release install meant `rm -rf ~/.local/share/field ~/.local/bin/field` from the docs, and removing a checkout install meant knowing to run `pnpm remove -g field`. This adds `field uninstall`, which runs the installer's new `uninstall` target the same way `field upgrade` runs the installer. Like `field upgrade`, it uses a checkout's own `install.sh`, or the newest release's. In a release install, the target removes only what the installer can show it made, using the same tests `prune` uses. That means the shim when it carries the installer's marker and runs this data directory's `current`, every version and download the installer made, `current`, `release.conf`, and JUCE's download in `cache/fetchcontent`. It then removes the data directory if nothing else is left in it. Anything else in the data or bin directory stays, with a `kept` row, because `FIELD_DATA_DIR` can point at a directory that holds other things. The shim goes first, so `field` never runs a half-removed version. A shim that runs another data directory stays, with a `kept` row naming that directory, so an install made with `FIELD_DATA_DIR` keeps its `field`. The model workers' weights stay where each worker keeps them, and the uninstall names them per worker that was set up: ACE-Step's in `FIELD_ACE_MODELS` or `~/.field/models/acestep` (about 10 GB), and Chatterbox's in the Hugging Face cache, which other tools share. For an install that follows a fork, the closing "to install again" row names the fork's installer. In a checkout install, the target runs `pnpm remove -g field` only when pnpm's global `field` links that checkout, and never deletes the checkout. `curl -fsSL https://field.one/uninstall.sh | bash` will be the way to uninstall when `field` itself no longer runs. That is a static file in okamnesiac/audiofield's `apps/field-one/public` that runs this target, so the logic stays in the one versioned, tested installer. It can merge only after a release that carries this change, because 0.3.0's installer rejects `uninstall` as an unknown target. The README and `docs/install.md` mention it, and field.one's page doesn't. Plan §3.5 records the design, with a §4 decision listing the alternatives that lost: a second `uninstall.sh` here, and a TypeScript-only `field uninstall`. This change also brings a few lines up to date now that field.one serves the installer. The README, `docs/install.md`, and `docs/cli.md` lead with `curl -fsSL https://field.one/install.sh | bash`, and the installer's header comment does too. `docs/release.md`'s example bumps `patch`, since releases are patch bumps from here on. Plan §10.3 records the first real install from GitHub (0.3.0, 255 s on a Mac). Plan §6 marks chunks 3 and 4 shipped and adds this one. field#218 also edits §6 and `install.sh`, so whichever of the two merges second needs `main` merged in. ## Testing From the repository root of a checkout of `install/uninstall`, after `pnpm install --frozen-lockfile`: 1. Run `pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts`. It should report 110 tests passed, with no unhandled errors. The new `install.sh uninstall` block runs the real installer under bash 3.2 against stand-ins and checks these cases: - **A full removal.** After two releases are installed, the shim, both versions, `current`, `release.conf`, the cache, and the data directory are all gone, and no pnpm or curl command runs. - **Another tool's files.** A foreign `field` in the bin directory and other things in the data directory, such as `3.11.4/bin/python3`, are kept and named. - **Model weights.** ACE-Step's directory and the Hugging Face cache stay, each named only for a worker that was set up, at the paths `FIELD_ACE_MODELS` and `HF_HUB_CACHE` move them to. - **Another install's shim.** A shim that runs another data directory, or that another install wrote over this one's, stays; so does one whose exec line cannot be read. A shim written through a link to the data directory, with a path that needs quoting, is removed. - **A fork.** The "install again" row names the fork's installer. - **Nothing installed.** The target says so and changes nothing. - **A checkout install.** The target runs `pnpm remove -g field` for its own link, and the checkout's files stay. - **Another checkout's link.** It's left alone. `src/commands/upgrade.test.ts` checks that `field uninstall` hands the installer `uninstall` and returns its exit status, and that it refuses on Windows by naming `pnpm remove -g field`. If an uninstall test fails with the data directory "kept" though it's empty, the tests' PATH has lost `rmdir`, which this change adds to the harness's tool list. 2. At the first head, `ef4ef2e`, the full gate `pnpm typecheck && pnpm build && pnpm test && project check` gave 91 files, 1277 passed and 1 skipped, no unhandled errors, and valid plans. At `9b9357d`, `pnpm typecheck`, `project check`, and step 1 pass, and CI runs the full suite. 3. To run it end to end, without GitHub or your own `~/.local`, use the harness steps from #214's Testing section: set `FIELD_DATA_DIR`, `FIELD_BIN_DIR`, `FIELD_RAW_URL`, and `FIELD_ARCHIVE_URL` to a temporary directory, `cut` a version from this commit, install it, and then run: ```sh field uninstall ls "$FIELD_DATA_DIR" "$FIELD_BIN_DIR/field" ``` I upgraded a harness install from 0.93.0 to a stand-in 0.95.0 cut from this commit, then ran `field uninstall` through its shim. It printed `+ curl -fsSL file://…/v0/install.sh | bash -s -- uninstall`, then `removed …/bin/field`, `removed 0.93.0`, `removed 0.95.0`, `removed …/data`, and `uninstalled to install again: curl -fsSL https://field.one/install.sh | bash`, and exited 0. Both `ls` targets were gone. If `field` crashes after removing its own version, or the data directory survives with nothing foreign in it, the change is wrong. Not run: `field uninstall` against your real `~/.local/share/field`. That would remove your 0.3.0 install, which another session's tests currently use through `FIELD_AUDIOD`. <!-- projector-summary v=1 sha=ed7690c62511e57adeba6d039eec514f8e35ae57 --> 📽️ **Projector summary** of ed7690c: https://field.amnes.ac/reviews/219
Field can now be installed without a clone. Piped from curl, or downloaded by
field upgrade,install.shinstalls the newest release:curl -fsSL https://raw.githubusercontent.com/okamnesiac/field/v0/install.sh | bashBefore this,
install.shinstalled only the checkout it sat in, and anywhere else it told you to clone. Field releases publish no binaries (install.md §7.1, so no JUCE binary is ever distributed), so a release install builds from source as a checkout install does. It reads the version frompackage.jsonatv0, downloads GitHub's archive of that version's immutable tag into~/.local/share/field/<version>/, runs the same builds with the same prerequisite checks, and sets up again the model workers you had in the version it replaces. Only then does it switchcurrentto the new version with one atomic rename. A failed download, build, or worker setup therefore leaves the installed version current, the installer says so, and it removes what it built of the version that failed.fieldis a two-line shim in~/.local/binthat runscurrent/dist/cli.js, so an upgrade relinks nothing and a release install needs no pnpm global bin directory. The installer keeps the version an upgrade replaced and removes older ones. JUCE's download goes into a cache shared by every version (native/audiod/CMakeLists.txtreadsFIELD_FETCHCONTENT_BASE_DIR), so an upgrade doesn't clone JUCE again. The installer refuses a version from before release installs, such as 0.2.0, because that version's ownfield upgraderuns itsinstall.shas a checkout's and could never move off it. It also refuses in a Windows shell such as Git Bash, and refuses a bin directory it cannot write, before anything changes. It lists, replaces, and removes only the versions and downloads it can show it made, so aFIELD_DATA_DIRthat holds other things loses none of them to a prune, and a directory of someone else's where the new version goes stops the install. A version's own installer, andfield upgrade, take the directory beside acurrentlink as the data directory only when the version's directory is namedX.Y.Z, so a release unpacked asfield-0.2.0beside another program'scurrentinstalls to the default instead.field upgradetells the two kinds of install apart the same way the installer does. A checkout, withsrc/cli.tsand a.gitbeside the installer, runs its owninstall.sh, as before. A release install readsrelease.conf, which records the repository and ref it follows, downloadsinstall.shat that ref, and runs it with the same target.FIELD_REPOandFIELD_REFfollow a fork or pin a release, andFIELD_REF=v0 field upgradeleaves a pin. UnderFIELD_OFFLINE,field upgradedownloads nothing and runs the installed version's owninstall.shinstead.field upgrade statuscompares the installed version with the release and checks each piece is built.Most of the code and tests came from the
live-supercollidersession (the0f5468dandea305ddwork-in-progress commits), which handed chunk 3 over before finishing it. This session mergedmain, finisheddocs/install.md, and revised the README and the CLI manual to lead with the one-line install now that the repository is public. It also ran the end-to-end checks that had never finished. Plan §2.1, §3.2, §4, §5, §6, and a new §10 describe chunk 3 as built. §7.5 (workers are set up again in each version) and §7.6 (noinstall.ps1here) are now decided. A Windows installer moves to windows-portability.md §7.2, so the question keeps an owner. §9 also records the first release, 0.2.0, as #208's review suggested. Two test changes keep the much largersrc/install.test.tshonest under vitest. It yields one event-loop turn after each test, because a minute of synchronousspawnSynctests left the worker'sonTaskUpdatereply unread until it timed out as an unhandled error, with every test passing. It also takes a 30-second timeout, which the yield makes enforceable.field.one/install.sh(chunk 4, okamnesiac/audiofield) servesinstall.shatv0, so it starts doing anything useful only once a release contains this change. Merge this, release it with the Release workflow (minor, so 0.3.0), and only then merge chunk 4.Testing
From the repository root of a checkout of
install/release-installer, afterpnpm install --frozen-lockfile:pnpm exec vitest run src/install.test.ts src/commands/upgrade.test.ts src/release.test.tsshould report 3 files and 113 tests passed, with no unhandled errors.src/install.test.tsruns the realinstall.shunder real bash (macOS's 3.2 locally, 5 in CI) with stand-ins for pnpm, cmake, the CLI, and the downloads, and covers both modes and every status row. IfErrors 1 errorwithTimeout calling "onTaskUpdate"comes back, the event-loop yield in itsafterEachis gone.The full gate,
pnpm typecheck && pnpm build && pnpm test && project check, gave 91 files, 1258 passed and 1 skipped, and valid plans, at2a9277a. Build the daemon first with./install.sh audiod, because this change editsnative/audiod/CMakeLists.txt, the merge ofmainbrings daemon changes, and./install.sh statusreportsaudiod-staleuntil you do. The daemon tests need the current build.src/keys/routing-voice.test.tsplays through scsynth on your default output device. Atce42ef9it heard a peak of 0.0033 against its 0.01 threshold, with AirPods Pro as the default output, and it passed again at2a9277awith nothing changed that reaches it, so a failure there points at the audio device rather than at this change.The release installer end to end, without touching GitHub or your own
~/.local. This is the harness I ran, in full, from any directory:Run verbatim, the first install took 254 seconds. It printed
building field-audiod for the first time: CMake fetches JUCE and compiles itand ended withswitched … current -> 0.90.0.field --versionprintedfield 0.90.0 (not a git checkout).field upgradeprinted+ curl -fsSL file://…/v0/install.sh | bash, thenbuilding field-audiod for this version: CMake compiles JUCE from its download in …/data/cache/fetchcontent, installed 0.91.0 in 61 seconds, and switchedcurrent.statusshowedrelease-latest 0.91.0 is installedandprevious 0.90.0 … kept to switch back to by hand. If the upgrade'sbuildingrow saysfetches JUCEagain, the cache isn't working. The offlinestatusprints+ …/data/0.91.0/install.sh statusandrelease okamnesiac/field v0 (offline; not compared), and exits 0.cannot upgrade: could not download the installerthere means it still downloads offline. At98dc9d5, with my copy of the harness, an upgrade from 0.91.0 to a 0.93.0 cut from this head took 63 seconds, and the offlinestatusprinted those rows. The run leaves everything under$E2E; delete it afterwards.A failed release, in the same shell afterwards:
There's no archive for 0.92.0, so the install exits 1 with
install.sh: 0.92.0 did not install, so 0.91.0 stays current and field still runs it, andfield --versionstill prints 0.91.0.ls -a $E2E/datashows no0.92.0and no.download-0.92.0. Output that switchescurrentbefore the failure, or a.download-0.92.0left behind, means the change is wrong. (I ran this case with my own copy of the same harness, pointingv0at 0.92.0 and, at98dc9d5, at 0.94.0, each with no archive.)Not verified: Linux, a real install from GitHub, and pruning a third version by hand (the unit tests cover pruning). The first real install is the release that carries this change.
📽️ Projector summary of 2a9277a: https://field.amnes.ac/reviews/214