Skip to content

fix(macos): support Homebrew installs and find ctrace on PATH - #25

Merged
Arthurvroum merged 2 commits into
mainfrom
fix/macos-support
Oct 16, 2026
Merged

Arthurvroum merged 2 commits into
mainfrom
fix/macos-support

Conversation

@cedricroulof

@cedricroulof cedricroulof commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On macOS:

  • Dependency installer printed Unrecognized package manager and getent: command not found, and chown user:user silently failed (macOS group is staff), leaving ~/.coretrace/tools root-owned.
  • After install, Ctrace binary could not be found or downloaded: upstream releases (v0.84.0) only ship linux-amd64/linux-arm64, so there is nothing to download for darwin.

Changes

  • DependencyInstaller.ts: Homebrew branch (brew run as $SUDO_USER since it refuses root), eval echo ~$SUDO_USER instead of getent, chown -R "$TOOLS_OWNER" without group.
  • BinaryLocator.ts / BinaryUpdater.ts: last-resort fallback to ctrace/coretrace on PATH.
  • extension.ts: error lists PATH as checked and, on macOS, explains no prebuilt binary exists.

Testing

  • npm run compile OK, 30 tests passing, bash -n on generated script OK.
  • Homebrew branch not yet run end-to-end under sudo on a Mac.

Follow-up

Real fix for macOS binaries: publish a darwin-arm64 asset in coretrace release CI; getAssetForPlatform already matches darwin/macos.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T00:36:46.001048Z 25694c2 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment on lines +124 to +125
// Bundled was already checked at the top; last resort is a user-installed ctrace.
return await locateBinaryOnPath();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.

@Arthurvroum Arthurvroum left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Arthurvroum
Arthurvroum merged commit e7b8f72 into main Oct 16, 2026
6 checks passed
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