[PR #3705] [Other] Mac: double-click launchers from source (START-HERE.command, SETUP/UPDATE/BENCH.command) #4754

Open
opened 2026-11-07 15:38:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/3705
Author: @OakRoller
Created: 10/22/2026
Status: 🔄 Open

Base: main ← Head: claude/practical-volta-drwpek


📝 Commits (2)

  • f3e65bc Mac: one-click install from source (START-HERE.command, SETUP/UPDATE/BENCH.command), the .bat files' counterparts
  • e3ed984 Mac docs: the source-zip links beside START-HERE.command point at Niko1221/Strata, where the launchers go

📊 Changes

12 files changed (+263 additions, -12 deletions)

View changed files

📝 .gitattributes (+1 -0)
➕ BENCH.command (+18 -0)
📝 README.md (+8 -3)
📝 README.zh-CN.md (+6 -2)
➕ SETUP.command (+3 -0)
➕ START-HERE.command (+24 -0)
➕ UPDATE.command (+24 -0)
📝 docs/INSTALL.md (+6 -3)
📝 docs/MAC.md (+9 -2)
📝 setup.sh (+6 -0)
➕ tools/test_mac_launchers.py (+152 -0)
📝 update.sh (+6 -2)

📄 Description

Problem and result

On a Mac the source install was terminal-only: ./setup.sh typed in a Terminal window. Windows has
START-HERE.bat, SETUP.bat, UPDATE.bat and BENCH.bat for people who do not want a terminal; a Mac had no
counterpart. Two smaller things on the same path: an Intel Mac ran setup.sh until the arm64 standalone Python it
had just downloaded failed to start, with no word about the chip; and update.sh told a Mac without git to use
apt.

After: four .command files beside the .bat files. A double-click in Finder opens Terminal, runs the .sh of the
same name from the Strata folder with the options passed on, and keeps the window open on an error so the reason
stays on screen. setup.sh tells an Intel Mac at once that the engine needs Apple Silicon and downloads nothing.
update.sh names xcode-select --install on a Mac. The default path on an Apple Silicon Mac is unchanged:
./setup.sh behaves as before, the .command files only call it.

none (no new feature in the engine, no change to a default; the launchers mirror the existing .bat files)

Approach

  • START-HERE.command runs sh ./setup.sh "$@"; SETUP.command is START-HERE.command --setup;
    UPDATE.command runs ./update.sh; BENCH.command runs ./bench.sh. Each cds to its own folder first
    (Terminal starts a double-clicked file in the home folder), refuses to run off a Mac with a pointer to the
    .sh/.bat, and waits for Enter after an error. UPDATE.command keeps its body in a function, as update.sh
    does, because the git pull it starts can change the file while it runs.
  • setup.sh: the Intel check is uname -s = Darwin, uname -m != arm64 and sysctl hw.optional.arm64 != 1.
    The third term keeps a Rosetta terminal (which reports x86_64 on an Apple Silicon Mac) on the normal path.
  • .gitattributes: *.command text eol=lf, so a Windows checkout with autocrlf does not break the launchers.
  • Docs: README.md and README.zh-CN.md (one line at the top, and the Mac paragraph under "Build from source"),
    docs/INSTALL.md ("From source: Mac"), docs/MAC.md (the "two ways in" list and the Install section). They also
    say what to do when macOS blocks a .command file from a downloaded zip the first time (right-click, Open).

Validation

Passed:

  • python -m unittest tools.test_mac_launchers at f3e65bc, Linux x86-64, Python 3.13: 11 tests OK. They copy the
    launchers next to stub setup.sh/update.sh/bench.sh and a stub uname/sysctl/curl on PATH, and check:
    the right script runs from its own folder with the options in order; the exit code is passed through and the
    "Press Enter" prompt appears only on an error; a non-Mac is refused; SETUP.command prepends --setup; each
    file is LF, executable, #!/bin/sh and passes sh -n; the real setup.sh stops an Intel Mac before curl is
    called, and goes on (to the Python download) on arm64 and in a Rosetta terminal.
  • python tools/test_setup_mac.py at f3e65bc, same machine: 26 tests OK (unchanged, run to show the Mac setup
    path is untouched).
  • python tools/test_setup_update.py: 8 tests OK.
  • sh -n on setup.sh, update.sh and the four .command files: clean.

Failed:
none observed

Not run:

  • Nothing on a real Mac: no Mac was available. Unverified: the Finder double-click itself, the Gatekeeper prompt
    on a zip download and the right-click-Open way around it, Terminal's window-closing behaviour after a clean exit,
    and sysctl hw.optional.arm64 in a Rosetta terminal. The code paths are the same sh lines the tests run on
    Linux.
  • No engine build (CUDA, HIP, SYCL, Metal): no engine source is touched.

Limits

  • A .command file from a downloaded zip is blocked by Gatekeeper once; the docs give the right-click step. A
    git clone has no quarantine mark. Signing the scripts is out of scope.
  • .command opens Terminal, so the model still runs in a Terminal window (closing it stops the model, as the
    .bat window does on Windows). It is not a .app; the .dmg remains the no-terminal way.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/3705 **Author:** [@OakRoller](https://github.com/OakRoller) **Created:** 10/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `claude/practical-volta-drwpek` --- ### 📝 Commits (2) - [`f3e65bc`](https://github.com/Niko1221/Strata/commit/f3e65bcb0a9a2bef96f918d51f67a87eabf5f66a) Mac: one-click install from source (START-HERE.command, SETUP/UPDATE/BENCH.command), the .bat files' counterparts - [`e3ed984`](https://github.com/Niko1221/Strata/commit/e3ed984df7caee360824ddd215df5bc7019ecfc8) Mac docs: the source-zip links beside START-HERE.command point at Niko1221/Strata, where the launchers go ### 📊 Changes **12 files changed** (+263 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `.gitattributes` (+1 -0) ➕ `BENCH.command` (+18 -0) 📝 `README.md` (+8 -3) 📝 `README.zh-CN.md` (+6 -2) ➕ `SETUP.command` (+3 -0) ➕ `START-HERE.command` (+24 -0) ➕ `UPDATE.command` (+24 -0) 📝 `docs/INSTALL.md` (+6 -3) 📝 `docs/MAC.md` (+9 -2) 📝 `setup.sh` (+6 -0) ➕ `tools/test_mac_launchers.py` (+152 -0) 📝 `update.sh` (+6 -2) </details> ### 📄 Description ## Problem and result On a Mac the source install was terminal-only: `./setup.sh` typed in a Terminal window. Windows has `START-HERE.bat`, `SETUP.bat`, `UPDATE.bat` and `BENCH.bat` for people who do not want a terminal; a Mac had no counterpart. Two smaller things on the same path: an Intel Mac ran `setup.sh` until the arm64 standalone Python it had just downloaded failed to start, with no word about the chip; and `update.sh` told a Mac without git to use `apt`. After: four `.command` files beside the `.bat` files. A double-click in Finder opens Terminal, runs the `.sh` of the same name from the Strata folder with the options passed on, and keeps the window open on an error so the reason stays on screen. `setup.sh` tells an Intel Mac at once that the engine needs Apple Silicon and downloads nothing. `update.sh` names `xcode-select --install` on a Mac. The default path on an Apple Silicon Mac is unchanged: `./setup.sh` behaves as before, the `.command` files only call it. ## Related discussion none (no new feature in the engine, no change to a default; the launchers mirror the existing `.bat` files) ## Approach - `START-HERE.command` runs `sh ./setup.sh "$@"`; `SETUP.command` is `START-HERE.command --setup`; `UPDATE.command` runs `./update.sh`; `BENCH.command` runs `./bench.sh`. Each `cd`s to its own folder first (Terminal starts a double-clicked file in the home folder), refuses to run off a Mac with a pointer to the `.sh`/`.bat`, and waits for Enter after an error. `UPDATE.command` keeps its body in a function, as `update.sh` does, because the `git pull` it starts can change the file while it runs. - `setup.sh`: the Intel check is `uname -s = Darwin`, `uname -m != arm64` and `sysctl hw.optional.arm64 != 1`. The third term keeps a Rosetta terminal (which reports x86_64 on an Apple Silicon Mac) on the normal path. - `.gitattributes`: `*.command text eol=lf`, so a Windows checkout with autocrlf does not break the launchers. - Docs: README.md and README.zh-CN.md (one line at the top, and the Mac paragraph under "Build from source"), docs/INSTALL.md ("From source: Mac"), docs/MAC.md (the "two ways in" list and the Install section). They also say what to do when macOS blocks a `.command` file from a downloaded zip the first time (right-click, Open). ## Validation **Passed:** - `python -m unittest tools.test_mac_launchers` at f3e65bc, Linux x86-64, Python 3.13: 11 tests OK. They copy the launchers next to stub `setup.sh`/`update.sh`/`bench.sh` and a stub `uname`/`sysctl`/`curl` on PATH, and check: the right script runs from its own folder with the options in order; the exit code is passed through and the "Press Enter" prompt appears only on an error; a non-Mac is refused; `SETUP.command` prepends `--setup`; each file is LF, executable, `#!/bin/sh` and passes `sh -n`; the real `setup.sh` stops an Intel Mac before `curl` is called, and goes on (to the Python download) on arm64 and in a Rosetta terminal. - `python tools/test_setup_mac.py` at f3e65bc, same machine: 26 tests OK (unchanged, run to show the Mac setup path is untouched). - `python tools/test_setup_update.py`: 8 tests OK. - `sh -n` on `setup.sh`, `update.sh` and the four `.command` files: clean. **Failed:** none observed **Not run:** - Nothing on a real Mac: no Mac was available. Unverified: the Finder double-click itself, the Gatekeeper prompt on a zip download and the right-click-Open way around it, Terminal's window-closing behaviour after a clean exit, and `sysctl hw.optional.arm64` in a Rosetta terminal. The code paths are the same `sh` lines the tests run on Linux. - No engine build (CUDA, HIP, SYCL, Metal): no engine source is touched. ## Limits - A `.command` file from a downloaded zip is blocked by Gatekeeper once; the docs give the right-click step. A `git clone` has no quarantine mark. Signing the scripts is out of scope. - `.command` opens Terminal, so the model still runs in a Terminal window (closing it stops the model, as the `.bat` window does on Windows). It is not a `.app`; the `.dmg` remains the no-terminal way. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4754
No description provided.