Skip to content

fix(detection): add sysctl hw.ncpu fallback for macOS in detection.sh - #5564

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/detection-macos-hw-ncpu-fallback
Open

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/detection-macos-hw-ncpu-fallback

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/installers/lib/detection.sh, get_host_logical_cpus() only queried nproc and /proc/cpuinfo before falling back to 1. On macOS and BSD systems where neither utility exists by default, core count was under-reported as 1.

Add sysctl -n hw.logicalcpu and sysctl -n hw.ncpu fallbacks to accurately identify host logical cores on macOS.

Validation

  • Baseline reproduction: environments lacking Linux nproc fell back to hardcoded 1 core.
  • Post-fix: test_detection_darwin_cpu_cores.py sources detection.sh and verifies positive integer core count.
  • Hardware detection suites: 1 passed. ShellCheck and diff checks pass; regression wired into Linux CI.

Overlap check

Searched live open/closed PRs by detection.sh. #5136 normalizes BSD paths; this complements it by improving CPU core discovery.

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens platform core discovery. Independent review remains a gate.

Follow-up integration evidence

Composed with #5136 at 5136 without conflicts. Hardware detection checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

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.

1 participant