Make local development work on macOS - #36
Open
0bserver07 wants to merge 4 commits into
Open
Conversation
just dev-store ran the rootless podman socket bootstrap on every platform, but justfile:53 fell back to /run/user/$(id -u) when XDG_RUNTIME_DIR is unset and justfile:57 called setsid, and neither exists on macOS, so the recipe died before podman compose up. The bootstrap now runs only when uname -s reports Linux, and setsid is dropped because nohup with a redirect already detaches the service. On any other system the recipe makes one podman info probe and, when that probe fails, prints a single line asking the user to start the container runtime first (podman machine start on macOS) before exiting 1. Proved by extracting the recipe body to a file and running bash -n on it, then running that body on this macOS host, where it printed the one line and exited 1 without reaching podman compose. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
justfile:33 skipped the SPA build whenever web/dist/index.html existed, but crates/walgit-server/build.rs:19-21 drops a placeholder index.html into web/dist on any cargo build of a fresh clone, so after the first cargo run just dev-local never built the real UI and served that placeholder page instead. The guard now tests web/dist/repos.js, which only a real Vite build produces and which Containerfile:23 already treats as the proof of one, and the message says the SPA is unbuilt rather than missing. Proved by moving the real web/dist aside and running the compiled walgit-server build script directly, which wrote the 220 byte placeholder index.html; against that tree the old condition skipped the build and the new one runs it, while against the restored Vite output the new condition stays quiet. The recipe body also passes bash -n after extraction, with and without just's {{config}} interpolation expanded.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tests/e2e.sh runs under set -euo pipefail, and bash 3.2, the /bin/bash macOS ships, calls the expansion of an empty array an unbound variable. The EXIT trap at line 73 therefore aborted on the PIDS expansion before rm -rf "$TMP" and leaked the temp directory, and the same expansion at lines 49, 51 and 56 stopped the run at its first health check. PIDS now takes the :- guard that tests/git-bundle-filter.sh:24 already uses, while the three argument lists take the +alternate form instead, because the :- form hands curl and git a blank argument they reject with "option : blank argument where content is expected". Proved on this macOS host with bash 3.2.57 by running tests/e2e.sh with WALGIT_E2E_BASE_URL pointed at a memory-backend server on loopback: before the change it died at line 56 with "AUTH_CURL_ARGS[@]: unbound variable", after it reaches the synth step and its mktemp directory is gone once the script exits. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tests/e2e.sh line 126 passed --config "$TMP/walgit.toml" to synth, but that file is written only by the heredoc at lines 92 to 108 inside the local-server branch, so a run with WALGIT_E2E_BASE_URL set died on its first command with "config file ... not found" and exit 2. synth reads nothing out of the config, since crates/walgit-cli/src/lib.rs:493 dispatches it with out, size, commits, files and seed alone, so the call now passes --config /dev/null, which crates/walgit-cli/src/lib.rs:451-455 names as the way to ask for defaults on purpose. That is one token against moving a seventeen line heredoc, and it also keeps remote mode from writing a config whose listen address and cache directory no server in that mode ever reads. Proved by running tests/e2e.sh with WALGIT_E2E_BASE_URL pointed at a memory-backend walgit on loopback, where it now passes every step from synth through DELETE repo, and by running the script in local mode, which still passes. Co-Authored-By: Claude Fable 5 <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.
#11 lists what breaks on a fresh macOS clone; #12 and #17 cover the docs and the port check and leave the recipes themselves alone (#17 says the socket bootstrap is best done separately). This is that part, one commit per fix.
just dev-storeran the rootless podman socket bootstrap on every OS, but/run/userandsetsidare Linux things, so on a Mac it died beforepodman compose up. The bootstrap is now Linux-only; elsewhere the recipe probespodman infoonce and, if that fails, tells you to start the machine.just dev-localskipped the SPA build wheneverweb/dist/index.htmlexisted, butbuild.rswrites a placeholderindex.htmlon any cargo build, so after the first build you got the placeholder page forever. The guard is nowweb/dist/repos.js, which only a real Vite build produces (theContainerfilealready checks that file).tests/e2e.shhad two bash 3.2 problems (the/bin/bashmacOS ships): empty arrays underset -uaborted the cleanup trap, leaking the temp dir, and killed remote mode at its first health check; and remote mode passedsyntha config file only the local branch writes. The arrays take the guardstests/git-bundle-filter.shalready uses, andsynthgets--config /dev/null.Checked on macOS with bash 3.2.57:
bash -non the script and both recipe bodies, and a full remote-mode run oftests/e2e.shagainst a memory-backend server on loopback, which now passes end to end; local mode still passes. The podman path past the probe wasn't exercised (no podman machine here).Same pass as #25, #26, #27, #28, #29.