Skip to content

Make local development work on macOS - #36

Open
0bserver07 wants to merge 4 commits into
tobi:mainfrom
0bserver07:fix/local-dev-on-macos
Open

Make local development work on macOS#36
0bserver07 wants to merge 4 commits into
tobi:mainfrom
0bserver07:fix/local-dev-on-macos

Conversation

@0bserver07

Copy link
Copy Markdown

#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-store ran the rootless podman socket bootstrap on every OS, but /run/user and setsid are Linux things, so on a Mac it died before podman compose up. The bootstrap is now Linux-only; elsewhere the recipe probes podman info once and, if that fails, tells you to start the machine.
  • just dev-local skipped the SPA build whenever web/dist/index.html existed, but build.rs writes a placeholder index.html on any cargo build, so after the first build you got the placeholder page forever. The guard is now web/dist/repos.js, which only a real Vite build produces (the Containerfile already checks that file).
  • tests/e2e.sh had two bash 3.2 problems (the /bin/bash macOS ships): empty arrays under set -u aborted the cleanup trap, leaking the temp dir, and killed remote mode at its first health check; and remote mode passed synth a config file only the local branch writes. The arrays take the guards tests/git-bundle-filter.sh already uses, and synth gets --config /dev/null.

Checked on macOS with bash 3.2.57: bash -n on the script and both recipe bodies, and a full remote-mode run of tests/e2e.sh against 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.

0bserver07 and others added 4 commits August 27, 2026 00:16
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant