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 16:42:16 -0500 Message-ID: <20171022164216.5fdf9f55@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> 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]:34971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6Shm-0006cR-Pq for bug-guix@gnu.org; Sun, 22 Oct 2017 22:43:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6Shh-00024s-Uy for bug-guix@gnu.org; Sun, 22 Oct 2017 22:43:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6Shh-00024m-QW for bug-guix@gnu.org; Sun, 22 Oct 2017 22:43:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87a80iws1q.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 18:50:57 -0700 ludo@gnu.org (Ludovic Court=C3=A8s) wrote: > Hi Maxim, >=20 > Maxim Cournoyer skribis: >=20 > > Ludovic Court=C3=A8s writes: > > =20 > >> * guix/build/compile.scm: New file. > >> * Makefile.am (MODULES): Add it. > >> * build-aux/compile-all.scm: Use it. > >> (warnings, file->module, load-module-file) > >> (%default-optimizations, %lightweight-optimizations) > >> (optimization-options, compile-file*): Remove. > >> : Use 'compile-files'. > >> * guix/build/pull.scm (%default-optimizations) > >> (%lightweight-optimizations, optimization-options): Remove. > >> (build-guix): Rewrite as a call to 'compile-files'. > >> * guix/discovery.scm (file-name->module-name): Export. > >> --- > >> Makefile.am | 1 + > >> build-aux/compile-all.scm | 92 ++++---------------------- > >> guix/build/compile.scm | 165 +++++++++++++++++++++++++++++++++++++= +++++++++ > >> guix/build/pull.scm | 105 ++++++++--------------------- > >> guix/discovery.scm | 4 +- > >> 5 files changed, 209 insertions(+), 158 deletions(-) > >> create mode 100644 guix/build/compile.scm =20 > > > > [...] > > > > This and the other patches in this series look fine to me. =20 >=20 > Awesome, thanks for looking. >=20 [...] > Speaking of the =E2=80=9Cmake -j=E2=80=9D patch, on IRC Eric Bavier sugge= sted that it > didn=E2=80=99t work as advertised because $MAKEFLAGS didn=E2=80=99t conta= in the =E2=80=9C-j=E2=80=9D > flag; I just checked and it does contain it here (with GNU=C2=A0make 4.2.= 1). > So no problem after all? The behavior changed in version 4.2. From the Changelog: 2016-04-04 Paul Smith Preserve the real value of -jN in MAKEFLAGS using jobserver. Previously if the jobserver was active, MAKEFLAGS would contain only the -j option but not the number (not -j5 or whatever) so users could not discover that value. Allow that value to be provided in MAKEFLAGS without error but still give warnings if -jN is provided on the command line if the jobserver is already activated. * NEWS: Discuss the new behavior. * os.h, posixos.c, w32/w32os.c: Return success/failure from jobserver_setup() and jobserver_parse_auth(). * main.c (main): Separate the command line storage of job slots (now in arg_job_slots) from the control storage (in job_slots). Make a distinction between -jN flags read from MAKEFLAGS and those seen on the command line: for the latter if the jobserver is enabled then warn and disable it, as before. * tests/scripts/features/jobserver: Add new testing. And from NEWS for the 4.2 release: * The amount of parallelism can be determined by querying MAKEFLAGS, even w= hen the job server is enabled (previously MAKEFLAGS would always contain only "-j", with no number, when job server was enabled). It Would Be Nice if the functionality worked for older versions of make that people might have on their systems. 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? `~Eric