Skip to content

Fix spurious nproc error on non-Linux hosts in beacon build#339

Open
slimwang wants to merge 1 commit into
Adaptix-Framework:mainfrom
slimwang:fix/nproc-macos-build
Open

Fix spurious nproc error on non-Linux hosts in beacon build#339
slimwang wants to merge 1 commit into
Adaptix-Framework:mainfrom
slimwang:fix/nproc-macos-build

Conversation

@slimwang

@slimwang slimwang commented Jun 11, 2026

Copy link
Copy Markdown

Problem

Building the server extenders on macOS prints:

make[2]: nproc: No such file or directory

AdaptixServer/extenders/beacon_agent/src_beacon/Makefile calls nproc unconditionally to set the parallel job count. nproc is a GNU coreutils tool and isn't present on macOS (or other non-GNU systems), so the command fails. The build still completes, but the error is misleading noise.

Note: the top-level Makefile already guards this with a uname -s check — only the beacon sub-Makefile was missing the equivalent.

Fix

Resolve the core count portably:

NPROC := $(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
  • Linux: nproc
  • macOS/BSD: sysctl -n hw.ncpu
  • fallback: 4

No more spurious error, and -j$(NPROC) now gets a real value on all platforms.

Testing

make server-ext on macOS — build completes with no nproc error.

The beacon src_beacon Makefile called `nproc` unconditionally to set
parallel jobs, which fails on macOS (and other systems without GNU
coreutils) with `nproc: No such file or directory`. The build still
succeeded but printed a spurious error.

Fall back to `sysctl -n hw.ncpu` on macOS, then to 4, so the job count
is resolved cleanly on all platforms.
@slimwang slimwang force-pushed the fix/nproc-macos-build branch from 7abd522 to 0e779e4 Compare June 11, 2026 02:46
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