Summary: | lang/ghc is not jobs-safe | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Nikolai Lifanov <lifanov> |
Component: | Individual Port(s) | Assignee: | freebsd-haskell (Nobody) <haskell> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Nikolai Lifanov
2014-02-17 04:10:00 UTC
Responsible Changed From-To: freebsd-ports-bugs->haskell Over to maintainer (via the GNATS Auto Assign Tool) Hi Nikolai, Yes, you were right, the build of GHC is not really thread-safe, so running this on multiple threads is going to fail at some point. I have been already notified about this by Baptiste (Daroussin) a few months ago when he did the experimental runs for activating multiple jobs by default. That is when I suggested to introduce a new variable called MAKE_JOBS_NUMBER_LIMIT to allow using multiple jobs but still in a careful fashion by setting a limit to the parallelization [1]. However, I am not sure this would prevent somebody from passing `-jN` directly to make(1). And I am not either sure if this is recommended at all. Instead, you should use MAKE_JOBS_NUMBER=N, that is: # make MAKE_JOBS_NUMBER=8 MAKE_JOBS_NUMBER is automatically set to the value of the hw.ncpu sysctl(3) variable. In that case, I could then add this MAKE_JOBS_NUMBER_LIMIT variable to the Makefile of lang/ghc so the port would allow parallel builds but only in a limited way. Can you please test if adding this line below to the Makefile fixes your problem? MAKE_JOBS_NUMBER_LIMIT= 4 Thanks! [1] http://svnweb.freebsd.org/changeset/ports/323100 On 2014-03-22 15:13, Gabor Pali wrote:
> Hi Nikolai,
>
> Yes, you were right, the build of GHC is not really thread-safe, so
> running this on multiple threads is going to fail at some point. I
> have been already notified about this by Baptiste (Daroussin) a few
> months ago when he did the experimental runs for activating multiple
> jobs by default.
>
> That is when I suggested to introduce a new variable called
> MAKE_JOBS_NUMBER_LIMIT to allow using multiple jobs but still in a
> careful fashion by setting a limit to the parallelization [1].
>
> However, I am not sure this would prevent somebody from passing `-jN`
> directly to make(1). And I am not either sure if this is recommended
> at all. Instead, you should use MAKE_JOBS_NUMBER=N, that is:
>
> # make MAKE_JOBS_NUMBER=8
>
> MAKE_JOBS_NUMBER is automatically set to the value of the hw.ncpu
> sysctl(3) variable. In that case, I could then add this
> MAKE_JOBS_NUMBER_LIMIT variable to the Makefile of lang/ghc so the
> port would allow parallel builds but only in a limited way.
>
> Can you please test if adding this line below to the Makefile fixes
> your problem?
>
> MAKE_JOBS_NUMBER_LIMIT= 4
>
> Thanks!
>
> [1] http://svnweb.freebsd.org/changeset/ports/323100
I verified that setting MAKE_JOBS_NUMBER_LIMIT= 4 fixes the build for
me. This is 4x better than marking it as jobs unsafe!
- Nikolai Lifanov
Author: pgj Date: Sun Mar 23 08:55:15 2014 New Revision: 348842 URL: http://svnweb.freebsd.org/changeset/ports/348842 QAT: https://qat.redports.org/buildarchive/r348842/ Log: - Limit built parallelism as GHC is not fully jobs-safe PR: ports/186829 Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> Obtained from: FreeBSD Haskell Modified: head/lang/ghc/Makefile Modified: head/lang/ghc/Makefile ============================================================================== --- head/lang/ghc/Makefile Sun Mar 23 08:09:29 2014 (r348841) +++ head/lang/ghc/Makefile Sun Mar 23 08:55:15 2014 (r348842) @@ -15,6 +15,8 @@ COMMENT= Compiler for the functional lan ONLY_FOR_ARCHS= i386 amd64 +MAKE_JOBS_NUMBER_LIMIT= 4 + GHC_VERSION= ${PORTVERSION} HSCOLOUR_VERSION= 1.20.3 _______________________________________________ svn-ports-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-ports-all To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org" State Changed From-To: open->patched Fixed in head. I, the submitter, verified that the commited patch fixes the build for me for all my systems (9.2-RELEASE, 10.0-RELEASE, 11.0-CURRENT, etc.). This PR can be closed. - Nikolai Lifanov 2014-03-26 0:00 GMT+01:00 Nikolai Lifanov <lifanov@mail.lifanov.com>: > This PR can be closed. Sorry that I have not yet closed the PR -- I just set the state the "patched", because I would like to merge this change to the 2014Q1 quarterly (stable) branch, if portmgr approves it. State Changed From-To: patched->closed The 2014Q1 is now closed, no merge is needed. So the PR can be closed. |