chore: add the local-setup.sh environment hook - #394
Open
tschm wants to merge 5 commits into
Open
Conversation
`rhiza-task`'s `setup` task execs a repo-owned `local-setup.sh` from the repository root if one exists; loman had none, so nothing provisioned graphviz after v1.4.0 retired the make layer and orphaned `.rhiza/scripts/customisations/build-extras.sh`. The hook installs graphviz — needed by `docs/notebooks/notebook-extras.py`, which renders a `loman.Computation` by shelling out to `dot`. It exits early when `dot` is already on PATH, resolves `sudo` once for root and non-root, and covers apt-get, brew, dnf and apk. A missing package manager warns rather than fails, since every gate reaches this hook and only one notebook needs the dependency; a package manager that exits 0 without putting `dot` on PATH is still an error. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
What
Adds
local-setup.shat the repository root — the repo-owned environment hook thatrhiza-task'ssetuptask execs when it exists. Copied frommarkrichardson/dummyrepo.Why
setupis a prerequisite ofinstall, which is a prerequisite of essentially every gate, so this hook runs on localmake test, on every CI job invokinguvx rhiza-task <gate>, and on the devcontainer'smake install. loman had no such hook: nothing has provisioned graphviz since rhiza v1.4.0 retired the make layer and orphaned.rhiza/scripts/customisations/build-extras.sh, which did the same job (apt-only, and assumedsudo).graphviz is needed by
docs/notebooks/notebook-extras.py, which builds aloman.Computationand draws it by shelling out todot. Nothing insrc/ortests/needs it.Behaviour
dotis already on PATH, which is the common case.sudoonce, handling both root containers (no sudo) and GitHub runners (sudo required).make teston a machine with no use for it. The warning names what is missing and what breaks.doton PATH is still an error — that is the silent-green outcome the hook exists to remove.Note
Windows cannot run this:
setupexecs the hook directly and Windows refuses to start a.sh, which the task reports as a failure. Documented in the file's own header.Closes #390.
🤖 Generated with Claude Code