Skip to content

v2.1.0

Choose a tag to compare

@janicduplessis janicduplessis released this 29 Nov 07:42
· 33 commits to main since this release
9949f6e

This release covers stim and @stim-cli/cache-s3. It pins Stim Host 0.2.1, which stimd now brings an installed Stim Host up to on its own, adds project plugins that can recognise and build a project type Stim does not bundle, makes cleanup treat dependency folders and git-ignored worktree files as disposable, and lets stim gc --dry-run answer from a report stimd keeps fresh. Every commit since v2.0.0 has an entry below. The Desktop changes noted below ship with the next Stim Desktop release, and the phone app ships through its own workflow.

New

  • Stim Host keeps itself current. stimd installs the Stim Host this version pins over an older one in ~/Applications each time it starts, with the same download, SHA-256 and Developer ID checks as stim service install, and retries hourly after a failure (logged as host_update_failed). It never installs Stim Host on a Mac that has none and never downgrades. engine.autoUpdate set to off turns this off. From Stim Host 0.2.1 on, the helper exits when its bundle is replaced, so launchd starts the new binary. 9c2c3b5b6
  • Stim Host's helper restarts a bloated fseventsd. fseventsd joins the Apple services the opt-in helper restarts, and the helper now measures each service's memory as the larger of its RSS and its physical footprint, so a service whose memory is mostly compressed or swapped still counts. Restarting fseventsd makes file watchers such as Metro, Watchman and Spotlight rescan once. This ships in Stim Host 0.2.1. Fixes #6600. ad81368d4
  • A project plugin kind recognises a project type Stim does not bundle, such as a Godot game, from a plugin's package.json alone (stimPlugin.kinds.project and a stimPlugin.project block with id, name and markers). The new machine setting plugins lists plugin directories by absolute path. A folder that holds every marker is a project root: stim worktree add and warm register it, stim status names the type (project: Godot (plugin stim-plugin-godot)), and stim ios, android, macos and start refuse with STIM_NO_PROJECT naming it, except for the Android build below. Stim never imports the plugin's code. Bundled integrations keep a folder they also serve. stim plugin list, stim plugin test, stim doctor and stim settings set plugins report a manifest Stim does not accept. The kind is experimental: its contract and integer may change in a minor release. stim/plugin exports PROJECT_API_VERSION, ProjectPluginManifest and runProjectContract. Refs #6599. 808fea14f
  • A project plugin can declare an Android build. stimPlugin.project.targets.android.build holds a debug argument list, an optional release one and "output": "apk". In a folder the plugin recognises, stim android runs that list in the project root with no shell, with {root} and {output} as its only placeholders and an executable that is an absolute path or a name on PATH (on Windows a .exe), then installs the APK on the workspace's emulator and launches it as a native process. stim ios, macos and start still refuse there. The build is never cached and never offloaded, and only an emulator this machine owns is a target. A bundled integration that builds the same folder keeps the build. stim/plugin exports ProjectPluginAndroidTarget and ProjectPluginCommand. Refs #6599. eb2a797e7
  • Dependency folders are deleted without a check for hand edits. Maintenance and stim gc delete the node_modules and Pods of idle workspaces, and finished or discovered worktrees that hold them, without looking inside. Make a library fix a committed patch (pnpm patch, yarn patch, patch-package or a Podfile post_install hook). An unfinished pnpm patch edit folder is still copied to $STIM_HOME/rescued first. The new machine setting maintenance.cleanAutoDiscoveredDependencies (default false, env STIM_MAINTENANCE_CLEAN_AUTO_DISCOVERED_DEPENDENCIES) governs checkouts that only maintenance.autoDiscover found: while it is off, their node_modules and Pods stay as long as the checkout does. Their build outputs and finished worktrees are cleaned either way. This replaces the hand-edit rules that #6608 and #6620 refined earlier in this release (pnpm's node_modules/.package-map.json, iOS build outputs in Pods and node_modules). Fixes #6638, #6603 and #6616. 7cab41806 9a208c7c6 b8109f969
  • Git-ignored files in a linked worktree are disposable. A finished linked worktree is no longer kept because a git-ignored file in it is missing from the main checkout or differs there. An ignored file that exists only in a worktree, such as a .env created there, is deleted with the finished worktree: keep what matters in the main checkout or outside the repository. A discovered worktree's recent write to an ignored file still counts as activity. A registered worktree has no file scan, so a finished one goes once gc.worktreeGraceMinutes has passed even if an ignored file changed minutes before. Writes inside .docusaurus and .pnpm-store no longer count as activity. Tracked changes, untracked files git does not ignore and unpushed commits still keep a worktree. Fixes #6643 and #6652. 19292c0d9 b7311874a a1f371a60
  • maintenance.discoverRoots is now maintenance.managedFolders. The 2.0.0 name is still read while the new one is unset, and stim settings get, set and unset accept it. A set through either name stores maintenance.managedFolders and removes the old key. When both are set, the new one wins and stim settings and stim doctor report the old one as not read. An older Stim that shares the Stim home reads only the old key, so update every Stim that shares it before setting the new one. Fixes #6644. eabbe775e
  • stim gc --dry-run answers from the gc report stimd keeps fresh. stimd refreshes the shared report in $STIM_HOME/gc/report-cache.json while daemon.mode is on and pressure is normal: after 15 minutes when cleanup state changed, and at least hourly. A dry run first measures the pressure level, then prints the cached report with its age, and --json adds measured (from: cache or scan, at, parts). A report older than an hour still answers, and stderr names --refresh. stim gc --dry-run --refresh measures again in its own process, as does a dry run with no cached report or one read at another pressure level, and names each part on stderr as it lands. --pressure measures in process and leaves the cache alone. --refresh without --dry-run refuses with STIM_BAD_ARG. An acting stim gc and every deletion still read each candidate fresh. stim-server reads the same file and sweeps only when it is missing or Desktop asks for a fresh one; while its own sweep runs, a Desktop report read also carries the parts read so far. (Desktop: shows those parts over the last complete report; ships with the next Stim Desktop release.) Fixes #6612 and #6613. 1fb5443b2 1c03227fa
  • Long-running commands report progress on stderr. An acting stim gc prints one line per phase of the stimd pass (level, discover, measure, plan, dormant, ladder) and a closing gc line (finished: N actions taken, X freed in T), in --json mode too. A request that joins a pass already under way prints a line saying so, then that pass's lines from that point; a pass stimd started on its own prints no phase lines, only its actions. stim engine install, use and update print their fetch and self-test steps, and stim remote update prints a line when it starts waiting on the remote machine. Fixes #6669. 63e1eff59

