From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Generating compiled scm (.go) files as part of LilyPond build Date: Fri, 28 Jan 2011 17:17:20 +0100 Message-ID: References: <4CF14302.1020502@hulin.org.uk> <4CF6BC51.3090909@hulin.org.uk> <4D1C7061.1000701@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 1296231450 16093 80.91.229.12 (28 Jan 2011 16:17:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 28 Jan 2011 16:17:30 +0000 (UTC) Cc: guile-user@gnu.org, Patrick@asmtp3.iomartmail.com, Han-Wen Nienhuys To: Ian Hulin Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 28 17:17:25 2011 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 1Pir0m-0005Gg-1S for guile-user@m.gmane.org; Fri, 28 Jan 2011 17:17:25 +0100 Original-Received: from localhost ([127.0.0.1]:52766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pir0j-0003j4-Tc for guile-user@m.gmane.org; Fri, 28 Jan 2011 11:17:22 -0500 Original-Received: from [140.186.70.92] (port=36241 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Piqw4-000101-JX for guile-user@gnu.org; Fri, 28 Jan 2011 11:12:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Piqw2-0005Nm-El for guile-user@gnu.org; Fri, 28 Jan 2011 11:12:31 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:46407 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Piqw2-0005Ni-Al for guile-user@gnu.org; Fri, 28 Jan 2011 11:12:30 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id B55FA4050; Fri, 28 Jan 2011 11:13:19 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=kMl+yKX5rg78 20kLgB40l2ZOkdo=; b=VoxkZ6kUAdRMHfq+y0jPTD1Ept5FnkNAAoFDZcHZWoBu I52bKcGutcv2GYTiSkk+TcDTFqMZUqH3xF4lcpivPwXEbMWaHc4HfUw+ncNiFe/f 7H8neXGjx2DXrCIBkp9vu6h8JoO5FG6er1bZqt30gaWeq7wyWgf1CtV8RviAi/o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=GgV3kR Jz2omoD8CUNKToW101ezWpXD5lRJ7ZeUtn58lhC/g2QlZo15d9p1Mw25vikqYoXz Kcqw3p3csiUjvC/+ITTVfp6VdX0HgsXS7NSzzF0K8RA8hZ+XPSXUW0j/11/RLDE5 RuV8cWvfFrHVNgoLYMSfhkfu5kbffz6fXJ9Ws= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7F885404D; Fri, 28 Jan 2011 11:13:16 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 49CFB404B; Fri, 28 Jan 2011 11:13:12 -0500 (EST) In-Reply-To: <4D1C7061.1000701@hulin.org.uk> (Ian Hulin's message of "Thu, 30 Dec 2010 11:43:29 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 83A2E4EE-2AF9-11E0-83D9-BC4EF3E828EC-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:8389 Archived-At: Hi Ian, On Thu 30 Dec 2010 12:43, Ian Hulin writes: > 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. > > 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. " This documentation was out-of-date. I have just committed updates to master, which are not very good, but at least more truthy. Basically compiled-file-name doesn't do any path searches. It simply computes a place in ~/.cache in which to cache the result of compiling FILE. As the comment in compile.scm says: ;;; This function is among the trickiest I've ever written. I tried many ;;; variants. In the end, simple is best, of course. ;;; ;;; After turning this around a number of times, it seems that the the ;;; desired behavior is that .go files should exist in a path, for ;;; searching. That is orthogonal to this function. For writing .go ;;; files, either you know where they should go, in which case you tell ;;; compile-file explicitly, as in the srcdir !=3D builddir case; or you ;;; don't know, in which case this function is called, and we just put ;;; them in your own ccache dir in ~/.guile-ccache. > 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). Load (system base compile) then, no? > It looks like (compiled-file-name) uses a hard-coded default setting for > %load-compiled-files to use as the root for cache. It doesn't use that path at all. It uses %compile-fallback-path. Cheers, Andy --=20 http://wingolog.org/