Page MenuHomeFreeBSD

Use nproc(1) instead of sysctl kern.smp.cpus
ClosedPublic

Authored by mjg on Feb 8 2023, 9:30 PM.
Tags
None
Referenced Files
F82857364: D38457.diff
Fri, May 3, 6:39 AM
Unknown Object (File)
Mon, Apr 22, 4:06 PM
Unknown Object (File)
Mon, Apr 22, 4:06 PM
Unknown Object (File)
Mon, Apr 22, 4:00 PM
Unknown Object (File)
Mon, Apr 22, 4:00 PM
Unknown Object (File)
Mon, Apr 22, 3:27 PM
Unknown Object (File)
Dec 28 2023, 4:38 AM
Unknown Object (File)
Dec 28 2023, 4:38 AM
Subscribers

Details

Summary

The former respects cpuset, while the latter does not.

$ cpuset -l 1 -- make -V MAKE_JOBS_NUMBER
1

As nproc is newly introduced, keep the previous variant as a fallback for the time being.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mjg requested review of this revision.Feb 8 2023, 9:30 PM
mjg created this revision.
This revision is now accepted and ready to land.Feb 9 2023, 12:37 AM
mandree added a subscriber: mandree.
This comment was removed by mandree.
bdrewery requested changes to this revision.Feb 9 2023, 6:32 PM
bdrewery added a subscriber: bdrewery.
bdrewery added inline comments.
Mk/bsd.port.mk
2044

This should be ${NPROC} and a new NPROC?= line added in Mk/bsd.commands.mk.

This revision now requires changes to proceed.Feb 9 2023, 6:32 PM
mjg marked an inline comment as done.Feb 9 2023, 6:45 PM
This revision is now accepted and ready to land.Feb 9 2023, 6:46 PM

I didn't mean to "accept as portmgr".

Note this introduces an extra PATH search for systems that do NOT yet have nproc so perhaps we need to add some OSVERSION switch here.

This revision was automatically updated to reflect the committed changes.