Bug 197910 - devel/ninja: MAKE_JOBS behavior differs from make
Summary: devel/ninja: MAKE_JOBS behavior differs from make
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Antoine Brodin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-22 02:51 UTC by Lawrence Chen
Modified: 2015-06-13 03:32 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gblach)
gblach: exp-run?


Attachments
Set _MAKE_JOBS= -j1 if DISABLE_MAKE_JOBS is set (369 bytes, patch)
2015-04-07 14:19 UTC, Grzegorz Blach
no flags Details | Diff
proposed patch (699 bytes, patch)
2015-04-08 14:25 UTC, Antoine Brodin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lawrence Chen 2015-02-22 02:51:19 UTC
Not sure whether its actually a bug in ninja, or a bug in Mk/bsd.port.mk

poudriere will now and then lock up and reboot my system, in what would appear to be a compiler storm.  Even though poudriere has set DISABLE_MAKE_JOBS.

The problem bsd.port.mk does "_MAKE_JOBS= #" when it is to be disabled, as make's default behavior is to not do more than one job at a time.

However, ninja does parallelism by default, a -j1 is needed to disable it.

Worse, ninja does 2 jobs, on single cpu systems, and 3 jobs on dual cpu systems, and systems with more 3 or more, it does ncpu+2.

I'm only doing 4 jobs in poudriere, so instead of doing up to 4 compiles at a time...its trying to do 13 comiles at a time.  Which it does for an hour or two, until it hits some spot and almost everything freezes (desktop is frozen, can't ssh in, but disks continue churning until the system reboots.  Probably due to watchdog.

So, evidently the work around to this problem is to put chromium into ALLOW_MAKE_JOBS_PACKAGES, and making MAKE_JOBS_NUMBER_LIMIT=1 :p

Though I in my situation, I do have MAKE_JOBS_NUMBER_LIMIT set higher, namely for libreoffice...which is usually the last port remaining, and will take near 24 hours to build without MAKE_JOBS.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-02-22 02:51:19 UTC
Auto-assigned to maintainer gblach@FreeBSD.org
Comment 2 Grzegorz Blach freebsd_committer freebsd_triage 2015-04-07 14:19:24 UTC
Created attachment 155305 [details]
Set _MAKE_JOBS= -j1 if DISABLE_MAKE_JOBS is set
Comment 3 Antoine Brodin freebsd_committer freebsd_triage 2015-04-07 15:49:54 UTC
I am pondering _MAKE_JOBS= vs _MAKE_JOBS?= , so that the following ports can continue overriding _MAKE_JOBS (they do this because they already set the number of jobs in the configure phase):

editors/libreoffice/Makefile:_MAKE_JOBS=        #
java/openjdk8/Makefile:_MAKE_JOBS=      #
java/openjdk7/Makefile:_MAKE_JOBS=      #
Comment 4 Baptiste Daroussin freebsd_committer freebsd_triage 2015-04-07 19:51:12 UTC
Beside it should be ?= it looks good to me
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2015-04-07 19:55:03 UTC
I will exp-run with ?=
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2015-04-08 14:25:52 UTC
Created attachment 155340 [details]
proposed patch

Here is a proposed patch
Comment 8 commit-hook freebsd_committer freebsd_triage 2015-04-10 05:46:09 UTC
A commit references this bug:

Author: antoine
Date: Fri Apr 10 05:45:16 UTC 2015
New revision: 383692
URL: https://svnweb.freebsd.org/changeset/ports/383692

Log:
  - Make it possible to override _MAKE_JOBS when MAKE_JOBS_NUMBER=1
  - Override it for USES=ninja
  With this commit and r383571, ports using ninja and waf now respect
  MAKE_JOBS_NUMBER when it's equal to 1

  PR:		197910
  With hat:	portmgr

Changes:
  head/Mk/Uses/ninja.mk
  head/Mk/bsd.port.mk
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2015-04-10 05:46:51 UTC
A fix has been committed.
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-06-13 03:32:24 UTC
A commit references this bug:

Author: bdrewery
Date: Sat Jun 13 03:32:10 UTC 2015
New revision: 389315
URL: https://svnweb.freebsd.org/changeset/ports/389315

Log:
  MFH: r383692

  - Make it possible to override _MAKE_JOBS when MAKE_JOBS_NUMBER=1
  - Override it for USES=ninja
  With this commit and r383571, ports using ninja and waf now respect
  MAKE_JOBS_NUMBER when it's equal to 1

  PR:		197910
  With hat:	portmgr

Changes:
_U  branches/2015Q2/
  branches/2015Q2/Mk/Uses/ninja.mk
  branches/2015Q2/Mk/bsd.port.mk