From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: bug#27284: [PATCH 1/8] build: Factorize module compilation in (guix build compile). Date: Sun, 22 Oct 2017 17:52:53 -0500 Message-ID: <20171022175253.2b72da76@centurylink.net> References: <87poamv2i7.fsf@gnu.org> <20171020160557.27096-1-ludo@gnu.org> <20171020160557.27096-2-ludo@gnu.org> <87efpu5142.fsf@gmail.com> <87a80iws1q.fsf@gnu.org> <20171022164216.5fdf9f55@centurylink.net> <87r2tuvaot.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6TnV-00088p-RH for bug-guix@gnu.org; Sun, 22 Oct 2017 23:53:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6TnS-0004cE-Jq for bug-guix@gnu.org; Sun, 22 Oct 2017 23:53:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47790) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6TnS-0004c2-Ft for bug-guix@gnu.org; Sun, 22 Oct 2017 23:53:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87r2tuvaot.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 27284@debbugs.gnu.org, Maxim Cournoyer On Sun, 22 Oct 2017 19:51:14 -0700 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Heya, >=20 > Eric Bavier skribis: >=20 > > And from NEWS for the 4.2 release: > > > > * The amount of parallelism can be determined by querying MAKEFLAGS, ev= en when > > the job server is enabled (previously MAKEFLAGS would always contain = only > > "-j", with no number, when job server was enabled). =20 >=20 > Thanks for digging! I didn=E2=80=99t expect such things to ever change. >=20 > > It Would Be Nice if the functionality worked for older versions of make > > that people might have on their systems. =20 >=20 > With the patch I posted, Scheme compilation would always use one thread > per core, which is what it currently does in =E2=80=98master=E2=80=99. >=20 > That=E2=80=99s in argument in favor of the lazy in me: it=E2=80=99s an im= provement for > people using a reasonably recent system, and it=E2=80=99s not a regressio= n for > the others! :-) >=20 > WDYT? Indeed. Understood like that, it makes sense. >=20 > > Using the jobserver directly would require quite a bit of work for the > > current patch set, but I wonder if there is another way to determine > > the -jN parameter for make<4.2 that we could use. Maybe simply > > polling the jobserver fds at the start? =20 >=20 > AIUI the job server does not reveal how many jobs are allowed. It > merely grants you an execution token. >=20 > Or did you have something else in mind? The idea (hardely tested) would be to read tokens from the input fd until it blocks, do the scheme compiles with however many tokens were read, then write them back out. Crude, I guess, and probably error prone; compile-all.scm could be invoked when make has job tokens tied up building the daemon source... Anyhow, the current patch works well for me with a recent make. I'm content leaving further improvements to a future hypothetical hacker. :) `~Eric