Skip to content

fix(macos): follow the log by name in dev-run.sh --log - #22

Open
PCcoding666 wants to merge 1 commit into
masterfrom
fix/macos-dev-run-log-follow
Open

PCcoding666 wants to merge 1 commit into
masterfrom
fix/macos-dev-run-log-follow

Conversation

@PCcoding666

Copy link
Copy Markdown
Owner

Summary

Scripts/dev-run.sh --log never shows the new run's log lines.

At launch, the app recreates ~/Library/Logs/LCTMac.log with FileManager.createFile(atPath:contents:) in applicationDidFinishLaunching. That call replaces the file with a new inode. dev-run.sh starts tail -f right after open, before the app has finished launching. So tail -f keeps following the old, deleted file: it prints the previous run's tail and then nothing.

Change

--log now runs tail -F, which follows the path and reopens it when the file is replaced. The usage comment is updated too.

Test plan

  • Confirmed the cause:
    • after createFile(atPath:contents: nil) on an existing file, the inode changed (90844092 → 90844094);
    • with the same replace-then-write sequence the app performs, tail -f printed only the old line, while tail -F also printed the new one.
  • New DevRunTests.testDevRun_Log_FollowsLogFileByName uses a stubbed tail and asserts that --log runs tail -F on the log path. It fails against the old script.
  • cd macos && ./Scripts/run_tests.sh: debug, release and -warnings-as-errors builds pass, and all 523 tests pass with 0 failures.

🤖 Generated with Claude Code

The app recreates ~/Library/Logs/LCTMac.log with
FileManager.createFile(atPath:contents:) in applicationDidFinishLaunching,
which replaces the file with a new inode. That usually happens after
dev-run.sh has already started `tail -f`, so tail kept following the
old, deleted file and --log never showed the new run's lines. Use
`tail -F`, which reopens the path when the file is replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 11, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants