A1: macOS readiness: setup guide, cargo xtask mac-report, unix/macOS fixes

- docs/macos.md: step-by-step setup for a fresh Apple Silicon Mac (Xcode
  CLT, Homebrew, git, PHP, Composer, Node 22, pnpm, rustup, clone from
  Forgejo), the machine report, Gatekeeper notes, macOS differences and
  what Windows cannot check.
- cargo xtask mac-report: versions, the gate steps, the bundled-UI desktop
  build and a self-check over the control channel (project, file,
  Phpactor, hover, git.status, terminal, screenshot, quit); every step
  times out and runs in a lutra_proc group; one report.md to send back.
- Fixes: macOS native menu (system menus only; Cmd+W stays buffer.close,
  Cmd+Q runs app.quit), xcap screenshot region in points on macOS
  (Retina), login shell (-l, /bin/zsh fallback) and LANG for the
  terminal on macOS, PHP lookup in Homebrew/MacPorts dirs for Finder
  starts, case-insensitive LSP path mapping on macOS, rendezvous file
  mode re-set to 0600, CLI-started desktop in its own process group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-10-31 14:47:45 +01:00
parent da58c83158
commit 1bf69ded55
18 changed files with 1795 additions and 36 deletions

View file

@ -971,13 +971,14 @@ fn clear_diagnostics(state: &mut State) {
}
}
/// `path` relative to `root`; `None` outside it. Windows paths compare
/// without regard to case, as the file system does.
/// `path` relative to `root`; `None` outside it. Windows and macOS paths
/// compare without regard to case, as their default file systems (NTFS,
/// APFS) do.
fn relative(root: &Path, path: &Path) -> Option<PathBuf> {
if let Ok(rel) = path.strip_prefix(root) {
return Some(rel.to_path_buf());
}
if !cfg!(windows) {
if !cfg!(any(windows, target_os = "macos")) {
return None;
}
let root_text = root.to_str()?.trim_end_matches(['\\', '/']);
@ -1119,6 +1120,13 @@ mod tests {
Some(PathBuf::from("b.php"))
);
}
if cfg!(target_os = "macos") {
assert_eq!(
relative(&root, Path::new("/WORK/Demo/b.php")),
Some(PathBuf::from("b.php"))
);
assert_eq!(relative(&root, Path::new("/WORK/Demo2/b.php")), None);
}
}
#[test]