Fix spurious nproc error on non-Linux hosts in beacon build#339
Open
slimwang wants to merge 1 commit into
Open
Fix spurious nproc error on non-Linux hosts in beacon build#339slimwang wants to merge 1 commit into
slimwang wants to merge 1 commit into
Conversation
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.
7abd522 to
0e779e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building the server extenders on macOS prints:
AdaptixServer/extenders/beacon_agent/src_beacon/Makefilecallsnprocunconditionally to set the parallel job count.nprocis 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
Makefilealready guards this with auname -scheck — only the beacon sub-Makefile was missing the equivalent.Fix
Resolve the core count portably:
nprocsysctl -n hw.ncpu4No more spurious error, and
-j$(NPROC)now gets a real value on all platforms.Testing
make server-exton macOS — build completes with nonprocerror.