Create ~/.fleet on first make serve#46521
Conversation
`make serve` writes ./build/fleet's default invocation to ~/.fleet/last-serve-invocation, both when FORWARDED_ARGS is empty (the default-invocation seed path) and when FORWARDED_ARGS is set (the save-invocation path). Neither branch creates the ~/.fleet directory first, so on a fresh machine the redirect fails with "No such file or directory" and the target aborts before fleet ever starts. Add `mkdir -p ~/.fleet` once at the top of the recipe so both branches have a directory to write into.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
This PR fixes make serve startup on fresh machines by ensuring the ~/.fleet directory exists before the default serve recipe writes ~/.fleet/last-serve-invocation.
Changes:
- Adds an idempotent
mkdir -p ~/.fleetbefore the defaultservebranch writes or seeds the last invocation file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
WalkthroughThe 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Makefile (1)
180-180:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRESET branch has the same missing directory issue.
The RESET branch tries to
touch ~/.fleet/last-serve-invocationwithout ensuring~/.fleetexists, so it will fail with "No such file or directory" on a fresh machine (the same issue fixed by line 185 for the default branch).🐛 Proposed fix
- `@touch` ~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation + `@mkdir` -p ~/.fleet && rm -f ~/.fleet/last-serve-invocation🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` at line 180, The RESET branch's Makefile target runs the command "`@touch` ~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation" without creating the parent directory; update that target (the line that contains the touch/rm invocation) to ensure the ~/.fleet directory exists first (e.g., run mkdir -p ~/.fleet or equivalent) before touching the file so the touch won't fail on a fresh machine.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@Makefile`:
- Line 180: The RESET branch's Makefile target runs the command "`@touch`
~/.fleet/last-serve-invocation && rm ~/.fleet/last-serve-invocation" without
creating the parent directory; update that target (the line that contains the
touch/rm invocation) to ensure the ~/.fleet directory exists first (e.g., run
mkdir -p ~/.fleet or equivalent) before touching the file so the touch won't
fail on a fresh machine.
Summary
make servewrites to~/.fleet/last-serve-invocationin both branches of its main recipe (save-invocation whenFORWARDED_ARGSis set, default-seed when it's empty), but neither branch creates the~/.fleetdirectory first.No such file or directoryand the target aborts before./build/fleetis ever invoked.mkdir -p ~/.fleetto the recipe so both branches have a directory to write into.Test plan
~/.fleet,make servepreviously failed withNo such file or directory; with this patch it creates the directory, seeds the default invocation, and starts fleet.~/.fleet/last-serve-invocation, behavior is unchanged (mkdir -pis a no-op).Follow-ups (not in this PR)
RESETbranch (make serve RESET=1, line 180) usestouch ~/.fleet/last-serve-invocation && rm ...which has the same gap on a fresh machine. Worth fixing in a follow-up if anyone hits it.SHOWbranch (line 170) handles missing files via$?and gracefully no-ops, so it's fine.Summary by CodeRabbit