Repository navigation
fix(macos): support Homebrew installs and find ctrace on PATH - #25
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25694c227b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| elif command -v brew >/dev/null 2>&1; then | ||
| echo "Detected macOS (Homebrew)." | ||
| # Homebrew refuses to run as root, so install as the invoking user. | ||
| sudo -u "\${SUDO_USER:-$(id -un)}" brew install cppcheck flawfinder cmake python3 || true |
There was a problem hiding this comment.
Install IKOS in the Homebrew branch
On a clean macOS installation, this command installs cppcheck, flawfinder, cmake, and Python but never installs IKOS; the later setup only links ikos when it already exists. Consequently, post-install verification adds ikos to the missing list and installDependencies reports failure, so the new Homebrew path cannot complete the advertised all-analyzer installation unless the user had separately installed IKOS.
Useful? React with 👍 / 👎.
| // Bundled was already checked at the top; last resort is a user-installed ctrace. | ||
| return await locateBinaryOnPath(); |
There was a problem hiding this comment.
Throttle release checks when using the PATH binary
When macOS has a working PATH-installed binary but the release response has no Darwin asset, every analysis reaches this fallback only after another GitHub API request. Although line 105 records coretrace-last-update-check, the earlier throttle applies only when downloadedBinaryPath exists, so this successful no-asset case is never throttled; each scan incurs network latency and can exhaust the unauthenticated API limit. Reuse the PATH binary while honoring the update interval, or check it before attempting a download.
Useful? React with 👍 / 👎.
- Install script: add Homebrew branch (run as $SUDO_USER), replace Linux-only getent, chown without assuming a same-named group. - No prebuilt macOS release exists upstream: fall back to ctrace on PATH and explain this in the error message on darwin.
25694c2 to
83262a5
Compare
Problem
On macOS:
Unrecognized package managerandgetent: command not found, andchown user:usersilently failed (macOS group isstaff), leaving~/.coretrace/toolsroot-owned.Ctrace binary could not be found or downloaded: upstream releases (v0.84.0) only shiplinux-amd64/linux-arm64, so there is nothing to download for darwin.Changes
DependencyInstaller.ts: Homebrew branch (brewrun as$SUDO_USERsince it refuses root),eval echo ~$SUDO_USERinstead ofgetent,chown -R "$TOOLS_OWNER"without group.BinaryLocator.ts/BinaryUpdater.ts: last-resort fallback toctrace/coretraceonPATH.extension.ts: error lists PATH as checked and, on macOS, explains no prebuilt binary exists.Testing
npm run compileOK, 30 tests passing,bash -non generated script OK.sudoon a Mac.Follow-up
Real fix for macOS binaries: publish a
darwin-arm64asset in coretrace release CI;getAssetForPlatformalready matchesdarwin/macos.