From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Hulin Newsgroups: gmane.lisp.guile.user Subject: Re: Generating compiled scm (.go) files as part of LilyPond build Date: Thu, 30 Dec 2010 11:43:29 +0000 Message-ID: <4D1C7061.1000701@hulin.org.uk> References: <4CF14302.1020502@hulin.org.uk> <4CF6BC51.3090909@hulin.org.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1293709438 9114 80.91.229.12 (30 Dec 2010 11:43:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 30 Dec 2010 11:43:58 +0000 (UTC) Cc: guile-user@gnu.org, Patrick@asmtp3.iomartmail.com, Han-Wen Nienhuys To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Dec 30 12:43:47 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PYGv5-0006aj-3O for guile-user@m.gmane.org; Thu, 30 Dec 2010 12:43:47 +0100 Original-Received: from localhost ([127.0.0.1]:38079 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYGv4-0003IT-HR for guile-user@m.gmane.org; Thu, 30 Dec 2010 06:43:46 -0500 Original-Received: from [140.186.70.92] (port=35445 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PYGv0-0003IM-3Q for guile-user@gnu.org; Thu, 30 Dec 2010 06:43:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PYGuy-0003S5-Tn for guile-user@gnu.org; Thu, 30 Dec 2010 06:43:41 -0500 Original-Received: from asmtp3.iomartmail.com ([62.128.201.159]:42782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PYGuy-0003RQ-MO for guile-user@gnu.org; Thu, 30 Dec 2010 06:43:40 -0500 Original-Received: from asmtp3.iomartmail.com (localhost.localdomain [127.0.0.1]) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id oBUBhacI001029; Thu, 30 Dec 2010 11:43:36 GMT Original-Received: from [192.168.1.100] (cpc3-rdng6-0-0-cust547.15-3.cable.virginmedia.com [82.10.50.36]) (authenticated bits=0) by asmtp3.iomartmail.com (8.13.8/8.13.8) with ESMTP id oBUBhYoN001022; Thu, 30 Dec 2010 11:43:35 GMT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b3pre Thunderbird/3.1.7 Original-Newsgroups: gmane.lisp.guile.user In-Reply-To: X-Enigmail-Version: 1.1.1 X-MIME-Autoconverted: from 8bit to quoted-printable by asmtp3.iomartmail.com id oBUBhYoN001022 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8336 Archived-At: Hi Andy, On 01/12/10 22:08, Andy Wingo wrote: > On Wed 01 Dec 2010 22:21, Ian Hulin writes: >=20 >> ian@greebo$ guile-tools compile scm/lily-library.scm >> wrote >> `/home/ian/.cache/guile/ccache/2.0-0.S-LE-4/home/ian/lilypond/scm/lily= -library.scm.go' >=20 > You will want to set the -o option, as in GCC. See guile-tools compile > --help. >=20 Thanks for the work-round, but I think there are problems with compiled-file-name, which in turn affect guile-tool compile, load-from-path and what happens when autocompile is in force. Documentation for compiled-file-name "=E2=80=94 Scheme Procedure: compiled-file-name file Compute an appropriate name for a compiled version of a Scheme file named file. Usually, the result will be the original file name with the .scm suffix replaced with .go, but the exact behavior depends on the contents of the %load-extensions and %load-compiled-extensions lists. " 1. compiled-file-name doesn't respect any settings of %load-compiled-path (which could be picked up from GUILE_LOAD_COMPILED_PATH setting. 2. compiled-file-name doesn't replace a .scm source extension with the default .go extension - it appends it to the complete filename. 3. compiled-file-name isn't available at the API until either you've used compile-file or else explicitly loaded module (system base compile). ian@greebo:~/lilypond$ echo $GUILE_LOAD_COMPILED_PATH /home/ian/lilypond/scm/out ian@greebo:~/lilypond$ian@greebo:~/lilypond$ guile -L /home/ian/lilypond/= scm GNU Guile 1.9.14 Copyright (C) 1995-2010 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use (ice-9 readline) scheme@(guile-user)> (activate-readline) scheme@(guile-user)> ,use (system base compile) scheme@(guile-user)> %load-compiled-path $1 =3D ("/home/ian/lilypond/scm/out" "/usr/local/lib/guile/2.0/ccache") scheme@(guile-user)> (compiled-file-name (%search-load-path "c++.scm")) $1 =3D "/home/ian/.cache/guile/ccache/2.0-0.T-LE-4/home/ian/lilypond/scm/c++.scm= .go" scheme@(guile-user)> It looks like (compiled-file-name) uses a hard-coded default setting for %load-compiled-files to use as the root for cache. For LilyPond purposes it would be preferable if (compiled-file-name) worked like this (this is only a prototype suggestion): (define (ly-compiled-file-name filename) (let* ( (pathdef (car %load-compiled-files)) (sextdef (car %load-extensions)) (oextdef (car %load-compiled-extensions)) (path (dirname filename)) (outname (basename filename sextdef))) (if (equal? path "." ) (set! path pathdef)) (string-append path "/" outname oextdef))) Cheers and Happy New Year, Ian Hulin