From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] build: pull: Compile .scm files in one process. Date: Thu, 05 Nov 2015 22:06:43 +0100 Message-ID: <87611gdul8.fsf@gnu.org> References: <87si4kxtge.fsf@T420.taylan> 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]:41620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZuRk9-0004Zn-TP for guix-devel@gnu.org; Thu, 05 Nov 2015 16:06:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZuRk6-0000C8-KR for guix-devel@gnu.org; Thu, 05 Nov 2015 16:06:49 -0500 In-Reply-To: <87si4kxtge.fsf@T420.taylan> ("Taylan Ulrich \=\?utf-8\?Q\?\=5C\=22Bay\=C4\=B1rl\=C4\=B1\=2FKammer\=5C\=22\=22's\?\= message of "Thu, 05 Nov 2015 18:10:57 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Taylan Ulrich =?utf-8?Q?=22Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer=22?= Cc: guix-devel@gnu.org taylanbayirli@gmail.com (Taylan Ulrich "Bay=C4=B1rl=C4=B1/Kammer") skribis: > It used to take ~18 minutes on my machine, now less than 3. Sounds compelling. :-) > From fd5d9bf77fd38fad354d66c31e57bc9bbc86481f Mon Sep 17 00:00:00 2001 > From: =3D?UTF-8?q?Taylan=3D20Ulrich=3D20Bay=3DC4=3DB1rl=3DC4=3DB1/Kammer?= =3D > > Date: Thu, 5 Nov 2015 16:21:48 +0100 > Subject: [PATCH] build: pull: Compile .scm files in one process. > > * guix/build/pull.scm (call-with-process): Removed procedure. > (report-build-progress): Removed procedure. > (p-for-each): Removed procedure. > (build-guix): Don't create subprocesses to compile the .scm files. [...] > - ;; Build guix/*.scm before gnu/*.scm to speed > - ;; things up. > - (sort (find-files out "\\.scm") > - (let ((guix (string-append out "/guix")) > - (gnu (string-append out "/gnu"))) > - (lambda (a b) > - (or (and (string-prefix? guix a) > - (string-prefix? gnu b)) > - (string + ;; Compile the .scm files. Also load every compiled file after writ= ing it > + ;; to work around (FIXME). > + (let* ((files (filter (cut string-suffix? ".scm" <>) > + (find-files out "\\.scm"))) > + (total (length files))) > + (let loop ((file (car files)) > + (files (cdr files)) > + (completed 0)) > + (display #\cr log-port) > + (format log-port "compiling...\t~5,1f% of ~d files" ;FIXME: i18n > + (* 100. (/ completed total)) total) > + (force-output log-port) > + (let ((go (string-append (string-drop-right file 4) > + ".go"))) > + (format debug-port "~%compiling '~a'...~%" file) > + (parameterize ((current-warning-port debug-port)) > + (compile-file file > + #:output-file go > + #:opts > + %auto-compilation-options) > + (load-compiled go))) So this simple =E2=80=98load-compiled=E2=80=99 call addresses , right? This is where the comment and explanation about this bug should go. The =E2=80=98load-compiled=E2=80=99 code seems to be the only difference wi= th 52af657a, which was right before we noticed #15602 (which led to 178f77b2.) Another stylistic issue: please use =E2=80=98match=E2=80=99 instead of the = unnameable primitives. ;-) Could you send an updated patch? Thanks! Ludo=E2=80=99.