Removed (breaking)

  • status --json no longer carries dependencyEdits, and stim doctor no longer reports edited dependency folders, because cleanup no longer looks for hand edits (see New). The field was optional and is now never present. Install records under $STIM_HOME/dependency-installs/ are no longer written or pruned; existing files stay. 7cab41806
  • stim gc no longer keeps the workspace it runs from. A gc pass, acting or dry run, plans the same work from any directory, so the checkout you run it in can lose its node_modules and Pods or, as a finished worktree, be removed, like any other. Everything that keeps a workspace in use still does: running dev servers and devices, live claims, agent sessions, running Stim commands and any process working in it, idle and dormant periods, recent use and pins. An acting pass runs its child processes from stimd's directory. stim start, ios and android still keep the workspace they build. 1fb5443b2
  • stim gc no longer lists or stops the current Expo project's orphaned EAS sessions. orphanedEasSessions in gc --json is always empty. Listing every Expo project's sessions would take a network scan per project. gc still cleans the local EAS ledger entries it can prove are stale. 1fb5443b2
  • Cleanup keeps less. Hand edits inside node_modules and Pods, and git-ignored files that exist only in a finished linked worktree, are now deleted with them (see New). 7cab41806 19292c0d9

Fixes

  • On Windows, a fresh install of Stim no longer picks up cross-spawn 7.1.0, which runs npm and other batch shims by their bare name in a way that makes npm look for its own files in the current directory (Cannot find module ...\node_modules\npm\bin\npm-prefix.js). Stim pins cross-spawn 7.0.6 until upstream fixes it. Fixes #6659. ccc4078ee
  • On Windows, a native build in a worktree that stim worktree add or warm filled from a source checkout is stored in the build cache again. The carried node_modules keeps the source checkout's file times, so the warm has to compare the worktree's install inputs with the source's, and Git for Windows checks package.json, the lockfile and patches out with CRLF line endings, so that comparison failed and every build printed ... changed after the last install; the build will be installed but not cached. The warm now compares these files without regard to line endings. Fixes #6633. 23a490683
  • Stim pins Stim Host 0.2.1, and the fseventsd memory advice now names stim service install --helper instead of sudo killall fseventsd. A Mac with Stim Host installed moves to 0.2.1 the next time stimd starts, unless engine.autoUpdate is off; stim service install installs it either way. A helper registered before 0.2.1 keeps running its old binary until a reboot or sudo launchctl kickstart -k system/dev.stim.host.helper. The helper's restart line in stim status shows the larger of RSS and footprint as memory. (Desktop: the preferences copy names fseventsd and says "2 GB of memory"; ships with the next Stim Desktop release.) Fixes #6601 and #6604. 6b364af97
  • A lock left with an unrecorded child is recovered after a reboot. A claim whose owner died before recording the child it started kept its workspace "in use" until removed by hand. It now reads as free when its owner is gone and the owner's process token records an earlier boot. Within one boot, when a boot id cannot be read, and on Windows nothing changes. Fixes #6618. 79f2cc714
  • Stim Desktop's cleanup report answers from stimd's cached gc report. On a Mac with many projects the report timed out at 60 s every time. stim-server now answers a gc report read at once with the last good report and when it was measured, or pending during a first sweep, runs at most one sweep with a 15 minute budget, and keeps the report in $STIM_HOME/gc/report-cache.json across stimd restarts. Phone machine details read the same report. (Desktop: polls without forcing a new sweep; ships with the next Stim Desktop release.) Fixes #6606. aaa3efabe
  • gc reports ask git each question once. A report no longer drops its shared git reads between sweeps, merge state is shared per run, a repository's worktrees share one git worktree list, and the source walk asks git check-ignore once per depth. On a Mac with 258 registered projects, stim gc --dry-run --json went from 6,617 git calls to 2,685. Fixes #6615. eb523efa9
  • stim gc names macOS swap as one disk user (swap, 60 files in /System/Volumes/VM) instead of one row per 1 GB swap file. Fixes #6607. 54e0d07c7
  • A finished worktree with a detached HEAD is removed when a merged pull request holds that HEAD. It was kept forever as unpushed, because the merged pull request lookup needed a branch. gc and maintenance now look the commit up on GitHub: a MERGED pull request of this repository whose head equals or contains HEAD waives the unpushed commits, and stim worktree remove waives them while HEAD still equals that head. A failed or missing gh waives nothing. Fixes #6645. 2800e2ae4
  • Native and plugin APKs are checked with aapt2 instead of aapt, which refused Godot's Android exports with the default renderer (attribute is not an integer value). The Android SDK build-tools need aapt2, which every release since 26.0.0 includes. Fixes #6668. a22670068
  • Internal only: the built-in Exact iOS integration runs through an internal plugin interface, locally and for offloaded builds, with no behavior change (e0e746f58, aa0130939). Fixes #6642 and #6649; refs #6599.
  • Test only: f804232b3 covers Exact behaviors that had no test (Fixes #6640), b5bf00f67 covers the Exact behaviors of machine-wide cleanup (Fixes #6664), and 1c3c1fda6 keeps git auto maintenance off across the worktree-add integration tests (Fixes #6621). No shipped behavior changes.

Migration notes

  • Rename maintenance.discoverRoots when every Stim that shares the Stim home runs 2.1.0: stim settings set maintenance.managedFolders '["/path/to/folder"]' --scope machine with the same list moves the value and removes the old key. Leaving the old key alone keeps working.
  • Commit library fixes as patches. An edit inside node_modules or Pods is deleted once the workspace is idle.
  • Move files you want to keep out of a worktree's git-ignored files, such as a .env created only in a worktree, before the worktree is finished.
  • To keep a checkout from cleanup, pin it with stim settings set maintenance.keep true in it; stim gc no longer spares the checkout you run it from. Use stim gc --dry-run --refresh when you need numbers newer than the cached report.
  • Scripts that read orphanedEasSessions from gc --json get an empty list; stop remote EAS sessions with eas-cli.
  • A Stim Host helper registered before 0.2.1 needs one reboot or sudo launchctl kickstart -k system/dev.stim.host.helper to run the new helper.