macOS support: file-manager buttons, settings folder, memory budget #2

Manually merged
github merged 4 commits from gh-pr/2/head into gh-pr/2/base 2026-11-26 20:02:25 +00:00
Owner

@⁠vladbondarenko97 on GitHub · 2026-11-21 21:33 UTC · original
vladbondarenko97:macos-support → master · +166 −24 · 13 files · 4 commits · merged 2026-11-21 21:41 UTC

SixNG already builds and runs on macOS (Apple Silicon, Rust 1.100, brew install cmake); the GUI renders through Metal. Three things were Windows-only:

  1. File-manager buttons: every Show in Explorer / Open / Show / Open output folder button ran explorer.exe (audio view used xdg-open on macOS). They now go through open_path / reveal in sixng-gui/src/main.rs: explorer (/select,) on Windows, open / open -R on macOS, xdg-open on Linux. The label names the platform's file manager (Explorer / Finder / file manager).

  2. Settings fallback: when the folder next to the exe is not writable the GUI fell back to %APPDATA% only, and failed elsewhere. New sixng_core::user_settings_dir(): %APPDATA%\SixNG on Windows (unchanged), ~/Library/Application Support/SixNG on macOS, $XDG_CONFIG_HOME/SixNG or ~/.config/SixNG elsewhere. Used by both the CLI and the GUI.

  3. Map memory budget: mem::query() returned process = 0, avail = 8 GB on non-Windows, so the 3D map streamer never saw pressure and never evicted. On macOS it now reads hw.memsize, kern.memorystatus_level (percent of RAM available) and the process physical footprint (proc_pid_rusage, the figure Activity Monitor shows). libc was already in Cargo.lock; it is added only as a macOS target dependency.

  4. scripts/macos-app.sh builds dist/SixNG.app (GUI + CLI, icon from assets/logo, ad-hoc signed, not notarised). Inside a .app the GUI keeps settings and the default work folder in ~/Library/Application Support/SixNG rather than next to the exe, since writing into a bundle breaks its signature. Plain binaries behave as before (portable, next to the exe).

Plus a short macOS section in the README.

Windows code paths are unchanged (same commands and arguments).

Tested on macOS 27 / Apple Silicon: cargo build --release clean, cargo test --release passes (two new tests: settings dir, and macOS memory figures cross-checked against sysctl: 48 GB total, ~32 GB available), CLI info / index / list on a real install, GUI starts; SixNG.app launches from Finder and its setup wizard defaults the work folder to ~/Library/Application Support/SixNG/work. Not built on Windows (no Windows machine here).

🤖 Generated with Claude Code

**@⁠vladbondarenko97** on GitHub · 2026-11-21 21:33 UTC · [original](https://github.com/holdmysocks/SixNG/pull/2) `vladbondarenko97:macos-support` → `master` · +166 −24 · 13 files · 4 commits · merged 2026-11-21 21:41 UTC SixNG already builds and runs on macOS (Apple Silicon, Rust 1.100, `brew install cmake`); the GUI renders through Metal. Three things were Windows-only: 1. **File-manager buttons**: every *Show in Explorer* / *Open* / *Show* / *Open output folder* button ran `explorer.exe` (audio view used `xdg-open` on macOS). They now go through `open_path` / `reveal` in `sixng-gui/src/main.rs`: `explorer` (`/select,`) on Windows, `open` / `open -R` on macOS, `xdg-open` on Linux. The label names the platform's file manager (Explorer / Finder / file manager). 2. **Settings fallback**: when the folder next to the exe is not writable the GUI fell back to `%APPDATA%` only, and failed elsewhere. New `sixng_core::user_settings_dir()`: `%APPDATA%\SixNG` on Windows (unchanged), `~/Library/Application Support/SixNG` on macOS, `$XDG_CONFIG_HOME/SixNG` or `~/.config/SixNG` elsewhere. Used by both the CLI and the GUI. 3. **Map memory budget**: `mem::query()` returned `process = 0, avail = 8 GB` on non-Windows, so the 3D map streamer never saw pressure and never evicted. On macOS it now reads `hw.memsize`, `kern.memorystatus_level` (percent of RAM available) and the process physical footprint (`proc_pid_rusage`, the figure Activity Monitor shows). `libc` was already in `Cargo.lock`; it is added only as a macOS target dependency. 4. **`scripts/macos-app.sh`** builds `dist/SixNG.app` (GUI + CLI, icon from `assets/logo`, ad-hoc signed, not notarised). Inside a `.app` the GUI keeps settings and the default work folder in `~/Library/Application Support/SixNG` rather than next to the exe, since writing into a bundle breaks its signature. Plain binaries behave as before (portable, next to the exe). Plus a short macOS section in the README. Windows code paths are unchanged (same commands and arguments). **Tested** on macOS 27 / Apple Silicon: `cargo build --release` clean, `cargo test --release` passes (two new tests: settings dir, and macOS memory figures cross-checked against `sysctl`: 48 GB total, ~32 GB available), CLI `info` / `index` / `list` on a real install, GUI starts; `SixNG.app` launches from Finder and its setup wizard defaults the work folder to `~/Library/Application Support/SixNG/work`. Not built on Windows (no Windows machine here). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Show in Explorer / Open / Show buttons called explorer.exe on every
platform; they now use open (macOS) or xdg-open (Linux) through one helper,
and the label names the platform's file manager.

The settings fallback only knew %APPDATA%; add sixng_core::user_settings_dir
(~/Library/Application Support/SixNG on macOS, XDG config dir elsewhere)
and use it in the CLI and GUI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Non-Windows builds reported process = 0 and avail = 8 GB, so the map
streamer never saw memory pressure and never evicted. On macOS read
hw.memsize, kern.memorystatus_level and the process physical footprint
(proc_pid_rusage). libc was already in Cargo.lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bundles the GUI and CLI with an icon from assets/logo and an ad-hoc
signature. Inside a .app the GUI keeps settings and the default work
folder in ~/Library/Application Support/SixNG instead of next to the exe
(writing into the bundle breaks its signature).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:02:23 +00:00
github manually merged commit eeea64fefc into gh-pr/2/base 2026-11-26 20:02:25 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.